/* ============================================================
   ILANS.NET — premium dark editorial system
   Type: Instrument Serif (display) · Inter (body) · JetBrains Mono (meta)
   ============================================================ */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #0b0b0d;
    --bg-elev: #121215;
    --bg-card: #131318;
    --ink: #ededea;
    --ink-muted: #a0a0a8;
    --ink-dim: #80808a;
    --accent: #8a7bff;
    --accent-ink: #b9afff;
    --ok: #4ade80;
    --line: #1f1f24;
    --line-strong: #2e2e35;
    --radius: 14px;
    --serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
    --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', monospace;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--ink);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    position: relative;
}

::selection { background: rgba(138,123,255,0.35); color: #fff; }

/* Canvas particle field */
#dotfield {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    pointer-events: none;
}

nav, main, section, footer { position: relative; z-index: 1; }

a { color: var(--accent-ink); text-decoration: none; transition: color 0.2s; }
a:hover { color: #d6cfff; }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 2px;
}

.container { max-width: 1140px; margin: 0 auto; padding: 0 28px; }

section { scroll-margin-top: 90px; }

/* Skip link */
.skip {
    position: absolute; left: 16px; top: -48px; z-index: 2000;
    background: var(--ink); color: var(--bg);
    padding: 10px 18px; border-radius: 8px;
    font-size: 13px; font-weight: 600;
    transition: top 0.2s;
}
.skip:focus { top: 16px; color: var(--bg); }

/* ── Typographic primitives ── */
.mono {
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.section-label {
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-dim);
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.section-label .idx { color: var(--accent-ink); }
.section-label::after {
    content: '';
    height: 1px;
    width: 56px;
    background: var(--line-strong);
}

.section-title {
    font-size: clamp(34px, 4.6vw, 52px);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.08;
    color: #fff;
    margin-bottom: 56px;
}
.section-title em {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 400;
    letter-spacing: 0;
    font-size: 1.06em;
}

/* ── NAV ── */
nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    padding: 18px 0;
    background: rgba(11, 11, 13, 0.78);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s, padding 0.3s;
}
nav.scrolled { border-bottom-color: var(--line); padding: 13px 0; }
nav .container { display: flex; justify-content: space-between; align-items: center; }
.nav-logo {
    font-family: var(--mono);
    font-weight: 600; font-size: 13px;
    letter-spacing: 0.1em;
    color: var(--ink);
}
.nav-logo span { color: var(--accent-ink); }
.nav-right { display: flex; align-items: center; gap: 28px; }
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a {
    color: var(--ink-muted);
    font-size: 13.5px; font-weight: 500;
}
.nav-links a:hover { color: var(--ink); }
.old-days-nav {
    font-size: 12px !important; opacity: 0.45;
    border-left: 1px solid var(--line-strong);
    padding-left: 28px;
}
.old-days-nav:hover { opacity: 1; color: var(--accent-ink) !important; }

.nav-cta {
    display: inline-flex; align-items: center;
    padding: 8px 18px; border-radius: 999px;
    background: var(--ink); color: #111;
    font-size: 13px; font-weight: 600;
    transition: transform 0.2s var(--ease-out), background 0.2s;
    flex-shrink: 0;
}
.nav-cta:hover { background: #fff; color: #111; transform: translateY(-1px); }

.nav-burger { display: none; background: none; border: none; cursor: pointer; padding: 4px; }
.nav-burger span { display: block; width: 22px; height: 2px; background: var(--ink); margin: 5px 0; border-radius: 2px; transition: transform 0.3s, opacity 0.3s; }
.nav-burger.open span:nth-child(1) { transform: rotate(45deg) translate(4px, 5px); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: rotate(-45deg) translate(4px, -5px); }

.theme-toggle {
    background: none; border: 1px solid var(--line-strong); border-radius: 8px;
    width: 38px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
    color: var(--ink-muted); cursor: pointer;
    transition: color .2s, border-color .2s, background .2s;
    flex-shrink: 0;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--ink-dim); background: var(--bg-card); }
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .icon-moon { display: none; }
html[data-theme="light"] .theme-toggle .icon-sun { display: none; }
html[data-theme="light"] .theme-toggle .icon-moon { display: inline; }

/* ── HERO ── */
.hero {
    min-height: 100svh;
    display: flex; align-items: center;
    position: relative; overflow: hidden;
    padding-top: 70px;
}
.hero-bg {
    position: absolute; inset: 0;
    background: radial-gradient(ellipse 75% 55% at 50% -15%, rgba(138,123,255,0.10) 0%, transparent 62%);
}
/* padding-bottom reserves the scroll-hint's zone (pill ~36px + bottom 30px + air) */
.hero-content { position: relative; z-index: 1; max-width: 840px; padding-bottom: 130px; }
@media (max-height: 740px) { .scroll-hint { display: none; } }
/* Soft scrim so hero copy stays legible over the particle field */
.hero-content::before {
    content: '';
    position: absolute;
    inset: -48px -90px;
    z-index: -1;
    background: radial-gradient(ellipse 72% 68% at 35% 45%, rgba(11,11,13,0.86) 0%, rgba(11,11,13,0.55) 52%, transparent 78%);
    pointer-events: none;
}

/* Availability pill: a quiet live-dot chip near the first impression */
.status-pill {
    display: inline-flex; align-items: center; gap: 9px;
    padding: 6px 15px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(18,18,21,0.5);
    font-family: var(--mono);
    font-size: 11.5px; font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--ink-muted);
    margin-bottom: 22px;
}
.pulse {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--ok);
    position: relative;
    flex-shrink: 0;
}
.pulse::after {
    content: '';
    position: absolute; inset: -5px;
    border-radius: 50%;
    border: 1px solid var(--ok);
    animation: pulseRing 2.4s ease-out infinite;
}
@keyframes pulseRing {
    0% { transform: scale(0.45); opacity: 0.8; }
    70% { transform: scale(1.25); opacity: 0; }
    100% { transform: scale(1.25); opacity: 0; }
}

.hero-label {
    font-family: var(--sans);
    font-size: 14px; font-weight: 500;
    letter-spacing: 0.01em;
    color: var(--ink-muted);
    margin-bottom: 26px;
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.hero-label .dot { color: var(--line-strong); }
.hero-label .loc { color: var(--ink-dim); }

.hero h1 {
    font-size: clamp(44px, 7.4vw, 84px);
    font-weight: 600;
    line-height: 1.04;
    letter-spacing: -0.03em;
    color: #fff;
    margin-bottom: 28px;
    text-wrap: balance;
}
.hero h1 em {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 400;
    letter-spacing: -0.01em;
    font-size: 1.07em;
    color: var(--ink);
}
.hero h1 .accent-dot { color: var(--accent); }
/* Hand-drawn pen squiggle in the headline */
.hero-wavy-wrap {
    display: inline-block;
    -webkit-text-fill-color: initial;
    vertical-align: -0.09em;
    margin: 0 0 0 -0.1em;
    position: relative;
    width: 92px; height: 34px;
    overflow: visible;
}
.hero-wavy-wrap svg {
    position: absolute; top: 50%; left: 0;
    transform: translateY(-50%);
    overflow: visible;
    filter: drop-shadow(0 0 8px rgba(138,123,255,0.45));
}
@media (max-width: 600px) {
    .hero-wavy-wrap { width: 58px; height: 22px; margin: 0 4px; }
}

.hero-desc {
    font-size: 18px; color: var(--ink-muted); line-height: 1.75;
    max-width: 560px; margin-bottom: 40px;
}
.hero-desc strong { color: var(--ink); font-weight: 600; }

.hero-links { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.hero-minor {
    font-size: 13px;
    color: var(--ink-dim);
    margin-left: 6px;
}
.hero-minor a { color: var(--ink-muted); font-weight: 600; }
.hero-minor a:hover { color: var(--ink); }
.hero-proof {
    font-family: var(--mono);
    font-size: 11.5px;
    letter-spacing: 0.04em;
    color: var(--ink-dim);
    margin-top: 26px;
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.hero-proof .dot { color: var(--line-strong); }

/* Buttons — ivory primary, hairline secondary. No gradients. */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 13px 26px; border-radius: 10px;
    font-size: 14px; font-weight: 600;
    transition: transform 0.2s var(--ease-out), background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
    border: none; cursor: pointer;
}
.btn-primary {
    background: var(--ink);
    color: #111;
}
.btn-primary:hover {
    background: #fff; color: #111;
    transform: translateY(-1px);
    box-shadow: 0 10px 36px rgba(237,237,234,0.12);
}
.btn-outline {
    background: transparent; color: var(--ink-muted);
    border: 1px solid var(--line-strong);
}
.btn-outline:hover {
    color: var(--ink); border-color: var(--ink-dim);
    background: var(--bg-card);
}

/* Scroll hint */
.scroll-hint {
    position: absolute; bottom: 30px; left: 50%;
    transform: translateX(-50%); z-index: 2;
    display: flex; align-items: center; gap: 9px;
    padding: 9px 18px 9px 15px;
    border-radius: 40px;
    border: 1px solid var(--line-strong);
    background: rgba(18,18,21,0.6);
    color: var(--ink-dim);
    font-family: var(--mono);
    font-size: 11px; font-weight: 500;
    letter-spacing: 0.14em; text-transform: uppercase;
    transition: all 0.3s;
    animation: hintFade 1.6s ease 1.4s both;
}
.scroll-hint:hover { color: var(--ink); border-color: var(--ink-dim); }
.scroll-hint svg { animation: bobDown 2s ease-in-out infinite; flex-shrink: 0; }
@keyframes bobDown { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(3px); } }
@keyframes hintFade {
    from { opacity: 0; transform: translateX(-50%) translateY(10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Hero entrance */
.hero-content > * {
    opacity: 0;
    transform: translateY(22px);
    animation: heroEntrance 0.9s var(--ease-out) forwards;
}
.hero-content > *:nth-child(1) { animation-delay: 0.1s; }
.hero-content > *:nth-child(2) { animation-delay: 0.22s; }
.hero-content > *:nth-child(3) { animation-delay: 0.36s; }
.hero-content > *:nth-child(4) { animation-delay: 0.5s; }
@keyframes heroEntrance { to { opacity: 1; transform: translateY(0); } }

/* ── SECTIONS ── */
section { padding: 130px 0; }
#work { padding-top: 110px; }

/* ── FEATURED CASES ── */
.case {
    display: grid;
    grid-template-columns: 7fr 5fr;
    gap: 56px;
    align-items: center;
    margin-bottom: 110px;
}
.case:last-of-type { margin-bottom: 0; }
.case.flip .case-media { order: 2; }
.case.flip .case-body { order: 1; }

.case-media {
    display: block;
    position: relative;
    aspect-ratio: 16 / 10;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--bg-elev);
}
.case-media img, .case-media video {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    transform: translateY(var(--py, 0px));
    transition: transform 0.8s var(--ease-out), opacity 0.5s ease;
}
/* Inner parallax (JS adds .parallax + drives --py): the image is slightly
   oversized inside the masked frame and drifts as you scroll past */
.case-media.parallax img, .case-media.parallax video {
    top: -7%;
    height: 114%;
}
.case-media video { opacity: 0; }
.case-media::after {
    content: '';
    position: absolute; inset: 0;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
    border-radius: 18px;
    pointer-events: none;
}
.case:hover .case-media img { transform: translateY(var(--py, 0px)) scale(1.025); }
.case:hover .case-media video { opacity: 1; transform: translateY(var(--py, 0px)) scale(1.025); }
.case:hover .case-media img.has-video { opacity: 0; }


/* ============================================================
   PER-CASE COLOUR
   One hue per discipline, shared with /writing so the site reads
   as one system. --c falls back to the brand violet.
   ============================================================ */
:root{ --c: var(--accent-ink); }
.c-green  { --c:#34d399; }   /* accessibility & assistive      */
.c-teal   { --c:#22d3ee; }   /* clinical & health              */
.c-violet { --c:#8a7bff; }   /* site brand, not a category     */
.c-amber  { --c:#f0a33c; }   /* creative production & motion   */
.c-lime   { --c:#a3e635; }   /* self-hosted AI & networks      */
.c-coral  { --c:#fb7185; }   /* consumer apps & experiments    */
html[data-theme="light"] .c-green  { --c:#047857; }
html[data-theme="light"] .c-teal   { --c:#0e7490; }
html[data-theme="light"] .c-violet { --c:#5b4de0; }
html[data-theme="light"] .c-amber  { --c:#a35f00; }
html[data-theme="light"] .c-lime   { --c:#4d7c0f; }
html[data-theme="light"] .c-coral  { --c:#be123c; }

.case-kicker {
    font-family: var(--mono);
    font-size: 11.5px; font-weight: 500;
    letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--c);
    margin-bottom: 16px;
    display: flex; align-items: center; gap: 10px;
}
.case-kicker .badge {
    color: var(--ok);
}
.case-title {
    font-size: clamp(28px, 3vw, 38px);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 16px;
}
.case-title a { color: #fff; }
.case-title a:hover { color: var(--c); }
.case-line {
    font-size: 15.5px;
    color: var(--ink-muted);
    line-height: 1.75;
    margin-bottom: 22px;
}
.case-meta {
    font-family: var(--mono);
    font-size: 11.5px;
    color: var(--ink-dim);
    letter-spacing: 0.02em;
    line-height: 2;
    margin-bottom: 26px;
}
.case-links { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.link-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 18px;
    border-radius: 999px;
    background: var(--ink);
    color: #111 !important;
    font-size: 13px; font-weight: 600;
    transition: transform 0.2s var(--ease-out), background 0.2s;
}
.link-pill:hover { background: #fff; transform: translateY(-1px); }
.link-plain {
    font-size: 13.5px; font-weight: 600;
    color: var(--ink-muted);
}
.link-plain:hover { color: var(--ink); }

/* ── MORE PROJECTS (compact grid) ── */
.more-head { margin-top: 130px; }
.mini-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}
.mini {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex; flex-direction: column;
    transition: border-color 0.3s, transform 0.3s var(--ease-out), box-shadow 0.3s;
}
.mini:hover {
    border-color: color-mix(in srgb, var(--c) 42%, var(--line-strong));
    transform: translateY(-4px);
    box-shadow: 0 18px 48px rgba(0,0,0,0.45);
}
.mini-media {
    display: block;
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--bg-elev);
}
.mini-media img, .mini-media video {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.7s var(--ease-out), opacity 0.5s ease;
}
.mini-media video { opacity: 0; }
.mini:hover .mini-media img { transform: scale(1.04); }
.mini:hover .mini-media video { opacity: 1; transform: scale(1.04); }
.mini:hover .mini-media img.has-video { opacity: 0; }
.mini-body { padding: 20px 22px 22px; flex: 1; display: flex; flex-direction: column; }
.mini-title {
    font-size: 16.5px; font-weight: 600;
    color: #fff;
    margin-bottom: 7px;
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.mini-title a { color: inherit; }
.mini-title a:hover { color: var(--c); }
.chip {
    font-family: var(--mono);
    font-size: 9.5px; font-weight: 600;
    letter-spacing: 0.08em;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid rgba(74,222,128,0.35);
    color: var(--ok);
}
.chip.violet { border-color: rgba(138,123,255,0.4); color: var(--accent-ink); }
.mini-desc {
    font-size: 13.5px;
    color: var(--ink-muted);
    line-height: 1.65;
    margin-bottom: 14px;
}
.mini-links {
    margin-top: auto;
    display: flex; gap: 14px;
    font-size: 12.5px; font-weight: 600;
}
.mini-links a { color: var(--ink-muted); }
.mini-links a:hover { color: var(--c); }
.mini-links a.case-link { color: var(--ink-dim); font-weight: 500; }
.mini-links a.case-link:hover { color: var(--ink-muted); }

/* Meta card: the site itself as a project */
.mini-wide {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    gap: 20px;
    padding: 22px 26px;
    border-color: rgba(138,123,255,0.22);
}
.mini-wide:hover { border-color: rgba(138,123,255,0.45); }
.mini-wide-avatar {
    width: 52px; height: 52px;
    border-radius: 50%;
    background: #15803d;
    flex-shrink: 0;
}
.mini-wide-body { flex: 1; min-width: 0; }
.mini-wide .mini-desc { margin-bottom: 0; }
.mini-wide-links { margin-top: 0; flex-shrink: 0; align-items: center; }
.mini-ask-ai {
    background: var(--ink);
    color: #111;
    border: none;
    border-radius: 999px;
    padding: 9px 18px;
    font-family: var(--sans);
    font-size: 13px; font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s var(--ease-out), background 0.2s;
}
.mini-ask-ai:hover { background: #fff; transform: translateY(-1px); }
html[data-theme="light"] .mini-ask-ai { background: var(--ink); color: #faf9f7; }
html[data-theme="light"] .mini-ask-ai:hover { background: #000; }
@media (max-width: 640px) {
    .mini-wide { flex-direction: column; align-items: flex-start; }
}

.more-gh {
    text-align: center;
    margin-top: 44px;
    font-size: 13.5px;
    color: var(--ink-dim);
}
/* Inline link in a muted paragraph: underline so it's distinguishable
   without relying on color (WCAG 1.4.1) */
.more-gh a { text-decoration: underline; text-underline-offset: 2px; }

/* Mid-page CTA band: catch interest right after the work */
.cta-band {
    margin-top: 90px;
    padding: 52px 40px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--bg-card);
    text-align: center;
}
.cta-band-title {
    font-size: clamp(24px, 3vw, 32px);
    font-weight: 600;
    letter-spacing: -0.02em;
    color: #fff;
    margin-bottom: 10px;
}
.cta-band-title em {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 400;
    font-size: 1.07em;
}
.cta-band-sub {
    font-size: 15px;
    color: var(--ink-muted);
    margin-bottom: 28px;
}
.cta-band-actions {
    display: flex; justify-content: center; align-items: center;
    gap: 18px; flex-wrap: wrap;
}

/* ── ABOUT ── */
.about-content { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; }
.about-photo-grid {
    display: grid; grid-template-columns: 190px 1fr;
    gap: 36px; align-items: start;
}
.about-portrait {
    width: 100%; border-radius: 14px;
    aspect-ratio: 1 / 1; /* reserve height pre-load: no layout shift mid-scroll */
    object-fit: cover;
    border: 1px solid var(--line);
    filter: grayscale(25%);
    clip-path: inset(0 100% 0 0);
    transition: filter 0.3s, clip-path 0.9s var(--ease-out) 0.15s;
}
.about-portrait:hover { filter: grayscale(0%); }
.reveal.visible .about-portrait { clip-path: inset(0 0 0 0); }
.about-bio p { margin-bottom: 18px; line-height: 1.8; font-size: 16px; color: var(--ink-muted); }
.about-bio p:last-child { margin-bottom: 0; }
.about-bio em {
    font-family: var(--serif);
    font-style: italic;
    font-size: 1.12em;
    color: var(--ink);
}
.about-bio strong { color: var(--ink); font-weight: 600; }

.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stat {
    padding: 26px 24px 22px;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.stat-number {
    font-family: var(--serif);
    font-size: 44px;
    font-weight: 400;
    line-height: 1;
    letter-spacing: -0.01em;
    color: var(--ink);
}
.stat-label {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-dim);
    margin-top: 10px;
}

/* ── SKILLS ── */
#skills .section-title { margin-bottom: 40px; }
.skills-rows { border-top: 1px solid var(--line); }
.skill-row {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 32px;
    padding: 26px 0;
    border-bottom: 1px solid var(--line);
    align-items: baseline;
}
.skill-row-title {
    font-family: var(--mono);
    font-size: 12px; font-weight: 500;
    letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--accent-ink);
}
.skill-row-list {
    font-family: var(--mono);
    font-size: 13px;
    color: var(--ink-muted);
    line-height: 2.3;
    letter-spacing: 0.01em;
}
.skill-row-list .sep { color: var(--line-strong); margin: 0 6px; }
.skill {
    transition: color 0.25s ease;
    cursor: default;
}
/* Core terms carry the headline; the rest are the supporting range.
   Declared BEFORE .decoding so the decode animation still wins (equal specificity). */
.skill.core { color: var(--ink); font-weight: 500; }
.skill.decoding { color: var(--accent-ink); }
.skill:hover { color: var(--ink); }

/* ── EXPERIENCE ── */
.timeline { position: relative; padding-left: 34px; }
.timeline::before {
    content: ''; position: absolute; left: 7px; top: 8px; bottom: 8px;
    width: 1px; background: var(--line);
}
.timeline-item {
    position: relative;
    padding: 0 0 44px;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
    content: ''; position: absolute; left: -31px; top: 7px;
    width: 9px; height: 9px; border-radius: 50%;
    background: var(--ink-dim); border: 2px solid var(--bg);
}
.timeline-item.current::before {
    background: var(--accent);
    box-shadow: 0 0 0 4px rgba(138,123,255,0.18);
}
/* Scroll-traveling dot + its trail along the timeline */
.timeline-trail {
    position: absolute;
    left: 7px; top: 8px;
    width: 1px;
    background: linear-gradient(180deg, rgba(138,123,255,0.15), var(--accent));
    pointer-events: none;
}
.timeline-marker {
    position: absolute;
    left: 7.5px; top: 0;
    width: 11px; height: 11px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 14px rgba(138,123,255,0.85), 0 0 0 4px rgba(138,123,255,0.18);
    pointer-events: none;
    will-change: transform;
}
.timeline-item.passed::before {
    background: var(--accent);
    transition: background 0.4s ease;
}
.timeline-head {
    display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
}
.timeline-role { font-size: 17px; font-weight: 600; color: #fff; }
.timeline-dates {
    font-family: var(--mono);
    font-size: 11.5px;
    color: var(--ink-dim);
    letter-spacing: 0.04em;
}
.timeline-company { font-size: 14px; color: var(--ink-muted); margin-top: 3px; }
.timeline-impact {
    font-size: 13.5px; color: var(--ink-dim);
    margin-top: 12px; line-height: 1.75;
    border-left: 2px solid var(--line);
    padding-left: 14px;
    max-width: 720px;
}
.timeline-link {
    display: inline-flex; align-items: center; gap: 6px;
    margin-top: 14px; margin-left: 14px;
    font-family: var(--mono); font-size: 12px; font-weight: 500;
    letter-spacing: 0.02em; color: var(--accent-ink);
    text-decoration: none;
    transition: gap 0.25s var(--ease-out, ease), color 0.2s;
}
.timeline-link svg { transition: transform 0.25s var(--ease-out, ease); }
.timeline-link:hover { color: #fff; gap: 10px; }
.timeline-link:hover svg { transform: translateX(2px); }

/* ── CONTACT ── */
.contact-section { text-align: center; padding: 150px 0 130px; }
.contact-section .section-label { justify-content: center; }
.contact-section .section-label::after { display: none; }
.contact-title {
    font-size: clamp(38px, 5.5vw, 64px);
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.08;
    color: #fff;
    margin-bottom: 22px;
}
.contact-title em {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 400;
    font-size: 1.07em;
}
.cta-tagline {
    color: var(--ink-muted); font-size: 16.5px;
    max-width: 600px; margin: 0 auto 40px;
    line-height: 1.75;
}
.contact-links { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.cta-availability {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--mono);
    font-size: 12px; letter-spacing: 0.04em;
    color: var(--ok); margin-top: 34px;
}
.contact-status {
    display: inline-flex; align-items: center; gap: 10px;
    font-family: var(--mono);
    font-size: 11.5px; font-weight: 500;
    letter-spacing: 0.06em; text-transform: uppercase;
    color: var(--ok);
    margin-bottom: 18px;
}
.contact-note {
    font-size: 13.5px;
    color: var(--ink-dim);
    margin-top: 14px;
}

/* ── FOOTER ── */
footer {
    padding: 36px 0; border-top: 1px solid var(--line);
}
footer .container {
    display: flex; justify-content: space-between; align-items: center;
    gap: 16px; flex-wrap: wrap;
}
footer p {
    font-family: var(--mono);
    font-size: 11.5px;
    letter-spacing: 0.04em;
    color: var(--ink-dim);
}

/* ── SCROLL PROGRESS ── */
.scroll-progress {
    position: fixed;
    top: 0; left: 0;
    height: 2px;
    background: var(--accent);
    z-index: 1001;
    width: 0%;
    pointer-events: none;
}

/* ── Noise texture ── */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 9998;
    pointer-events: none;
    opacity: 0.028;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 256px 256px;
}

/* ── Email contact sheet (mailto fallback) ── */
.email-modal {
    position: fixed; inset: 0;
    z-index: 10000;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.email-modal[hidden] { display: none; }
.email-modal-backdrop {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.email-modal-card {
    position: relative;
    width: 100%; max-width: 440px;
    background: var(--bg-elev);
    border: 1px solid var(--line-strong);
    border-radius: 18px;
    padding: 40px 36px 32px;
    text-align: center;
    box-shadow: 0 30px 90px rgba(0,0,0,0.6);
    animation: modalIn 0.35s var(--ease-out);
}
@keyframes modalIn {
    from { opacity: 0; transform: translateY(14px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.email-modal-label {
    font-family: var(--mono);
    font-size: 11.5px; font-weight: 500;
    letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--ink-dim);
    margin-bottom: 8px;
}
.email-modal-address {
    font-family: var(--serif);
    font-size: clamp(24px, 5vw, 30px);
    color: var(--ink);
    margin-bottom: 26px;
    user-select: all;
}
.email-modal-actions {
    display: flex; justify-content: center;
    gap: 10px; flex-wrap: wrap;
    margin-bottom: 20px;
}
.email-modal-actions .btn { padding: 11px 18px; font-size: 13.5px; }
.email-modal-tg {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--ink-dim);
}
.email-modal-tg:hover { color: var(--accent-ink); }
.email-modal-close {
    position: absolute; top: 12px; right: 16px;
    background: none; border: none;
    font-size: 26px; line-height: 1;
    color: var(--ink-dim);
    cursor: pointer;
    padding: 4px;
}
.email-modal-close:hover { color: var(--ink); }
html[data-theme="light"] .email-modal-backdrop { background: rgba(23,23,28,0.35); }
html[data-theme="light"] .email-modal-card { box-shadow: 0 30px 80px rgba(23,23,28,0.25); }

/* ── AI Ilan chat agent ── */
.agent-launcher {
    position: fixed;
    bottom: 24px; right: 24px;
    z-index: 9990;
    display: inline-flex; align-items: center; gap: 10px;
    padding: 8px 20px 8px 10px;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    background: var(--bg-elev);
    color: var(--ink);
    font-family: var(--mono);
    font-size: 12px; font-weight: 600;
    letter-spacing: 0.08em; text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 12px 40px rgba(0,0,0,0.45);
    transition: transform 0.2s var(--ease-out), border-color 0.2s, background 0.2s;
}
.agent-launcher:hover {
    transform: translateY(-2px);
    border-color: var(--ink-dim);
}
.agent-launcher.panel-open { opacity: 0; pointer-events: none; }

/* Periodic attention nudges (random one fires while idle) */
.agent-launcher.nudge-bounce { animation: lnBounce 1s var(--ease-out); }
@keyframes lnBounce {
    0%, 100% { transform: translateY(0); }
    25% { transform: translateY(-11px); }
    45% { transform: translateY(0); }
    62% { transform: translateY(-5px); }
    80% { transform: translateY(0); }
}
.agent-launcher.nudge-wiggle { animation: lnWiggle 0.85s ease-in-out; }
@keyframes lnWiggle {
    0%, 100% { transform: rotate(0); }
    20% { transform: rotate(-6deg); }
    40% { transform: rotate(5deg); }
    60% { transform: rotate(-4deg); }
    80% { transform: rotate(3deg); }
}
.agent-launcher.nudge-pop { animation: lnPop 0.7s var(--ease-out); }
@keyframes lnPop {
    0%, 100% { transform: scale(1); }
    40% { transform: scale(1.13); }
    70% { transform: scale(0.97); }
}
.agent-launcher.nudge-swing { animation: lnSwing 1s ease-in-out; transform-origin: bottom right; }
@keyframes lnSwing {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(7deg); }
    55% { transform: rotate(-5deg); }
    80% { transform: rotate(3deg); }
}
/* A quick attention ring that radiates out with the nudge */
.agent-launcher::after {
    content: '';
    position: absolute; inset: -3px;
    border-radius: 999px;
    border: 1.5px solid var(--ok);
    opacity: 0;
    pointer-events: none;
}
.agent-launcher.nudging::after { animation: lnRing 1s var(--ease-out); }
@keyframes lnRing {
    0% { opacity: 0.55; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.18); }
}

.agent-panel {
    position: fixed;
    bottom: 24px; right: 24px;
    z-index: 9991;
    width: min(390px, calc(100vw - 32px));
    height: min(560px, calc(100vh - 48px));
    display: flex; flex-direction: column;
    background: var(--bg-elev);
    border: 1px solid var(--line-strong);
    border-radius: 18px;
    box-shadow: 0 30px 90px rgba(0,0,0,0.6);
    overflow: hidden;
    animation: agentIn 0.35s var(--ease-out);
}
.agent-panel[hidden] { display: none; }
@keyframes agentIn {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.agent-head {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
}
/* Animated cartoon avatar */
.agent-face {
    position: relative;
    width: 40px; height: 40px;
    flex-shrink: 0;
    display: inline-block;
}
.agent-face-lg { width: 52px; height: 52px; }
.agent-svg-slot { display: block; width: 100%; height: 100%; }
.agent-face-img {
    width: 100%; height: 100%;
    display: block;
    border-radius: 50%;
    background: #15803d;
    animation: avatarBob 4.5s ease-in-out infinite;
    transition: transform 0.3s var(--ease-out);
    transform-origin: 50% 85%;
}
@keyframes avatarBob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-1.5px); }
}
.agent-launcher:hover .agent-face-img {
    animation: none;
    transform: rotate(-7deg) scale(1.08);
}
.agent-face-img.thinking {
    animation: avatarThink 1s ease-in-out infinite;
}
@keyframes avatarThink {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-4deg); }
    75% { transform: rotate(4deg); }
}
.agent-face-img.talking {
    animation: avatarTalk 0.55s ease-in-out infinite;
}
@keyframes avatarTalk {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(1.2px) scale(1.03, 0.97); }
}
.agent-online {
    position: absolute;
    right: -1px; bottom: -1px;
    width: 9px; height: 9px;
    border-radius: 50%;
    background: var(--ok);
    border: 2px solid var(--bg-elev);
}
.agent-head-text { flex: 1; min-width: 0; }
.agent-name {
    font-size: 14.5px; font-weight: 600; color: var(--ink);
}
.agent-sub {
    font-family: var(--mono);
    font-size: 10.5px;
    color: var(--ink-dim);
    letter-spacing: 0.03em;
}
.agent-sub a { color: var(--ink-muted); }
.agent-sub a:hover { color: var(--accent-ink); }
.agent-lang {
    background: none;
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    color: var(--ink-dim);
    font-family: var(--mono);
    font-size: 11px; font-weight: 600;
    padding: 4px 8px;
    cursor: pointer;
    flex-shrink: 0;
    transition: color 0.2s, border-color 0.2s;
}
.agent-lang:hover { color: var(--ink); border-color: var(--ink-dim); }
.agent-close {
    background: none; border: none;
    font-size: 24px; line-height: 1;
    color: var(--ink-dim);
    cursor: pointer; padding: 4px 6px;
}
.agent-close:hover { color: var(--ink); }

.agent-msgs {
    flex: 1;
    overflow-y: auto;
    padding: 18px 16px 8px;
    display: flex; flex-direction: column; gap: 12px;
}
.agent-msg {
    max-width: 85%;
    font-size: 14px;
    line-height: 1.65;
    white-space: pre-wrap;
    word-wrap: break-word;
}
.agent-msg.from-ai {
    color: var(--ink-muted);
    align-self: flex-start;
}
.agent-msg.from-user {
    background: var(--ink);
    color: #111;
    padding: 9px 14px;
    border-radius: 14px 14px 4px 14px;
    align-self: flex-end;
    font-weight: 500;
}
.agent-msg a { color: var(--accent, #a78bfa); text-decoration: underline; text-underline-offset: 3px;
    text-decoration-thickness: 1px; word-break: break-word; unicode-bidi: isolate; direction: ltr; }
.agent-msg.from-user a { color: #fff; text-decoration-color: rgba(255,255,255,.55); }
.agent-msg.thinking { color: var(--ink-dim); letter-spacing: 3px; }

/* Inline lead-capture form inside the chat */
.agent-lead {
    align-self: stretch;
    display: flex; flex-direction: column; gap: 8px;
    padding: 14px;
    border: 1px solid rgba(138,123,255,0.3);
    border-radius: 14px;
    background: var(--bg-card);
}
.agent-lead input {
    background: transparent;
    border: 1px solid var(--line-strong);
    border-radius: 9px;
    padding: 10px 12px;
    color: var(--ink);
    font-family: var(--sans);
    font-size: 13.5px;
    outline: none;
    transition: border-color 0.2s;
}
.agent-lead input:focus { border-color: var(--accent); }
.agent-lead input::placeholder { color: var(--ink-dim); }
.agent-lead-send {
    background: var(--ink);
    color: #111;
    border: none;
    border-radius: 999px;
    padding: 10px 16px;
    font-family: var(--sans);
    font-size: 13.5px; font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s var(--ease-out), background 0.2s;
}
.agent-lead-send:hover { background: #fff; transform: translateY(-1px); }
.agent-lead-send:disabled { opacity: 0.5; cursor: default; transform: none; }
html[data-theme="light"] .agent-lead-send { background: var(--ink); color: #faf9f7; }
html[data-theme="light"] .agent-lead-send:hover { background: #000; }

.agent-starters {
    display: flex; flex-direction: column; gap: 8px;
    padding: 8px 16px 12px;
    flex-shrink: 0;
}
.agent-chip {
    background: transparent;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    padding: 8px 14px;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--ink-muted);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}
.agent-chip:hover { border-color: var(--ink-dim); color: var(--ink); }

/* Speaker button under each AI reply */
.agent-msg-tools {
    align-self: flex-start;
    margin-top: -4px;
}
.agent-speak {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px;
    border-radius: 50%;
    border: 1px solid var(--line-strong);
    background: transparent;
    color: var(--ink-dim);
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.agent-speak:hover { color: var(--ink); border-color: var(--ink-dim); }
.agent-speak.speaking {
    color: var(--ok);
    border-color: rgba(74,222,128,0.5);
    animation: speakPulse 1.4s ease-in-out infinite;
}
@keyframes speakPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(74,222,128,0.25); }
    50% { box-shadow: 0 0 0 4px rgba(74,222,128,0); }
}

.agent-form {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 14px;
    border-top: 1px solid var(--line);
    flex-shrink: 0;
}
.agent-mic {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 1px solid var(--line-strong);
    background: transparent;
    color: var(--ink-muted);
    cursor: pointer;
    flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.agent-mic:hover { color: var(--ink); border-color: var(--ink-dim); }
.agent-mic.listening {
    color: #fff;
    background: #e5484d;
    border-color: #e5484d;
    animation: micPulse 1.2s ease-in-out infinite;
}
@keyframes micPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(229,72,77,0.4); }
    50% { box-shadow: 0 0 0 6px rgba(229,72,77,0); }
}
.agent-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--ink);
    font-family: var(--sans);
    font-size: 14px;
}
.agent-input::placeholder { color: var(--ink-dim); }
.agent-send {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--ink);
    color: #111;
    cursor: pointer;
    flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    transition: transform 0.2s var(--ease-out), background 0.2s, box-shadow 0.2s;
}
.agent-send svg { display: block; }
.agent-send:hover { background: #fff; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(237,237,234,0.18); }
.agent-send:active { transform: translateY(0) scale(0.94); }
.agent-send:disabled { opacity: 0.4; cursor: default; transform: none; box-shadow: none; }

@media (max-width: 640px) {
    /* Avatar-only launcher on phones: no collision with the scroll hint */
    .agent-launcher { bottom: 18px; right: 16px; padding: 7px; border-radius: 50%; }
    .agent-launcher .agent-launcher-label { display: none; }
    .agent-launcher .agent-face { width: 48px; height: 48px; }
    .agent-panel {
        bottom: 0; right: 0; left: 0;
        width: 100vw;
        height: min(85vh, 640px);
        border-radius: 18px 18px 0 0;
        border-left: none; border-right: none; border-bottom: none;
    }
}

html[data-theme="light"] .agent-launcher { box-shadow: 0 12px 36px rgba(23,23,28,0.16); }
html[data-theme="light"] .agent-panel { box-shadow: 0 30px 80px rgba(23,23,28,0.25); }
html[data-theme="light"] .agent-msg.from-user { background: var(--ink); color: #faf9f7; }
html[data-theme="light"] .agent-send { background: var(--ink); color: #faf9f7; }
html[data-theme="light"] .agent-send:hover { background: #000; }

/* ── AI Ilan spotlight: when the agent points at an element ── */
.agent-spotlight {
    position: relative;
    border-radius: 14px;
    animation: agentSpotlight 2.8s ease-out;
    scroll-margin: 120px;
}
@keyframes agentSpotlight {
    0% { box-shadow: 0 0 0 0 rgba(138,123,255,0); }
    12% { box-shadow: 0 0 0 3px rgba(138,123,255,0.9), 0 0 34px 6px rgba(138,123,255,0.45); }
    55% { box-shadow: 0 0 0 3px rgba(138,123,255,0.55), 0 0 26px 4px rgba(138,123,255,0.3); }
    100% { box-shadow: 0 0 0 0 rgba(138,123,255,0); }
}
html[data-theme="light"] .agent-spotlight { animation: agentSpotlightLight 2.8s ease-out; }
@keyframes agentSpotlightLight {
    0% { box-shadow: 0 0 0 0 rgba(91,77,224,0); }
    12% { box-shadow: 0 0 0 3px rgba(91,77,224,0.8), 0 0 30px 5px rgba(91,77,224,0.35); }
    55% { box-shadow: 0 0 0 3px rgba(91,77,224,0.5), 0 0 22px 3px rgba(91,77,224,0.22); }
    100% { box-shadow: 0 0 0 0 rgba(91,77,224,0); }
}
@media (prefers-reduced-motion: reduce) {
    .agent-spotlight { animation: none; box-shadow: 0 0 0 3px rgba(138,123,255,0.7); }
}

/* ── Reveal animations ── */
.reveal {
    opacity: 0; transform: translateY(18px);
    transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.stagger > * { transition-delay: calc(var(--i, 0) * 0.07s); }

/* ── RESPONSIVE ── */
@media (max-width: 980px) {
    .case { grid-template-columns: 1fr; gap: 26px; margin-bottom: 80px; }
    .case.flip .case-media { order: 0; }
    .case.flip .case-body { order: 1; }
    .mini-grid { grid-template-columns: repeat(2, 1fr); }
    .about-content { grid-template-columns: 1fr; gap: 44px; }
    .skill-row { grid-template-columns: 1fr; gap: 8px; padding: 20px 0; }
    .nav-burger { display: block; }
    .nav-cta { padding: 7px 15px; font-size: 12.5px; }
    .nav-right { gap: 14px; }
    .nav-links {
        display: none; flex-direction: column; gap: 0; align-items: stretch;
        position: absolute; top: 100%; left: 0; right: 0;
        background: var(--bg);
        padding: 8px 28px 16px; border-bottom: 1px solid var(--line);
    }
    .nav-links.open { display: flex; }
    .nav-links a { padding: 13px 0; font-size: 16px; border-bottom: 1px solid var(--line); }
    .nav-links a:last-child { border-bottom: none; }
    .old-days-nav { border-left: none; padding-left: 0; }
}
@media (max-width: 640px) {
    section { padding: 80px 0; }
    .container { padding: 0 20px; }
    .hero h1 { letter-spacing: -0.02em; }
    .hero-desc { font-size: 15.5px; }
    /* Reserve room below the hero content so the absolutely-positioned
       scroll hint never collides with the proof strip on tall content */
    .hero-content { padding-bottom: 130px; }
    .mini-grid { grid-template-columns: 1fr; }
    .about-photo-grid { grid-template-columns: 1fr; }
    .about-portrait { max-width: 220px; }
    .stats-grid { gap: 10px; }
    .stat { padding: 20px 18px 16px; }
    .stat-number { font-size: 34px; }
    .timeline { padding-left: 28px; }
    .timeline-item::before { left: -25px; }
    .contact-section { padding: 100px 0 80px; }
    footer .container { justify-content: center; text-align: center; }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
    html { scroll-behavior: auto !important; }
    .reveal { opacity: 1 !important; transform: none !important; }
    .hero-content > * { opacity: 1 !important; transform: none !important; animation: none !important; }
    .about-portrait { clip-path: inset(0 0 0 0) !important; }
    #dotfield { display: none !important; }
    .scroll-hint svg { animation: none !important; }
}

/* ── No-JS fallback ── */
.no-js .reveal { opacity: 1; transform: none; }
.no-js #dotfield { display: none; }
.no-js .about-portrait { clip-path: inset(0 0 0 0); }

/* ============================================================
   LIGHT THEME — warm paper re-tokenization
   ============================================================ */
html[data-theme="light"] {
    --bg: #faf9f7;
    --bg-elev: #f1f0ed;
    --bg-card: #f4f3f0;
    --ink: #17171c;
    --ink-muted: #54545e;
    --ink-dim: #7c7c86;
    --accent: #5b4de0;
    --accent-ink: #4d3ed1;
    --ok: #15803d;
    --line: #e7e5e0;
    --line-strong: #d6d4cd;
}
html[data-theme="light"] a:hover { color: #3527ad; }
html[data-theme="light"] ::selection { background: rgba(91,77,224,0.18); color: var(--ink); }
html[data-theme="light"] nav { background: rgba(250,249,247,0.82); }
html[data-theme="light"] .hero-bg {
    background: radial-gradient(ellipse 75% 55% at 50% -15%, rgba(91,77,224,0.07) 0%, transparent 62%);
}
html[data-theme="light"] .hero-content::before {
    background: radial-gradient(ellipse 72% 68% at 35% 45%, rgba(250,249,247,0.92) 0%, rgba(250,249,247,0.6) 52%, transparent 78%);
}
html[data-theme="light"] .hero h1,
html[data-theme="light"] .section-title,
html[data-theme="light"] .contact-title,
html[data-theme="light"] .case-title a,
html[data-theme="light"] .mini-title,
html[data-theme="light"] .timeline-role { color: var(--ink); }
html[data-theme="light"] .case-title a:hover { color: var(--c); }
html[data-theme="light"] .btn-primary { background: var(--ink); color: #faf9f7; }
html[data-theme="light"] .btn-primary:hover { background: #000; color: #fff; box-shadow: 0 10px 32px rgba(23,23,28,0.18); }
html[data-theme="light"] .link-pill { background: var(--ink); color: #faf9f7 !important; }
html[data-theme="light"] .link-pill:hover { background: #000; }
html[data-theme="light"] .nav-cta { background: var(--ink); color: #faf9f7; }
html[data-theme="light"] .nav-cta:hover { background: #000; color: #fff; }
html[data-theme="light"] .status-pill { background: rgba(244,243,240,0.7); }
html[data-theme="light"] .cta-band-title { color: var(--ink); }
html[data-theme="light"] .mini:hover { box-shadow: 0 18px 44px rgba(23,23,28,0.1); }
html[data-theme="light"] .scroll-hint { background: rgba(244,243,240,0.7); }
html[data-theme="light"] .skip { background: var(--ink); color: var(--bg); }
html[data-theme="light"] body::after { opacity: 0.018; }
@media (max-width: 980px) {
    html[data-theme="light"] .nav-links { background: var(--bg); }
}
/* Light theme: violet squiggle tuned to the indigo accent */
html[data-theme="light"] #heroWaveGrad stop:nth-child(1) { stop-color: #5b4de0; }
html[data-theme="light"] #heroWaveGrad stop:nth-child(2) { stop-color: #8a7bff; }
html[data-theme="light"] #heroWaveGrad stop:nth-child(3) { stop-color: #5b4de0; }
html[data-theme="light"] .hero-wavy-wrap svg { filter: drop-shadow(0 0 7px rgba(91,77,224,0.38)); }

/* ── Hero "Now" line ── */
.hero-now {
    margin-top: 14px;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--ink-dim);
    letter-spacing: 0.02em;
    display: flex; align-items: center; gap: 10px;
}
.hero-now .now-tag {
    font-size: 9.5px; font-weight: 600;
    letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--accent-ink);
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    padding: 3px 9px;
}
.hero-now a { color: var(--ink-muted); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
.hero-now a:hover { color: var(--accent-ink); text-decoration-color: var(--accent-ink); }

/* ── Featured case pull-stat ── */
.case-stat {
    display: flex; align-items: baseline; gap: 14px;
    margin: -4px 0 24px;
}
.case-stat-num {
    font-family: var(--serif);
    font-size: 40px;
    line-height: 1;
    letter-spacing: -0.01em;
    color: var(--c);
    white-space: nowrap;
}
.case-stat-label {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--ink-dim);
    line-height: 1.5;
}

/* ── Timeline role chip ── */
.tl-chip {
    font-family: var(--mono);
    font-size: 9.5px; font-weight: 600;
    letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--ink-dim);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 3px 9px;
    white-space: nowrap;
}

/* ── Framed media: minimal window chrome on web/desktop tool previews ── */
.mini-media.framed::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0;
    height: 26px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--line);
    z-index: 2;
}
.mini-media.framed::after {
    content: '';
    position: absolute; top: 10px; left: 14px;
    width: 6px; height: 6px; border-radius: 50%;
    color: var(--ink-dim);
    background: currentColor;
    box-shadow: 11px 0 0 currentColor, 22px 0 0 currentColor;
    opacity: 0.45;
    z-index: 3;
}
.mini-media.framed img, .mini-media.framed video {
    top: 26px;
    height: calc(100% - 26px);
}

/* ── Touch devices: videos revealed by in-view autoplay (JS adds .playing) ── */
.case-media.playing video, .mini-media.playing video { opacity: 1; }
.case-media.playing img.has-video, .mini-media.playing img.has-video { opacity: 0; }

@media (max-width: 640px) {
    .case-stat-num { font-size: 32px; }
    .hero-now { flex-wrap: wrap; }
}

/* ── Craft details ── */
::selection { background: var(--accent); color: #0b0b0d; }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
    outline: 2px solid var(--accent-ink);
    outline-offset: 3px;
    border-radius: 4px;
}

/* ── Nav ⌘K hint ── */
.cmdk-hint {
    font-family: var(--mono);
    font-size: 10.5px; font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--ink-dim);
    background: none;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 5px 9px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}
.cmdk-hint kbd { font: inherit; }
.cmdk-hint:hover { color: var(--ink); border-color: var(--line-strong); }
@media (max-width: 900px), (hover: none) { .cmdk-hint { display: none; } }

/* ── Command palette ── */
.cmdk { position: fixed; inset: 0; z-index: 300; display: flex; align-items: flex-start; justify-content: center; padding: 15vh 20px 0; }
.cmdk[hidden] { display: none; }
.cmdk-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.cmdk-card {
    position: relative;
    width: 100%; max-width: 540px;
    background: var(--bg-elev);
    border: 1px solid var(--line-strong);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 30px 90px rgba(0,0,0,0.55);
}
.cmdk-input {
    width: 100%;
    background: none; border: none; outline: none;
    font-family: var(--mono);
    font-size: 14px;
    color: var(--ink);
    padding: 17px 20px;
    border-bottom: 1px solid var(--line);
}
.cmdk-input::placeholder { color: var(--ink-dim); }
.cmdk-list { max-height: 336px; overflow-y: auto; padding: 8px; }
.cmdk-item {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 11px 12px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13.5px; font-weight: 500;
    color: var(--ink-muted);
}
.cmdk-item .k { font-family: var(--mono); font-size: 9.5px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-dim); }
.cmdk-item.sel { background: var(--bg-card); color: var(--ink); box-shadow: inset 2px 0 0 var(--accent); }
.cmdk-empty { padding: 22px 16px; font-family: var(--mono); font-size: 12px; color: var(--ink-dim); text-align: center; }
.cmdk-foot {
    display: flex; gap: 16px;
    padding: 10px 16px;
    border-top: 1px solid var(--line);
    font-family: var(--mono); font-size: 10px; color: var(--ink-dim);
}
.cmdk-foot kbd {
    font: inherit;
    border: 1px solid var(--line); border-radius: 4px;
    padding: 1px 5px; margin-right: 5px;
}

/* ── Section rail (scrollspy, wide screens) ── */
.rail {
    position: fixed; right: 26px; left: auto; top: 50%;
    width: auto; padding: 0;
    background: none; border: none;
    backdrop-filter: none; -webkit-backdrop-filter: none;
    transform: translateY(-50%);
    z-index: 90;
    display: flex; flex-direction: column; gap: 16px;
}
.rail a { display: flex; align-items: center; gap: 10px; justify-content: flex-end; text-decoration: none; }
.rail .rail-label {
    font-family: var(--mono); font-size: 10px;
    letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--ink-dim);
    opacity: 0; transform: translateX(6px);
    transition: opacity 0.25s, transform 0.25s;
}
.rail:hover .rail-label { opacity: 1; transform: none; }
.rail .rail-idx {
    font-family: var(--mono); font-size: 10px; font-weight: 600;
    color: var(--ink-dim);
    transition: color 0.25s;
}
.rail a.active .rail-idx { color: var(--accent-ink); }
.rail a.active .rail-label { opacity: 1; transform: none; color: var(--ink-muted); }
@media (max-width: 1240px) { .rail { display: none; } }

/* ── Footer sign-off ── */
.footer-sign {
    font-family: var(--serif);
    font-size: clamp(18px, 2vw, 24px);
    color: var(--ink-muted);
    line-height: 1.2;
}
.footer-sign em { font-style: italic; color: var(--accent-ink); }
.footer-clock { color: var(--ink-dim); }
.footer-clock::before { content: '· '; }

html[data-theme="light"] ::selection { background: var(--accent); color: #faf9f7; }

/* ── PWA install entry (mobile menu; JS reveals when installable) ── */
.nav-install { display: none; color: var(--accent-ink) !important; }
.nav-install.available { display: block; }
@media (min-width: 981px) { .nav-install { display: none !important; } }
