/* Public site design system. Dark by default (the template's navy + teal), with a light theme that follows
   the OS unless the visitor picks one (data-theme on <html>, set by theme.js before first paint). */

:root {
    --bg: #040a15;
    --bg-raised: #0a1424;
    --bg-sunken: #071020;
    --surface: #0d1a2c;
    --border: #1d2d3f;
    --border-strong: #2b4157;
    --text: #e7f0f4;
    --text-dim: #9fb0c1;
    --text-faint: #7a8da1;
    --accent: #2ad6a8;
    --accent-strong: #10b98a;
    --accent-2: #67d7e8;
    --accent-ink: #03241b;
    --accent-soft: rgba(42, 214, 168, .12);
    --warn: #f5c35b;
    --grid-line: rgba(30, 216, 164, .03);
    --glow-1: rgba(8, 184, 146, .09);
    --glow-2: rgba(0, 141, 182, .08);
    --shadow: 0 20px 50px rgba(0, 0, 0, .35);
    --radius: 14px;
    --radius-sm: 8px;
    --header-h: 72px;
    --header-h-min: 58px;   /* compact header, once the page has scrolled */
    --max: 1160px;
    /* Motion tokens, shared by hover states here and by motion.css. */
    --dur-fast: 160ms;
    --dur-base: 320ms;
    --dur-slow: 640ms;
    --ease-out: cubic-bezier(.16, 1, .3, 1);   /* arrivals: quick start, long soft settle */
    --ease-std: cubic-bezier(.4, 0, .2, 1);    /* state changes */
    --stagger: 80ms;                           /* between siblings arriving together */
    --stagger-item: 45ms;                      /* between items inside a block */
    --hero-dur: 700ms;                         /* the hero's on-load entrance */
    --hero-step: 90ms;
    --move-s: 10px;
    --move-m: 24px;
    --move-l: 48px;
    color-scheme: dark;
}

@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) {
        --bg: #f6f8fb;
        --bg-raised: #ffffff;
        --bg-sunken: #eef2f7;
        --surface: #ffffff;
        --border: #dbe3ec;
        --border-strong: #c3cfdc;
        --text: #0d1b2a;
        --text-dim: #44576b;
        --text-faint: #5b6c7e;
        --accent: #087a5c;
        --accent-strong: #06654c;
        --accent-2: #0b7f95;
        --accent-ink: #ffffff;
        --accent-soft: rgba(11, 143, 108, .1);
        --warn: #a86b00;
        --grid-line: rgba(13, 27, 42, .035);
        --glow-1: rgba(11, 143, 108, .07);
        --glow-2: rgba(11, 127, 149, .06);
        --shadow: 0 16px 40px rgba(13, 27, 42, .08);
        color-scheme: light;
    }
}

:root[data-theme="light"] {
    --bg: #f6f8fb;
    --bg-raised: #ffffff;
    --bg-sunken: #eef2f7;
    --surface: #ffffff;
    --border: #dbe3ec;
    --border-strong: #c3cfdc;
    --text: #0d1b2a;
    --text-dim: #44576b;
    --text-faint: #5b6c7e;
    --accent: #087a5c;
    --accent-strong: #06654c;
    --accent-2: #0b7f95;
    --accent-ink: #ffffff;
    --accent-soft: rgba(11, 143, 108, .1);
    --warn: #a86b00;
    --grid-line: rgba(13, 27, 42, .035);
    --glow-1: rgba(11, 143, 108, .07);
    --glow-2: rgba(11, 127, 149, .06);
    --shadow: 0 16px 40px rgba(13, 27, 42, .08);
    color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 24px); -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.65;
    overflow-x: hidden;
}
img, video { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0; letter-spacing: -.02em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }

.skip-link {
    position: absolute; left: 16px; top: -60px; z-index: 200;
    background: var(--accent); color: var(--accent-ink); padding: 10px 16px; border-radius: var(--radius-sm);
    font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 12px; }
.visually-hidden {
    position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.bg-grid, .bg-glow { position: fixed; inset: 0; pointer-events: none; z-index: -1; }
.bg-grid {
    background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: linear-gradient(#000, transparent 80%);
}
.bg-glow { background: radial-gradient(ellipse at 15% 0, var(--glow-1), transparent 50%), radial-gradient(ellipse at 95% 45%, var(--glow-2), transparent 45%); }

.container { width: min(var(--max), calc(100% - 32px)); margin-inline: auto; }
@media (min-width: 720px) { .container { width: min(var(--max), calc(100% - 64px)); } }

/* ---------- Header ---------- */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}
.header-inner {
    height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 20px;
    transition: height .2s ease;
}
/* Compact once the page scrolls (class set by public.js). */
.site-header.scrolled { box-shadow: 0 6px 24px rgba(0, 0, 0, .12); }
.site-header.scrolled .header-inner { height: var(--header-h-min); }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.logo-mark {
    display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px;
    font-size: 13px; font-weight: 900; letter-spacing: .02em; color: var(--accent-ink);
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.logo-name { font-weight: 900; font-size: 18px; letter-spacing: .12em; text-transform: uppercase; }
.logo-dot { color: var(--accent); }
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a {
    font-size: 12px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700;
    color: var(--text-dim); text-decoration: none; padding: 8px 10px; border-radius: 6px; position: relative;
}
.site-nav a:hover { color: var(--text); background: var(--accent-soft); }
.site-nav a[aria-current="page"], .site-nav a.is-active { color: var(--accent); }
.site-nav a[aria-current="page"]::after, .site-nav a.is-active::after {
    content: ""; position: absolute; left: 10px; right: 10px; bottom: 2px; height: 2px; border-radius: 2px; background: var(--accent);
}
.site-nav .nav-world {
    display: inline-flex; align-items: center; gap: 7px; margin-left: 8px;
    color: var(--accent-2); border: 1px solid var(--border-strong); padding: 7px 12px;
}
.site-nav .nav-world svg { width: 15px; height: 15px; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn {
    width: 40px; height: 40px; display: inline-grid; place-items: center;
    background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-dim);
}
.icon-btn:hover { color: var(--accent); border-color: var(--border-strong); }
.icon-btn svg { width: 18px; height: 18px; }
.nav-toggle { display: none; }
/* The toggle shows the theme you'd switch TO: a sun on dark, a moon on light. */
.icon-moon { display: none; }
:root[data-theme="light"] .icon-sun { display: none; }
:root[data-theme="light"] .icon-moon { display: block; }
@media (prefers-color-scheme: light) {
    :root:not([data-theme]) .icon-sun { display: none; }
    :root:not([data-theme]) .icon-moon { display: block; }
}

.icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-menu { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

/* Below this the full nav doesn't fit; keep in sync with the matchMedia in public.js. */
@media (max-width: 980px) {
    .nav-toggle { display: inline-grid; }
    .site-nav {
        position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0;
        background: var(--bg); border-bottom: 1px solid var(--border); box-shadow: var(--shadow); padding: 8px 16px 20px;
        max-height: calc(100vh - var(--header-h)); overflow-y: auto;
        transform: translateY(-8px); opacity: 0; visibility: hidden; transition: opacity .18s, transform .18s, visibility .18s;
    }
    .site-nav.open { transform: none; opacity: 1; visibility: visible; }
    .site-nav a { padding: 14px 8px; border-bottom: 1px solid var(--border); border-radius: 0; font-size: 13px; }
    .site-nav a[aria-current="page"]::after, .site-nav a.is-active::after { left: 0; right: auto; top: 12px; bottom: 12px; width: 3px; height: auto; }
    .site-nav .nav-world { margin: 12px 0 0; border: 1px solid var(--border-strong); border-radius: 8px; justify-content: center; }
    /* Without JS there's no toggle, so the links simply wrap under the logo. */
    .no-js .nav-toggle { display: none; }
    .no-js .header-inner { height: auto; flex-wrap: wrap; padding: 12px 0; }
    .no-js .site-nav { position: static; opacity: 1; visibility: visible; transform: none; flex-direction: row; flex-wrap: wrap; box-shadow: none; border: 0; padding: 0; order: 3; width: 100%; }
    .no-js .site-nav a { border: 0; padding: 8px; }
}
@media (max-width: 340px) { .logo-name { display: none; } }

.read-progress {
    position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; display: none;
    background: linear-gradient(90deg, var(--accent), var(--accent-2)); transform: scaleX(0); transform-origin: 0 50%;
}
.read-progress.on { display: block; }

.to-top {
    position: fixed; right: 20px; bottom: 20px; z-index: 90; width: 44px; height: 44px; display: grid; place-items: center;
    border-radius: 50%; background: var(--bg-raised); border: 1px solid var(--border-strong); color: var(--text-dim); box-shadow: var(--shadow);
    opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity .2s, transform .2s, visibility .2s, color .2s;
}
.to-top svg { width: 18px; height: 18px; }
.to-top:hover { color: var(--accent); border-color: var(--accent); }
.to-top.show { opacity: 1; visibility: visible; transform: none; }
main:focus { outline: none; }

/* ---------- Buttons & chips ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 46px; padding: 0 20px; border-radius: var(--radius-sm);
    font-weight: 700; font-size: 14px; text-decoration: none; border: 1px solid transparent; transition: transform .15s, background .15s, border-color .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-strong); }
.btn-ghost { border-color: var(--border-strong); color: var(--text); background: transparent; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 13px; }
.btn-link { color: var(--text); padding: 0 8px; background: transparent; }
.btn-link:hover { color: var(--accent); }
.btn svg { width: 16px; height: 16px; }
.chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px;
    font-size: 12.5px; font-weight: 600; color: var(--text-dim); background: var(--bg-sunken); border: 1px solid var(--border);
}
.chip-accent { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; }

/* ---------- Sections ---------- */
.section { padding: 88px 0; }
.section + .section { border-top: 1px solid var(--border); }
.kicker { font-size: 12px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 36px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(28px, 4vw, 40px); margin-top: 10px; }
.section-head p { color: var(--text-dim); margin-top: 10px; max-width: 620px; }
.text-link { color: var(--accent); font-weight: 700; font-size: 14px; text-decoration: none; }
.text-link:hover { text-decoration: underline; }
.muted { color: var(--text-dim); }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 104px 0 64px; isolation: isolate; }
/* Its soft light follows the pointer: data-pointer="spotlight" (motion.css) paints it on the background. */
.hero { --spot-size: 520px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 56px; align-items: center; }
.status {
    display: inline-flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 700; letter-spacing: .08em;
    color: var(--accent); background: var(--accent-soft); padding: 7px 13px; border-radius: 999px;
}
.status-dot { position: relative; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.status-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--accent); opacity: 0; }
.hero h1 { font-size: clamp(44px, 8vw, 88px); font-weight: 900; letter-spacing: -.04em; margin: 22px 0 14px; line-height: 1.02; }
.hero h1 .word { display: inline-block; margin-right: .22em; }
.hero h1 .word:last-child {
    margin-right: 0;
    /* Two layers clipped to the letters: a light band (the sheen, moved by motion.css) that rests just off the
       name at either end of its layer, over the name's own gradient, which never moves. */
    background:
        linear-gradient(100deg, transparent 40%, color-mix(in srgb, #fff 60%, transparent) 50%, transparent 60%) 100% 0 / 250% 100% no-repeat,
        linear-gradient(100deg, var(--text) 10%, var(--accent) 60%, var(--accent-2));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .headline { font-size: clamp(18px, 2.4vw, 24px); font-weight: 700; color: var(--text); }
/* Rotating headline word: every phrase is stacked in one grid cell (so the widest sets the width and nothing
   shifts), and public.js marks one .on at a time. Without JS the first phrase shows. */
.rotator { display: inline-grid; vertical-align: bottom; overflow: hidden; }
.rotator > span {
    grid-area: 1 / 1; white-space: nowrap;
    background: linear-gradient(100deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent;
    transition: transform .5s cubic-bezier(.2, .7, .2, 1), opacity .5s;
}
.rotator > span:not(:first-child) { opacity: 0; transform: translateY(100%); }
.rotator.live > span { opacity: 0; transform: translateY(100%); }
.rotator.live > span.on { opacity: 1; transform: none; }
.rotator.live > span.off { opacity: 0; transform: translateY(-100%); }
.hero .tagline { color: var(--text-dim); font-size: 17.5px; max-width: 620px; margin-top: 18px; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 30px; }
.hero-copy-email { display: contents; }
/* The Contact link stands in until the copy button is ready (public.js), and stays if it never is. */
.hero-actions:has(.copy-btn.ready) .contact-fallback { display: none; }
.hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: 28px; color: var(--text-dim); font-size: 14px; }
.hero-loc { display: inline-flex; align-items: center; gap: 8px; }
.hero-loc svg { width: 16px; height: 16px; color: var(--accent); flex-shrink: 0; }
.socials { list-style: none; display: flex; gap: 8px; }
.hero-side { display: grid; justify-items: center; }
/* Portrait with a slowly turning gradient ring. */
.avatar-wrap { position: relative; padding: 5px; border-radius: 34px; }
.avatar-wrap::before {
    content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1;
    background: conic-gradient(from var(--ring, 0deg), var(--accent), var(--accent-2), var(--accent-soft), var(--accent-2), var(--accent));
}
.avatar-wrap::after {
    content: ""; position: absolute; inset: -30px; border-radius: 50%; z-index: -2;
    background: radial-gradient(circle, var(--glow-1), transparent 70%); filter: blur(10px);
}
.avatar {
    width: 260px; height: 260px; border-radius: 30px; object-fit: cover; display: block;
    background: var(--bg-raised); box-shadow: var(--shadow);
}
.avatar-fallback {
    display: grid; place-items: center; font-size: 72px; font-weight: 900; color: var(--accent);
    background: linear-gradient(140deg, var(--accent-soft), var(--bg-raised));
}
@media (max-width: 860px) {
    .hero { padding: 48px 0 40px; }
    /* A smaller portrait sits above the name. */
    .hero-grid { grid-template-columns: 1fr; gap: 24px; grid-template-areas: "side" "copy"; }
    .hero-side { justify-items: start; grid-area: side; }
    .avatar { width: 112px; height: 112px; border-radius: 22px; }
    .avatar-wrap { border-radius: 26px; padding: 4px; }
    .avatar-fallback { font-size: 34px; }
    .hero-actions .btn-primary, .hero-actions .btn-ghost { flex: 1 1 auto; }
    .hero-copy { grid-area: copy; }
    .hero h1 { margin-top: 18px; }
}

/* ---------- Proof strip ---------- */
.proof { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.proof-item { background: var(--bg-raised); padding: 22px 22px 20px; }
.proof-item strong { display: block; font-size: clamp(22px, 3vw, 30px); font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums;
    background: linear-gradient(100deg, var(--text), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.proof-item span { display: block; color: var(--text-dim); font-size: 13.5px; margin-top: 4px; }

/* ---------- Cards / projects ---------- */
.card {
    background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius);
    transition: border-color .2s, transform .2s, box-shadow .2s;
}
.card:hover { border-color: var(--border-strong); }
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 20px; }
.project-card { display: flex; flex-direction: column; overflow: hidden; position: relative; }
.project-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.project-media { aspect-ratio: 16 / 9; background: var(--bg-sunken); overflow: hidden; border-bottom: 1px solid var(--border); }
.project-media img { width: 100%; height: 100%; object-fit: cover; }
/* Generated cover art (no image uploaded): two hues per area, one of four line patterns per project. */
.art {
    --art-1: #2ad6a8; --art-2: #67d7e8;
    position: relative; width: 100%; height: 100%; padding: 18px 20px; overflow: hidden;
    display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto 1fr; align-items: start; gap: 0 12px;
    background:
        radial-gradient(110% 90% at 100% 0%, color-mix(in srgb, var(--art-2) 34%, transparent), transparent 62%),
        radial-gradient(90% 90% at 0% 100%, color-mix(in srgb, var(--art-1) 38%, transparent), transparent 66%),
        var(--bg-sunken);
}
.art::before {
    content: ""; position: absolute; inset: 0; opacity: .55;
    mask-image: linear-gradient(200deg, #000 10%, transparent 75%);
}
.art-ai { --art-1: #8b5cf6; --art-2: #2ad6a8; }
.art-dotnet { --art-1: #6d4aff; --art-2: #38bdf8; }
.art-xr { --art-1: #ec4899; --art-2: #f59e0b; }
.art-unity { --art-1: #10b981; --art-2: #0ea5e9; }
.art-v0::before { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--art-2) 40%, transparent) 0 1px, transparent 1px 14px); }
.art-v1::before { background: radial-gradient(color-mix(in srgb, var(--text) 30%, transparent) 1px, transparent 1.6px) 0 0 / 16px 16px; }
.art-v2::before { background: repeating-radial-gradient(circle at 88% 12%, transparent 0 17px, color-mix(in srgb, var(--art-2) 45%, transparent) 17px 18px); }
.art-v3::before {
    background:
        linear-gradient(color-mix(in srgb, var(--art-1) 35%, transparent) 1px, transparent 1px) 0 0 / 26px 26px,
        linear-gradient(90deg, color-mix(in srgb, var(--art-1) 35%, transparent) 1px, transparent 1px) 0 0 / 26px 26px;
}
.art > * { position: relative; }
.art-glyph {
    width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px; color: var(--text);
    background: color-mix(in srgb, var(--art-1) 30%, var(--bg-raised)); border: 1px solid color-mix(in srgb, var(--art-1) 45%, transparent);
}
.art-glyph svg { width: 22px; height: 22px; }
.art-label {
    align-self: center; justify-self: end; font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
    color: var(--text-dim);
}
.art-title {
    grid-column: 1 / -1; align-self: end; font-size: 21px; font-weight: 800; line-height: 1.2; letter-spacing: -.02em;
    color: var(--text); max-width: 92%;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.project-body { padding: 20px 20px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.project-body h3 { font-size: 19px; }
.project-body h3 a { text-decoration: none; }
.project-body h3 a::after { content: ""; position: absolute; inset: 0; } /* whole card clickable, one link */
.project-body .summary { color: var(--text-dim); font-size: 14.5px; }
.metric { color: var(--accent); font-weight: 700; font-size: 14px; display: flex; gap: 8px; align-items: baseline; }
.metric::before { content: "▲"; font-size: 10px; }
.project-foot { margin-top: auto; padding-top: 6px; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; display: grid; gap: 18px; }
.company { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 28px; padding: 26px; }
.company-meta h3 { font-size: 18px; }
.company-meta .period { color: var(--text-faint); font-size: 13.5px; margin-top: 6px; }
.roles { list-style: none; display: grid; gap: 22px; position: relative; }
.roles.multi { padding-left: 22px; border-left: 2px solid var(--border); }
.role { position: relative; }
.roles.multi .role::before {
    content: ""; position: absolute; left: -29px; top: 7px; width: 12px; height: 12px; border-radius: 50%;
    background: var(--bg-raised); border: 2px solid var(--accent);
}
.role h4 { font-size: 16.5px; }
.role .role-meta { color: var(--text-faint); font-size: 13.5px; margin-top: 3px; }
.role ul { margin-top: 10px; padding-left: 18px; color: var(--text-dim); font-size: 14.5px; display: grid; gap: 6px; }
.role.current h4::after {
    content: "Current"; margin-left: 10px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
    color: var(--accent); background: var(--accent-soft); padding: 2px 8px; border-radius: 999px; vertical-align: 2px;
}
.role details.more ul { margin-top: 6px; }
.role details.more summary {
    display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; cursor: pointer; list-style: none;
    color: var(--accent); font-size: 13.5px; font-weight: 700; border-radius: 4px;
}
.role details.more summary::-webkit-details-marker { display: none; }
.role details.more summary::after { content: "▾"; font-size: 11px; transition: transform .2s; }
.role details.more[open] summary::after { transform: rotate(180deg); }
.role details.more summary:hover { text-decoration: underline; }
details.more .when-open, details.more[open] .when-closed { display: none; }
details.more[open] .when-open { display: inline; }
@media (max-width: 760px) {
    .company { grid-template-columns: 1fr; gap: 14px; padding: 20px; }
}

/* ---------- Skills / services / creds ---------- */
.skill-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.skill-group { padding: 22px; }
.skill-group h3 { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 14px; }
.services { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; }
.service { padding: 24px; }
.service .icon { font-size: 26px; }
.service h3 { font-size: 17px; margin: 12px 0 8px; }
.service p { color: var(--text-dim); font-size: 14.5px; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.cred-list { list-style: none; display: grid; gap: 12px; }
.cred { padding: 18px 20px; display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.cred h3 { font-size: 16px; }
.cred .muted { font-size: 13.5px; margin-top: 2px; }

/* ---------- About / testimonials / contact ---------- */
.about { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 40px; }
.about .prose p + p { margin-top: 14px; }
.about .prose { color: var(--text-dim); font-size: 16.5px; }
.facts { list-style: none; display: grid; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; align-self: start; }
.facts li { background: var(--bg-raised); padding: 14px 18px; display: flex; justify-content: space-between; gap: 16px; font-size: 14.5px; }
.facts li span:first-child { color: var(--text-faint); }
.facts li span:last-child { text-align: right; font-weight: 600; }
@media (max-width: 860px) { .about { grid-template-columns: 1fr; } }
.quote { padding: 28px; }
.quote blockquote { margin: 0; font-size: 17px; line-height: 1.7; }
.quote figcaption { margin-top: 16px; color: var(--text-dim); font-size: 14px; }
.quote figcaption strong { color: var(--text); }
.contact-band { padding: 40px; display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; background: linear-gradient(120deg, var(--accent-soft), transparent 70%), var(--bg-raised);
    --spot-under: linear-gradient(120deg, var(--accent-soft), transparent 70%); --spot-size: 420px; }
.contact-band h2 { font-size: clamp(24px, 3vw, 32px); margin-top: 8px; }
.contact-email { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 16px; }
.contact-email a { font-weight: 700; font-size: 17px; text-decoration: none; overflow-wrap: anywhere; }
.contact-email a:hover { color: var(--accent); text-decoration: underline; }
.copy-btn { display: none; }
.copy-btn.ready { display: inline-flex; }
.copy-btn.copied { color: var(--accent); border-color: var(--accent); }
@media (max-width: 640px) { .contact-band { padding: 24px; } .contact-band .hero-actions { width: 100%; } .contact-band .btn { flex: 1 1 auto; } }

/* ---------- Projects page ---------- */
.page-hero { padding: 64px 0 28px; }
.page-hero h1 { font-size: clamp(34px, 5vw, 52px); font-weight: 900; margin-top: 10px; }
.page-hero p { color: var(--text-dim); margin-top: 12px; max-width: 640px; }
/* Privacy and other reading pages */
.legal { max-width: 720px; padding-bottom: 72px; color: var(--text-dim); font-size: 16px; }
.legal h2 { color: var(--text); font-size: 20px; font-weight: 800; margin: 36px 0 10px; }
.legal p + p, .legal p + ul, .legal ul + p { margin-top: 12px; }
.legal ul { padding-left: 20px; display: grid; gap: 6px; list-style: disc; }
.legal a { color: var(--accent); }
.legal code { font-size: .9em; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 26px; }
.filter-group { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-btn {
    display: inline-flex; align-items: center; gap: 7px; text-decoration: none;
    border: 1px solid var(--border); background: var(--bg-raised); color: var(--text-dim);
    border-radius: 999px; padding: 7px 8px 7px 14px; font-size: 13px; font-weight: 600; transition: border-color .15s, color .15s;
}
.filter-btn:hover { border-color: var(--border-strong); color: var(--text); }
.filter-glyph { display: inline-grid; }
.filter-glyph svg { width: 15px; height: 15px; }
.filter-count {
    min-width: 22px; padding: 1px 7px; border-radius: 999px; text-align: center; font-size: 11.5px; font-weight: 700;
    background: var(--bg-sunken); color: var(--text-dim);
}
.filter-btn[aria-current="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.filter-btn[aria-current="true"] .filter-count { background: color-mix(in srgb, var(--accent-ink) 18%, transparent); color: inherit; }
.search-wrap { position: relative; flex: 0 1 280px; min-width: min(100%, 220px); }
.search-wrap svg { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--text-faint); pointer-events: none; }
.search {
    width: 100%; min-height: 40px; padding: 0 14px 0 36px; border-radius: var(--radius-sm);
    border: 1px solid var(--border); background: var(--bg-raised);
}
.search:focus { border-color: var(--accent); }
.empty {
    display: grid; justify-items: center; gap: 6px; text-align: center; padding: 56px 16px;
    border: 1px dashed var(--border-strong); border-radius: var(--radius); color: var(--text-dim);
}
.empty svg { width: 36px; height: 36px; color: var(--text-faint); margin-bottom: 6px; }
.empty strong { color: var(--text); }
.empty .btn { margin-top: 10px; }
@media (max-width: 640px) { .search-wrap { flex: 1 1 100%; } }

/* ---------- Case study ---------- */
.breadcrumb { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; font-size: 13px; color: var(--text-faint); }
.breadcrumb li + li::before { content: "/"; margin-right: 4px; color: var(--text-faint); }
.breadcrumb a { text-decoration: none; color: var(--text-dim); }
.breadcrumb a:hover { color: var(--accent); text-decoration: underline; }
.breadcrumb [aria-current] { color: var(--text); }
.cs-hero .hero-actions { margin-top: 22px; }
.toc ol { list-style: none; display: grid; gap: 2px; border-left: 2px solid var(--border); }
.toc a {
    display: block; padding: 5px 12px; margin-left: -2px; border-left: 2px solid transparent;
    font-size: 14px; color: var(--text-dim); text-decoration: none;
}
.toc a:hover { color: var(--text); }
.toc a.is-active { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 48px; }
.pager-link { display: grid; gap: 4px; padding: 18px 20px; text-decoration: none; }
.pager-link:hover { border-color: var(--accent); transform: translateY(-2px); }
.pager-link.next { text-align: right; }
.pager-dir { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.pager-title { font-weight: 700; }
@media (max-width: 560px) { .pager { grid-template-columns: 1fr; } }
.cs-hero { padding: 48px 0 36px; }
.cs-hero h1 { font-size: clamp(32px, 5vw, 52px); font-weight: 900; margin: 14px 0 12px; }
.cs-hero .lede { font-size: 18px; color: var(--text-dim); max-width: 760px; }
.cs-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-top: 28px; }
.cs-facts div { background: var(--bg-raised); padding: 16px 18px; }
.cs-facts dt { color: var(--text-faint); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.cs-facts dd { margin: 6px 0 0; font-weight: 600; }
.cs-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; align-items: start; }
.cs-layout aside { position: sticky; top: calc(var(--header-h) + 20px); display: grid; gap: 16px; }
.cs-block + .cs-block { margin-top: 36px; }
.cs-block h2 { font-size: 22px; margin-bottom: 12px; }
.cs-block p, .cs-block li { color: var(--text-dim); }
.cs-block p + p { margin-top: 12px; }
.cs-block ul { padding-left: 20px; display: grid; gap: 8px; }
.side-card { padding: 20px; }
.side-card h3, .side-card .side-title { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 12px; }
.side-card .btn { width: 100%; }
.side-card .btn + .btn { margin-top: 10px; }
@media (max-width: 900px) {
    .cs-layout { grid-template-columns: 1fr; }
    .cs-layout aside { position: static; }
    .toc { display: none; } /* the sections are short on one column; the progress bar covers orientation */
}

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 12px; }
.gallery figure { margin: 0; }
.gallery button {
    padding: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--bg-sunken);
    width: 100%; aspect-ratio: 16 / 10; display: block;
}
.gallery button img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.gallery button:hover img { transform: scale(1.03); }
.gallery figcaption { font-size: 13px; color: var(--text-faint); margin-top: 6px; }
.video-frame { aspect-ratio: 16 / 9; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); background: #000; }
.video-frame iframe, .video-frame video { width: 100%; height: 100%; border: 0; }
.videos { display: grid; gap: 16px; margin-bottom: 16px; }

.lightbox {
    border: 0; padding: 0; background: transparent; max-width: min(96vw, 1400px); max-height: 92vh; color: #fff;
}
.lightbox::backdrop { background: rgba(2, 6, 12, .9); }
.lightbox img { max-height: 82vh; width: auto; margin: auto; border-radius: var(--radius-sm); }
.lightbox-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; }
.lightbox-bar p { font-size: 14px; opacity: .85; }
.lightbox-bar .controls { display: flex; gap: 8px; }
.lightbox .icon-btn { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .2); color: #fff; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 32px 0 40px; margin-top: 40px; color: var(--text-faint); font-size: 14px; }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: var(--accent); }
.motion-toggle {
    display: inline-flex; align-items: center; gap: 8px; padding: 0; border: 0; background: none; color: inherit; font-size: 14px;
}
.motion-toggle::before {
    content: ""; width: 28px; height: 16px; border-radius: 999px; background: var(--accent);
    box-shadow: inset 0 0 0 2px var(--accent); transition: background .2s;
}
/* A small switch: filled with the knob right while animations are on, hollow with the knob left when off. */
.motion-toggle[aria-pressed="true"]::before { background: radial-gradient(circle at 20px 50%, var(--accent-ink) 5px, transparent 5.5px), var(--accent); }
.motion-toggle[aria-pressed="false"]::before { background: radial-gradient(circle at 8px 50%, var(--accent) 5px, transparent 5.5px), var(--bg-sunken); }
.motion-toggle:hover { color: var(--accent); }


/* ---------- CV (screen + print) ---------- */
.cv { max-width: 860px; margin: 40px auto; padding: 48px; }
.cv header { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; border-bottom: 2px solid var(--accent); padding-bottom: 18px; }
.cv h1 { font-size: 34px; font-weight: 900; }
.cv .cv-headline { color: var(--accent); font-weight: 700; margin-top: 4px; }
.cv .cv-contact { list-style: none; font-size: 13.5px; color: var(--text-dim); text-align: right; display: grid; gap: 2px; }
.cv .cv-contact a { text-decoration: none; }
.cv section { margin-top: 26px; }
.cv h2 { font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin-bottom: 12px; }
.cv .cv-item + .cv-item { margin-top: 16px; }
.cv .cv-row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.cv .cv-row h3 { font-size: 15.5px; }
.cv .cv-row span { color: var(--text-faint); font-size: 13.5px; white-space: nowrap; }
.cv ul.points { padding-left: 18px; margin-top: 6px; font-size: 14px; color: var(--text-dim); display: grid; gap: 3px; }
.cv-actions { display: flex; gap: 10px; justify-content: center; margin: 24px 0 0; }
@media (max-width: 640px) { .cv { padding: 24px; margin: 16px; } .cv .cv-contact { text-align: left; } }

@media print {
    :root, :root[data-theme] { --bg: #fff; --bg-raised: #fff; --text: #111; --text-dim: #333; --text-faint: #555; --border: #ccc; --accent: #0b6e55; color-scheme: light; }
    body { font-size: 11pt; }
    .site-header, .site-footer, .bg-grid, .bg-glow, .cv-actions, .skip-link, .to-top { display: none !important; }
    /* Gradient text is painted as a background, which printing leaves out. */
    .hero h1 .word, .hero .headline .rotator > span, .proof-item strong { background: none !important; color: var(--text) !important; }
    .cv { margin: 0; padding: 0; border: 0; box-shadow: none; max-width: none; }
    .cv .cv-item, .cv section { break-inside: avoid; }
    a { text-decoration: none; }
}

/* ---------- 404 ---------- */
.not-found { padding-bottom: 56px; }
.not-found .path {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .9em; padding: 2px 6px; border-radius: 5px;
    background: var(--bg-sunken); border: 1px solid var(--border); color: var(--text); overflow-wrap: anywhere;
}
.nf-links { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-top: 28px; max-width: 900px; }
.nf-link { display: grid; gap: 2px; padding: 16px 18px; text-decoration: none; height: 100%; }
.nf-link:hover { border-color: var(--accent); transform: translateY(-2px); }
.nf-link strong { color: var(--accent); }
.nf-link span { font-size: 13.5px; color: var(--text-dim); }

/* ---------- Small utilities ---------- */
.subhead { margin: 40px 0 14px; }
.contact-note { margin-top: 8px; }
.hero-actions.flush { margin-top: 0; }
.small-note { font-size: 13.5px; margin-bottom: 14px; }
.side-note { font-size: 14px; margin-bottom: 12px; }
.cv-para { font-size: 14px; }
.cv-para + .cv-para { margin-top: 6px; }
.cv-role { margin-top: 8px; }

/* ---------- Case study: hero cover, media first ---------- */
.cs-hero-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px 48px; align-items: center; }
.cs-hero-grid .cs-facts { grid-column: 1 / -1; }
.cs-hero-text h1 { margin-top: 14px; }
.cs-cover { margin: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: var(--bg-sunken); aspect-ratio: 16 / 10; box-shadow: 0 24px 60px -30px rgba(0, 0, 0, .45); }
.cs-cover img, .cs-cover .art { width: 100%; height: 100%; object-fit: cover; display: block; }
.cs-cover-button { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.cs-cover-button img { transition: transform .3s; }
.cs-cover-button:hover img { transform: scale(1.02); }
@media (max-width: 900px) {
    .cs-hero-grid { grid-template-columns: minmax(0, 1fr); }
    .cs-cover { order: -1; }
}
.cs-highlights { list-style: none; padding: 0 !important; }
.cs-highlights li { position: relative; padding-left: 26px; }
.cs-highlights li::before { content: ""; position: absolute; left: 4px; top: .55em; width: 10px; height: 10px; border-radius: 3px; background: var(--accent); transform: rotate(45deg); }
.cs-media-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.cs-media-head h2 { margin-bottom: 0; }
.cs-media-head p { font-size: 14px; }
.cs-media figure { margin: 0; }
.cs-media figcaption { font-size: 13px; color: var(--text-faint); margin-top: 6px; }
.video-featured { margin-bottom: 16px !important; }
.video-featured .video-frame { box-shadow: 0 20px 50px -28px rgba(0, 0, 0, .5); }
.cs-media .videos { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.gallery button { position: relative; cursor: zoom-in; }
.gallery-zoom { position: absolute; right: 8px; bottom: 8px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 14px; opacity: 0; transition: opacity .2s; }
.gallery button:hover .gallery-zoom, .gallery button:focus-visible .gallery-zoom { opacity: 1; }
.gallery-hint { font-size: 13px; margin-top: 10px; }
.legal-updated { font-size: 14px; color: var(--text-faint); margin-top: 8px; }
.legal p + h2, .legal ul + h2 { margin-top: 36px; }
.legal h2:first-child { margin-top: 0; }
.legal ul + p, .legal p + ul { margin-top: 12px; }
.contact-privacy { font-size: 13px; margin-top: 10px; }
.contact-privacy a { color: var(--text-dim); }

.load-more { display: flex; justify-content: center; margin-top: 28px; }

/* ---------- Home: marquee ---------- */
.marquee-wrap { position: relative; margin-top: 40px; }
.marquee {
    display: flex; overflow: hidden; padding: 14px 0; user-select: none;
    border-block: 1px solid var(--border);
    mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee-track {
    list-style: none; display: flex; flex-shrink: 0; gap: 44px; padding-right: 44px; min-width: 100%; justify-content: space-around;
}
.marquee-track li { white-space: nowrap; font-size: 14px; font-weight: 700; letter-spacing: .06em; color: var(--text-faint); }
.marquee-track li::before { content: "◆"; margin-right: 44px; font-size: 8px; vertical-align: 3px; color: var(--accent); opacity: .6; }
.marquee-toggle { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; }
.marquee-toggle svg { width: 14px; height: 14px; }
.marquee-toggle .icon-play, .marquee-wrap.paused .marquee-toggle .icon-pause { display: none; }
.marquee-wrap.paused .marquee-toggle .icon-play { display: block; }

/* ---------- Hover details ---------- */
.project-media img, .project-media .art { transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.project-card:hover .project-media img, .project-card:hover .project-media .art { transform: scale(1.04); }
.arrow-link span { display: inline-block; transition: transform .2s; }
.arrow-link:hover span { transform: translateX(4px); }
.btn svg { transition: transform .2s; }
.btn-primary:hover svg { transform: translateY(2px); }

/* ---------- Home: island teaser ---------- */
.island-section { padding-top: 24px; border-top: 0 !important; }
.island-teaser {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 360px); align-items: center; gap: 24px;
    padding: 36px 40px; text-decoration: none; overflow: hidden;
    background: linear-gradient(120deg, color-mix(in srgb, var(--accent-2) 10%, transparent), transparent 60%), var(--bg-raised);
}
.island-teaser:hover, .island-teaser:focus-visible { border-color: var(--accent-2); transform: translateY(-2px); box-shadow: var(--shadow); }
.island-copy h2 { font-size: clamp(24px, 3vw, 32px); margin: 8px 0 10px; }
.island-cta { margin-top: 20px; }
.island-teaser:hover .island-cta, .island-teaser:focus-visible .island-cta { border-color: var(--accent-2); color: var(--accent-2); }
.island-art { width: 100%; height: auto; border-radius: 14px; }
.ia-sun { fill: var(--warn); opacity: .85; }
.ia-land { fill: color-mix(in srgb, var(--accent) 55%, var(--bg-raised)); }
.ia-tree { fill: none; stroke: var(--accent-strong); stroke-width: 5; stroke-linecap: round; }
.ia-wave { fill: color-mix(in srgb, var(--accent-2) 35%, var(--bg-raised)); }
.ia-wave-1 { fill: color-mix(in srgb, var(--accent-2) 55%, var(--bg-raised)); }
@media (max-width: 760px) {
    .island-teaser { grid-template-columns: 1fr; padding: 24px; }
    .island-art { order: -1; max-width: 300px; }
}


/* Featured cards: one row on wide screens; on tablets an odd count lets the first span the row so none is left alone. */
@media (min-width: 980px) { .featured-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 640px) and (max-width: 979px) {
    .featured-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .featured-grid > :first-child:nth-last-child(odd) { grid-column: 1 / -1; }
    .featured-grid > :first-child:nth-last-child(odd) .project-media { aspect-ratio: 21 / 9; }
}

/* ---------- Home: scroll cue ---------- */
.scroll-cue {
    position: absolute; left: 0; right: 0; bottom: 18px; margin-inline: auto; width: max-content;
    display: grid; justify-items: center; gap: 6px;
    color: var(--text-faint); text-decoration: none; font-size: 11px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
}
.scroll-cue:hover { color: var(--accent); }
.scroll-cue-mouse { width: 22px; height: 34px; border: 2px solid currentColor; border-radius: 12px; display: grid; justify-items: center; padding-top: 6px; }
.scroll-cue-mouse span { width: 3px; height: 7px; border-radius: 2px; background: currentColor; }
@media (max-width: 860px), (max-height: 640px) { .scroll-cue { display: none; } }

/* ---------- Home: hero aurora (two soft light sources; motion.css drifts them) ---------- */
.hero-aurora { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; mask-image: linear-gradient(#000 55%, transparent); }
.hero-aurora span {
    position: absolute; width: 46vmax; height: 46vmax; border-radius: 50%; filter: blur(70px); opacity: .32;
    background: radial-gradient(circle, var(--accent), transparent 65%); left: -12vmax; top: -18vmax;
}
.hero-aurora span + span { background: radial-gradient(circle, var(--accent-2), transparent 65%); left: auto; right: -14vmax; top: 10vmax; opacity: .26; }
:root[data-theme="light"] .hero-aurora span { opacity: .16; }
@media (prefers-color-scheme: light) { :root:not([data-theme]) .hero-aurora span { opacity: .16; } }

/* ---------- Home: chapters (sections numbered in order, "01 ——", whichever ones the page has) ---------- */
[data-progress] { counter-reset: chapter; }
[data-progress] > .section :is(.section-head, .island-copy, .contact-band) .kicker::before {
    counter-increment: chapter; content: counter(chapter, decimal-leading-zero); content: counter(chapter, decimal-leading-zero) / "";
    display: inline-block; padding-right: 46px; color: var(--text-faint); font-variant-numeric: tabular-nums;
    background: linear-gradient(var(--accent), var(--accent)) no-repeat right 10px center / 26px 1px;
    transition: background-size var(--dur-slow) var(--ease-out) 150ms;
}

/* ---------- Home: section rail (a dot per section on wide screens, following the scroll) ---------- */
.section-rail {
    position: fixed; right: 22px; top: 50%; translate: 0 -50%; z-index: 80;
    opacity: 0; visibility: hidden; transition: opacity var(--dur-base) var(--ease-std), visibility var(--dur-base);
}
.section-rail.show { opacity: 1; visibility: visible; }
.section-rail ol { list-style: none; display: grid; gap: 14px; }
.section-rail a {
    position: relative; display: block; width: 10px; height: 10px; border-radius: 999px; background: var(--border-strong);
    transition: height var(--dur-base) var(--ease-out), background .32s;
}
.section-rail a:hover, .section-rail a:focus-visible { background: var(--accent-2); }
.section-rail a.is-active { height: 28px; background: var(--accent); }
.rail-label {
    position: absolute; right: 22px; top: 50%; translate: 6px -50%; white-space: nowrap; pointer-events: none;
    font-size: 12px; font-weight: 700; color: var(--text); background: var(--bg-raised); border: 1px solid var(--border);
    padding: 4px 10px; border-radius: 6px; box-shadow: var(--shadow); opacity: 0;
    transition: opacity var(--dur-fast) var(--ease-std), translate var(--dur-base) var(--ease-out);
}
.section-rail a:hover .rail-label, .section-rail a:focus-visible .rail-label { opacity: 1; translate: 0 -50%; }
@media (max-width: 1279px) { .section-rail { display: none; } }

/* ---------- Header: one underline glides to the active link (public.js places it on wide screens) ---------- */
.nav-indicator {
    position: absolute; left: 0; bottom: 2px; height: 2px; width: 1px; border-radius: 2px; background: var(--accent);
    transform-origin: 0 50%; opacity: 0; pointer-events: none;
    transition: transform var(--dur-base) var(--ease-out), opacity var(--dur-fast) var(--ease-std);
}
@media (min-width: 981px) {
    .site-nav.has-indicator { position: relative; }
    .site-nav.has-indicator a.is-active::after, .site-nav.has-indicator a[aria-current="page"]::after { content: none; }
}
@media (max-width: 980px) { .nav-indicator { display: none; } }
/* Phones: the header tucks away while reading down and returns on the first scroll up (public.js). */
@media (max-width: 860px) {
    .site-header { transition: translate var(--dur-base) var(--ease-out), box-shadow .2s; }
    .site-header.tucked { translate: 0 -100%; }
}

/* ---------- Hover and touch feedback ---------- */
.service .icon { display: inline-block; transition: transform var(--dur-base) var(--ease-out); }
.service:hover .icon { transform: translateY(-4px) rotate(-8deg) scale(1.12); }
.services .service:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.skill-group .chip { transition: transform var(--dur-fast) var(--ease-out), color .15s, border-color .15s; }
.skill-group .chip:hover { transform: translateY(-3px); color: var(--accent); border-color: var(--accent); }
/* Touch has no hover, so a press answers every tap on a card or button. */
@media (hover: none) {
    .project-card, .island-teaser, .service, .skill-group, .btn, .filter-btn, .nf-link, .pager-link {
        transition: transform var(--dur-fast) var(--ease-out), border-color .2s, box-shadow .2s;
    }
    .project-card:active, .island-teaser:active, .service:active, .skill-group:active,
    .btn:active, .filter-btn:active, .nf-link:active, .pager-link:active { transform: scale(.97); }
}
