/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
}

:root {
    --black-rgb: 0, 0, 0;
    --white-rgb: 255, 255, 255;
    --brand-blue-rgb: 0, 102, 255;
    --primary-color: #0066ff;
    --primary-rgb: 0, 102, 255;
    --primary-contrast-bg: #0066ff;
    --secondary-color: #1a1a1a;
    --text-color: #333;
    --text-light: #666;
    --bg-color: #ffffff;
    --bg-rgb: 255, 255, 255;
    --bg-alt: #f8f9fa;
    --border-color: #e0e0e0;
    --success-color: #157347;
    --warning-color: #9a6700;
    --error-color: #b42318;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --container-wide: 1440px;
    --container-reading: 980px;
    --container-detail: 1180px;
    --shadow: 0 2px 8px rgba(var(--black-rgb), 0.1);
    --shadow-lg: 0 4px 16px rgba(var(--black-rgb), 0.12);
    --transition: color 0.3s ease, background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease, opacity 0.3s ease;
}

[data-theme="dark"] {
    --primary-color: #4d94ff;
    --primary-rgb: 77, 148, 255;
    --primary-contrast-bg: #1f6feb;
    --secondary-color: #e0e0e0;
    --text-color: #e0e0e0;
    --text-light: #a0a0a0;
    --bg-color: #0d1117;
    --bg-rgb: 13, 17, 23;
    --bg-alt: #161b22;
    --border-color: #30363d;
    --success-color: #4ade80;
    --warning-color: #facc15;
    --error-color: #ff7b72;
    --shadow: 0 2px 8px rgba(var(--black-rgb), 0.4);
    --shadow-lg: 0 4px 16px rgba(var(--black-rgb), 0.5);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    line-height: 1.68;
    color: var(--text-color);
    background-color: var(--bg-color);
    background-image:
        radial-gradient(circle at 10% 8%, rgba(var(--primary-rgb), 0.08), transparent 26%),
        radial-gradient(circle at 88% 0%, rgba(var(--primary-rgb), 0.07), transparent 20%);
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    letter-spacing: -0.02em;
}

p {
    line-height: 1.72;
}

main:focus {
    outline: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid rgba(var(--primary-rgb), 0.55);
    outline-offset: 3px;
}

.container {
    max-width: var(--container-wide);
    margin: 0 auto;
    padding: 0 5rem;
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 1100;
    padding: 0.7rem 1rem;
    border-radius: var(--radius-md);
    background: var(--primary-contrast-bg);
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    transform: translateY(calc(-100% - 1rem));
    transition: transform 0.2s ease;
}

.skip-link:focus {
    transform: translateY(0);
}

/* Navigation */
.navbar {
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    transition: var(--transition);
    box-shadow: 0 8px 24px rgba(var(--black-rgb), 0.04);
}

[data-theme="light"] .navbar {
    background: rgba(var(--white-rgb), 0.95);
}

[data-theme="dark"] .navbar {
    background: rgba(var(--bg-rgb), 0.95);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    padding: 0.5rem;
    color: var(--text-color);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-alt);
    color: var(--text-color);
    cursor: pointer;
    transition: var(--transition);
}

.nav-toggle:hover {
    border-color: rgba(var(--primary-rgb), 0.45);
    color: var(--primary-color);
}

.nav-toggle-bar {
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
    opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary-color);
    text-decoration: none;
    letter-spacing: -0.5px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.35rem 0.65rem;
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.12), transparent 65%);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    font-size: 0.95rem;
    position: relative;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.nav-links a[aria-current="page"] {
    color: var(--primary-color);
}

.nav-links a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -0.4rem;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
}

.nav-links a:hover::after,
.nav-links a[aria-current="page"]::after {
    transform: scaleX(1);
}

/* Hero Section */
.hero {
    padding: 6rem 0;
    min-height: 70vh;
    display: flex;
    align-items: center;
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background: linear-gradient(145deg, rgba(var(--primary-rgb), 0.06), transparent 55%), var(--bg-color);
}

.hero::before,
.hero::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    z-index: -1;
    pointer-events: none;
}

.hero::before {
    width: 440px;
    height: 440px;
    top: -160px;
    right: -140px;
    background: radial-gradient(circle, rgba(var(--primary-rgb), 0.22) 0%, transparent 68%);
}

.hero::after {
    width: 360px;
    height: 360px;
    bottom: -180px;
    left: -140px;
    background: radial-gradient(circle, rgba(var(--primary-rgb), 0.14) 0%, transparent 70%);
}

.hero-content {
    flex: 1;
    min-width: 0;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--primary-color);
    background: rgba(var(--primary-rgb), 0.12);
    border: 1px solid rgba(var(--primary-rgb), 0.24);
}

.hero-title {
    font-size: clamp(2.3rem, 5.4vw, 3.6rem);
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 1rem;
    letter-spacing: -1px;
    line-height: 1.1;
}

.hero-highlight {
    background: linear-gradient(120deg, var(--secondary-color) 25%, var(--primary-color) 88%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: clamp(1.15rem, 2.2vw, 1.55rem);
    color: var(--text-light);
    margin-bottom: 1.5rem;
    font-weight: 400;
    line-height: 1.45;
}

.hero-description {
    font-size: 1.125rem;
    color: var(--text-light);
    margin-bottom: 2.5rem;
    line-height: 1.8;
    max-width: 72ch;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-trust {
    margin-top: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.8rem;
}

.hero-stat {
    padding: 0.9rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-alt);
}

.hero-stat strong {
    display: block;
    color: var(--secondary-color);
    font-size: 0.95rem;
    margin-bottom: 0.15rem;
}

.hero-stat span {
    font-size: 0.83rem;
    color: var(--text-light);
}

/* Buttons */
.btn,
.content-btn {
    padding: 0.875rem 2rem;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    display: inline-block;
    border: none;
    cursor: pointer;
}

.content-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: fit-content;
    min-height: 44px;
    white-space: nowrap;
}

.content-btn--compact {
    padding: 0.7rem 1rem;
    font-size: 0.875rem;
}

.content-btn span {
    transition: transform 0.2s ease;
}

.btn-primary,
.content-btn--primary {
    background: linear-gradient(135deg, var(--primary-color), #004ed0);
    color: white;
    box-shadow: 0 10px 24px rgba(var(--primary-rgb), 0.28);
}

.btn-primary:hover,
.content-btn--primary:hover {
    background: linear-gradient(135deg, #0052cc, #003ea8);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary,
.content-btn--secondary {
    background: rgba(var(--primary-rgb), 0.08);
    color: var(--secondary-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover,
.content-btn--secondary:hover {
    background: rgba(var(--primary-rgb), 0.16);
    border-color: rgba(var(--primary-rgb), 0.35);
}

.content-btn--primary:hover span {
    transform: translateX(3px);
}

/* Quick Links Section */
.quick-links {
    padding: 4.75rem 0;
    background: linear-gradient(180deg, rgba(var(--primary-rgb), 0.04), transparent 26%), var(--bg-alt);
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.link-card {
    background: var(--bg-color);
    padding: 2rem;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.link-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(125deg, rgba(var(--primary-rgb), 0.12), transparent 48%);
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.link-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(var(--primary-rgb), 0.35);
}

.link-card:hover::before {
    opacity: 1;
}

.reveal-card {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.45s ease, transform 0.45s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.reveal-card.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.link-icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--primary-rgb), 0.10);
    border-radius: 14px;
    margin-bottom: 1.25rem;
    color: var(--primary-color);
    transition: background 0.25s ease, transform 0.25s ease;
}

.link-card:hover .link-icon {
    background: rgba(var(--primary-rgb), 0.18);
    transform: scale(1.08);
}

.link-card h2 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--secondary-color);
}

.link-card p {
    color: var(--text-light);
    margin-bottom: 1.25rem;
    line-height: 1.6;
}

.link-arrow {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    transition: var(--transition);
}

.link-arrow:hover {
    transform: translateX(4px);
}

/* Page Header */
.page-header {
    padding: 4.5rem 0 2.25rem;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.page-header h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    color: var(--secondary-color);
    margin-bottom: 0.7rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.page-header .subtitle {
    font-size: 1.15rem;
    color: var(--text-light);
    line-height: 1.65;
}

.page-header.page-header--compact h1 {
    margin-bottom: 0;
}

/* ── Search integrated in page-header ── */
.page-header--has-search {
    padding: 2.5rem 0;
}

.page-header--has-search .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    text-align: left;
}

.page-header-text {
    flex: 1;
    min-width: 0;
}

.page-header-text h1 {
    font-size: 2.75rem;
    color: var(--secondary-color);
    margin-bottom: 0.4rem;
    word-wrap: break-word;
}

.page-header-text .subtitle {
    font-size: 1.05rem;
    color: var(--text-light);
}

.page-header-search {
    flex-shrink: 0;
    width: 340px;
}

/* Search form */
.search-form {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.search-field {
    display: flex;
    align-items: center;
    background: var(--bg-alt);
    border: 1.5px solid var(--border-color);
    border-radius: 50px;
    overflow: hidden;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    box-shadow: 0 2px 10px rgba(var(--black-rgb), 0.06);
}

.search-field:focus-within {
    border-color: var(--primary-color);
    background: var(--bg-color);
    box-shadow: 0 0 0 3px rgba(var(--brand-blue-rgb), 0.13), 0 2px 10px rgba(var(--black-rgb), 0.06);
}

.search-icon {
    display: flex;
    align-items: center;
    padding: 0 0.5rem 0 1.1rem;
    color: var(--text-light);
    pointer-events: none;
    flex-shrink: 0;
    transition: color 0.25s ease;
}

.search-field:focus-within .search-icon {
    color: var(--primary-color);
}

.search-input {
    flex: 1;
    padding: 0.72rem 0.4rem;
    font-size: 0.95rem;
    color: var(--text-color);
    background: transparent;
    border: none;
    outline: none;
    font-family: inherit;
    min-width: 0;
}

.search-input:focus-visible {
    outline: none;
}

.search-input::placeholder {
    color: var(--text-light);
    opacity: 0.85;
}

.search-input[type="search"]::-webkit-search-cancel-button {
    display: none;
}

.search-btn {
    margin: 4px;
    min-height: 44px;
    padding: 0.62rem 1.15rem;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    letter-spacing: 0.02em;
    background: var(--primary-contrast-bg);
    color: #fff;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.search-btn:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

.search-btn:active {
    transform: translateY(0);
    opacity: 1;
}

.search-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0 0.5rem;
    font-size: 0.85rem;
    color: var(--text-light);
    animation: searchFadeIn 0.2s ease both;
}

.search-meta[hidden] {
    display: none;
}

.search-meta strong {
    color: var(--text-color);
}

.search-clear {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.85rem;
    flex-shrink: 0;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    transition: opacity 0.2s ease;
}

.search-clear:hover {
    opacity: 0.7;
    text-decoration: underline;
}

@keyframes searchFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Live filter — card hide/show */
.card-hidden {
    display: none !important;
}

.live-empty-hidden {
    display: none !important;
}

/* Mobile: stack search below heading */
@media (max-width: 768px) {
    .page-header--has-search {
        padding: 2rem 0;
    }

    .page-header--has-search .container {
        flex-direction: column;
        align-items: stretch;
        gap: 1.25rem;
        text-align: center;
    }

    .page-header-text h1 {
        font-size: 2.25rem;
    }

    .page-header-search {
        width: 100%;
    }

    .search-meta {
        justify-content: center;
        flex-wrap: wrap;
    }
}

/* About Page */
.about-content {
    padding: 4.75rem 0;
}

.about-content > .container {
    max-width: var(--container-detail);
}

.about-story {
    display: grid;
    grid-template-columns: minmax(280px, 0.82fr) minmax(0, 1.35fr);
    align-items: start;
    gap: clamp(3rem, 7vw, 6rem);
}

.about-portrait {
    position: sticky;
    top: 7.5rem;
    margin: 0;
}

.about-portrait-frame {
    position: relative;
    isolation: isolate;
}

.about-portrait-frame::before {
    content: "";
    position: absolute;
    inset: 1.15rem -1.15rem -1.15rem 1.15rem;
    z-index: -1;
    border: 1px solid rgba(var(--primary-rgb), 0.28);
    border-radius: 22px;
    background: rgba(var(--primary-rgb), 0.07);
}

.about-portrait img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 22px;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 45px rgba(var(--black-rgb), 0.14);
}

.about-kicker {
    margin-bottom: 0.8rem !important;
    color: var(--primary-color) !important;
    font-size: 0.78rem !important;
    font-weight: 700;
    letter-spacing: 0.11em;
    line-height: 1.4 !important;
    text-transform: uppercase;
}

.about-story-copy h2 {
    max-width: 13ch;
    margin-bottom: 1.25rem;
    color: var(--secondary-color);
    font-size: clamp(2.4rem, 5vw, 4.25rem);
    line-height: 1.03;
    letter-spacing: -0.045em;
}

.about-story-copy .about-lead {
    margin-bottom: 1.75rem;
    color: var(--text-light);
    font-size: clamp(1.2rem, 2vw, 1.4rem);
    line-height: 1.65;
}

.about-story-copy > p:not(.about-kicker):not(.about-lead) {
    margin-bottom: 1.2rem;
    color: var(--text-light);
    font-size: 1.08rem;
    line-height: 1.85;
}

.about-story-copy em {
    color: var(--text-color);
    font-style: normal;
    font-weight: 600;
}

.about-section {
    margin-bottom: 4rem;
}

.about-section--work {
    margin-top: clamp(5rem, 10vw, 8rem);
}

.about-section-heading {
    max-width: 760px;
}

.about-section h3 {
    margin-bottom: 1.25rem;
    color: var(--secondary-color);
    font-size: clamp(2rem, 4vw, 3rem);
    letter-spacing: -0.035em;
}

.about-section p {
    font-size: 1.125rem;
    line-height: 1.82;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

.skill-category {
    padding: 2rem;
    background: var(--bg-alt);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.skill-category:hover {
    border-color: rgba(var(--primary-rgb), 0.45);
    box-shadow: var(--shadow);
    transform: translateY(-3px);
}

.skill-category h4 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.skill-category p {
    margin-bottom: 0;
    font-size: 1rem;
    color: var(--text-light);
}

.about-closing {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 3rem;
    margin-top: 5rem;
    padding: clamp(2rem, 5vw, 3.5rem);
    border: 1px solid rgba(var(--primary-rgb), 0.22);
    border-radius: 20px;
    background:
        radial-gradient(circle at 88% 12%, rgba(var(--primary-rgb), 0.13), transparent 34%),
        var(--bg-alt);
}

.about-closing > div {
    max-width: 720px;
}

.about-closing h3 {
    margin-bottom: 1rem;
    color: var(--secondary-color);
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    letter-spacing: -0.035em;
}

.about-closing p:not(.about-kicker) {
    margin: 0;
    color: var(--text-light);
    font-size: 1.05rem;
    line-height: 1.8;
}

.about-closing .btn {
    flex-shrink: 0;
}

/* Projects Page */
.projects-content {
    padding: 3.5rem 0;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    width: 100%;
}

.project-card {
    background: var(--bg-color);
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: var(--transition);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 22px rgba(var(--black-rgb), 0.06);
}

.project-card:hover {
    box-shadow: 0 8px 24px rgba(var(--black-rgb), 0.12);
    transform: translateY(-4px);
    border-color: var(--primary-color);
}

.project-image {
    width: 100%;
    height: auto;
    min-height: 200px;
    max-height: 300px;
    overflow: hidden;
    position: relative;
    background: var(--bg-alt);
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-image img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 300px !important;
    min-height: 200px !important;
    object-fit: cover !important;
    -o-object-fit: cover !important;
    object-position: center !important;
    -o-object-position: center !important;
    transition: transform 0.5s ease;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.project-card:hover .project-image img {
    transform: scale(1.08);
}

.project-card-content {
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.project-card h2,
.project-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.7rem;
    color: var(--secondary-color);
    line-height: 1.28;
}

.project-card h2 a,
.project-card h3 a,
.project-card h2 a:visited,
.project-card h3 a:visited {
    color: var(--secondary-color);
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-card h2 a:hover,
.project-card h3 a:hover,
.project-card h2 a:focus-visible,
.project-card h3 a:focus-visible {
    color: var(--primary-color);
    text-decoration: none;
}

.project-card p {
    color: var(--text-color);
    margin-bottom: 1.25rem;
    line-height: 1.74;
    flex-grow: 1;
}

.project-card .card-excerpt,
.blog-card .card-excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.tag {
    background: var(--primary-contrast-bg);
    color: white;
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.project-links {
    display: flex;
    gap: 0.5rem 0.75rem;
    flex-wrap: wrap;
}

.project-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0.35rem 0;
    transition: var(--transition);
}

.project-link.secondary {
    color: var(--text-light);
}

.project-link:hover {
    gap: 0.5rem;
}

/* Project Detail Page */
.project-tech-stack {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    padding: 1rem 1.25rem;
    background: var(--bg-alt);
    border-radius: 14px;
    margin-top: 2rem;
    border: 1px solid var(--border-color);
}

.project-tech-stack h2 {
    margin-bottom: 0;
    color: var(--secondary-color);
    font-size: 1.15rem;
    flex: 0 0 auto;
}

.project-tech-stack .project-tags {
    margin-bottom: 0;
    align-items: center;
}

.project-tech-stack .tag {
    padding: 0.45rem 0.85rem;
    border: 1px solid rgba(var(--primary-rgb), 0.42);
    border-radius: 999px;
    background: rgba(var(--primary-rgb), 0.045);
    color: var(--secondary-color);
    font-family: 'Menlo', 'Monaco', 'Consolas', monospace;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.2;
}

.project-links-section {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--border-color);
    flex-wrap: wrap;
}

.project-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.project-btn.primary {
    background: var(--primary-color);
    color: white;
}

.project-btn.primary:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--brand-blue-rgb), 0.3);
}

.project-btn.secondary {
    background: var(--bg-alt);
    color: var(--secondary-color);
    border: 2px solid var(--border-color);
}

.project-btn.secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
}

/* Blog Page */
.blog-content {
    padding: 3.5rem 0;
}

.blog-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    width: 100%;
}

.blog-card {
    background: var(--bg-color);
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: var(--transition);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 22px rgba(var(--black-rgb), 0.06);
}

.blog-card:hover {
    box-shadow: 0 8px 24px rgba(var(--black-rgb), 0.12);
    transform: translateY(-4px);
    border-color: var(--primary-color);
}

.blog-date {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.blog-date::before {
    content: "📅";
}

.blog-card h2 {
    font-size: clamp(1.45rem, 2.5vw, 1.8rem);
    margin-bottom: 0.7rem;
    color: var(--secondary-color);
    line-height: 1.25;
}

.blog-card h2 a {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card h2:hover {
    color: var(--primary-color);
}

.blog-card p {
    color: var(--text-color);
    margin-bottom: 1.25rem;
    line-height: 1.74;
    flex-grow: 1;
}

.blog-card-content {
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
}

.read-more {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 44px;
    width: fit-content;
    transition: var(--transition);
}

.read-more:hover {
    gap: 0.75rem;
    text-decoration: none;
}

/* Blog Images */
.blog-card .blog-image {
    width: 100%;
    height: auto;
    min-height: 250px;
    max-height: 400px;
    overflow: hidden;
    position: relative;
    background: var(--bg-alt);
    display: flex;
    align-items: center;
    justify-content: center;
}

.blog-card .blog-image img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 400px !important;
    min-height: 250px !important;
    object-fit: cover !important;
    -o-object-fit: cover !important;
    object-position: center !important;
    -o-object-position: center !important;
    transition: transform 0.5s ease;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.blog-card:hover .blog-image img {
    transform: scale(1.08);
}

/* Blog Detail Page */
.blog-detail-content {
    padding: 1.5rem 0 3.5rem;
}

.blog-article {
    max-width: var(--container-detail);
    width: 100%;
    margin: 0 auto;
    background: var(--bg-color);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(var(--black-rgb), 0.08);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.blog-article .blog-content {
    padding: 0;
}

.blog-article .markdown-content > :last-child {
    margin-bottom: 0;
}

.blog-article .markdown-content > p,
.blog-article .markdown-content > ul,
.blog-article .markdown-content > ol,
.blog-article .markdown-content > blockquote {
    max-width: 82ch;
}

.blog-article .markdown-content > pre,
.blog-article .markdown-content > .highlight,
.blog-article .markdown-content > table,
.blog-article .markdown-content > p:has(img) {
    max-width: 100%;
}

.featured-image {
    width: calc(100% + 6rem);
    margin-left: -3rem;
    margin-right: -3rem;
    margin-top: -3rem;
    margin-bottom: 3rem;
    max-height: 500px;
    min-height: 300px;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-alt);
}

.featured-image img {
    width: 100% !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: 500px !important;
    min-height: 300px !important;
    object-fit: cover !important;
    -o-object-fit: cover !important;
    object-position: center !important;
    -o-object-position: center !important;
    display: block !important;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Detail page meta bar: date left · read-time right */
.detail-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.75rem;
    font-size: 0.95rem;
    color: var(--text-light);
    width: 100%;
    padding: 0 1.5rem;
    text-align: left;
}

.detail-meta .blog-date {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0;   /* override list-card margin */
    text-align: left;
}

.detail-meta .read-time {
    text-align: right;
}

/* Read time badge — detail pages only */
.read-time {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-color);
    background: rgba(var(--brand-blue-rgb), 0.08);
    padding: 0.22rem 0.65rem;
    border-radius: 20px;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.read-time::before {
    content: "⏱";
    font-size: 0.78rem;
}

.blog-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Post / Project prev-next navigation */
.post-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.post-nav-prev {
    justify-self: start;
}

.post-nav-next {
    justify-self: end;
    text-align: right;
}

.post-nav-link {
    display: inline-flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.85rem 1.25rem;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-color);
    background: var(--bg-alt);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, background 0.2s ease;
    max-width: 280px;
}

.post-nav-link:hover {
    border-color: var(--primary-color);
    background: var(--bg-color);
    box-shadow: 0 4px 14px rgba(var(--brand-blue-rgb), 0.1);
    transform: translateY(-2px);
}

.post-nav-direction {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--primary-color);
}

.post-nav-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-color);
    line-height: 1.4;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Iconography & Illustrations ─────────────────────────────────────── */

/* Hero two-column layout */
.hero .container {
    display: flex;
    align-items: center;
    gap: 5rem;
}

/* Button icon alignment */
.btn-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-icon svg {
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.btn-icon:hover svg {
    transform: translateX(3px);
}

/* Skill category icons */
.skill-icon {
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--primary-rgb), 0.10);
    border-radius: 12px;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

/* Contact method icons */
.contact-method-icon {
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--primary-rgb), 0.10);
    border-radius: 12px;
    margin-bottom: 0.75rem;
    color: var(--primary-color);
}

.contact-method-icon--text {
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

/* ── Terminal / Code Window illustration ── */
.hero-illustration {
    flex-shrink: 0;
    width: 400px;
    perspective: 900px;
    opacity: 0;
    transition: opacity 0.45s ease;
}

.hero-illustration.is-ready {
    opacity: 1;
}

.term-window {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 24px 56px rgba(var(--black-rgb), 0.10);
    transform: rotateY(-5deg) rotateX(2deg);
    transition: transform 0.5s ease, box-shadow 0.5s ease;
    font-family: 'Menlo', 'Monaco', 'Consolas', monospace;
    font-size: 0.83rem;
    will-change: transform;
}

.hero-illustration:hover .term-window {
    transform: rotateY(0deg) rotateX(0deg);
    box-shadow: 0 32px 64px rgba(var(--black-rgb), 0.14);
}

.term-topbar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.65rem 1rem;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border-color);
}

.term-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    flex-shrink: 0;
}

.term-dot--red    { background: #ff5f57; }
.term-dot--yellow { background: #febc2e; }
.term-dot--green  { background: #28c840; }

.term-title {
    margin-left: auto;
    font-size: 0.73rem;
    color: var(--text-light);
    font-family: inherit;
    letter-spacing: 0.02em;
}

.term-body {
    padding: 1.1rem 1.25rem;
    line-height: 1.8;
    background: var(--bg-color);
}

.term-line   { white-space: nowrap; }
.term-blank  { display: block; height: 0.5rem; }
.term-indent { padding-left: 1.5rem; }

.term-kw   { color: #7c3aed; font-weight: 600; }
.term-mod  { color: var(--primary-color); }
.term-fn   { color: #059669; }
.term-str  { color: var(--text-color); }
.term-arg  { color: #d97706; }
.term-op,
.term-punc { color: var(--text-light); }
.term-cm   { color: var(--text-light); font-style: italic; }
.term-ok   { color: #16a34a; font-weight: 600; }

.term-cursor {
    display: inline-block;
    width: 7px;
    height: 1em;
    background: var(--primary-color);
    vertical-align: text-bottom;
    animation: term-blink 1.1s step-end infinite;
}

@keyframes term-blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

[data-theme="dark"] .term-window {
    background: var(--bg-alt);
    box-shadow: 0 24px 56px rgba(var(--black-rgb), 0.5);
}

[data-theme="dark"] .term-fn { color: #34d399; }
[data-theme="dark"] .term-ok { color: #4ade80; }
[data-theme="dark"] .term-kw { color: #a78bfa; }



.back-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.back-link:hover {
    gap: 0.75rem;
}

/* Markdown Content Styling */
.markdown-content {
    line-height: 1.8;
    color: var(--text-color);
    font-size: 1.125rem;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
    font-weight: 700;
    color: var(--secondary-color);
    line-height: 1.3;
}

.markdown-content h1:first-child,
.markdown-content h2:first-child,
.markdown-content h3:first-child {
    margin-top: 0;
}

.markdown-content h1 {
    font-size: 2.5rem;
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 0.75rem;
    margin-bottom: 2rem;
}

.markdown-content h2 {
    font-size: 2rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

.markdown-content h3 {
    font-size: 1.5rem;
}

.markdown-content h4 {
    font-size: 1.25rem;
}

.markdown-content p {
    margin-bottom: 1.75rem;
    line-height: 1.9;
}

.markdown-content a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: var(--transition);
    font-weight: 500;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.markdown-content a:hover {
    border-bottom-color: var(--primary-color);
}

/* External references should read like the surrounding prose, with an underline
   as their only visual distinction. Keep this scoped away from project CTAs. */
.blog-content.markdown-content a[target="_blank"],
.blog-content.markdown-content a[target="_blank"]:hover,
.blog-content.markdown-content a[target="_blank"]:focus-visible,
.blog-content.markdown-content a[target="_blank"]:visited {
    color: inherit;
    text-decoration-line: underline;
    text-decoration-color: currentColor;
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.2em;
    border-bottom-color: transparent;
}

.markdown-content ul,
.markdown-content ol {
    margin-bottom: 1.75rem;
    padding-left: 2rem;
    line-height: 1.9;
}

.markdown-content li {
    margin-bottom: 0.75rem;
}

.markdown-content li p {
    margin-bottom: 0.5rem;
}

.markdown-content code {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 0.9em;
}

[data-theme="light"] .markdown-content code {
    color: #0b5cad;
    background: rgba(9, 105, 218, 0.08);
}

[data-theme="dark"] .markdown-content code {
    color: #79b8ff;
    background: transparent;
}

.markdown-content pre {
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 2rem 0;
    max-width: 100%;
    border: 1px solid var(--border-color);
}

[data-theme="light"] .markdown-content pre {
    background: #f8f9fa;
    color: #24292e;
    box-shadow: 0 2px 8px rgba(var(--black-rgb), 0.08);
}

[data-theme="dark"] .markdown-content pre {
    background: #1e1e1e;
    color: #d4d4d4;
    box-shadow: 0 4px 12px rgba(var(--black-rgb), 0.3);
}

.markdown-content pre code {
    background: transparent;
    padding: 0;
    color: inherit;
    font-size: 0.95rem;
    line-height: 1.6;
    border: none;
    white-space: pre;
    word-wrap: normal;
    overflow-wrap: normal;
}

[data-theme="light"] .markdown-content pre code {
    color: #24292e;
    background: transparent;
}

/* Pygments Syntax Highlighting - Light Mode (Easy to Read) */
[data-theme="light"] .markdown-content .highlight {
    background: #f6f8fa;
    color: #24292e;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 2rem 0;
    box-shadow: 0 2px 8px rgba(var(--black-rgb), 0.08);
    max-width: 100%;
    border: 1px solid #d0d7de;
}

[data-theme="light"] .markdown-content .highlight pre {
    margin: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
    border: none;
}

[data-theme="light"] .markdown-content .highlight .hll { background-color: #fff8c5 }
[data-theme="light"] .markdown-content .highlight .c { color: #6a737d; font-style: italic } /* Comment */
[data-theme="light"] .markdown-content .highlight .err { color: #d47500 } /* Error */
[data-theme="light"] .markdown-content .highlight .k { color: #005cc5; font-weight: bold } /* Keyword */
[data-theme="light"] .markdown-content .highlight .o { color: #24292e } /* Operator */
[data-theme="light"] .markdown-content .highlight .ch { color: #6a737d; font-style: italic } /* Comment.Hashbang */
[data-theme="light"] .markdown-content .highlight .cm { color: #6a737d; font-style: italic } /* Comment.Multiline */
[data-theme="light"] .markdown-content .highlight .cp { color: #6a737d; font-style: italic } /* Comment.Preproc */
[data-theme="light"] .markdown-content .highlight .cpf { color: #6a737d; font-style: italic } /* Comment.PreprocFile */
[data-theme="light"] .markdown-content .highlight .c1 { color: #6a737d; font-style: italic } /* Comment.Single */
[data-theme="light"] .markdown-content .highlight .cs { color: #6a737d; font-style: italic } /* Comment.Special */
[data-theme="light"] .markdown-content .highlight .kc { color: #005cc5 } /* Keyword.Constant */
[data-theme="light"] .markdown-content .highlight .kd { color: #005cc5 } /* Keyword.Declaration */
[data-theme="light"] .markdown-content .highlight .kn { color: #005cc5 } /* Keyword.Namespace */
[data-theme="light"] .markdown-content .highlight .kp { color: #005cc5 } /* Keyword.Pseudo */
[data-theme="light"] .markdown-content .highlight .kr { color: #005cc5 } /* Keyword.Reserved */
[data-theme="light"] .markdown-content .highlight .kt { color: #005cc5 } /* Keyword.Type */
[data-theme="light"] .markdown-content .highlight .m { color: #005cc5 } /* Literal.Number */
[data-theme="light"] .markdown-content .highlight .s { color: #22863a } /* Literal.String */
[data-theme="light"] .markdown-content .highlight .na { color: #6f42c1 } /* Name.Attribute */
[data-theme="light"] .markdown-content .highlight .nb { color: #005cc5 } /* Name.Builtin */
[data-theme="light"] .markdown-content .highlight .nc { color: #6f42c1 } /* Name.Class */
[data-theme="light"] .markdown-content .highlight .no { color: #005cc5 } /* Name.Constant */
[data-theme="light"] .markdown-content .highlight .nd { color: #6f42c1 } /* Name.Decorator */
[data-theme="light"] .markdown-content .highlight .ne { color: #6f42c1 } /* Name.Exception */
[data-theme="light"] .markdown-content .highlight .nf { color: #6f42c1 } /* Name.Function */
[data-theme="light"] .markdown-content .highlight .nn { color: #24292e } /* Name.Namespace */
[data-theme="light"] .markdown-content .highlight .nt { color: #22863a } /* Name.Tag */
[data-theme="light"] .markdown-content .highlight .nv { color: #24292e } /* Name.Variable */
[data-theme="light"] .markdown-content .highlight .ow { color: #005cc5 } /* Operator.Word */
[data-theme="light"] .markdown-content .highlight .mb { color: #005cc5 } /* Literal.Number.Bin */
[data-theme="light"] .markdown-content .highlight .mf { color: #005cc5 } /* Literal.Number.Float */
[data-theme="light"] .markdown-content .highlight .mh { color: #005cc5 } /* Literal.Number.Hex */
[data-theme="light"] .markdown-content .highlight .mi { color: #005cc5 } /* Literal.Number.Integer */
[data-theme="light"] .markdown-content .highlight .mo { color: #005cc5 } /* Literal.Number.Oct */
[data-theme="light"] .markdown-content .highlight .sa { color: #22863a } /* Literal.String.Affix */
[data-theme="light"] .markdown-content .highlight .sb { color: #22863a } /* Literal.String.Backtick */
[data-theme="light"] .markdown-content .highlight .sc { color: #22863a } /* Literal.String.Char */
[data-theme="light"] .markdown-content .highlight .dl { color: #22863a } /* Literal.String.Delimiter */
[data-theme="light"] .markdown-content .highlight .sd { color: #22863a } /* Literal.String.Doc */
[data-theme="light"] .markdown-content .highlight .s2 { color: #22863a } /* Literal.String.Double */
[data-theme="light"] .markdown-content .highlight .se { color: #005cc5 } /* Literal.String.Escape */
[data-theme="light"] .markdown-content .highlight .sh { color: #22863a } /* Literal.String.Heredoc */
[data-theme="light"] .markdown-content .highlight .si { color: #005cc5 } /* Literal.String.Interpol */
[data-theme="light"] .markdown-content .highlight .sx { color: #22863a } /* Literal.String.Other */
[data-theme="light"] .markdown-content .highlight .sr { color: #22863a } /* Literal.String.Regex */
[data-theme="light"] .markdown-content .highlight .s1 { color: #22863a } /* Literal.String.Single */
[data-theme="light"] .markdown-content .highlight .ss { color: #22863a } /* Literal.String.Symbol */
[data-theme="light"] .markdown-content .highlight .bp { color: #005cc5 } /* Name.Builtin.Pseudo */
[data-theme="light"] .markdown-content .highlight .fm { color: #6f42c1 } /* Name.Function.Magic */
[data-theme="light"] .markdown-content .highlight .vc { color: #24292e } /* Name.Variable.Class */
[data-theme="light"] .markdown-content .highlight .vg { color: #24292e } /* Name.Variable.Global */
[data-theme="light"] .markdown-content .highlight .vi { color: #24292e } /* Name.Variable.Instance */
[data-theme="light"] .markdown-content .highlight .vm { color: #24292e } /* Name.Variable.Magic */
[data-theme="light"] .markdown-content .highlight .il { color: #005cc5 } /* Literal.Number.Integer.Long */

/* Pygments Syntax Highlighting - Dark Mode (VS Code Python Style) */
[data-theme="dark"] .markdown-content .highlight {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 2rem 0;
    box-shadow: 0 4px 12px rgba(var(--black-rgb), 0.3);
    max-width: 100%;
    border: 1px solid #3e3e3e;
}

[data-theme="dark"] .markdown-content .highlight pre {
    margin: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
    border: none;
}

[data-theme="dark"] .markdown-content .highlight .hll { background-color: #3e3e3e }
[data-theme="dark"] .markdown-content .highlight .c { color: #6a9955 } /* Comment */
[data-theme="dark"] .markdown-content .highlight .err { color: #f48771 } /* Error */
[data-theme="dark"] .markdown-content .highlight .k { color: #569cd6; font-weight: bold } /* Keyword */
[data-theme="dark"] .markdown-content .highlight .o { color: #d4d4d4 } /* Operator */
[data-theme="dark"] .markdown-content .highlight .ch { color: #6a9955 } /* Comment.Hashbang */
[data-theme="dark"] .markdown-content .highlight .cm { color: #6a9955 } /* Comment.Multiline */
[data-theme="dark"] .markdown-content .highlight .cp { color: #6a9955 } /* Comment.Preproc */
[data-theme="dark"] .markdown-content .highlight .cpf { color: #6a9955 } /* Comment.PreprocFile */
[data-theme="dark"] .markdown-content .highlight .c1 { color: #6a9955 } /* Comment.Single */
[data-theme="dark"] .markdown-content .highlight .cs { color: #6a9955 } /* Comment.Special */
[data-theme="dark"] .markdown-content .highlight .kc { color: #569cd6 } /* Keyword.Constant */
[data-theme="dark"] .markdown-content .highlight .kd { color: #569cd6 } /* Keyword.Declaration */
[data-theme="dark"] .markdown-content .highlight .kn { color: #c586c0 } /* Keyword.Namespace */
[data-theme="dark"] .markdown-content .highlight .kp { color: #569cd6 } /* Keyword.Pseudo */
[data-theme="dark"] .markdown-content .highlight .kr { color: #569cd6 } /* Keyword.Reserved */
[data-theme="dark"] .markdown-content .highlight .kt { color: #4ec9b0 } /* Keyword.Type */
[data-theme="dark"] .markdown-content .highlight .m { color: #b5cea8 } /* Literal.Number */
[data-theme="dark"] .markdown-content .highlight .s { color: #ce9178 } /* Literal.String */
[data-theme="dark"] .markdown-content .highlight .na { color: #9cdcfe } /* Name.Attribute */
[data-theme="dark"] .markdown-content .highlight .nb { color: #4ec9b0 } /* Name.Builtin */
[data-theme="dark"] .markdown-content .highlight .nc { color: #4ec9b0 } /* Name.Class */
[data-theme="dark"] .markdown-content .highlight .no { color: #569cd6 } /* Name.Constant */
[data-theme="dark"] .markdown-content .highlight .nd { color: #4ec9b0 } /* Name.Decorator */
[data-theme="dark"] .markdown-content .highlight .ne { color: #4ec9b0 } /* Name.Exception */
[data-theme="dark"] .markdown-content .highlight .nf { color: #dcdcaa } /* Name.Function */
[data-theme="dark"] .markdown-content .highlight .nn { color: #4ec9b0 } /* Name.Namespace */
[data-theme="dark"] .markdown-content .highlight .nt { color: #569cd6 } /* Name.Tag */
[data-theme="dark"] .markdown-content .highlight .nv { color: #9cdcfe } /* Name.Variable */
[data-theme="dark"] .markdown-content .highlight .ow { color: #569cd6 } /* Operator.Word */
[data-theme="dark"] .markdown-content .highlight .mb { color: #b5cea8 } /* Literal.Number.Bin */
[data-theme="dark"] .markdown-content .highlight .mf { color: #b5cea8 } /* Literal.Number.Float */
[data-theme="dark"] .markdown-content .highlight .mh { color: #b5cea8 } /* Literal.Number.Hex */
[data-theme="dark"] .markdown-content .highlight .mi { color: #b5cea8 } /* Literal.Number.Integer */
[data-theme="dark"] .markdown-content .highlight .mo { color: #b5cea8 } /* Literal.Number.Oct */
[data-theme="dark"] .markdown-content .highlight .sa { color: #ce9178 } /* Literal.String.Affix */
[data-theme="dark"] .markdown-content .highlight .sb { color: #ce9178 } /* Literal.String.Backtick */
[data-theme="dark"] .markdown-content .highlight .sc { color: #ce9178 } /* Literal.String.Char */
[data-theme="dark"] .markdown-content .highlight .dl { color: #ce9178 } /* Literal.String.Delimiter */
[data-theme="dark"] .markdown-content .highlight .sd { color: #ce9178 } /* Literal.String.Doc */
[data-theme="dark"] .markdown-content .highlight .s2 { color: #ce9178 } /* Literal.String.Double */
[data-theme="dark"] .markdown-content .highlight .se { color: #d7ba7d } /* Literal.String.Escape */
[data-theme="dark"] .markdown-content .highlight .sh { color: #ce9178 } /* Literal.String.Heredoc */
[data-theme="dark"] .markdown-content .highlight .si { color: #d7ba7d } /* Literal.String.Interpol */
[data-theme="dark"] .markdown-content .highlight .sx { color: #ce9178 } /* Literal.String.Other */
[data-theme="dark"] .markdown-content .highlight .sr { color: #d16969 } /* Literal.String.Regex */
[data-theme="dark"] .markdown-content .highlight .s1 { color: #ce9178 } /* Literal.String.Single */
[data-theme="dark"] .markdown-content .highlight .ss { color: #ce9178 } /* Literal.String.Symbol */
[data-theme="dark"] .markdown-content .highlight .bp { color: #4ec9b0 } /* Name.Builtin.Pseudo */
[data-theme="dark"] .markdown-content .highlight .fm { color: #dcdcaa } /* Name.Function.Magic */
[data-theme="dark"] .markdown-content .highlight .vc { color: #9cdcfe } /* Name.Variable.Class */
[data-theme="dark"] .markdown-content .highlight .vg { color: #9cdcfe } /* Name.Variable.Global */
[data-theme="dark"] .markdown-content .highlight .vi { color: #9cdcfe } /* Name.Variable.Instance */
[data-theme="dark"] .markdown-content .highlight .vm { color: #9cdcfe } /* Name.Variable.Magic */
[data-theme="dark"] .markdown-content .highlight .il { color: #b5cea8 } /* Literal.Number.Integer.Long */

/* Copy control for fenced and syntax-highlighted code blocks */
.markdown-content .code-block-shell {
    position: relative;
    max-width: 100%;
    margin: 2rem 0;
}

.markdown-content .code-block-shell > pre,
.markdown-content .code-block-shell > .highlight {
    margin: 0;
    padding-right: 6.5rem;
}

.code-copy-button {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 40px;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 7px;
    background: rgba(var(--white-rgb), 0.9);
    color: #24292e;
    font: 650 0.78rem/1 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(var(--black-rgb), 0.08);
    opacity: 0;
    pointer-events: none;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

.code-block-shell:hover .code-copy-button,
.code-block-shell:focus-within .code-copy-button,
.code-copy-button:focus-visible,
.code-copy-button.is-copied {
    opacity: 1;
    pointer-events: auto;
}

.code-copy-button svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.code-copy-button:hover {
    border-color: var(--primary-color);
    background: #fff;
    color: var(--primary-color);
    transform: translateY(-1px);
}

.code-copy-button:disabled {
    cursor: wait;
}

.code-copy-button.is-copied {
    border-color: var(--success-color);
    color: var(--success-color);
}

[data-theme="dark"] .code-copy-button {
    border-color: #4b5563;
    background: rgba(36, 41, 47, 0.94);
    color: #e6edf3;
    box-shadow: 0 2px 8px rgba(var(--black-rgb), 0.32);
}

[data-theme="dark"] .code-copy-button:hover {
    border-color: var(--primary-color);
    background: #2d333b;
    color: var(--primary-color);
}

[data-theme="dark"] .code-copy-button.is-copied {
    border-color: var(--success-color);
    color: var(--success-color);
}

@media print {
    .code-copy-button {
        display: none;
    }
}

@media (hover: none), (pointer: coarse), (max-width: 640px) {
    .markdown-content .code-block-shell > pre,
    .markdown-content .code-block-shell > .highlight {
        padding-right: 1.5rem;
    }

    .code-copy-button {
        display: none;
    }
}

.markdown-content blockquote {
    border-left: 5px solid var(--primary-color);
    padding: 1rem 1.5rem;
    margin: 2rem 0;
    background: var(--bg-alt);
    color: var(--text-color);
    font-style: italic;
    border-radius: 0 8px 8px 0;
}

.markdown-content blockquote p:last-child {
    margin-bottom: 0;
}

/* Enhanced Image Styling in Content */
.markdown-content img {
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
    max-height: 600px !important;
    display: block !important;
    margin: 2.5rem auto !important;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(var(--black-rgb), 0.1);
    transition: var(--transition);
    object-fit: contain !important;
    -o-object-fit: contain !important;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.markdown-content img:hover {
    box-shadow: 0 8px 30px rgba(var(--black-rgb), 0.15);
    transform: translateY(-2px);
}

/* Image with caption support */
.markdown-content p {
    max-width: 100%;
    overflow-x: auto;
}

.markdown-content p > img {
    margin: 2rem auto !important;
    max-width: 100% !important;
    max-height: 600px !important;
    width: auto !important;
    height: auto !important;
}

.markdown-content p > img + em {
    display: block;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-light);
    margin-top: -1.5rem;
    margin-bottom: 2rem;
}

.markdown-content table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    box-shadow: 0 2px 8px rgba(var(--black-rgb), 0.05);
    border-radius: 8px;
    overflow: hidden;
    display: block;
    overflow-x: auto;
}

.markdown-content table th,
.markdown-content table td {
    padding: 1rem;
    border: 1px solid var(--border-color);
    text-align: left;
}

.markdown-content table th {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
}

.markdown-content table tr:nth-child(even) {
    background: var(--bg-alt);
}

.markdown-content table tr:hover {
    background: rgba(var(--brand-blue-rgb), 0.05);
}

.markdown-content hr {
    border: none;
    border-top: 2px solid var(--border-color);
    margin: 3rem 0;
}

/* Project section headings already provide a divider; avoid a second Markdown rule. */
.project-article .markdown-content hr {
    display: none;
}

.markdown-content .highlight {
    background: #2d2d2d;
    border-radius: 8px;
    margin: 2rem 0;
    box-shadow: 0 4px 12px rgba(var(--black-rgb), 0.15);
}

/* Strong and emphasis */
.markdown-content strong {
    font-weight: 700;
    color: var(--secondary-color);
}

.markdown-content em {
    font-style: italic;
}

/* Contact Page */
.contact-content {
    padding: 4.75rem 0;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.contact-info h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.contact-info p {
    color: var(--text-light);
    margin-bottom: 2rem;
    line-height: 1.78;
}

.contact-methods {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.contact-method {
    padding: 1.5rem;
    background: var(--bg-alt);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.contact-method h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
}

.contact-method p {
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.contact-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.contact-link:hover {
    text-decoration: underline;
}

/* Contact Form */
.contact-form-container {
    position: relative;
}

.messages {
    margin-bottom: 1.5rem;
}

.alert {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-weight: 500;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.contact-form {
    background: var(--bg-alt);
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--secondary-color);
}

.required-marker,
.required-note {
    color: var(--error-color);
}

.required-note {
    font-size: 0.875rem;
    margin: -0.4rem 0 1rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--brand-blue-rgb), 0.1);
}

.form-error {
    color: var(--error-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.form-help {
    color: var(--text-light);
    font-size: 0.875rem;
    line-height: 1.5;
    margin-top: 0.35rem;
}

.contact-form .btn[disabled] {
    cursor: progress;
    opacity: 0.78;
    transform: none;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-light);
}

.empty-state p {
    font-size: 1.125rem;
    margin-bottom: 1rem;
}

.empty-state a {
    color: var(--primary-color);
    font-weight: 600;
}

/* Footer */
.footer {
    background: linear-gradient(180deg, transparent, rgba(var(--primary-rgb), 0.04)), var(--bg-alt);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: 4rem;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.footer-copy {
    color: var(--text-light);
    font-size: 0.95rem;
    margin: 0;
}

.footer-policy {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.footer-policy a {
    color: var(--text-light);
    font-size: 0.875rem;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-policy a:hover {
    color: var(--primary-color);
}

.footer-sep {
    color: var(--border-color);
    font-size: 0.875rem;
    user-select: none;
}

/* ── Policy pages ──────────────────────────────────────── */
.policy-content {
    padding: 3.5rem 0;
}

.policy-body {
    max-width: var(--container-reading);
    margin: 0 auto;
}

.policy-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    font-size: 0.875rem;
    color: var(--text-light);
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.policy-intro {
    padding: 1.25rem 1.5rem;
    background: var(--bg-alt);
    border-left: 3px solid var(--primary-color);
    border-radius: 0 6px 6px 0;
    margin-bottom: 2.5rem;
    color: var(--text-light);
    font-size: 0.975rem;
    line-height: 1.7;
}

.policy-intro p {
    margin: 0;
}

.policy-section {
    margin-bottom: 3rem;
}

.policy-section h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    color: var(--secondary-color);
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.25rem;
}

.policy-section p {
    color: var(--text-light);
    line-height: 1.75;
    margin-bottom: 0.75rem;
}

.policy-section p:last-child {
    margin-bottom: 0;
}

.policy-section a {
    color: var(--primary-color);
    text-decoration: none;
}

.policy-section a:hover {
    text-decoration: underline;
}

.policy-number {
    display: inline-flex;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--primary-color);
    background: rgba(var(--primary-rgb, 59,130,246), 0.1);
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    letter-spacing: 0.08em;
    font-family: var(--mono-font, 'JetBrains Mono', 'Fira Code', monospace);
    flex-shrink: 0;
}

.policy-list {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.policy-list li {
    color: var(--text-light);
    line-height: 1.7;
    padding-left: 1.25rem;
    position: relative;
    font-size: 0.975rem;
}

.policy-list li::before {
    content: '›';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: 700;
}

.policy-list code {
    font-size: 0.85em;
    background: var(--bg-alt);
    padding: 0.1em 0.35em;
    border-radius: 3px;
    border: 1px solid var(--border-color);
}

.policy-table-wrap {
    overflow-x: auto;
    margin: 0.5rem 0 0;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.policy-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.policy-table th {
    background: var(--bg-alt);
    color: var(--text-color);
    font-weight: 600;
    padding: 0.7rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.policy-table td {
    padding: 0.65rem 1rem;
    color: var(--text-light);
    vertical-align: top;
    border-bottom: 1px solid var(--border-color);
    line-height: 1.55;
}

.policy-table tr:last-child td {
    border-bottom: none;
}

.policy-table td code,
.policy-table th code {
    font-size: 0.83em;
    background: var(--bg-alt);
    padding: 0.1em 0.35em;
    border-radius: 3px;
    border: 1px solid var(--border-color);
    white-space: normal;
    word-break: break-all;
}

.policy-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.policy-link-btn {
    display: inline-block;
    padding: 0.5rem 1.1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--primary-color);
    font-size: 0.9rem;
    text-decoration: none;
    transition: border-color 0.2s, background 0.2s;
}

.policy-link-btn:hover {
    border-color: var(--primary-color);
    background: rgba(var(--primary-rgb, 59,130,246), 0.06);
}

/* Responsive Design */
@media (max-width: 1024px) and (min-width: 769px) {
    .container {
        padding: 0 2.5rem;
    }

    .hero .container {
        gap: 2.75rem;
    }

    .hero-illustration {
        width: min(43vw, 360px);
    }

    .links-grid {
        gap: 1.25rem;
    }

    .about-section--work .skills-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .about-section--work .skill-category:last-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1.5rem;
    }

    body {
        line-height: 1.62;
    }

    .hero {
        padding: 2.5rem 0;
        min-height: auto;
    }

    .hero .container {
        flex-direction: column;
        gap: 2.5rem;
    }

    .hero::before,
    .hero::after {
        display: none;
    }

    .hero-illustration {
        width: 100%;
        max-width: 380px;
        margin: 0 auto;
    }

    .term-window {
        transform: none;
    }

    .hero-title {
        letter-spacing: -0.03em;
    }

    .hero-trust {
        grid-template-columns: 1fr;
        gap: 0.6rem;
        margin-top: 1.3rem;
    }

    .hero-subtitle {
        margin-bottom: 1rem;
    }

    .hero-description {
        line-height: 1.72;
        margin-bottom: 1.5rem;
    }

    .hero-stat {
        padding: 0.75rem 0.85rem;
    }

    .hero-cta {
        gap: 0.65rem;
    }

    .btn {
        width: 100%;
        text-align: center;
        padding: 0.8rem 1.1rem;
    }

    .quick-links,
    .about-content,
    .projects-content,
    .blog-content,
    .contact-content {
        padding: 3.5rem 0;
    }

    .about-story {
        grid-template-columns: 1fr;
        gap: 3.25rem;
    }

    .about-portrait {
        position: relative;
        top: auto;
        width: min(100%, 420px);
        margin: 0 auto;
    }

    .about-story-copy h2 {
        max-width: none;
    }

    .about-section--work {
        margin-top: 5rem;
    }

    .about-closing {
        align-items: stretch;
        flex-direction: column;
        gap: 1.75rem;
        margin-top: 4rem;
    }

    .nav-right {
        gap: 0.6rem;
        min-width: 0;
    }

    .nav-toggle {
        display: inline-flex;
        order: 1;
    }

    .theme-toggle {
        order: 2;
        width: 44px;
        height: 44px;
    }

    .nav-links {
        position: absolute;
        top: calc(100% + 0.75rem);
        left: 1rem;
        right: 1rem;
        display: none;
        flex-direction: column;
        gap: 0.2rem;
        padding: 0.6rem;
        border: 1px solid var(--border-color);
        border-radius: var(--radius-lg);
        background: var(--bg-color);
        box-shadow: var(--shadow-lg);
    }

    .nav-links.is-open {
        display: flex;
    }

    .nav-links a {
        width: 100%;
        justify-content: flex-start;
        padding: 0.35rem 0.8rem;
        border-radius: var(--radius-md);
    }

    .nav-links a::after {
        display: none;
    }

    .nav-links a:hover,
    .nav-links a[aria-current="page"] {
        background: rgba(var(--primary-rgb), 0.1);
    }

    .navbar .container {
        padding: 0 1rem;
    }

    .logo {
        margin-right: 0.5rem;
    }

    .links-grid,
    .projects-grid,
    .skills-grid,
    .blog-grid {
        grid-template-columns: 1fr;
    }

    .contact-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .page-header h1 {
        margin-bottom: 0.45rem;
    }

    .page-header .subtitle {
        line-height: 1.6;
    }

    /* Blog Responsive */
    .blog-card .blog-image {
        min-height: 200px;
        max-height: 300px;
    }

    .blog-card .blog-image img {
        max-height: 300px;
    }

    .blog-card-content {
        padding: 1.5rem;
    }

    .blog-article {
        padding: 1.5rem;
    }

    .project-tech-stack {
        align-items: flex-start;
        gap: 0.65rem;
        padding: 1rem;
    }

    .project-tech-stack h2 {
        flex-basis: 100%;
    }

    .featured-image {
        width: calc(100% + 3rem);
        margin-left: -1.5rem;
        margin-right: -1.5rem;
        margin-top: -1.5rem;
        max-height: 300px;
        min-height: 200px;
    }

    .featured-image img {
        max-height: 300px;
    }

    .blog-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .detail-meta {
        flex-wrap: wrap;
        gap: 0.4rem;
    }

    .detail-meta .read-time {
        text-align: left;
    }

    /* Markdown Content Responsive */
    .markdown-content {
        line-height: 1.75;
    }

    .project-card-content,
    .contact-form,
    .contact-method {
        padding: 1.5rem;
    }

    .link-arrow,
    .contact-link,
    .back-link,
    .footer-policy a {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
    }

    .contact-form .btn {
        min-height: 44px;
    }

    .markdown-content pre {
        padding: 1rem;
    }

    .markdown-content table th,
    .markdown-content table td {
        padding: 0.5rem;
    }

    .markdown-content img {
        margin: 1.5rem auto;
        border-radius: 8px;
        max-height: 400px;
    }

    .markdown-content p > img {
        max-height: 400px;
    }

    /* Footer responsive */
    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    /* Policy responsive */
    .policy-meta {
        flex-direction: column;
        gap: 0.4rem;
    }

    .policy-footer-links {
        flex-direction: column;
    }

    .policy-link-btn {
        text-align: center;
    }

    .post-nav {
        grid-template-columns: 1fr;
    }

    .post-nav-next {
        justify-self: start;
        text-align: left;
    }

    .post-nav-link {
        max-width: 100%;
        width: 100%;
    }
}

@media (max-width: 430px) {
    .container {
        padding: 0 1rem;
    }

    .hero-cta {
        flex-direction: column;
    }

    .search-field {
        border-radius: var(--radius-lg);
        align-items: stretch;
    }

    .search-input {
        min-height: 44px;
    }

    .search-btn {
        padding-left: 0.85rem;
        padding-right: 0.85rem;
    }

    .project-link,
    .read-more {
        padding-top: 0.4rem;
        padding-bottom: 0.4rem;
    }

    .about-portrait-frame::before {
        inset: 0.7rem -0.7rem -0.7rem 0.7rem;
    }

    .term-body {
        padding: 0.9rem;
        overflow-x: auto;
    }

    .term-line {
        width: max-content;
        min-width: 100%;
    }

    .policy-section h2 {
        align-items: flex-start;
    }

    .footer-policy {
        gap: 0.35rem 0.5rem;
    }
}



/* Dark Mode Specific Styles */
[data-theme="dark"] .project-card,
[data-theme="dark"] .blog-card,
[data-theme="dark"] .link-card,
[data-theme="dark"] .skill-category {
    background: var(--bg-alt);
    box-shadow: 0 2px 8px rgba(var(--black-rgb), 0.3);
}

[data-theme="dark"] .project-card:hover,
[data-theme="dark"] .blog-card:hover,
[data-theme="dark"] .link-card:hover {
    box-shadow: 0 8px 24px rgba(var(--black-rgb), 0.5);
}

[data-theme="dark"] .markdown-content pre {
    background: #1c1f26;
    border-color: #30363d;
}

[data-theme="dark"] .markdown-content code {
    background: #1c1f26;
    color: #f0f6fc;
}

[data-theme="dark"] .markdown-content blockquote {
    border-left-color: var(--primary-color);
    background: var(--bg-alt);
}

[data-theme="dark"] .markdown-content table th {
    background: #1c1f26;
}

[data-theme="dark"] .markdown-content table tr:nth-child(even) {
    background: #1c1f26;
}

[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group textarea {
    background: var(--bg-alt);
    border-color: var(--border-color);
    color: var(--text-color);
}

[data-theme="dark"] .form-group input:focus,
[data-theme="dark"] .form-group textarea:focus {
    background: var(--bg-color);
    border-color: var(--primary-color);
}

[data-theme="dark"] .project-image,
[data-theme="dark"] .blog-image {
    background: #1c1f26;
}

[data-theme="dark"] .alert-success {
    background: rgba(46, 160, 67, 0.15);
    border-color: #2ea043;
    color: #3fb950;
}

[data-theme="dark"] .alert-error {
    background: rgba(248, 81, 73, 0.15);
    border-color: #f85149;
    color: #ff7b72;
}

[data-theme="dark"] .btn-secondary,
[data-theme="dark"] .content-btn--secondary {
    background: var(--bg-alt);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .btn-secondary:hover,
[data-theme="dark"] .content-btn--secondary:hover {
    background: var(--border-color);
    border-color: var(--primary-color);
}

[data-theme="dark"] .search-btn:hover {
    background: #1a5fd0;
    opacity: 1;
}

[data-theme="dark"] .project-tech-stack {
    border-color: #2b3543;
    background: #111821;
}

[data-theme="dark"] .project-tech-stack .tag {
    border-color: rgba(var(--primary-rgb), 0.48);
    background: rgba(var(--primary-rgb), 0.06);
    color: #e6edf7;
}

[data-theme="dark"] .hero {
    background: linear-gradient(145deg, rgba(var(--primary-rgb), 0.12), transparent 55%), var(--bg-color);
}

[data-theme="dark"] .hero-stat {
    background: rgba(var(--white-rgb), 0.02);
    border-color: rgba(var(--primary-rgb), 0.24);
}

[data-theme="dark"] .hero-badge {
    background: rgba(var(--primary-rgb), 0.18);
}

[data-theme="dark"] .navbar {
    box-shadow: 0 12px 28px rgba(var(--black-rgb), 0.35);
}

.footer .footer-policy a {
    color: var(--text-light);
}

.footer .footer-policy a:hover,
.footer .footer-policy a:focus-visible {
    color: var(--primary-color);
}

[data-theme="dark"] .btn-primary,
[data-theme="dark"] .content-btn--primary {
    background: linear-gradient(135deg, #1f6feb, #1158c7);
    color: #ffffff;
    box-shadow: 0 10px 24px rgba(31, 111, 235, 0.32);
}

[data-theme="dark"] .btn-primary:hover,
[data-theme="dark"] .content-btn--primary:hover {
    background: linear-gradient(135deg, #2f81f7, #1f6feb);
    color: #ffffff;
}

[data-theme="light"] .markdown-content code {
    color: #0b5cad;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }

    .project-card:hover,
    .blog-card:hover,
    .link-card:hover,
    .project-card:hover .project-image img,
    .blog-card:hover .blog-image img,
    .featured-image img:hover {
        transform: none !important;
    }
}

/* ── 404 Error Page ──────────────────────────────────────────────────────── */
.error-page {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem 1rem;
}

.error-page > .container {
    width: 100%;
}

.error-content {
    max-width: 640px;
    margin: 0 auto;
}

.error-code {
    font-size: clamp(6rem, 20vw, 10rem);
    font-weight: 800;
    line-height: 1;
    color: var(--primary-color);
    letter-spacing: -0.04em;
    margin-bottom: 1rem;
}

.error-title {
    margin-bottom: 0.75rem;
    font-size: clamp(2rem, 6vw, 2.75rem);
    line-height: 1.15;
}

.error-message {
    color: var(--text-light);
    font-size: 1.05rem;
    margin-bottom: 2rem;
}

@media (min-width: 769px) {
    .error-message {
        white-space: nowrap;
    }
}

.error-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

.error-actions .btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 430px) {
    .error-actions {
        flex-direction: column;
    }

    .error-actions .btn {
        width: 100%;
    }
}

/* ── Interactive home experience ───────────────────────────────────────── */
.home-shell {
    --home-surface-rgb: 255, 255, 255;
    --home-surface-alpha: 0.72;
    --home-surface: rgba(var(--home-surface-rgb), var(--home-surface-alpha));
    --home-surface-strong: #ffffff;
    --home-line-rgb: 18, 31, 53;
    --home-line-alpha: 0.12;
    --home-line: rgba(var(--home-line-rgb), var(--home-line-alpha));
    --home-muted: #667085;
    --home-ink: #111827;
    --home-blue: #1668e8;
    --home-cyan: #0e9f8c;
    --home-purple: #7c3aed;
    --home-blue-base-rgb: 22, 104, 232;
    --home-blue-highlight-rgb: 79, 152, 255;
    --home-cyan-highlight-rgb: 54, 214, 173;
    --home-glow: rgba(var(--home-blue-base-rgb), 0.2);
    --home-spotlight-rgb: 52, 124, 246;
    --home-neutral-rgb: 127, 141, 163;
    --home-panel-rgb: 247, 249, 252;
    --home-shadow-rgb: 28, 40, 65;
    --home-shadow-blue-rgb: 28, 65, 128;
    --home-shadow-slate-rgb: 32, 48, 75;
    --home-lilac-rgb: 169, 139, 255;
    position: relative;
    background: #f7f9fc;
    color: var(--home-ink);
    overflow: hidden;
}

[data-theme="dark"] .home-shell {
    --home-surface-rgb: 17, 23, 33;
    --home-surface-alpha: 0.74;
    --home-surface-strong: #111721;
    --home-line-rgb: 158, 173, 196;
    --home-line-alpha: 0.17;
    --home-muted: #98a5b8;
    --home-ink: #f0f4fa;
    --home-blue: #4f98ff;
    --home-cyan: #36d6ad;
    --home-purple: #a98bff;
    --home-glow: rgba(var(--home-blue-highlight-rgb), 0.24);
    --home-panel-rgb: 11, 16, 24;
    background: #090d14;
}

.home-shell a {
    text-underline-offset: 0.2em;
}

.home-progress {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1200;
    width: 100%;
    height: 2px;
    pointer-events: none;
}

.home-progress span {
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, var(--home-cyan), var(--home-blue), var(--home-purple));
    transform: scaleX(0);
    transform-origin: left;
    will-change: transform;
}

.home-hero {
    --spotlight-x: 50%;
    --spotlight-y: 40%;
    position: relative;
    min-height: min(900px, calc(100vh - 74px));
    display: flex;
    align-items: center;
    isolation: isolate;
    border-bottom: 1px solid var(--home-line);
    background:
        radial-gradient(circle 520px at var(--spotlight-x) var(--spotlight-y), rgba(var(--home-spotlight-rgb), 0.09), transparent 72%),
        linear-gradient(145deg, rgba(var(--home-blue-base-rgb), 0.04), transparent 42%);
}

[data-theme="dark"] .home-hero {
    background:
        radial-gradient(circle 580px at var(--spotlight-x) var(--spotlight-y), rgba(var(--home-spotlight-rgb), 0.13), transparent 72%),
        linear-gradient(145deg, rgba(var(--home-blue-base-rgb), 0.06), transparent 42%);
}

.home-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.02fr) minmax(470px, 0.98fr);
    align-items: center;
    gap: clamp(3.5rem, 7vw, 7.5rem);
    padding-top: 6.2rem;
    padding-bottom: 7.5rem;
    position: relative;
    z-index: 2;
}

.home-grid-pattern {
    position: absolute;
    inset: 0;
    z-index: -2;
    opacity: 0.36;
    background-image:
        linear-gradient(var(--home-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--home-line) 1px, transparent 1px);
    background-size: 64px 64px;
    -webkit-mask-image: linear-gradient(to bottom, black, transparent 80%);
    mask-image: linear-gradient(to bottom, black, transparent 80%);
}

.home-orb {
    position: absolute;
    z-index: -1;
    width: 32rem;
    aspect-ratio: 1;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.13;
    pointer-events: none;
    animation: home-orb-drift 12s ease-in-out infinite alternate;
}

.home-orb--one {
    right: -14rem;
    top: -12rem;
    background: var(--home-blue);
}

.home-orb--two {
    left: -20rem;
    bottom: -17rem;
    background: var(--home-purple);
    animation-delay: -5s;
}

@keyframes home-orb-drift {
    to { transform: translate3d(2.5rem, 1.5rem, 0) scale(1.08); }
}

.home-eyebrow,
.home-section-kicker {
    display: flex;
    align-items: center;
    gap: 0.72rem;
    margin-bottom: 1.35rem;
    color: var(--home-blue);
    font-family: 'Menlo', 'Monaco', 'Consolas', monospace;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.status-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--home-cyan);
    box-shadow: 0 0 0 0 rgba(var(--home-cyan-highlight-rgb), 0.5);
    animation: home-pulse 2.2s ease-out infinite;
}

@keyframes home-pulse {
    70%, 100% { box-shadow: 0 0 0 9px rgba(var(--home-cyan-highlight-rgb), 0); }
}

.home-title {
    margin: 0;
    color: var(--home-ink);
}

.home-title-name {
    display: block;
    margin-bottom: 1.15rem;
    color: var(--home-muted);
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.04em;
}

.home-title-statement {
    display: block;
    max-width: 760px;
    font-size: clamp(3.15rem, 5.2vw, 5.7rem);
    font-weight: 760;
    line-height: 0.99;
    letter-spacing: -0.06em;
    text-wrap: balance;
}

.home-title-statement em {
    color: var(--home-blue);
    font-style: normal;
    background: linear-gradient(110deg, var(--home-blue), var(--home-cyan));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.home-role {
    margin-top: 1.65rem;
    color: var(--home-ink);
    font-size: 1rem;
    font-weight: 700;
}

.home-intro {
    max-width: 610px;
    margin-top: 0.65rem;
    color: var(--home-muted);
    font-size: clamp(1.02rem, 1.4vw, 1.16rem);
    line-height: 1.8;
}

.home-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-top: 2rem;
}

.home-actions .btn {
    min-height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.home-primary-action {
    position: relative;
    overflow: hidden;
}

.home-primary-action::after {
    content: "";
    position: absolute;
    top: -60%;
    left: -30%;
    width: 24%;
    height: 220%;
    background: rgba(var(--white-rgb), 0.34);
    transform: rotate(18deg);
    transition: left 0.55s ease;
}

.home-primary-action:hover::after {
    left: 118%;
}

.home-social {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.8rem 1.15rem;
    margin-top: 1.4rem;
    color: var(--home-muted);
    font-size: 0.84rem;
}

.home-social > span {
    font-family: 'Menlo', 'Monaco', 'Consolas', monospace;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.home-social a {
    position: relative;
    z-index: 1;
    color: var(--home-ink);
    font-weight: 650;
    text-decoration: none;
}

.home-social a:hover {
    color: var(--home-blue);
}

.hero-terminal-wrap {
    position: relative;
    width: 100%;
    max-width: 610px;
    justify-self: end;
    perspective: 1200px;
}

.terminal-aura {
    position: absolute;
    inset: 12% -8% -14% 12%;
    z-index: -1;
    border-radius: 50%;
    background: var(--home-blue);
    filter: blur(90px);
    opacity: 0.14;
    animation: terminal-aura 4s ease-in-out infinite alternate;
}

@keyframes terminal-aura {
    to { opacity: 0.25; transform: scale(1.05); }
}

.hero-terminal {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--home-line);
    border-radius: 20px;
    background: rgba(var(--home-panel-rgb), 0.88);
    box-shadow: 0 38px 90px rgba(var(--home-shadow-rgb), 0.15), inset 0 1px 0 rgba(var(--white-rgb), 0.8);
    transform: rotateY(-3deg) rotateX(1.5deg);
    transition: transform 0.5s ease, box-shadow 0.5s ease, border-color 0.3s ease;
    -webkit-backdrop-filter: blur(22px);
    backdrop-filter: blur(22px);
}

[data-theme="dark"] .hero-terminal {
    background: rgba(var(--home-panel-rgb), 0.92);
    box-shadow: 0 38px 100px rgba(var(--black-rgb), 0.48), inset 0 1px 0 rgba(var(--white-rgb), 0.035);
}

.hero-terminal:hover,
.hero-terminal.is-running {
    border-color: rgba(var(--home-blue-highlight-rgb), 0.46);
    transform: rotateY(0) rotateX(0) translateY(-4px);
    box-shadow: 0 42px 110px rgba(var(--home-shadow-blue-rgb), 0.22);
}

[data-theme="dark"] .hero-terminal:hover,
[data-theme="dark"] .hero-terminal.is-running {
    box-shadow: 0 42px 110px rgba(var(--black-rgb), 0.58), 0 0 45px rgba(var(--home-blue-highlight-rgb), 0.08);
}

.hero-terminal::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(115deg, transparent 28%, rgba(var(--white-rgb), 0.025) 48%, transparent 66%);
    transform: translateX(-120%);
}

.hero-terminal.is-running::after {
    animation: terminal-scan 1.5s ease-out;
}

@keyframes terminal-scan {
    to { transform: translateX(120%); }
}

.hero-terminal-topbar {
    min-height: 56px;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0 1.2rem;
    border-bottom: 1px solid var(--home-line);
    background: rgba(var(--home-neutral-rgb), 0.055);
    color: var(--home-muted);
    font-family: 'Menlo', 'Monaco', 'Consolas', monospace;
    font-size: 0.72rem;
}

.terminal-lights {
    display: flex;
    gap: 0.45rem;
}

.terminal-light {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.terminal-light--red { background: #ff5f57; }
.terminal-light--yellow { background: #febc2e; }
.terminal-light--green { background: #28c840; }

.hero-terminal-title {
    margin-left: auto;
    letter-spacing: 0.02em;
}

.terminal-mode {
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
    padding: 0.25rem 0.48rem;
    border: 1px solid rgba(var(--home-cyan-highlight-rgb), 0.22);
    border-radius: 999px;
    color: var(--home-cyan);
    font-size: 0.62rem;
    text-transform: uppercase;
}

.terminal-mode span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
}

.hero-terminal-body {
    min-height: 380px;
    padding: 1.55rem 1.6rem 1.25rem;
    font-family: 'Menlo', 'Monaco', 'Consolas', monospace;
    font-size: clamp(0.72rem, 1vw, 0.84rem);
    line-height: 1.85;
}

.terminal-code-line {
    display: grid;
    grid-template-columns: 2.1rem minmax(0, 1fr);
    min-height: 1.85em;
    opacity: 1;
    transform: translateY(0);
}

.terminal-code-line b {
    font-weight: 600;
}

.code-muted { color: rgba(102, 112, 133, 0.56); user-select: none; }
.code-purple { color: var(--home-purple); }
.code-blue { color: var(--home-blue); }
.code-green { color: var(--home-cyan); }
.code-neutral { color: var(--home-ink); }
.code-indent { display: inline-block; padding-left: 1.5rem; }

.terminal-output {
    position: relative;
    min-height: 112px;
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--home-line);
    border-radius: 10px;
    background: rgba(var(--home-neutral-rgb), 0.045);
    color: var(--home-muted);
}

.terminal-output-line {
    min-height: 1.8em;
    opacity: 1;
}

.terminal-output-line--ok {
    color: var(--home-cyan);
    font-weight: 700;
}

.terminal-prompt {
    color: var(--home-blue);
    font-weight: 800;
}

.output-spinner {
    display: inline-block;
    width: 0.75em;
    height: 0.75em;
    margin-right: 0.35rem;
    border: 1.5px solid rgba(var(--home-blue-highlight-rgb), 0.25);
    border-top-color: var(--home-blue);
    border-radius: 50%;
    animation: terminal-spin 0.7s linear infinite;
}

.hero-terminal.is-complete .output-spinner {
    width: 0.48em;
    height: 0.48em;
    margin-right: 0.55rem;
    border-color: var(--home-cyan);
    background: var(--home-cyan);
    box-shadow: 0 0 8px rgba(var(--home-cyan-highlight-rgb), 0.7);
    animation: none;
}

@keyframes terminal-spin {
    to { transform: rotate(360deg); }
}

.terminal-caret {
    display: inline-block;
    width: 7px;
    height: 1em;
    margin-left: 0.18rem;
    vertical-align: -0.14em;
    background: var(--home-blue);
    animation: home-caret 1s step-end infinite;
}

@keyframes home-caret {
    50% { opacity: 0; }
}

.terminal-animated .terminal-code-line,
.terminal-animated .terminal-output-line {
    opacity: 0;
    transform: translateY(6px);
}

.terminal-animated .terminal-code-line.is-visible,
.terminal-animated .terminal-output-line.is-visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.28s ease, transform 0.28s ease;
}

.hero-terminal-footer {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.7rem 1.2rem;
    border-top: 1px solid var(--home-line);
    background: rgba(var(--home-neutral-rgb), 0.04);
}

.terminal-safety {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1rem;
    color: var(--home-muted);
    font-size: 0.66rem;
}

.terminal-safety span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.terminal-safety i {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--home-cyan);
}

.terminal-run {
    flex-shrink: 0;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.42rem;
    padding: 0.42rem 0.7rem;
    border: 1px solid rgba(var(--home-blue-highlight-rgb), 0.28);
    border-radius: 7px;
    background: rgba(var(--home-blue-highlight-rgb), 0.09);
    color: var(--home-blue);
    font-family: inherit;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.terminal-run:hover {
    border-color: var(--home-blue);
    background: rgba(var(--home-blue-highlight-rgb), 0.16);
    transform: translateY(-1px);
}

.terminal-run.is-running svg {
    animation: terminal-spin 0.8s linear infinite;
}

.terminal-caption {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0 0;
    color: var(--home-muted);
    font-family: 'Menlo', 'Monaco', 'Consolas', monospace;
    font-size: 0.68rem;
    line-height: 1.6;
}

.terminal-caption span {
    color: var(--home-blue);
}

.home-scroll-cue {
    position: absolute;
    bottom: 1.6rem;
    left: 50%;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--home-muted);
    font-family: 'Menlo', 'Monaco', 'Consolas', monospace;
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    text-decoration: none;
    text-transform: uppercase;
    transform: translateX(-50%);
}

.home-scroll-cue i {
    position: relative;
    width: 1px;
    height: 26px;
    overflow: hidden;
    background: var(--home-line);
}

.home-scroll-cue i::after {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--home-blue);
    transform: translateY(-100%);
    animation: home-scroll-line 1.8s ease-in-out infinite;
}

@keyframes home-scroll-line {
    80%, 100% { transform: translateY(100%); }
}

.home-section {
    position: relative;
    padding: clamp(5.5rem, 9vw, 9rem) 0;
    border-bottom: 1px solid var(--home-line);
}

.home-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: clamp(2.5rem, 5vw, 4.5rem);
}

.home-section-kicker span {
    color: var(--home-muted);
}

.home-section-heading h2,
.home-story-copy h2,
.home-contact-copy h2 {
    max-width: 860px;
    color: var(--home-ink);
    font-size: clamp(2.25rem, 4.8vw, 4.7rem);
    font-weight: 730;
    line-height: 1.04;
    letter-spacing: -0.052em;
    text-wrap: balance;
}

@media (min-width: 921px) {
    .home-work .home-section-heading > div {
        flex: 1 1 auto;
        min-width: 0;
    }

    .home-work .home-section-heading h2 {
        max-width: none;
        font-size: clamp(2.25rem, 3.65vw, 4.1rem);
        white-space: nowrap;
        text-wrap: nowrap;
    }

    .home-work .home-section-heading .home-text-link {
        flex: 0 0 auto;
    }
}

.home-text-link {
    position: relative;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 44px;
    color: var(--home-ink);
    font-size: 0.86rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.home-text-link span {
    color: var(--home-blue);
    transition: transform 0.2s ease;
}

.home-text-link:hover {
    color: var(--home-blue);
}

.home-text-link:hover span {
    transform: translate(2px, -2px);
}

.featured-projects {
    display: grid;
    gap: 1.1rem;
}

.featured-project {
    --spotlight-x: 50%;
    --spotlight-y: 50%;
    --project-accent: var(--home-blue);
    --project-accent-rgb: 22, 104, 232;
    position: relative;
    display: grid;
    grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.28fr);
    min-height: 320px;
    overflow: hidden;
    border: 1px solid var(--home-line);
    border-radius: 22px;
    background:
        radial-gradient(circle 300px at var(--spotlight-x) var(--spotlight-y), rgba(var(--home-blue-highlight-rgb), 0.095), transparent 70%),
        var(--home-surface);
    box-shadow: 0 18px 50px rgba(var(--home-shadow-slate-rgb), 0.05);
    transform-style: preserve-3d;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.18s ease;
}

[data-theme="dark"] .featured-project {
    --project-accent-rgb: 79, 152, 255;
    box-shadow: 0 20px 70px rgba(var(--black-rgb), 0.18);
}

.featured-project--2 {
    --project-accent: #ca8a04;
    --project-accent-rgb: 202, 138, 4;
}

[data-theme="dark"] .featured-project--2 {
    --project-accent: #facc15;
    --project-accent-rgb: 250, 204, 21;
}

.featured-project--3 {
    --project-accent: var(--home-cyan);
    --project-accent-rgb: 14, 159, 140;
}

[data-theme="dark"] .featured-project--3 {
    --project-accent-rgb: 54, 214, 173;
}

.featured-project:hover {
    border-color: rgba(var(--home-blue-highlight-rgb), 0.42);
    box-shadow: 0 24px 70px rgba(var(--home-shadow-blue-rgb), 0.12);
}

.featured-project-hitarea,
.writing-row-hitarea {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.featured-project-visual {
    position: relative;
    min-height: 100%;
    overflow: hidden;
    border-right: 1px solid var(--home-line);
    background:
        radial-gradient(circle at 50% 50%, rgba(var(--project-accent-rgb), 0.18), transparent 46%),
        linear-gradient(145deg, rgba(var(--project-accent-rgb), 0.08), rgba(var(--project-accent-rgb), 0.025));
}

.project-visual-grid {
    position: absolute;
    inset: 0;
    opacity: 0.54;
    background-image:
        linear-gradient(var(--home-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--home-line) 1px, transparent 1px);
    background-size: 34px 34px;
    -webkit-mask-image: radial-gradient(circle, black 12%, transparent 74%);
    mask-image: radial-gradient(circle, black 12%, transparent 74%);
}

.project-visual-node {
    position: absolute;
    z-index: 2;
    width: 72px;
    height: 72px;
    border: 1px solid rgba(var(--project-accent-rgb), 0.5);
    border-radius: 18px;
    background: var(--home-surface-strong);
    box-shadow: 0 0 0 8px rgba(var(--project-accent-rgb), 0.045), 0 14px 35px rgba(var(--home-shadow-slate-rgb), 0.12);
    animation: project-node-float 4s ease-in-out infinite alternate;
}

.project-visual-node::before,
.project-visual-node::after {
    content: "";
    position: absolute;
    border-radius: 50%;
}

.project-visual-node::before {
    inset: 20px;
    border: 1px solid var(--project-accent);
}

.project-visual-node::after {
    inset: 30px;
    background: var(--project-accent);
    box-shadow: 0 0 16px var(--project-accent);
}

.project-visual-node--a { left: 18%; top: 22%; }
.project-visual-node--b { right: 16%; top: 42%; animation-delay: -1.2s; }
.project-visual-node--c { left: 35%; bottom: 14%; animation-delay: -2.4s; }

@keyframes project-node-float {
    to { transform: translateY(-7px); }
}

.project-visual-line {
    position: absolute;
    z-index: 1;
    height: 1px;
    overflow: hidden;
    background: var(--home-line);
    transform-origin: left;
}

.project-visual-line::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, var(--project-accent), transparent);
    animation: project-packet 2.2s linear infinite;
}

.project-visual-line--a {
    width: 47%;
    left: 31%;
    top: 38%;
    transform: rotate(17deg);
}

.project-visual-line--b {
    width: 42%;
    left: 33%;
    top: 67%;
    transform: rotate(-25deg);
}

@keyframes project-packet {
    from { transform: translateX(-100%); }
    to { transform: translateX(100%); }
}

.project-visual-label {
    position: absolute;
    z-index: 3;
    color: var(--home-muted);
    font-family: 'Menlo', 'Monaco', 'Consolas', monospace;
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.project-visual-label { left: 1.1rem; top: 1rem; }

.featured-project-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(1.65rem, 3vw, 2.75rem);
}

.featured-project-meta {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    color: var(--home-muted);
    font-family: 'Menlo', 'Monaco', 'Consolas', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.featured-project-content h3 {
    margin-top: 0.7rem;
    color: var(--home-ink);
    font-size: clamp(1.55rem, 2.2vw, 2.15rem);
    line-height: 1.14;
    letter-spacing: -0.04em;
}

.featured-project-content h3 a {
    position: relative;
    z-index: 3;
    color: inherit;
    text-decoration: none;
}

.featured-project-content > p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    max-width: 65ch;
    margin-top: 0.75rem;
    color: var(--home-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

.featured-project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.9rem;
}

.featured-project-tags span {
    padding: 0.32rem 0.58rem;
    border: 1px solid var(--home-line);
    border-radius: 999px;
    color: var(--home-muted);
    background: rgba(var(--home-neutral-rgb), 0.045);
    font-family: 'Menlo', 'Monaco', 'Consolas', monospace;
    font-size: 0.63rem;
}

.featured-project-links {
    position: relative;
    z-index: 3;
    display: flex;
    flex-wrap: wrap;
    gap: 1.2rem;
    margin-top: 1rem;
}

.featured-project-links a {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--home-ink);
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
}

.featured-project-links a:hover {
    color: var(--home-blue);
}

.featured-project-links a:first-child span {
    color: var(--home-blue);
    transition: transform 0.2s ease;
}

.featured-project-links a:first-child:hover span {
    transform: translateX(3px);
}

.writing-list {
    border-top: 1px solid var(--home-line);
}

.writing-row {
    position: relative;
    min-height: 180px;
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr) 48px;
    align-items: center;
    gap: clamp(1.5rem, 4vw, 4rem);
    padding: 1.8rem 1rem;
    border-bottom: 1px solid var(--home-line);
    transition: background 0.25s ease, padding 0.25s ease;
}

.writing-row:hover {
    padding-right: 1.4rem;
    padding-left: 1.4rem;
    background: rgba(var(--home-blue-highlight-rgb), 0.045);
}

.writing-date {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    color: var(--home-muted);
    font-family: 'Menlo', 'Monaco', 'Consolas', monospace;
    font-size: 0.62rem;
    line-height: 1.25;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.writing-date strong {
    grid-row: span 2;
    color: var(--home-ink);
    font-size: 2.1rem;
    font-weight: 500;
    letter-spacing: -0.05em;
}

.writing-copy > p {
    color: var(--home-blue);
    font-family: 'Menlo', 'Monaco', 'Consolas', monospace;
    font-size: 0.62rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.writing-copy h3 {
    margin-top: 0.42rem;
    color: var(--home-ink);
    font-size: clamp(1.25rem, 2.3vw, 2rem);
    line-height: 1.2;
    letter-spacing: -0.03em;
}

.writing-copy h3 a {
    position: relative;
    z-index: 3;
    color: inherit;
    text-decoration: none;
}

.writing-copy > span {
    display: block;
    max-width: 80ch;
    margin-top: 0.5rem;
    color: var(--home-muted);
    font-size: 0.85rem;
    line-height: 1.65;
}

.writing-arrow {
    color: var(--home-blue);
    font-size: 1.25rem;
    transition: transform 0.25s ease;
}

.writing-row:hover .writing-arrow {
    transform: translate(4px, -4px);
}

.home-story {
    background:
        radial-gradient(circle at 13% 40%, rgba(var(--home-blue-highlight-rgb), 0.07), transparent 28%),
        linear-gradient(180deg, transparent, rgba(var(--home-blue-highlight-rgb), 0.025));
}

.home-story-grid {
    display: grid;
    grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1.28fr);
    align-items: center;
    gap: clamp(3.5rem, 8vw, 8rem);
}

.home-story-portrait {
    max-width: 450px;
}

.story-image-frame {
    position: relative;
    padding: 0.6rem;
    border: 1px solid var(--home-line);
    border-radius: 24px;
    background: var(--home-surface);
    transform: rotate(-2deg);
    transition: transform 0.45s ease;
}

.story-image-frame:hover {
    transform: rotate(0deg) translateY(-4px);
}

.story-image-frame::before {
    content: "";
    position: absolute;
    inset: 12% -7% -7% 12%;
    z-index: -1;
    border: 1px solid rgba(var(--home-blue-highlight-rgb), 0.2);
    border-radius: inherit;
}

.story-image-frame img {
    width: 100%;
    aspect-ratio: 1;
    display: block;
    border-radius: 17px;
    object-fit: cover;
    filter: saturate(0.84) contrast(1.03);
}

.story-image-code {
    position: absolute;
    right: -1rem;
    bottom: 1.7rem;
    padding: 0.52rem 0.7rem;
    border: 1px solid var(--home-line);
    border-radius: 7px;
    background: var(--home-surface-strong);
    color: var(--home-blue);
    box-shadow: 0 12px 35px rgba(var(--home-shadow-rgb), 0.12);
    font-family: 'Menlo', 'Monaco', 'Consolas', monospace;
    font-size: 0.58rem;
    letter-spacing: 0.08em;
}

.home-story-copy h2 {
    max-width: 620px;
}

.home-story-lead {
    max-width: 720px;
    margin-top: 1.4rem;
    color: var(--home-ink);
    font-size: clamp(1.18rem, 2vw, 1.5rem);
    line-height: 1.55;
}

.home-story-copy > p:not(.home-section-kicker):not(.home-story-lead) {
    max-width: 720px;
    margin-top: 1rem;
    color: var(--home-muted);
    font-size: 0.96rem;
    line-height: 1.8;
}

.home-story-copy .home-text-link {
    margin-top: 1.25rem;
}

.home-contact {
    padding: clamp(4rem, 7vw, 7rem) 0;
    background: #f2f6fc;
}

[data-theme="dark"] .home-contact {
    background: #080b11;
}

.home-contact-panel {
    --spotlight-x: 50%;
    --spotlight-y: 50%;
    position: relative;
    min-height: 420px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 3rem;
    overflow: hidden;
    padding: clamp(2.2rem, 6vw, 5.5rem);
    border: 1px solid rgba(var(--home-blue-highlight-rgb), 0.3);
    border-radius: 26px;
    background:
        radial-gradient(circle 480px at var(--spotlight-x) var(--spotlight-y), rgba(var(--home-blue-highlight-rgb), 0.16), transparent 68%),
        linear-gradient(135deg, rgba(var(--home-blue-highlight-rgb), 0.1), rgba(var(--home-lilac-rgb), 0.05)),
        var(--home-surface);
}

.home-contact-copy {
    position: relative;
    z-index: 2;
}

.home-contact-copy h2 {
    max-width: 890px;
}

.home-contact-copy > p:last-child {
    max-width: 680px;
    margin-top: 1.2rem;
    color: var(--home-muted);
    font-size: 1rem;
    line-height: 1.75;
}

.home-contact-actions {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
}

.contact-radar {
    position: absolute;
    top: -115px;
    right: -85px;
    width: 330px;
    height: 330px;
    border: 1px solid rgba(var(--home-blue-highlight-rgb), 0.13);
    border-radius: 50%;
}

.contact-radar span {
    position: absolute;
    border: 1px solid rgba(var(--home-blue-highlight-rgb), 0.13);
    border-radius: 50%;
}

.contact-radar span:nth-child(1) { inset: 42px; }
.contact-radar span:nth-child(2) { inset: 86px; }
.contact-radar span:nth-child(3) { inset: 130px; }

.contact-radar::after {
    content: "";
    position: absolute;
    inset: 50% 50% 0;
    width: 50%;
    height: 1px;
    background: linear-gradient(90deg, var(--home-blue), transparent);
    transform-origin: left;
    animation: contact-radar 5s linear infinite;
}

.contact-radar i {
    position: absolute;
    right: 58px;
    bottom: 88px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--home-cyan);
    box-shadow: 0 0 12px var(--home-cyan);
    animation: home-pulse 2s ease-out infinite;
}

@keyframes contact-radar {
    to { transform: rotate(360deg); }
}

.home-empty-card {
    padding: 2rem;
    border: 1px solid var(--home-line);
    border-radius: 16px;
    color: var(--home-muted);
    background: var(--home-surface);
}

.home-empty-card a {
    display: inline-block;
    margin-top: 0.7rem;
    color: var(--home-blue);
    font-weight: 700;
}

.reveal-up {
    opacity: 0;
    transform: translateY(18px);
}

.reveal-up.is-visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.65s ease, transform 0.65s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.home-hero .reveal-up:nth-child(2) { transition-delay: 0.08s; }
.home-hero .reveal-up:nth-child(3) { transition-delay: 0.14s; }
.home-hero .reveal-up:nth-child(4) { transition-delay: 0.2s; }
.home-hero .reveal-up:nth-child(5) { transition-delay: 0.26s; }

@media (max-width: 1180px) {
    .home-hero-grid {
        grid-template-columns: minmax(0, 1fr) minmax(420px, 0.85fr);
        gap: 3rem;
    }

    .home-title-statement {
        font-size: clamp(3rem, 5vw, 4.6rem);
    }

    .hero-terminal-body {
        min-height: 350px;
        padding-right: 1.2rem;
        padding-left: 1.2rem;
    }

    .featured-project {
        grid-template-columns: 0.72fr 1.28fr;
    }
}

@media (max-width: 920px) {
    .home-hero {
        min-height: auto;
    }

    .home-hero-grid {
        grid-template-columns: 1fr;
        gap: 4rem;
        padding-top: 5.5rem;
        padding-bottom: 7rem;
    }

    .home-hero-grid > *,
    .home-hero-copy,
    .hero-terminal-wrap,
    .hero-terminal {
        min-width: 0;
        width: 100%;
    }

    .home-title-statement {
        max-width: 760px;
        font-size: clamp(3.1rem, 9vw, 5.2rem);
    }

    .hero-terminal-wrap {
        width: 100%;
        max-width: 690px;
        justify-self: start;
    }

    .home-scroll-cue {
        display: none;
    }

    .featured-project {
        grid-template-columns: 1fr;
    }

    .featured-project-visual {
        min-height: 240px;
        border-right: 0;
        border-bottom: 1px solid var(--home-line);
    }

    .home-story-grid {
        grid-template-columns: minmax(240px, 0.7fr) minmax(0, 1.3fr);
        gap: 3.5rem;
    }

    .home-contact-panel {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .home-contact-actions {
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .home-hero-grid {
        gap: 3rem;
        padding-top: 4rem;
        padding-bottom: 4.5rem;
    }

    .home-title-statement {
        font-size: clamp(2.8rem, 13vw, 4.3rem);
        letter-spacing: -0.055em;
    }

    .home-role {
        margin-top: 1.25rem;
    }

    .home-actions {
        flex-direction: column;
    }

    .home-actions .btn {
        width: 100%;
    }

    .hero-terminal {
        transform: none;
        border-radius: 15px;
    }

    .hero-terminal:hover,
    .hero-terminal.is-running {
        transform: translateY(-2px);
    }

    .hero-terminal-body {
        min-height: 325px;
        overflow-x: auto;
        padding: 1.15rem 1rem;
        font-size: 0.68rem;
    }

    .terminal-code {
        min-width: 430px;
    }

    .hero-terminal-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .terminal-run {
        width: 100%;
    }

    .home-section-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 1rem;
    }

    .featured-project-visual {
        min-height: 220px;
    }

    .featured-project-content {
        padding: 1.6rem;
    }

    .writing-row {
        grid-template-columns: 74px minmax(0, 1fr) 24px;
        gap: 1rem;
        padding-right: 0;
        padding-left: 0;
    }

    .writing-row:hover {
        padding-right: 0.25rem;
        padding-left: 0.25rem;
    }

    .writing-date strong {
        font-size: 1.55rem;
    }

    .writing-copy > span {
        display: none;
    }

    .home-story-grid {
        grid-template-columns: 1fr;
    }

    .home-story-portrait {
        width: min(85%, 420px);
    }

    .story-image-code {
        right: -0.7rem;
    }

    .home-contact-panel {
        min-height: 470px;
        padding: 2rem 1.4rem;
        border-radius: 18px;
    }
}

@media (max-width: 430px) {
    .home-eyebrow {
        align-items: flex-start;
        font-size: 0.66rem;
    }

    .status-pulse {
        flex-shrink: 0;
        margin-top: 0.23rem;
    }

    .home-title-statement {
        font-size: clamp(2.55rem, 13vw, 3.4rem);
    }

    .home-social {
        gap: 0.65rem 0.85rem;
    }

    .hero-terminal-topbar {
        padding: 0 0.75rem;
    }

    .hero-terminal-title {
        display: none;
    }

    .terminal-mode {
        margin-left: auto;
    }

    .terminal-safety span:last-child {
        display: none;
    }

    .home-section-heading h2,
    .home-story-copy h2,
    .home-contact-copy h2 {
        font-size: 2.25rem;
    }

    .featured-project-visual {
        min-height: 190px;
    }

    .project-visual-node {
        width: 58px;
        height: 58px;
    }

    .project-visual-node::before { inset: 16px; }
    .project-visual-node::after { inset: 24px; }

    .featured-project-meta {
        flex-direction: column;
        gap: 0.25rem;
    }

    .featured-project-content h3 {
        font-size: 1.55rem;
    }

    .writing-row {
        grid-template-columns: 1fr 24px;
        min-height: 150px;
    }

    .writing-date {
        display: none;
    }

    .home-story-portrait {
        width: calc(100% - 1rem);
    }

    .home-contact-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .home-contact-actions .btn {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .reveal-up {
        opacity: 1;
        transform: none;
    }

    .hero-terminal,
    .featured-project {
        transform: none !important;
    }

    .terminal-animated .terminal-code-line,
    .terminal-animated .terminal-output-line {
        opacity: 1;
        transform: none;
    }
}
