/* ---------- Tokens ---------- */
:root {
    --bg: #f6f6fa;
    --bg-elevated: #ffffff;
    --surface: #ffffff;
    --surface-2: #f0f0f6;
    --text: #12131a;
    --muted: #5b6072;
    --border: #e2e3ec;
    --accent: #6a4cf5;
    --accent-2: #0ea5a4;
    --accent-contrast: #ffffff;
    --accent-soft: rgb(106 76 245 / 0.1);
    --glow-1: rgb(106 76 245 / 0.18);
    --glow-2: rgb(14 165 164 / 0.14);
    --shadow: 0 1px 2px rgb(18 19 26 / 0.04), 0 12px 32px rgb(18 19 26 / 0.08);
    --radius: 18px;
    --radius-sm: 10px;
    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
    --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --gutter: 16px;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0a0b10;
        --bg-elevated: #10121a;
        --surface: #12141d;
        --surface-2: #181b26;
        --text: #eceef5;
        --muted: #9aa0b4;
        --border: #232737;
        --accent: #9b8aff;
        --accent-2: #3fd8cf;
        --accent-contrast: #0a0b10;
        --accent-soft: rgb(155 138 255 / 0.12);
        --glow-1: rgb(124 102 255 / 0.22);
        --glow-2: rgb(63 216 207 / 0.12);
        --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 16px 40px rgb(0 0 0 / 0.45);
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --bg: #0a0b10;
    --bg-elevated: #10121a;
    --surface: #12141d;
    --surface-2: #181b26;
    --text: #eceef5;
    --muted: #9aa0b4;
    --border: #232737;
    --accent: #9b8aff;
    --accent-2: #3fd8cf;
    --accent-contrast: #0a0b10;
    --accent-soft: rgb(155 138 255 / 0.12);
    --glow-1: rgb(124 102 255 / 0.22);
    --glow-2: rgb(63 216 207 / 0.12);
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 16px 40px rgb(0 0 0 / 0.45);
    color-scheme: dark;
}

@media (min-width: 640px) { :root { --gutter: 32px; } }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
@media (min-width: 640px) { body { font-size: 1.0625rem; } }

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--accent); color: var(--accent-contrast); }

h1, h2, h3 { font-family: var(--font-display); line-height: 1.1; letter-spacing: -0.03em; margin: 0 0 0.5em; font-weight: 600; }
h1 { font-size: clamp(2.5rem, 7vw, 4.75rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.75rem); }
h3 { font-size: 1.25rem; letter-spacing: -0.015em; }
p { margin: 0 0 1em; }
code { font-family: var(--mono); font-size: 0.875em; background: var(--accent-soft); padding: 0.15em 0.4em; border-radius: 6px; }

.container { width: 100%; max-width: 1160px; margin-inline: auto; padding-inline: var(--gutter); }
.container.narrow { max-width: 820px; }
.muted { color: var(--muted); }
.icon { flex: none; vertical-align: -0.15em; }

.skip-link { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--surface); padding: 8px 14px; border-radius: var(--radius-sm); }
.skip-link:focus { left: 8px; }

/* Soft colour glows behind the page */
.backdrop {
    position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background:
        radial-gradient(600px 400px at 85% -5%, var(--glow-1), transparent 70%),
        radial-gradient(500px 380px at -10% 30%, var(--glow-2), transparent 70%);
}
.backdrop::after {
    content: ""; position: absolute; inset: 0;
    background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse 80% 50% at 50% 0%, #000 10%, transparent 70%);
    opacity: 0.35;
}

/* ---------- Header ---------- */
.site-header {
    position: sticky; top: 0; z-index: 20;
    background: color-mix(in srgb, var(--bg) 78%, transparent);
    backdrop-filter: saturate(160%) blur(14px);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; position: relative; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; }
.brand-mark {
    display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff; font-size: 0.9rem; font-weight: 700;
}
.site-nav { display: flex; align-items: center; gap: 8px; }
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.nav-list a {
    display: block; padding: 8px 14px; border-radius: 999px;
    color: var(--muted); text-decoration: none; font-weight: 500; font-size: 0.95rem;
    transition: color 0.15s, background 0.15s;
}
.nav-list a:hover { color: var(--text); background: var(--surface-2); }

.icon-button {
    display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
    border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer;
    transition: border-color 0.15s;
}
.icon-button:hover { border-color: var(--accent); }
.menu-toggle { display: none; }

.theme-toggle .when-dark { display: none; }
:root[data-theme="dark"] .theme-toggle .when-dark { display: block; }
:root[data-theme="dark"] .theme-toggle .when-light { display: none; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-toggle .when-dark { display: block; }
    :root:not([data-theme="light"]) .theme-toggle .when-light { display: none; }
}

@media (max-width: 720px) {
    .js .menu-toggle { display: inline-grid; }
    .js .site-nav {
        position: absolute; top: calc(100% + 8px); right: 0; left: 0;
        flex-direction: column; align-items: stretch; gap: 8px; padding: 12px;
        background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius);
        box-shadow: var(--shadow);
        opacity: 0; visibility: hidden; transform: translateY(-6px);
        transition: opacity 0.18s, transform 0.18s, visibility 0.18s;
    }
    .js .site-nav.open { opacity: 1; visibility: visible; transform: none; }
    .js .nav-list { flex-direction: column; }
    .js .nav-list a { padding: 12px 14px; font-size: 1.05rem; color: var(--text); }
    .js .theme-toggle { align-self: flex-start; margin-left: 8px; }
    .no-js .nav-list a { padding: 8px; }
}

/* ---------- Buttons and links ---------- */
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 28px 0 0; }
.actions.small { margin-top: 20px; gap: 16px; }
.actions.centered { justify-content: center; }
.button {
    display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 20px;
    border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
    color: var(--text); text-decoration: none; font-weight: 600; font-size: 0.95rem;
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.button:hover { border-color: var(--accent); transform: translateY(-1px); }
.button.primary {
    background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--accent-2)));
    border-color: transparent; color: #fff;
    box-shadow: 0 8px 24px -8px var(--accent);
}
:root[data-theme="dark"] .button.primary { color: var(--accent-contrast); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .button.primary { color: var(--accent-contrast); } }
.text-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 0.95rem; color: var(--text); text-decoration: none; }
.text-link:hover { color: var(--accent); }
.more-link { margin-top: 40px; text-align: center; }
.more-link > a:not(.button) { display: inline-flex; gap: 6px; align-items: center; font-weight: 600; text-decoration: none; }

/* ---------- Hero ---------- */
.hero {
    display: grid; gap: 48px; align-items: center;
    padding-top: clamp(40px, 9vw, 112px); padding-bottom: clamp(48px, 8vw, 96px);
}
@media (min-width: 900px) { .hero { grid-template-columns: 1.25fr 0.75fr; } }
.eyebrow {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
    font-family: var(--mono); font-size: 0.8rem; color: var(--muted);
    margin-bottom: 24px;
}
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px rgb(34 197 94 / 0.18); }
.eyebrow .chip {
    display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
    padding: 6px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
}
.gradient-text {
    background: linear-gradient(120deg, var(--accent) 10%, var(--accent-2) 90%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lead { font-size: clamp(1.1rem, 2.2vw, 1.3rem); color: var(--muted); max-width: 58ch; }
.social { list-style: none; display: flex; gap: 10px; padding: 0; margin: 32px 0 0; }
.social a {
    display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
    border: 1px solid var(--border); background: var(--surface); color: var(--muted);
    transition: color 0.15s, border-color 0.15s;
}
.social a:hover { color: var(--accent); border-color: var(--accent); }

.hero > * { min-width: 0; }
.hero h1 { font-size: clamp(2.3rem, 5.2vw, 3.9rem); text-wrap: balance; }
.hero-visual { position: relative; justify-self: center; width: min(470px, 100%); }
@media (min-width: 900px) { .hero-visual { justify-self: end; } }
@media (max-width: 899px) { .hero-visual .float-chip { display: none; } }

/* Hero code card: a light editor theme in light mode, a dark one in dark mode. */
.code-card {
    --code-bg: #ffffff; --code-bar: #f6f7fb; --code-line: #e2e3ec; --code-text: #24292f; --code-dim: #6e7781; --code-dot: #d0d3de;
    --tk-kw: #8250df; --tk-type: #0550ae; --tk-prop: #953800; --tk-str: #116329; --tk-com: #6e7781; --tk-p: #57606a;
}
:root[data-theme="dark"] .code-card {
    --code-bg: #0d0f17; --code-bar: #11141e; --code-line: #262a3a; --code-text: #d7dbe8; --code-dim: #8b91a7; --code-dot: #3a3f52;
    --tk-kw: #c792ea; --tk-type: #82aaff; --tk-prop: #89ddff; --tk-str: #c3e88d; --tk-com: #6b7394; --tk-p: #8b91a7;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .code-card {
        --code-bg: #0d0f17; --code-bar: #11141e; --code-line: #262a3a; --code-text: #d7dbe8; --code-dim: #8b91a7; --code-dot: #3a3f52;
        --tk-kw: #c792ea; --tk-type: #82aaff; --tk-prop: #89ddff; --tk-str: #c3e88d; --tk-com: #6b7394; --tk-p: #8b91a7;
    }
}
.code-card {
    position: relative; border-radius: var(--radius); overflow: hidden;
    background: var(--code-bg); color: var(--code-text); border: 1px solid var(--code-line);
    box-shadow: 0 30px 80px -30px var(--accent), var(--shadow);
    font-family: var(--mono); font-size: clamp(0.7rem, 2.6vw, 0.8rem); line-height: 1.8;
}
.code-card::before {
    content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
    background: linear-gradient(140deg, var(--accent), transparent 40%, transparent 60%, var(--accent-2));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.code-bar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--code-line); background: var(--code-bar); }
.code-bar i { width: 11px; height: 11px; border-radius: 50%; background: var(--code-dot); }
.code-bar i:nth-child(1) { background: #ff5f57; } .code-bar i:nth-child(2) { background: #febc2e; } .code-bar i:nth-child(3) { background: #28c840; }
.code-bar span { margin-left: 8px; color: var(--code-dim); font-size: 0.78rem; }
.code-card code { background: none; padding: 0; border-radius: 0; font-size: inherit; }
.code-card pre { margin: 0; padding: 18px 20px 22px; overflow: hidden; white-space: pre-wrap; overflow-wrap: anywhere; }
.tk-kw { color: var(--tk-kw); } .tk-type { color: var(--tk-type); } .tk-prop { color: var(--tk-prop); } .tk-str { color: var(--tk-str); } .tk-com { color: var(--tk-com); font-style: italic; } .tk-p { color: var(--tk-p); }
.caret { display: inline-block; width: 0.55em; height: 1.1em; vertical-align: -0.2em; background: var(--accent-2); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.photo-ring {
    position: relative; border-radius: 32px; padding: 3px;
    background: linear-gradient(140deg, var(--accent), var(--accent-2));
    box-shadow: 0 30px 80px -30px var(--accent);
}
.photo-ring img { border-radius: 29px; aspect-ratio: 1; object-fit: cover; width: 100%; }
.float-chip {
    position: absolute; font-family: var(--mono); font-size: 0.8rem; font-weight: 500;
    padding: 6px 12px; border-radius: 999px; background: var(--bg-elevated); color: var(--text);
    border: 1px solid var(--border); box-shadow: var(--shadow);
    animation: float 6s ease-in-out infinite;
}
.chip-0 { top: 8%; left: -8%; }
.chip-1 { top: 42%; right: -10%; animation-delay: -1.5s; }
.chip-2 { bottom: 10%; left: -6%; animation-delay: -3s; }
.chip-3 { bottom: -4%; right: 14%; animation-delay: -4.5s; }
@media (max-width: 480px) { .chip-0, .chip-2 { left: -2%; } .chip-1 { right: -2%; } }
@keyframes float { 50% { transform: translateY(-8px); } }

/* ---------- Sections ---------- */
.section { padding-top: clamp(64px, 10vw, 120px); }
.section-head { margin-bottom: 40px; max-width: 720px; }
.kicker { font-family: var(--mono); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent); margin: 0 0 12px; }
.small-title { font-family: var(--mono); font-size: 0.75rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); margin: 0 0 14px; }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(20px, 3vw, 32px); }

/* Featured projects: horizontal gallery, three per view on wide screens */
.section-head-row { max-width: none; display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; }
.gallery-nav { display: flex; gap: 8px; }
.gallery-nav[hidden] { display: none; }
.gallery-nav .icon-button:disabled { opacity: 0.35; cursor: default; border-color: var(--border); }
.gallery {
    display: grid; grid-auto-flow: column; gap: 24px;
    grid-auto-columns: calc((100% - 48px) / 3);
    overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; overscroll-behavior-x: contain;
    padding: 6px 2px 18px; margin: -6px -2px 0; scrollbar-width: thin;
}
.gallery > .card { scroll-snap-align: start; }
@media (max-width: 1020px) { .gallery { grid-auto-columns: calc((100% - 24px) / 2); } }
@media (max-width: 640px) { .gallery { grid-auto-columns: 85%; gap: 16px; } }
.gallery:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: var(--radius); }

.detail-video { margin: 48px 0; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: #000; box-shadow: var(--shadow); }
.detail-video iframe { width: 100%; height: 100%; border: 0; display: block; }

/* Project cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 24px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s; }
.card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); box-shadow: var(--shadow); }
.card-link { color: inherit; text-decoration: none; display: flex; flex-direction: column; height: 100%; }
.card-media { aspect-ratio: 16 / 10; overflow: hidden; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.card-media img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.card-body { padding: 22px; display: flex; flex-direction: column; flex: 1; }
.card-body h3 { display: flex; justify-content: space-between; gap: 8px; }
.card-body p { color: var(--muted); flex: 1; }
.card-arrow { color: var(--accent); transition: transform 0.2s; }
.card:hover .card-arrow { transform: translateX(4px); }

.tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
    font-family: var(--mono); font-size: 0.75rem; font-weight: 500;
    padding: 5px 11px; border-radius: 8px; background: var(--surface-2); color: var(--text);
    border: 1px solid var(--border);
}

/* About */
.about-grid { display: grid; gap: 24px; }
@media (min-width: 900px) { .about-grid { grid-template-columns: 1.1fr 0.9fr; } }
.about-text > p:first-child { font-size: 1.1rem; }
/* Both columns end at the same height: the last panel of each column grows to fill. */
.skills, .about-col { display: flex; flex-direction: column; gap: 16px; }
.skills > :last-child, .about-col > :last-child { flex: 1; }
.skill-groups { display: grid; gap: 22px; }
.skill-groups .small-title { margin-bottom: 10px; }

.timeline { list-style: none; margin: 0; padding: 0 0 0 20px; border-left: 2px solid var(--border); display: grid; gap: 20px; }
.timeline li { position: relative; display: grid; }
.timeline li::before {
    content: ""; position: absolute; left: -27px; top: 6px; width: 12px; height: 12px; border-radius: 50%;
    background: var(--bg); border: 2px solid var(--accent);
}
.timeline-date { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); }
.timeline-title { font-weight: 600; color: var(--text); text-decoration: none; }
.timeline-title .icon { display: inline; vertical-align: -1px; margin-left: 4px; }
a.timeline-title:hover { color: var(--accent); }

/* Posts */
.post-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.post-link {
    display: grid; gap: 4px; padding: 20px 24px; border-radius: var(--radius);
    border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none;
    transition: border-color 0.15s;
}
.post-link:hover { border-color: var(--accent); }
.post-link time { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); }
.post-title { font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; }

/* Contact */
.contact-panel {
    position: relative; text-align: center; padding: clamp(40px, 7vw, 80px) clamp(20px, 5vw, 64px);
    border-radius: 28px; background: var(--surface); overflow: hidden; isolation: isolate;
    border: 1px solid var(--border);
}
.contact-panel::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background: radial-gradient(500px 240px at 50% 0%, var(--glow-1), transparent 70%), radial-gradient(400px 200px at 50% 100%, var(--glow-2), transparent 70%);
}
.contact-panel .lead { margin-inline: auto; }
.contact-panel .button.primary { overflow-wrap: anywhere; }
.contact-email { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 16px; margin: 20px 0 0; color: var(--muted); font-family: var(--mono); font-size: 0.9rem; }
.contact-email > span { overflow-wrap: anywhere; }
.contact-email .text-link { background: none; border: 0; padding: 0; cursor: pointer; }

/* Expertise */
.expertise-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.expertise { position: relative; transition: border-color 0.2s, transform 0.2s; }
.expertise:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); transform: translateY(-3px); }
.expertise-index { font-family: var(--mono); font-size: 0.8rem; color: var(--accent); display: block; margin-bottom: 18px; }
.expertise h3 { font-size: 1.15rem; }
.expertise p { color: var(--muted); margin: 0; font-size: 0.95rem; }

/* Experience */
.experience-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.job-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; align-items: baseline; }
.job-head h3 { margin: 0; font-size: 1.3rem; }
.job-company { color: var(--accent); font-weight: 500; }
.job-location { margin: 4px 0 0; font-size: 0.9rem; }
.job-dates { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); white-space: nowrap; padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; }
.job-highlights { margin: 18px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.job-highlights li { position: relative; padding-left: 22px; color: var(--muted); }
.job-highlights li::before { content: ""; position: absolute; left: 2px; top: 0.7em; width: 8px; height: 2px; background: var(--accent); border-radius: 2px; }

.about-text p:last-child { margin-bottom: 0; }
.language-list { margin: 0; display: grid; gap: 10px; }
.language-list div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; }
.language-list dt { font-weight: 600; }
.language-list dd { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* Résumé */
.resume { padding-top: clamp(32px, 6vw, 56px); }
.resume-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 32px; }
.resume-toolbar .back-link { margin: 0; }
.resume-head h1 { font-size: clamp(2.2rem, 6vw, 3.2rem); margin-bottom: 0.2em; }
.resume-role { font-size: 1.15rem; color: var(--muted); margin-bottom: 12px; }
.resume-contact { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 0.95rem; }
.resume-section { border-top: 1px solid var(--border); padding-top: 24px; margin-top: 28px; }
.resume-section h2 { font-family: var(--mono); font-size: 0.8rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent); margin-bottom: 16px; }
.resume-job + .resume-job { margin-top: 22px; }
.resume-job-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; align-items: baseline; }
.resume-job-head h3 { margin: 0; font-size: 1.1rem; }
.resume-job-head span { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); }
.resume-job p { margin: 2px 0 8px; font-size: 0.9rem; }
.resume-job ul, .resume-plain { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.resume-plain { list-style: none; padding: 0; }
.resume-skills { margin: 0; display: grid; gap: 8px; }
.resume-skills div { display: grid; grid-template-columns: 150px 1fr; gap: 16px; }
@media (max-width: 560px) { .resume-skills div { grid-template-columns: 1fr; gap: 0; } }
.resume-skills dt { font-weight: 600; }
.resume-skills dd { margin: 0; color: var(--muted); }

@media print {
    :root, :root:not([data-theme="light"]), :root[data-theme="dark"] { --bg: #fff; --surface: #fff; --surface-2: #f3f3f3; --text: #111; --muted: #444; --border: #ccc; --accent: #3b2db8; color-scheme: light; }
    .no-print, .backdrop, .site-header, .site-footer { display: none !important; }
    body { font-size: 9.5pt; line-height: 1.45; background: #fff; }
    .resume { padding: 0; max-width: none; }
    .resume a { color: inherit; text-decoration: none; }
    .resume-head h1 { font-size: 24pt; }
    .resume-role { font-size: 11pt; margin-bottom: 6px; }
    .resume-section { margin-top: 12px; padding-top: 10px; }
    .resume-section h2 { margin-bottom: 8px; }
    .resume-job + .resume-job { margin-top: 12px; }
    .resume-job ul, .resume-plain, .resume-skills { gap: 3px; }
    .resume-job { break-inside: avoid; }
    @page { margin: 12mm 14mm; }
}

/* ---------- Detail pages ---------- */
.page-head { padding-top: clamp(48px, 8vw, 96px); padding-bottom: 32px; }
.detail { padding-top: clamp(32px, 6vw, 64px); }
.back-link { display: inline-flex; gap: 8px; align-items: center; color: var(--muted); text-decoration: none; font-weight: 500; margin-bottom: 28px; }
.back-link:hover { color: var(--accent); }
.detail-head { max-width: 820px; }
.detail-cover { margin: 48px 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow); }
.detail-cover img { width: 100%; }
.detail-cover a { display: block; cursor: zoom-in; }

/* Screenshot gallery on project pages, opened full size in a dialog */
.detail-gallery { margin-top: clamp(48px, 8vw, 80px); }
.shots { list-style: none; padding: 0; margin: 24px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 16px; }
.shots a { display: block; aspect-ratio: 16 / 10; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); cursor: zoom-in; transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s; }
.shots a:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); box-shadow: var(--shadow); }
.shots a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.shots img { width: 100%; height: 100%; object-fit: cover; object-position: top; }

.lightbox { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 56px 72px 24px; border: 0; background: transparent; color: #f3f4f8; }
.lightbox::backdrop { background: rgb(8 9 14 / 0.92); }
.lightbox[open] { display: grid; place-items: center; }
.lightbox figure { margin: 0; display: grid; gap: 12px; justify-items: center; max-height: 100%; min-height: 0; grid-template-rows: minmax(0, 1fr) auto; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: var(--radius-sm); }
.lightbox figcaption { font-size: 0.95rem; text-align: center; }
.lightbox-count { font-family: var(--mono); font-size: 0.8rem; opacity: 0.7; margin-left: 8px; }
.lightbox .icon-button { position: fixed; background: rgb(255 255 255 / 0.08); border-color: rgb(255 255 255 / 0.2); color: #f3f4f8; }
.lightbox .icon-button:hover { border-color: #fff; }
.lightbox-close { top: 12px; right: 12px; }
.lightbox-prev, .lightbox-next { top: 50%; transform: translateY(-50%); }
.lightbox-prev { left: 12px; }
.lightbox-next { right: 12px; }
.lightbox [hidden] { display: none; }
@media (max-width: 640px) {
    .lightbox { padding: 56px 8px 72px; }
    .lightbox-prev, .lightbox-next { top: auto; bottom: 12px; transform: none; }
    .lightbox-prev { left: calc(50% - 52px); }
    .lightbox-next { right: calc(50% - 52px); }
}
.detail-grid { display: grid; gap: 32px; align-items: start; }
@media (min-width: 900px) { .detail-grid { grid-template-columns: 1fr 340px; } .callout { position: sticky; top: 96px; } }
.callout-title { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.callout dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; }
.callout dt { color: var(--muted); }
.callout dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 480px) {
    .callout dl { grid-template-columns: 1fr; gap: 2px; }
    .callout dd + dt { margin-top: 10px; }
}

.prose { max-width: 70ch; }
.prose h2 { font-size: 1.6rem; margin-top: 1.6em; }
.prose table { border-collapse: collapse; width: 100%; margin: 16px 0; font-size: 0.95rem; display: block; overflow-x: auto; }
.prose th, .prose td { border-bottom: 1px solid var(--border); padding: 10px 12px; text-align: left; }
.prose th { font-family: var(--mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer { margin-top: clamp(80px, 12vw, 140px); border-top: 1px solid var(--border); color: var(--muted); font-size: 0.9rem; }
.footer-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-block: 28px; }
.inline-list { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 16px; }
.inline-list a { color: var(--muted); display: inline-flex; gap: 6px; align-items: center; text-decoration: none; }
.inline-list a:hover { color: var(--accent); }

/* ---------- Motion ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s ease; }
.js .reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .js .reveal { opacity: 1; transform: none; }
}

@media (max-width: 400px) {
    .eyebrow { font-size: 0.72rem; gap: 6px; }
    .eyebrow .chip { padding: 5px 10px; gap: 6px; }
}
