/* ═══════════════════════════════════════════════════════
   Homepage design system (index.html only)
   Clean, editorial, light + dark. Other pages keep
   styles/styles.css; the legacy variable names at the end of
   :root keep the shared chatbot widget styled consistently.
   ═══════════════════════════════════════════════════════ */

:root {
    --bg:        #FAFAF9;
    --surface:   #FFFFFF;
    --surface-2: #F3F4F3;
    --ink:       #0E1726;
    --text:      #1F2937;
    --muted:     #5B6472;
    --faint:     #8A93A0;
    --line:      rgba(14, 23, 38, 0.09);
    --line-2:    rgba(14, 23, 38, 0.16);
    --accent:    #2552D0;
    --accent-ink:#FFFFFF;
    --accent-soft: rgba(37, 82, 208, 0.08);
    --good:      #13824A;
    --band:      #0E1726;
    --band-text: #E7ECF3;
    --band-muted:#9AA6B6;

    --shadow-sm: 0 1px 2px rgba(14,23,38,.05), 0 1px 1px rgba(14,23,38,.03);
    --shadow-md: 0 1px 2px rgba(14,23,38,.04), 0 8px 24px rgba(14,23,38,.07);
    --shadow-lg: 0 2px 4px rgba(14,23,38,.04), 0 18px 48px rgba(14,23,38,.12);

    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 18px;
    --wrap: 1160px;
    --gutter: clamp(16px, 4vw, 40px);
    --nav-h: 68px;
    --ease: cubic-bezier(.2, .8, .2, 1);

    --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

    /* legacy names used by the shared chatbot widget */
    --bg-primary: var(--surface);
    --bg-secondary: var(--surface-2);
    --text-primary: var(--ink);
    --text-secondary: var(--muted);
    --accent-gold: var(--accent);
    --accent-gold-light: var(--accent-soft);
    --glass-border: var(--line-2);
    --radius-lg: var(--r-md);
    --radius-md: var(--r-sm);
    --shadow-hover: var(--shadow-lg);
    --transition: all .25s var(--ease);

    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg:        #0A0E15;
        --surface:   #111722;
        --surface-2: #18202D;
        --ink:       #F1F4F8;
        --text:      #D6DCE4;
        --muted:     #9AA4B2;
        --faint:     #6E7886;
        --line:      rgba(255,255,255,.08);
        --line-2:    rgba(255,255,255,.14);
        --accent:    #86A6FF;
        --accent-ink:#0A0E15;
        --accent-soft: rgba(134,166,255,.12);
        --good:      #4ADE80;
        --band:      #111A28;
        --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
        --shadow-md: 0 8px 24px rgba(0,0,0,.35);
        --shadow-lg: 0 18px 48px rgba(0,0,0,.5);
        color-scheme: dark;
    }
}
:root[data-theme="dark"] {
    --bg:        #0A0E15;
    --surface:   #111722;
    --surface-2: #18202D;
    --ink:       #F1F4F8;
    --text:      #D6DCE4;
    --muted:     #9AA4B2;
    --faint:     #6E7886;
    --line:      rgba(255,255,255,.08);
    --line-2:    rgba(255,255,255,.14);
    --accent:    #86A6FF;
    --accent-ink:#0A0E15;
    --accent-soft: rgba(134,166,255,.12);
    --good:      #4ADE80;
    --band:      #111A28;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
    --shadow-md: 0 8px 24px rgba(0,0,0,.35);
    --shadow-lg: 0 18px 48px rgba(0,0,0,.5);
    color-scheme: dark;
}

/* ── Base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 12px); -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}
img, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { color: var(--ink); margin: 0; line-height: 1.2; letter-spacing: -0.02em; font-weight: 650; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.mono { font-family: var(--font-mono); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 1000; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: var(--r-sm); font-size: .85rem; }
.skip-link:focus { top: 12px; }

/* ── Buttons ──────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    height: 44px; padding: 0 1.15rem; border-radius: 10px;
    font-size: .92rem; font-weight: 600; letter-spacing: -0.005em;
    border: 1px solid transparent; cursor: pointer; white-space: nowrap;
    transition: background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
}
.btn i { font-size: .95em; }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn-secondary:hover { border-color: var(--ink); }
.btn-sm { height: 36px; padding: 0 .9rem; font-size: .85rem; border-radius: 9px; }

.icon-btn {
    width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--muted);
    cursor: pointer; font-size: 1.05rem; transition: color .2s, border-color .2s, background .2s;
}
.icon-btn:hover { color: var(--ink); border-color: var(--line-2); background: var(--surface); }

.text-link { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; font-size: .92rem; color: var(--accent); }
.text-link i { font-size: .8em; transition: transform .2s var(--ease); }
.text-link:hover i { transform: translateX(3px); }

/* ── Header ───────────────────────────────────────────── */
.site-header .wrap { max-width: 1320px; }
.site-header {
    position: sticky; top: 0; z-index: 100; height: var(--nav-h);
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid transparent; transition: border-color .2s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; font-weight: 700; color: var(--ink); letter-spacing: -0.02em; }
.brand-mark {
    width: 32px; height: 32px; border-radius: 9px; background: var(--ink); color: var(--bg);
    display: grid; place-items: center; font-size: .8rem; font-weight: 700; letter-spacing: 0;
}
.brand-name { font-size: 1rem; }
.nav { display: flex; align-items: center; gap: .1rem; }
.nav > a, .dd-toggle { padding: .45rem .6rem; border-radius: 8px; font-size: .875rem; font-weight: 500; color: var(--muted); transition: color .2s, background .2s; white-space: nowrap; }
.dd-toggle { display: inline-flex; align-items: center; gap: .3rem; background: none; border: 0; cursor: pointer; font-family: inherit; }
.dd-toggle i { font-size: .55rem; transition: transform .2s var(--ease); }
.nav > a:hover, .dd-toggle:hover, .dd.is-open .dd-toggle { color: var(--ink); background: var(--surface-2); }
.dd { position: relative; }
.dd-menu {
    position: absolute; top: 100%; left: 50%; padding-top: 10px; z-index: 110;
    opacity: 0; visibility: hidden; transform: translate(-50%, 4px);
    transition: opacity .18s var(--ease), transform .18s var(--ease), visibility .18s;
}
.dd-menu--right { left: auto; right: 0; transform: translateY(4px); }
.dd:hover .dd-menu, .dd:focus-within .dd-menu, .dd.is-open .dd-menu { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.dd:hover .dd-menu--right, .dd:focus-within .dd-menu--right, .dd.is-open .dd-menu--right { transform: none; }
.dd:hover .dd-toggle i, .dd.is-open .dd-toggle i { transform: rotate(180deg); }
.dd-list, .mega { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-lg); padding: .5rem; }
.dd-list { width: 300px; display: grid; }
.dd-list a, .mega-col a { display: block; padding: .55rem .75rem; border-radius: 8px; font-size: .86rem; color: var(--text); line-height: 1.4; }
.dd-list a:hover, .mega-col a:hover { background: var(--surface-2); color: var(--ink); }
.dd-list .dd-all { margin-top: .25rem; border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; color: var(--accent); font-weight: 600; display: flex; align-items: center; justify-content: space-between; }
.dd--mega { position: static; }
.dd--mega .dd-menu { left: 50%; width: min(1100px, calc(100vw - 32px)); }
.mega { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .25rem; padding: 1rem; }
.mega-col { padding: .5rem; border-right: 1px solid var(--line); }
.mega-col:last-child { border-right: 0; }
.mega-title { font-size: .92rem; font-weight: 650; color: var(--ink); padding: 0 .75rem; }
.mega-sub { font-size: .8rem; color: var(--muted); line-height: 1.45; padding: .3rem .75rem .6rem; }
.nav > a.is-active { color: var(--ink); }
.header-actions { display: flex; align-items: center; gap: .5rem; }
.menu-btn { display: none; }
.theme-btn .lni-sun { display: none; }
:root[data-theme="dark"] .theme-btn .lni-sun { display: inline; }
:root[data-theme="dark"] .theme-btn .lni-night { display: none; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-btn .lni-sun { display: inline; }
    :root:not([data-theme="light"]) .theme-btn .lni-night { display: none; }
}

.mobile-menu {
    display: none; position: fixed; inset: var(--nav-h) 0 auto 0; z-index: 99;
    background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-lg);
    padding: .5rem var(--gutter) 1.25rem; max-height: calc(100vh - var(--nav-h)); overflow-y: auto; overscroll-behavior: contain;
}
.mobile-menu.is-open { display: block; }
.mobile-menu .mm-group { margin-top: 1rem; padding: 0 .25rem .35rem; font-family: var(--font-mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.mobile-menu a { display: block; padding: .6rem .25rem; border-bottom: 1px solid var(--line); font-size: .95rem; font-weight: 500; color: var(--ink); }

/* ── Hero ─────────────────────────────────────────────── */
.hero { padding: clamp(48px, 8vw, 96px) 0 clamp(40px, 6vw, 72px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 80px); align-items: center; }
.status-pill {
    display: inline-flex; align-items: center; gap: .55rem; padding: .35rem .8rem .35rem .65rem;
    border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface);
    font-size: .8rem; font-weight: 500; color: var(--muted);
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 22%, transparent); }
.hero h1 { margin-top: 1.4rem; font-size: clamp(2.6rem, 6.2vw, 4.4rem); font-weight: 700; letter-spacing: -0.04em; line-height: 1.02; }
.hero-role { margin-top: .9rem; font-size: clamp(1.05rem, 1.8vw, 1.25rem); font-weight: 600; color: var(--ink); letter-spacing: -0.01em; }
.hero-lead { margin-top: 1.1rem; max-width: 36rem; font-size: clamp(1rem, 1.5vw, 1.1rem); color: var(--muted); line-height: 1.7; }
.hero-meta { margin-top: 1.4rem; display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; font-size: .88rem; color: var(--muted); }
.hero-meta span { display: inline-flex; align-items: center; gap: .45rem; }
.hero-meta i { color: var(--faint); }
.hero-cta { margin-top: 2rem; display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.hero-socials { display: flex; gap: .4rem; margin-left: .25rem; }

.portrait { position: relative; max-width: 420px; justify-self: end; width: 100%; }
.portrait-frame {
    aspect-ratio: 4 / 5; border-radius: var(--r-lg); overflow: hidden;
    background: var(--surface-2); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
}
.portrait-frame img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.portrait-card {
    position: absolute; left: -28px; bottom: 28px; max-width: 260px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
    box-shadow: var(--shadow-lg); padding: .85rem 1rem;
}
.portrait-card .k { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.portrait-card p { margin-top: .3rem; font-size: .86rem; line-height: 1.45; color: var(--ink); font-weight: 500; }

/* Stats */
.stats {
    margin-top: clamp(48px, 7vw, 80px);
    display: grid; grid-template-columns: repeat(4, 1fr);
    border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden;
}
.stat { padding: 1.5rem 1.5rem 1.4rem; border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; }
.stat-n { font-size: clamp(1.7rem, 3vw, 2.2rem); font-weight: 700; color: var(--ink); letter-spacing: -0.03em; line-height: 1; }
.stat-l { margin-top: .55rem; font-size: .85rem; color: var(--muted); line-height: 1.45; }

/* ── Sections ─────────────────────────────────────────── */
.section { padding: clamp(64px, 9vw, 112px) 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; margin-bottom: clamp(32px, 5vw, 52px); }
.eyebrow { font-family: var(--font-mono); font-size: .74rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.section-title { margin-top: .6rem; font-size: clamp(1.8rem, 3.6vw, 2.5rem); font-weight: 700; letter-spacing: -0.03em; }
.section-sub { margin-top: .75rem; max-width: 40rem; color: var(--muted); font-size: 1.02rem; }

.card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
    transition: border-color .25s var(--ease), box-shadow .25s var(--ease), transform .25s var(--ease);
}
a.card:hover, .card.is-link:hover { border-color: var(--line-2); box-shadow: var(--shadow-md); transform: translateY(-2px); }

.tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.tag {
    display: inline-flex; align-items: center; height: 26px; padding: 0 .6rem; border-radius: 6px;
    background: var(--surface-2); color: var(--muted); font-size: .76rem; font-weight: 500;
}

/* ── About ────────────────────────────────────────────── */
.about-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 72px); }
.about-statement { font-size: clamp(1.45rem, 2.6vw, 1.9rem); font-weight: 600; color: var(--ink); line-height: 1.3; letter-spacing: -0.025em; }
.about-body { margin-top: 1.4rem; display: grid; gap: 1rem; color: var(--muted); font-size: 1.02rem; }
.about-body a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.about-body a:hover { text-decoration-color: var(--accent); }
.facts { margin-top: 1.75rem; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.fact { background: var(--surface); padding: .85rem 1rem; }
.fact .k { font-size: .74rem; color: var(--faint); font-weight: 500; }
.fact .v { margin-top: .15rem; font-size: .92rem; color: var(--ink); font-weight: 600; }

.now-card { padding: 1.6rem; align-self: start; }
.now-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.1rem; }
.now-head h3 { font-size: 1rem; display: flex; align-items: center; gap: .5rem; }
.now-head .status-dot { width: 7px; height: 7px; }
.now-head span { font-size: .76rem; color: var(--faint); }
.now-list { display: grid; gap: 1.1rem; }
.now-list li { display: grid; grid-template-columns: 22px 1fr; gap: .75rem; }
.now-list i { color: var(--accent); font-size: 1rem; margin-top: .2rem; }
.now-list .k { display: block; font-size: .74rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); }
.now-list .v { display: block; margin-top: .15rem; font-size: .92rem; color: var(--text); line-height: 1.5; }
.now-links { margin-top: 1.4rem; padding-top: 1.2rem; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: .5rem 1.1rem; }
.now-links a { font-size: .86rem; font-weight: 500; color: var(--muted); display: inline-flex; align-items: center; gap: .35rem; }
.now-links a:hover { color: var(--accent); }

/* ── Story ────────────────────────────────────────────── */
.story { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; position: relative; }
.story::before { content: ""; position: absolute; left: 0; right: 0; top: 9px; height: 1px; background: var(--line-2); }
.story-step { position: relative; padding: 2rem 1.1rem 0 0; }
.story-step::before { content: ""; position: absolute; left: 0; top: 4px; width: 11px; height: 11px; border-radius: 50%; background: var(--bg); border: 2px solid var(--line-2); }
.story-step.is-now::before { background: var(--good); border-color: var(--good); box-shadow: 0 0 0 4px color-mix(in srgb, var(--good) 20%, transparent); }
.story-year { font-family: var(--font-mono); font-size: .78rem; color: var(--accent); font-weight: 600; }
.story-step.is-now .story-year { color: var(--good); }
.story-step h3 { margin-top: .4rem; font-size: 1rem; }
.story-step p { margin-top: .45rem; font-size: .86rem; color: var(--muted); line-height: 1.55; }
.vm-grid { margin-top: 40px; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.vm { padding: 1.5rem 1.6rem; }
.vm p:last-child { margin-top: .6rem; font-size: 1.02rem; color: var(--ink); line-height: 1.55; font-weight: 500; }

/* ── Work ─────────────────────────────────────────────── */
.flow { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.flow span { font-family: var(--font-mono); font-size: .72rem; color: var(--muted); padding: .3rem .55rem; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); white-space: nowrap; }
.flow i { font-size: .6rem; color: var(--faint); }

.feature {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); overflow: hidden;
}
.feature-visual {
    position: relative; padding: clamp(24px, 4vw, 40px); background: var(--surface-2);
    border-right: 1px solid var(--line); display: flex; flex-direction: column; justify-content: center; gap: 1rem;
}
.pipeline { display: grid; gap: .6rem; }
.pipe-step {
    display: grid; grid-template-columns: 36px 1fr; gap: .85rem; align-items: center;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: .7rem .85rem;
}
.pipe-step i { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 1rem; }
.pipe-step strong { display: block; font-size: .88rem; color: var(--ink); font-weight: 600; }
.pipe-step small { display: block; font-size: .78rem; color: var(--muted); line-height: 1.4; }
.pipe-connector { width: 1px; height: 10px; background: var(--line-2); margin-left: calc(.85rem + 18px); }
.feature-body { padding: clamp(24px, 4vw, 44px); display: flex; flex-direction: column; }
.project-kicker { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; font-size: .78rem; color: var(--faint); font-weight: 500; }
.badge { display: inline-flex; align-items: center; gap: .35rem; height: 24px; padding: 0 .55rem; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-size: .72rem; font-weight: 600; letter-spacing: .01em; }
.badge.badge-live { background: color-mix(in srgb, var(--good) 12%, transparent); color: var(--good); }
.feature-body h3 { margin-top: .9rem; font-size: clamp(1.4rem, 2.4vw, 1.75rem); letter-spacing: -0.025em; }
.feature-body .sub { margin-top: .35rem; color: var(--muted); font-size: .92rem; }
.pao { margin: 1.5rem 0; display: grid; gap: 1rem; }
.pao div { display: grid; grid-template-columns: 92px 1fr; gap: 1rem; }
.pao dt { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); padding-top: .2rem; }
.pao dd { margin: 0; font-size: .95rem; color: var(--text); line-height: 1.55; }
.feature-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-top: 1.25rem; border-top: 1px solid var(--line); }

.project-grid { margin-top: 20px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.project { display: flex; flex-direction: column; padding: 1.6rem; }
.project h3 { margin-top: .85rem; font-size: 1.18rem; letter-spacing: -0.02em; }
.project .sub { margin-top: .3rem; font-size: .84rem; color: var(--faint); }
.project .summary { margin-top: .9rem; color: var(--muted); font-size: .94rem; line-height: 1.6; }
.project .outcome { margin-top: .9rem; font-size: .9rem; color: var(--text); padding-left: .85rem; border-left: 2px solid var(--accent); line-height: 1.55; }
.project .flow { margin-top: 1.1rem; }
.project-foot { margin-top: auto; padding-top: 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.project-foot .tags { flex: 1; }
.project-links { display: flex; align-items: center; gap: 1rem; }
.project-links .gh { color: var(--muted); font-size: 1.1rem; }
.project-links .gh:hover { color: var(--ink); }
.work-more { margin-top: 28px; display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center; }

/* ── Experience ───────────────────────────────────────── */
.exp-layout { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: clamp(32px, 6vw, 80px); align-items: start; }
.exp-aside { position: sticky; top: calc(var(--nav-h) + 32px); }
.exp-company { margin-top: 1.75rem; display: flex; align-items: center; gap: .85rem; padding: 1rem; }
.exp-logo { width: 44px; height: 44px; border-radius: 10px; background: var(--ink); color: var(--bg); display: grid; place-items: center; font-weight: 700; font-size: .9rem; flex-shrink: 0; }
.exp-company strong { display: block; font-size: .95rem; color: var(--ink); }
.exp-company span { font-size: .82rem; color: var(--muted); }
.timeline { position: relative; display: grid; gap: 0; }
.role { position: relative; display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 1.5rem; padding: 0 0 2.5rem; }
.role:last-child { padding-bottom: 0; }
.role::before { content: ""; position: absolute; left: 144px; top: 10px; bottom: -2px; width: 1px; background: var(--line-2); }
.role:last-child::before { display: none; }
.role-date { font-family: var(--font-mono); font-size: .78rem; color: var(--faint); padding-top: .2rem; }
.role-body { position: relative; padding-left: 1.75rem; }
.role-body::before { content: ""; position: absolute; left: -4px; top: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--bg); border: 2px solid var(--line-2); }
.role.is-current .role-body::before { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.role h3 { font-size: 1.15rem; letter-spacing: -0.02em; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.role .focus { margin-top: .3rem; font-size: .84rem; color: var(--faint); }
.role .desc { margin-top: .75rem; color: var(--muted); font-size: .95rem; }
.role ul { margin-top: .85rem; display: grid; gap: .5rem; }
.role li { position: relative; padding-left: 1.1rem; font-size: .92rem; color: var(--text); line-height: 1.55; }
.role li::before { content: ""; position: absolute; left: 0; top: .62em; width: 5px; height: 5px; border-radius: 50%; background: var(--faint); }
.role li strong { color: var(--ink); }
.role .tags { margin-top: 1rem; }

/* ── Skills ───────────────────────────────────────────── */
.skills-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.skill-group { padding: 1.5rem; }
.skill-group i { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 1.1rem; }
.skill-group h3 { margin-top: 1rem; font-size: 1rem; }
.skill-group .tags { margin-top: .9rem; }
.focus-note { margin-top: 20px; padding: 1rem 1.25rem; display: flex; gap: .85rem; align-items: flex-start; font-size: .92rem; color: var(--muted); }
.focus-note strong { color: var(--ink); }
.focus-note i { color: var(--accent); margin-top: .2rem; }

/* ── Education & awards ───────────────────────────────── */
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(32px, 5vw, 56px); }
.col-title { font-size: .8rem; font-family: var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin-bottom: 1rem; font-weight: 500; }
.stack { display: grid; gap: 14px; }
.edu { padding: 1.35rem 1.5rem; display: grid; grid-template-columns: 44px 1fr; gap: 1rem; }
.edu .ic { width: 44px; height: 44px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; color: var(--ink); font-size: 1.15rem; }
.edu h3 { font-size: 1.02rem; }
.edu .inst { margin-top: .25rem; color: var(--muted); font-size: .9rem; }
.edu .row { margin-top: .6rem; display: flex; flex-wrap: wrap; gap: .4rem; }
.award { padding: 1.2rem 1.5rem; display: grid; grid-template-columns: 1fr auto; gap: .25rem 1rem; align-items: baseline; }
.award h3 { font-size: 1rem; }
.award .count { font-family: var(--font-mono); font-size: .85rem; font-weight: 600; color: var(--accent); }
.award p { grid-column: 1 / -1; color: var(--muted); font-size: .9rem; line-height: 1.55; }

/* ── Writing ──────────────────────────────────────────── */
.writing-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px; }
.post-feature { overflow: hidden; display: flex; flex-direction: column; }
.post-feature .media { aspect-ratio: 16 / 9; background: var(--surface-2); overflow: hidden; border-bottom: 1px solid var(--line); }
.post-feature .media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.post-feature:hover .media img { transform: scale(1.03); }
.post-feature .body { padding: 1.5rem; display: flex; flex-direction: column; gap: .7rem; flex: 1; }
.post-meta { display: flex; align-items: center; gap: .6rem; font-size: .78rem; color: var(--faint); flex-wrap: wrap; }
.post-meta .src { display: inline-flex; align-items: center; gap: .3rem; color: var(--muted); font-weight: 600; }
.post-meta .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); }
.post-feature h3 { font-size: 1.3rem; letter-spacing: -0.02em; line-height: 1.3; }
.post-feature p { color: var(--muted); font-size: .94rem; line-height: 1.6; }
.post-list { display: grid; gap: 0; padding: .4rem 1.5rem; }
.post-row { display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: center; padding: 1.15rem 0; border-bottom: 1px solid var(--line); }
.post-row:last-child { border-bottom: 0; }
.post-row h3 { margin-top: .35rem; font-size: 1rem; line-height: 1.4; transition: color .2s; }
.post-row:hover h3 { color: var(--accent); }
.post-row > i { color: var(--faint); transition: transform .2s var(--ease), color .2s; }
.post-row:hover > i { color: var(--accent); transform: translate(2px, -2px); }
.essays { margin-top: 20px; padding: 1.5rem; }
.essays-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .75rem; }
.essays-head h3 { font-size: 1rem; }
.essay-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2rem; }
.essay-links a { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .8rem 0; border-bottom: 1px solid var(--line); font-size: .92rem; color: var(--text); font-weight: 500; }
.essay-links a i { color: var(--faint); font-size: .75rem; flex-shrink: 0; transition: transform .2s var(--ease); }
.essay-links a:hover { color: var(--accent); }
.essay-links a:hover i { transform: translateX(3px); color: var(--accent); }

/* ── Beyond work ──────────────────────────────────────── */
.moments { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.moment { position: relative; padding: 0; border: 0; cursor: pointer; text-align: left; border-radius: var(--r-lg); overflow: hidden; background: var(--surface-2); aspect-ratio: 4 / 5; }
.moment img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.moment:hover img { transform: scale(1.04); }
.moment::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(5,10,18,.82)); }
.moment .cap { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 1.25rem; color: #fff; }
.moment .cap q { display: block; font-size: .95rem; line-height: 1.45; font-weight: 500; quotes: none; }
.moment .cap span { display: flex; align-items: center; justify-content: space-between; margin-top: .6rem; font-size: .76rem; opacity: .8; font-family: var(--font-mono); }
.interests { margin-top: 20px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.interest { padding: 1.3rem 1.4rem; }
.interest h3 { font-size: .98rem; display: flex; align-items: center; gap: .55rem; }
.interest h3 i { color: var(--accent); }
.interest p { margin-top: .5rem; color: var(--muted); font-size: .88rem; line-height: 1.55; }

/* ── Contact band ─────────────────────────────────────── */
.contact { padding: clamp(64px, 9vw, 112px) 0; }
.contact-card {
    position: relative; overflow: hidden; background: var(--band); color: var(--band-text);
    border-radius: 24px; padding: clamp(32px, 6vw, 72px);
    display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: center;
}
.contact-card::before {
    content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
    background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
    background-size: 32px 32px; mask-image: radial-gradient(ellipse at 85% 20%, #000 0%, transparent 65%); -webkit-mask-image: radial-gradient(ellipse at 85% 20%, #000 0%, transparent 65%);
}
.contact-card > * { position: relative; }
.contact-card .eyebrow { color: #9DB5FF; }
.contact-card h2 { margin-top: .75rem; color: #fff; font-size: clamp(1.9rem, 4vw, 2.8rem); font-weight: 700; letter-spacing: -0.035em; line-height: 1.1; }
.contact-card p { margin-top: 1rem; color: var(--band-muted); font-size: 1.02rem; max-width: 34rem; }
.contact-actions { margin-top: 1.75rem; display: flex; flex-wrap: wrap; gap: .75rem; }
.contact-card .btn-primary { background: #fff; color: #0E1726; }
.contact-card .btn-secondary { background: transparent; color: #fff; border-color: rgba(255,255,255,.22); }
.contact-card .btn-secondary:hover { border-color: #fff; }
.contact-links { display: grid; gap: 0; border-top: 1px solid rgba(255,255,255,.1); }
.contact-links a { display: grid; grid-template-columns: 22px 1fr auto; gap: .85rem; align-items: center; padding: 1rem 0; border-bottom: 1px solid rgba(255,255,255,.1); color: var(--band-text); font-size: .94rem; transition: color .2s; }
.contact-links a i:first-child { color: var(--band-muted); font-size: 1.05rem; }
.contact-links a .arr { color: var(--band-muted); font-size: .8rem; transition: transform .2s var(--ease); }
.contact-links a:hover { color: #fff; }
.contact-links a:hover .arr { transform: translate(2px, -2px); color: #fff; }

/* ── Footer ───────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--line); padding: 40px 0 120px; }
.footer-grid { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; align-items: flex-start; }
.footer-brand p { margin-top: .6rem; color: var(--muted); font-size: .88rem; max-width: 22rem; }
.footer-nav { display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; }
.footer-nav a { font-size: .88rem; color: var(--muted); }
.footer-nav a:hover { color: var(--ink); }
.footer-bottom { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: center; font-size: .82rem; color: var(--faint); }
.footer-socials { display: flex; gap: .4rem; }

/* ── Lightbox ─────────────────────────────────────────── */
.lightbox { position: fixed; inset: 0; z-index: 1000; background: rgba(5,8,14,.94); display: none; align-items: center; justify-content: center; padding: 64px 72px; }
.lightbox.is-open { display: flex; }
.lb-media { max-width: min(1100px, 100%); max-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.lb-media img, .lb-media video { max-height: calc(100vh - 200px); width: auto; max-width: 100%; border-radius: 10px; object-fit: contain; }
.lb-quote { color: #E5E9F0; font-size: .98rem; text-align: center; max-width: 40rem; line-height: 1.5; }
.lb-btn { position: absolute; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.06); color: #fff; cursor: pointer; display: grid; place-items: center; font-size: 1rem; transition: background .2s; }
.lb-btn:hover { background: rgba(255,255,255,.16); }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
.lb-counter { position: absolute; top: 26px; left: 50%; transform: translateX(-50%); color: rgba(255,255,255,.7); font-family: var(--font-mono); font-size: .8rem; }

/* ── Toast ────────────────────────────────────────────── */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); z-index: 1001; background: var(--ink); color: var(--bg); padding: .7rem 1.1rem; border-radius: 10px; font-size: .88rem; font-weight: 500; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s var(--ease); box-shadow: var(--shadow-lg); }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ── Reveal ───────────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
    .reveal { opacity: 1; transform: none; }
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 1180px) {
    .nav { display: none; }
    .menu-btn { display: inline-flex; }
}
@media (max-width: 1024px) {
    .story { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 2rem; }
    .story::before { display: none; }
    .skills-grid, .interests { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .exp-layout { grid-template-columns: 1fr; }
    .exp-aside { position: static; }
}
@media (max-width: 900px) {
    .hero-grid { grid-template-columns: 1fr; }
    .portrait { justify-self: start; max-width: 380px; }
    .portrait-card { left: auto; right: -12px; bottom: 18px; }
    .stats { grid-template-columns: repeat(2, 1fr); }
    .stat:nth-child(3) { border-left: 0; }
    .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
    .about-grid, .feature, .writing-grid, .two-col, .contact-card { grid-template-columns: 1fr; }
    .feature-visual { border-right: 0; border-bottom: 1px solid var(--line); }
    .project-grid { grid-template-columns: 1fr; }
    .moments { grid-template-columns: 1fr 1fr; }
    .moments .moment:last-child { grid-column: 1 / -1; aspect-ratio: 16 / 9; }
}
@media (max-width: 640px) {
    .story { grid-template-columns: 1fr; row-gap: 1.5rem; }
    .story-step { padding: 0 0 0 1.6rem; }
    .story-step::before { top: 3px; }
    .vm-grid { grid-template-columns: 1fr; }
    .portrait { max-width: 100%; }
    .portrait-frame { aspect-ratio: 1 / 1; }
    .portrait-card { position: static; margin-top: 12px; max-width: none; box-shadow: none; }
    .hero-socials { margin-left: 0; width: 100%; }
    .stat { padding: 1.15rem; }
    .facts { grid-template-columns: 1fr; }
    .role { grid-template-columns: 1fr; gap: .35rem; padding-left: 1.1rem; border-left: 2px solid var(--line); }
    .role.is-current { border-left-color: var(--accent); }
    .role::before, .role-body::before { display: none; }
    .role-body { padding-left: 0; }
    .pao div { grid-template-columns: 1fr; gap: .25rem; }
    .skills-grid, .interests, .moments, .essay-links { grid-template-columns: 1fr; }
    .moments .moment, .moments .moment:last-child { aspect-ratio: 4 / 3; grid-column: auto; }
    .lightbox { padding: 64px 12px; }
    .lb-prev, .lb-next { top: auto; bottom: 16px; transform: none; }
    .site-footer { padding-bottom: 140px; }
}


/* ── Shared chatbot widget (copied from styles/styles.css) ── */
/* ═══════════════════════════════════════════════════════
   Chatbot - Ask about Shanjai
   A floating, rule-based FAQ widget present site-wide. No
   external API, no network request - pure client-side keyword
   matching against a fixed knowledge base built from real site
   content, disclosed as such in the panel itself.
   ═══════════════════════════════════════════════════════ */
.cb-toggle { position: fixed; bottom: 2rem; left: 2rem; width: 56px; height: 56px; border-radius: 50%; background: var(--accent-gold); color: var(--bg-primary); border: none; display: flex; align-items: center; justify-content: center; font-size: 1.35rem; cursor: pointer; box-shadow: var(--shadow-md); z-index: 950; transition: var(--transition); }
.cb-toggle:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.cb-toggle:focus-visible { outline: 2px solid var(--accent-gold); outline-offset: 3px; }

.cb-panel { position: fixed; bottom: calc(2rem + 68px); left: 2rem; width: 360px; max-width: calc(100vw - 2.5rem); height: 620px; max-height: calc(100vh - 8rem); background: var(--bg-primary); border: 1px solid var(--glass-border); border-radius: var(--radius-lg); box-shadow: 0 20px 60px rgba(10,20,40,0.22); display: flex; flex-direction: column; z-index: 951; opacity: 0; transform: translateY(16px) scale(0.98); pointer-events: none; transition: opacity 0.25s var(--ease), transform 0.25s var(--ease); overflow: hidden; }

/* On Playground pages the sidebar already owns the left 240px column
   (desktop only - it's an off-screen drawer on mobile) - shift the
   widget clear of it there instead of sitting on top of the nav tree. */
@media (min-width: 1025px) {
    body.pg-page .cb-toggle { left: calc(240px + 1.5rem); }
    body.pg-page .cb-panel { left: calc(240px + 1.5rem); }
}
.cb-panel.is-open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }

.cb-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-bottom: 1px solid var(--glass-border); background: var(--bg-secondary); flex-shrink: 0; }
.cb-header-info { display: flex; align-items: center; gap: 0.75rem; }
.cb-avatar { display: flex; color: var(--accent-gold); flex-shrink: 0; }
.cb-toggle-icon { display: flex; }
.cb-header-info strong { display: block; font-size: 0.85rem; font-weight: 700; color: var(--text-primary); }
.cb-sub { display: block; font-size: 0.66rem; color: var(--text-secondary); margin-top: 0.15rem; }
.cb-close { background: none; border: none; color: var(--text-secondary); font-size: 1rem; cursor: pointer; padding: 0.3rem; line-height: 1; }
.cb-close:hover { color: var(--accent-gold); }

.cb-messages { flex: 1; overflow-y: auto; padding: 1.25rem; display: flex; flex-direction: column; gap: 0.85rem; }
.cb-msg { max-width: 88%; }
.cb-msg p { margin: 0; font-size: 0.83rem; line-height: 1.55; }
.cb-msg--bot { align-self: flex-start; background: var(--bg-secondary); border: 1px solid var(--glass-border); border-radius: var(--radius-lg); padding: 0.7rem 0.9rem; color: var(--text-primary); }
.cb-msg--user { align-self: flex-end; background: var(--accent-gold); border-radius: var(--radius-lg); padding: 0.7rem 0.9rem; }
.cb-msg--user p { color: var(--bg-primary); }
.cb-msg-links { display: flex; flex-direction: column; gap: 0.4rem; margin-top: 0.65rem; }
.cb-msg-link { display: flex; align-items: center; justify-content: space-between; font-size: 0.76rem; font-weight: 700; color: var(--accent-gold); background: var(--bg-primary); border: 1px solid rgba(20,33,61,0.2); border-radius: var(--radius-md); padding: 0.45rem 0.7rem; transition: var(--transition); }
.cb-msg-link:hover { background: var(--accent-gold-light); }
.cb-msg-link i { font-size: 0.7rem; }

.cb-typing { align-self: flex-start; background: var(--bg-secondary); border: 1px solid var(--glass-border); border-radius: var(--radius-lg); padding: 0.85rem 1rem; display: flex; gap: 0.3rem; }
.cb-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--text-secondary); opacity: 0.5; animation: cbTypingBounce 1.2s infinite ease-in-out; }
.cb-typing span:nth-child(2) { animation-delay: 0.15s; }
.cb-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes cbTypingBounce { 0%, 60%, 100% { transform: translateY(0); opacity: 0.5; } 30% { transform: translateY(-4px); opacity: 1; } }

.cb-quick { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0 1.25rem 1rem; flex-shrink: 0; }
.cb-quick-btn { font-family: inherit; font-size: 0.72rem; font-weight: 600; color: var(--text-primary); background: var(--bg-secondary); border: 1px solid var(--glass-border); border-radius: 100px; padding: 0.4rem 0.8rem; cursor: pointer; transition: var(--transition); }
.cb-quick-btn:hover { border-color: var(--accent-gold); color: var(--accent-gold); }
.cb-quick-btn:focus-visible { outline: 2px solid var(--accent-gold); outline-offset: 2px; }

.cb-input-row { display: flex; gap: 0.5rem; padding: 1rem 1.25rem; border-top: 1px solid var(--glass-border); flex-shrink: 0; }
.cb-input-row input { flex: 1; min-width: 0; font-family: inherit; font-size: 0.83rem; padding: 0.65rem 0.9rem; border: 1px solid var(--glass-border); border-radius: var(--radius-md); background: var(--bg-primary); color: var(--text-primary); }
.cb-input-row input:focus-visible { outline: 2px solid var(--accent-gold); outline-offset: 1px; }
.cb-input-row button { width: 40px; height: 40px; border-radius: var(--radius-md); border: none; background: var(--accent-gold); color: var(--bg-primary); cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: var(--transition); }
.cb-input-row button:hover { opacity: 0.88; }

@media (max-width: 480px) {
    .cb-toggle, body.pg-page .cb-toggle { left: 1.25rem; bottom: calc(1.25rem + 66px); width: 52px; height: 52px; }
    .cb-panel, body.pg-page .cb-panel { left: 0.75rem; right: 0.75rem; bottom: calc(5rem + 66px); width: auto; max-width: none; height: min(72vh, 560px); }
}
[hidden]{display:none !important}

/* Hide floating widgets while the mobile menu is open */
body.menu-open { overflow: hidden; }
body.menu-open .cb-toggle, body.menu-open .cb-panel, body.menu-open .mcta-bar { display: none !important; }
