/* =========================================================
   Vijay Joshi: portfolio
   Editorial "lab notebook" system: serif display, mono labels,
   numbered sections and captioned figures.
   ========================================================= */

:root {
    --bg: #0e0e0d;
    --bg-2: #161614;
    --ink: #edebe4;
    --ink-2: #bdbab0;
    --muted: #8a877e;
    --faint: #57554f;
    --rule: #262522;
    --accent: #ff7a4a;
    --accent-ink: #1b0b03;
    --tint: rgba(255, 122, 74, 0.13);
    --study: #8fb3ff;

    --display: 'Instrument Serif', 'Times New Roman', serif;
    --serif: 'Source Serif 4', Georgia, serif;
    --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

    --max: 1240px;
    --gutter: 48px;
    --ease: cubic-bezier(.2, .7, .1, 1);
    --topbar: 64px;
    color-scheme: dark;
}

:root[data-theme="light"] {
    --bg: #f5f3ee;
    --bg-2: #ebe8e0;
    --ink: #151513;
    --ink-2: #45433d;
    --muted: #6c6960;
    --faint: #a7a397;
    --rule: #dad6cb;
    --accent: #d2461b;
    --accent-ink: #ffffff;
    --tint: rgba(210, 70, 27, 0.1);
    --study: #3b63c4;
    color-scheme: light;
}

/* ---------- Reset ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--serif);
    font-size: 18px;
    line-height: 1.6;
    background: var(--bg);
    color: var(--ink);
    min-height: 100vh;
    font-optical-sizing: auto;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    transition: background-color .35s var(--ease), color .35s var(--ease);
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button, input, textarea { font: inherit; color: inherit; }
strong, b { font-weight: 600; color: var(--ink); }
::selection { background: var(--accent); color: var(--accent-ink); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.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: fixed; left: 16px; top: -60px; z-index: 300;
    padding: 8px 14px; background: var(--accent); color: var(--accent-ink);
    font-family: var(--mono); font-size: 13px;
}
.skip-link:focus { top: 12px; }

/* Faint paper grain */
body::before {
    content: '';
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    opacity: .05;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
:root[data-theme="light"] body::before { opacity: .07; }

/* ---------- Shared type ---------- */
.eyebrow, .mono-label, .fig-num, .sec-idx, .stack-line, .row-date, .role-meta, .project-meta, .post-date {
    font-family: var(--mono);
    font-size: 12.5px;
    letter-spacing: .02em;
}
.eyebrow { color: var(--muted); display: inline-flex; align-items: center; gap: 10px; }
.mono-label { color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-size: 11.5px; }

.live-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #3ecf8e; display: inline-block; flex: none;
    box-shadow: 0 0 0 0 rgba(62, 207, 142, .55);
    animation: pulse 2.2s infinite;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(62, 207, 142, .5); }
    70% { box-shadow: 0 0 0 8px rgba(62, 207, 142, 0); }
    100% { box-shadow: 0 0 0 0 rgba(62, 207, 142, 0); }
}

.ulink {
    font-family: var(--mono);
    font-size: 14px;
    color: var(--ink);
    background-image: linear-gradient(var(--accent), var(--accent));
    background-size: 0% 1px;
    background-position: 0 100%;
    background-repeat: no-repeat;
    border-bottom: 1px solid var(--rule);
    padding-bottom: 2px;
    transition: background-size .35s var(--ease), color .2s;
}
.ulink:hover { background-size: 100% 1px; color: var(--accent); }

.btn-primary {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--mono); font-size: 14px;
    padding: 13px 22px;
    background: var(--accent); color: var(--accent-ink);
    border: 1px solid var(--accent);
    cursor: pointer;
    transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .2s;
}
.btn-primary:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--ink); }

kbd {
    font-family: var(--mono); font-size: 11.5px;
    padding: 2px 6px; border: 1px solid var(--rule); border-bottom-width: 2px;
    border-radius: 4px; color: var(--ink-2); background: var(--bg-2);
}

/* ---------- Top bar ---------- */
.topbar {
    position: sticky; top: 0; z-index: 100;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: saturate(1.4) blur(12px);
    -webkit-backdrop-filter: saturate(1.4) blur(12px);
}
.topbar-inner {
    max-width: var(--max); margin: 0 auto; height: var(--topbar);
    padding: 0 var(--gutter);
    display: flex; align-items: center; gap: 28px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 22px; letter-spacing: -.01em; white-space: nowrap; }
.brand-mark {
    display: grid; place-items: center; width: 28px; height: 28px;
    border: 1px solid var(--ink); font-family: var(--mono); font-size: 12px; letter-spacing: -.04em;
    transition: background .25s, color .25s, transform .4s var(--ease);
}
.brand:hover .brand-mark { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); transform: rotate(-8deg); }

.site-nav { display: flex; gap: 22px; margin-left: auto; }
.site-nav a {
    font-family: var(--mono); font-size: 13px; color: var(--muted);
    position: relative; padding: 4px 0; white-space: nowrap;
    transition: color .2s;
}
.site-nav a::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px;
    background: var(--accent); transform: scaleX(0); transform-origin: left;
    transition: transform .35s var(--ease);
}
.site-nav a:hover, .site-nav a.active { color: var(--ink); }
.site-nav a.active::after { transform: scaleX(1); }

.topbar-actions { display: flex; align-items: center; gap: 10px; }
.palette-btn, .theme-btn {
    display: grid; place-items: center; height: 34px; min-width: 34px;
    background: transparent; border: 1px solid var(--rule); border-radius: 999px;
    color: var(--ink); cursor: pointer; transition: border-color .2s, transform .4s var(--ease);
}
.palette-btn { padding: 0 6px; }
.palette-btn kbd { border: 0; background: none; padding: 0 4px; }
.palette-btn:hover, .theme-btn:hover { border-color: var(--ink); }
.theme-btn:hover svg { transform: rotate(180deg); }
.theme-btn svg { transition: transform .6s var(--ease); }

/* Segmented progress: one segment per visible section */
.progress {
    display: flex; gap: 3px; height: 2px;
    max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter);
}
.progress-seg { position: relative; flex: 1 1 0; background: var(--rule); overflow: hidden; }
.progress-seg i {
    position: absolute; inset: 0; background: var(--ink-2);
    transform-origin: left; transform: scaleX(0);
}
.progress-seg.is-current i { background: var(--accent); }

/* ---------- Layout ---------- */
.main {
    position: relative; z-index: 1;
    max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter);
}
main > section {
    padding: 112px 0 96px;
    border-top: 1px solid var(--rule);
    scroll-margin-top: var(--topbar);
}
main > section#about { border-top: 0; padding-top: 72px; }
body:not([data-page="home"]) main > section { border-top: 0; padding-top: 72px; }

.split {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
    gap: 48px;
}

/* Section heads */
.sec-head { margin-bottom: 56px; max-width: 900px; }
.sec-idx { display: block; color: var(--accent); margin-bottom: 14px; }
.sec-idx::before { content: '§ '; color: var(--faint); }
.sec-title {
    font-family: var(--display); font-weight: 400;
    font-size: clamp(48px, 7vw, 88px);
    line-height: .98; letter-spacing: -.02em;
}
.sec-title em { font-style: italic; color: var(--accent); }
.sec-sub { margin-top: 20px; font-size: 21px; line-height: 1.5; color: var(--ink-2); max-width: 640px; }
.sec-head-side { margin-bottom: 0; }
.sec-head-side .sec-title { font-size: clamp(40px, 5vw, 60px); }

/* Reveal */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* Lists */
.dash-list { display: grid; gap: 10px; color: var(--ink-2); font-size: 17px; }
.dash-list li { position: relative; padding-left: 26px; }
.dash-list li::before { content: '–'; position: absolute; left: 0; color: var(--accent); font-family: var(--mono); }
.stack-line { color: var(--muted); margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--rule); }

/* ---------- Figures ---------- */
.fig { margin: 0; }
.fig-caption { margin-top: 16px; font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.fig-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.fig-num { color: var(--ink); text-transform: uppercase; font-weight: 500; letter-spacing: .06em; }
.fig-title { color: var(--ink-2); }
.fig-note { margin-top: 12px; line-height: 1.7; max-width: 560px; }
.fig-note .ulink { font-size: 12.5px; }

/* ---------- Hero ---------- */
.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: 56px;
    align-items: center;
    min-height: calc(100vh - var(--topbar) - 120px);
}
.hero-title {
    font-family: var(--display); font-weight: 400;
    font-size: clamp(46px, 6.3vw, 90px);
    line-height: .96; letter-spacing: -.025em;
    margin: 22px 0 30px;
}
.hero-line { display: block; white-space: nowrap; }
.hero-line.dim { color: var(--muted); }
.rotator { font-style: italic; color: var(--accent); white-space: nowrap; }

.js .hero-line, .js .hero .eyebrow, .js .hero .lede, .js .hero-actions, .js .fig-mmr {
    opacity: 0; transform: translateY(26px);
    animation: rise 1s var(--ease) forwards;
}
.js .hero .eyebrow { animation-delay: .05s; }
.js .hero-line:nth-child(1) { animation-delay: .12s; }
.js .hero-line:nth-child(2) { animation-delay: .22s; }
.js .hero-line:nth-child(3) { animation-delay: .32s; }
.js .hero .lede { animation-delay: .45s; }
.js .hero-actions { animation-delay: .55s; }
.js .fig-mmr { animation-delay: .35s; animation-duration: 1.4s; }
@keyframes rise { to { opacity: 1; transform: none; } }

.lede { font-size: 21px; line-height: 1.6; color: var(--ink-2); max-width: 600px; }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 26px; margin-top: 36px; }

/* Fig. 1: MMR */
.mmr-stage {
    position: relative;
    aspect-ratio: 5 / 4;
    border: 1px solid var(--rule);
    background:
        linear-gradient(var(--rule) 1px, transparent 1px) 0 0 / 100% 25%,
        linear-gradient(90deg, var(--rule) 1px, transparent 1px) 0 0 / 20% 100%;
    background-color: var(--bg);
    overflow: hidden;
}
.mmr-stage::after {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 55%, var(--bg) 100%);
    opacity: .7;
}
.mmr-canvas { display: block; width: 100%; height: 100%; cursor: crosshair; touch-action: none; }
.mmr-hint {
    position: absolute; right: 12px; bottom: 10px; z-index: 2;
    font-family: var(--mono); font-size: 11.5px; color: var(--ink-2);
    background: var(--bg); padding: 3px 8px; border: 1px solid var(--rule);
    transition: opacity .5s, transform .5s var(--ease);
    animation: nudge 2.4s ease-in-out infinite;
}
.mmr-hint.gone { opacity: 0; transform: translateY(6px); animation: none; }
@keyframes nudge { 50% { transform: translateY(-3px); } }

.mmr-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: 14px; }
.seg-toggle { display: inline-flex; border: 1px solid var(--rule); }
.seg-toggle button {
    background: none; border: 0; padding: 6px 12px; cursor: pointer;
    font-family: var(--mono); font-size: 12px; color: var(--muted);
    transition: background .2s, color .2s;
}
.seg-toggle button + button { border-left: 1px solid var(--rule); }
.seg-toggle button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.seg-toggle button:hover:not([aria-pressed="true"]) { color: var(--ink); }
.mmr-lambda { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); transition: opacity .3s; }
.mode-sim .mmr-lambda { opacity: .4; }
.mmr-lambda output { min-width: 3.2em; color: var(--accent); }
input[type="range"] {
    -webkit-appearance: none; appearance: none; width: 140px; height: 18px; background: transparent; cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track { height: 1px; background: var(--ink-2); }
input[type="range"]::-moz-range-track { height: 1px; background: var(--ink-2); }
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; width: 12px; height: 12px; margin-top: -6px;
    background: var(--accent); border: 2px solid var(--bg); border-radius: 50%; box-shadow: 0 0 0 1px var(--accent);
}
input[type="range"]::-moz-range-thumb { width: 10px; height: 10px; background: var(--accent); border: 2px solid var(--bg); border-radius: 50%; }
.mmr-readout { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 12px; min-height: 1.6em; color: var(--muted); }
.mmr-readout b { color: var(--ink); font-weight: 500; }

/* Marquee */
.marquee {
    margin: 24px calc(var(--gutter) * -1) 0;
    border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
    overflow: hidden; padding: 18px 0;
    mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee-track { display: flex; width: max-content; animation: marquee 48s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span {
    font-family: var(--display); font-size: 30px; font-style: italic; color: var(--muted);
    padding: 0 28px; white-space: nowrap; display: inline-flex; align-items: center; gap: 56px;
    transition: color .2s;
}
.marquee-track span::after { content: '✦'; font-style: normal; font-size: 14px; color: var(--accent); margin-left: 28px; }
.marquee-track span:hover { color: var(--ink); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* About */
.about-block { padding-top: 112px; }
.about-body { max-width: 720px; }
.portrait {
    width: 112px; height: 112px; object-fit: cover; border-radius: 50%;
    filter: grayscale(1) contrast(1.05);
    border: 1px solid var(--rule);
    margin-bottom: 28px;
    transition: filter .6s var(--ease), transform .6s var(--ease);
}
.portrait:hover { filter: none; transform: rotate(-4deg) scale(1.04); }
.big-text { font-family: var(--display); font-size: clamp(30px, 3.4vw, 42px); line-height: 1.15; letter-spacing: -.01em; margin-bottom: 24px; }
.about-body > p:not(.big-text) { color: var(--ink-2); font-size: 19px; }

.stats {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 48px; border-top: 1px solid var(--rule);
}
.stat { padding: 26px 24px 26px 0; border-bottom: 1px solid var(--rule); }
.stat:nth-child(odd) { border-right: 1px solid var(--rule); }
.stat:nth-child(even) { padding-left: 24px; }
.stat-num { display: block; font-family: var(--display); font-size: clamp(48px, 5.4vw, 72px); line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-label { display: block; margin-top: 10px; font-family: var(--mono); font-size: 12.5px; color: var(--muted); max-width: 220px; }

/* ---------- Experience ---------- */
.timeline-fig { margin-bottom: 72px; }
.timeline { position: relative; padding-top: 34px; border-top: 1px solid var(--rule); }
.timeline-years { position: absolute; inset: 0; pointer-events: none; }
.timeline-years span {
    position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--rule);
    font-family: var(--mono); font-size: 11.5px; color: var(--muted); padding: 8px 0 0 8px;
}
.timeline-now {
    position: absolute; top: 0; bottom: 0; left: var(--now);
    border-left: 1px dashed var(--accent); pointer-events: none;
}
.timeline-now span { position: absolute; top: 6px; right: 6px; font-family: var(--mono); font-size: 11.5px; color: var(--accent); }
.timeline-lane { position: relative; height: 34px; }
.timeline-bar {
    position: absolute; top: 12px; height: 10px;
    background: var(--ink); transform-origin: left; transform: scaleX(0);
    transition: transform 1.1s var(--ease);
    transition-delay: calc(var(--i) * 120ms + 200ms);
}
.timeline-bar.study { background: transparent; border: 1px solid var(--study); background-image: repeating-linear-gradient(135deg, var(--study) 0 1px, transparent 1px 6px); }
.timeline-bar.ongoing { background: linear-gradient(90deg, var(--ink), var(--accent)); }
.timeline-fig.is-in .timeline-bar, html:not(.js) .timeline-bar { transform: scaleX(1); }
.timeline-label {
    position: absolute; top: 7px; font-family: var(--mono); font-size: 12px; color: var(--ink-2); white-space: nowrap;
    opacity: 0; transition: opacity .6s; transition-delay: calc(var(--i, 0) * 120ms + 700ms);
}
.timeline-fig.is-in .timeline-label, html:not(.js) .timeline-label { opacity: 1; transition-delay: .9s; }
.timeline-label.inside { top: 9px; padding: 0 6px; background: var(--bg); color: var(--ink); font-size: 11.5px; line-height: 16px; }
.legend { display: flex; gap: 18px; margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.sw { width: 14px; height: 8px; display: inline-block; }
.sw.work { background: var(--ink); }
.sw.study { border: 1px solid var(--study); background-image: repeating-linear-gradient(135deg, var(--study) 0 1px, transparent 1px 4px); }

.roles { border-top: 1px solid var(--rule); }
.role {
    display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 48px;
    padding: 44px 0; border-bottom: 1px solid var(--rule);
}
.role-meta { display: flex; flex-direction: column; gap: 6px; color: var(--muted); }
.role-num { color: var(--accent); }
.role-company { color: var(--ink-2); }
.role-title { font-family: var(--display); font-weight: 400; font-size: clamp(30px, 3.2vw, 40px); line-height: 1.08; margin-bottom: 20px; letter-spacing: -.01em; }
.role-at { color: var(--muted); font-style: italic; }

/* ---------- Education ---------- */
.rows { border-top: 1px solid var(--rule); }
.row {
    display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 6fr) minmax(0, 2fr); gap: 48px;
    padding: 40px 0; border-bottom: 1px solid var(--rule); align-items: start;
}
.row-date { color: var(--muted); padding-top: 10px; }
.row-title { font-family: var(--display); font-weight: 400; font-size: clamp(28px, 3vw, 36px); line-height: 1.1; }
.row-sub { font-family: var(--mono); font-size: 13px; color: var(--accent); margin: 8px 0 14px; }
.row-body > p:last-child { color: var(--ink-2); font-size: 17px; }
.row-metric { text-align: right; font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.row-metric b { display: block; font-family: var(--display); font-weight: 400; font-size: 48px; line-height: 1; color: var(--ink); }

/* ---------- Skills ---------- */
.skill-grid {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    border-top: 1px solid var(--rule); border-left: 1px solid var(--rule);
}
.skill-card {
    padding: 28px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
    position: relative; transition-delay: calc(var(--i) * 70ms);
    background: linear-gradient(var(--tint), var(--tint)) no-repeat 0 100% / 100% 0;
    transition: opacity .8s var(--ease), transform .8s var(--ease), background-size .5s var(--ease);
}
.skill-card:hover { background-size: 100% 100%; }
.skill-card-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 18px; }
.skill-label { font-family: var(--mono); font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink); }
.skill-count { font-family: var(--mono); font-size: 12px; color: var(--faint); }
.skill-items { display: flex; flex-wrap: wrap; gap: 4px 0; font-size: 17px; line-height: 1.55; color: var(--ink-2); }
.skill-items span { white-space: nowrap; transition: color .2s; }
.skill-items span:not(:last-child)::after { content: '·'; color: var(--faint); margin: 0 9px; }
.skill-items span:hover { color: var(--accent); }

/* ---------- Projects ---------- */
.projects { border-top: 1px solid var(--rule); }
.project { padding: 52px 0; border-bottom: 1px solid var(--rule); max-width: 760px; }
.project-featured {
    max-width: none; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; align-items: center;
}
.project-meta { display: flex; gap: 16px; color: var(--muted); margin-bottom: 14px; }
.project-num { color: var(--accent); }
.project-title { font-family: var(--display); font-weight: 400; font-size: clamp(34px, 4vw, 52px); line-height: 1.02; letter-spacing: -.015em; }
.project-summary { font-size: 20px; color: var(--ink-2); margin: 14px 0 24px; font-style: italic; }
.project-links { display: flex; gap: 24px; margin-top: 22px; }

.pipeline-scroll { overflow-x: auto; border: 1px solid var(--rule); background: var(--bg); padding: 14px 8px 8px; }
.pipeline { display: block; width: 100%; min-width: 560px; height: auto; }
.pl-edges path { fill: none; stroke: var(--faint); stroke-width: 1.2; stroke-dasharray: 4 5; animation: flow 1.2s linear infinite; }
.pl-edges .pl-retry { stroke: var(--accent); opacity: .75; animation-direction: reverse; }
@keyframes flow { to { stroke-dashoffset: -18; } }
.pl-motion { fill: none; stroke: none; }
.pl-packet { fill: var(--accent); }
.pl-packet.alt { fill: var(--ink); }
.pl-node rect { fill: var(--bg); stroke: var(--ink-2); stroke-width: 1; transition: stroke .2s, fill .2s; }
.pl-node:hover rect { stroke: var(--accent); fill: var(--tint); }
.pl-out rect { stroke: var(--accent); }
.pl-label { font-family: var(--mono); font-size: 12px; fill: var(--ink); }
.pl-num { font-family: var(--mono); font-size: 10px; fill: var(--muted); }
.pl-note { font-family: var(--mono); font-size: 10.5px; fill: var(--accent); }
.callouts { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 12px; }
.callouts span { display: inline-flex; align-items: center; gap: 7px; }
.callouts b { font-weight: 400; font-size: 10.5px; color: var(--ink-2); border: 1px solid var(--rule); padding: 0 5px; border-radius: 3px; }

/* Shared figure bits */
.mmr-readout b.acc { color: var(--accent); }
.chip-toggle {
    padding: 6px 12px; cursor: pointer; background: none; border: 1px dashed var(--rule); border-radius: 999px;
    font-family: var(--mono); font-size: 12px; color: var(--muted); transition: border-color .2s, color .2s, background .2s;
}
.chip-toggle:hover { color: var(--ink); border-color: var(--ink-2); }
.chip-toggle[aria-pressed="true"] { border-style: solid; border-color: var(--accent); color: var(--accent); background: var(--tint); }

/* Fig. 4: driver monitor */
.drowsy-stage { border: 1px solid var(--rule); background: var(--bg); padding: 10px 8px 4px; overflow-x: auto; }
.drowsy { display: block; width: 100%; min-width: 520px; height: auto; }
.dz-outline { fill: none; stroke: var(--ink-2); stroke-width: 1.4; }
.dz-eye { fill: var(--bg); stroke: var(--ink); stroke-width: 1.4; }
.dz-pupil { fill: var(--ink); transition: opacity .08s; }
.dz-lid { stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; }
.dz-frame { fill: none; stroke: var(--rule); }
.dz-th { stroke: var(--accent); stroke-dasharray: 4 4; opacity: .8; }
.dz-line { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linejoin: round; }
.dz-area { fill: var(--tint); }
.alerting .dz-line { stroke: var(--accent); }
.dz-small { font-family: var(--mono); font-size: 10.5px; fill: var(--muted); }
.dz-alert { opacity: 0; transition: opacity .2s; }
.dz-alert rect { fill: var(--accent); }
.dz-alert text { font-family: var(--mono); font-size: 11px; font-weight: 500; fill: var(--accent-ink); letter-spacing: .06em; }
.dz-alert.on { opacity: 1; animation: alert-blink .7s steps(2) infinite; }
@keyframes alert-blink { 50% { opacity: .35; } }

/* Fig. 5: tweet classifier */
.tw-stage { border: 1px solid var(--rule); background: var(--bg); padding: 22px; display: grid; gap: 16px; }
.tw-card { border: 1px solid var(--rule); background: var(--bg-2); padding: 14px 16px; min-height: 104px; }
.tw-handle { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.tw-text { margin-top: 6px; font-size: 19px; line-height: 1.45; color: var(--ink); }
.tw-word { display: inline-block; opacity: 0; transform: translateY(4px); animation: tw-in .35s var(--ease) forwards; }
@keyframes tw-in { to { opacity: 1; transform: none; } }
.tw-cue { box-shadow: inset 0 -2px 0 var(--accent); background: var(--tint); }
.tw-amb { border-bottom: 1px dashed var(--ink-2); }
.tw-meter { display: grid; grid-template-columns: auto 1fr 3.2em; gap: 12px; align-items: center; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.tw-bar { position: relative; height: 8px; background: var(--rule); }
.tw-bar i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--ink-2); transition: width .9s var(--ease), background .3s; }
.tw-bar i.hot { background: var(--accent); }
.tw-bar b { position: absolute; left: 50%; top: -4px; bottom: -4px; border-left: 1px dashed var(--ink-2); }
.tw-p { color: var(--ink); text-align: right; }
.tw-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.tw-verdict { font-family: var(--mono); font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; padding: 4px 10px; border: 1px solid transparent; }
.tw-verdict.yes { background: var(--accent); color: var(--accent-ink); animation: tw-in .3s var(--ease); }
.tw-verdict.no { border-color: var(--ink-2); color: var(--ink); animation: tw-in .3s var(--ease); }
.tw-log { display: grid; gap: 4px; font-family: var(--mono); font-size: 11.5px; color: var(--muted); min-height: 5.6em; }
.tw-log li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 14px; position: relative; animation: tw-in .4s var(--ease); }
.tw-log li::before { content: ''; position: absolute; left: 0; top: .55em; width: 7px; height: 7px; border: 1px solid var(--ink-2); }
.tw-log li.yes::before { background: var(--accent); border-color: var(--accent); }

/* Interactive: LLM judge */
.grader-stage { border: 1px solid var(--rule); background: var(--bg); padding: 10px 8px 2px; overflow-x: auto; }
.grader { display: block; width: 100%; min-width: 520px; height: auto; }
.gr-pass-zone { fill: var(--tint); transition: x .15s, width .15s; }
.gr-mid { stroke: var(--rule); stroke-dasharray: 2 4; }
.gr-lane, .gr-axis text, .gr-th-label { font-family: var(--mono); font-size: 10.5px; fill: var(--muted); }
.gr-th-label { fill: var(--accent); }
.gr-axis line { stroke: var(--faint); }
.gr-th { stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 5 4; }
.gr-dot { transition: transform .7s var(--ease); }
.gr-core { stroke-width: 1.5; }
.gr-ring { fill: none; stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 2; }
.gr-dot.ok .gr-core { fill: var(--ink); stroke: var(--ink); }
.gr-dot.ff .gr-core { fill: var(--bg); stroke: var(--ink); }
.gr-dot.fp .gr-core { fill: var(--accent); stroke: var(--accent); }
.gr-dot.rj .gr-core { fill: var(--faint); stroke: var(--faint); }
.gr-legend { flex-wrap: wrap; gap: 6px 16px; }
.gl { width: 9px; height: 9px; border-radius: 50%; display: inline-block; border: 1.5px solid var(--ink); }
.gl.ok { background: var(--ink); }
.gl.ff { background: transparent; }
.gl.fp { background: var(--accent); border-color: var(--accent); }
.gl.rj { background: var(--faint); border-color: var(--faint); }
.gl.lg { width: 13px; height: 13px; border: 1px dashed var(--muted); }

/* Interactive figures inside articles break out of the text column a little */
.blog-interactive { margin: 2.4em -40px; }
.blog-interactive .fig-caption { padding: 0 2px; }
.blog-interactive .fig-num { color: var(--accent); }

/* ---------- Writing ---------- */
.post-list { border-top: 1px solid var(--rule); }
.post-row {
    position: relative;
    display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr) minmax(0, 1fr); gap: 48px;
    padding: 34px 0; border-bottom: 1px solid var(--rule);
}
.post-row::before {
    content: ''; position: absolute; inset: 0; z-index: -1;
    background: var(--tint); transform: scaleY(0); transform-origin: bottom;
    transition: transform .45s var(--ease);
}
.post-row:hover::before { transform: scaleY(1); }
.post-date { color: var(--muted); padding-top: 8px; }
.post-title { font-family: var(--display); font-weight: 400; font-size: clamp(28px, 3vw, 38px); line-height: 1.1; letter-spacing: -.01em; }
.post-title a::after { content: ''; position: absolute; inset: 0; }
.post-excerpt { color: var(--ink-2); font-size: 17px; margin-top: 10px; }
.post-row .stack-line { border-top: 0; padding-top: 0; margin-top: 12px; }
.post-arrow { justify-self: end; font-family: var(--mono); font-size: 20px; color: var(--muted); transition: transform .35s var(--ease), color .2s; }
.post-row:hover .post-arrow { transform: translate(4px, -4px); color: var(--accent); }
.post-row:hover .post-title { color: var(--accent); }

/* Announcement */
.blog-announcement {
    display: flex; align-items: center; gap: 16px;
    margin-top: 24px; padding: 10px 12px 10px 16px;
    border: 1px solid var(--rule); background: var(--bg-2);
    font-family: var(--mono); font-size: 13px;
}
.blog-announcement-label { color: var(--accent-ink); background: var(--accent); padding: 1px 8px; text-transform: uppercase; letter-spacing: .06em; font-size: 11px; flex: none; }
.blog-announcement-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.blog-announcement-title:hover { color: var(--accent); }
.blog-announcement-date { color: var(--muted); flex: none; }
.blog-announcement-close { display: grid; place-items: center; width: 28px; height: 28px; background: none; border: 0; color: var(--muted); cursor: pointer; flex: none; }
.blog-announcement-close:hover { color: var(--ink); }

/* Article */
.blog-article { max-width: 720px; margin: 0 auto; }
.blog-back-link { display: inline-block; font-family: var(--mono); font-size: 13px; color: var(--muted); margin-bottom: 40px; transition: color .2s, transform .3s var(--ease); }
.blog-back-link:hover { color: var(--accent); transform: translateX(-4px); }
.blog-article-meta { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.blog-article-title { font-family: var(--display); font-weight: 400; font-size: clamp(42px, 6vw, 72px); line-height: 1; letter-spacing: -.02em; margin: 14px 0 22px; }
.blog-article-excerpt { font-size: 22px; line-height: 1.5; color: var(--ink-2); font-style: italic; }
.blog-article .stack-line { border-top: 0; }
.blog-article-content { margin-top: 48px; padding-top: 40px; border-top: 1px solid var(--rule); font-size: 19px; line-height: 1.75; }
.blog-article-content > p { margin-bottom: 1.2em; color: var(--ink); }
.blog-article-content > p:first-child::first-letter {
    float: left; font-family: var(--display); font-size: 4.4em; line-height: .82; padding: 6px 12px 0 0; color: var(--accent);
}
.blog-subheading { font-family: var(--display); font-weight: 400; font-size: 34px; line-height: 1.1; margin: 1.8em 0 .6em; }
.blog-list-items { margin: 0 0 1.3em; display: grid; gap: 8px; }
.blog-list-items li { position: relative; padding-left: 26px; color: var(--ink-2); }
.blog-list-items li::before { content: '–'; position: absolute; left: 0; color: var(--accent); font-family: var(--mono); }
.blog-callout { margin: 1.8em 0; padding: 4px 0 4px 24px; border-left: 2px solid var(--accent); font-family: var(--display); font-size: 26px; line-height: 1.3; color: var(--ink); }
.blog-figure { margin: 2em 0; }
.blog-figure img { width: 100%; border: 1px solid var(--rule); }
.blog-figure figcaption { margin-top: 10px; font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.blog-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--rule); }
.blog-action-button {
    font-family: var(--mono); font-size: 13px; padding: 8px 14px; cursor: pointer;
    background: none; border: 1px solid var(--rule); color: var(--ink); transition: border-color .2s, color .2s;
}
.blog-action-button:hover { border-color: var(--accent); color: var(--accent); }
.blog-action-status { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }

/* ---------- Achievements ---------- */
.award-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--rule); }
.award { padding: 28px 22px 30px 0; border-bottom: 1px solid var(--rule); }
.award + .award { padding-left: 22px; border-left: 1px solid var(--rule); }
.award-num { display: block; font-family: var(--display); font-size: clamp(36px, 3.6vw, 52px); line-height: 1; letter-spacing: -.02em; margin-bottom: 16px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.award p { font-size: 15.5px; color: var(--ink-2); line-height: 1.5; }
.leadership { margin-top: 64px; }

/* ---------- Contact ---------- */
.contact-title { font-size: clamp(48px, 7.6vw, 104px); }
.contact-grid { align-items: start; }
.contact-side { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.contact-email {
    font-family: var(--display); font-size: clamp(24px, 2.6vw, 34px); line-height: 1.1; word-break: break-all;
    background-image: linear-gradient(var(--accent), var(--accent)); background-size: 100% 1px; background-position: 0 100%; background-repeat: no-repeat;
    transition: color .2s, background-size .4s var(--ease);
}
.contact-email:hover { color: var(--accent); background-size: 100% 2px; }
.copy-btn { font-family: var(--mono); font-size: 12.5px; color: var(--muted); background: none; border: 0; cursor: pointer; padding: 0; }
.copy-btn:hover { color: var(--accent); }
.copy-status { font-family: var(--mono); font-size: 12.5px; color: var(--accent); min-height: 1.2em; }
.local-time { display: flex; align-items: baseline; gap: 10px; font-family: var(--mono); font-size: 13px; color: var(--muted); margin: 18px 0 10px; line-height: 1.6; }
.local-time .live-dot { transform: translateY(-1px); }
.local-time b { color: var(--ink); font-weight: 500; }
.contact-links { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }

.contact-form { display: grid; gap: 20px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.contact-form label { display: grid; gap: 6px; }
.contact-form label span { font-family: var(--mono); font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.contact-form input, .contact-form textarea {
    background: transparent; border: 0; border-bottom: 1px solid var(--rule);
    padding: 8px 0 10px; font-size: 20px; color: var(--ink); border-radius: 0;
    transition: border-color .25s;
}
.contact-form textarea { resize: vertical; min-height: 120px; }
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-bottom-color: var(--accent); }
.form-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; margin-top: 8px; }
.form-note { font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* ---------- 404 ---------- */
.route-not-found { min-height: 60vh; }
.route-not-found .sec-title { margin: 18px 0 32px; max-width: 900px; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--rule); padding: 32px 0 120px; font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.footer-row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.colophon { margin-top: 14px; max-width: 640px; line-height: 1.7; color: var(--faint); }

/* ---------- Command palette ---------- */
.palette { position: fixed; inset: 0; z-index: 200; display: grid; justify-items: center; align-items: start; padding: 14vh 16px 16px; }
.palette-backdrop { position: absolute; inset: 0; background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; transition: opacity .25s; }
.palette-box {
    position: relative; width: min(600px, 100%);
    background: var(--bg-2); border: 1px solid var(--rule);
    box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
    opacity: 0; transform: translateY(-10px) scale(.98);
    transition: opacity .25s var(--ease), transform .3s var(--ease);
}
.palette.open .palette-backdrop { opacity: 1; }
.palette.open .palette-box { opacity: 1; transform: none; }
.palette-input-row { display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--rule); }
.palette-prompt { font-family: var(--mono); color: var(--accent); }
.palette-input-row input { flex: 1; min-width: 0; background: none; border: 0; padding: 18px 0; font-family: var(--mono); font-size: 15px; color: var(--ink); outline: none; }
.palette-list { max-height: min(52vh, 420px); overflow-y: auto; padding: 8px; }
.palette-group { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); padding: 12px 10px 6px; }
.palette-item {
    display: flex; justify-content: space-between; align-items: center; gap: 16px;
    padding: 10px 12px; cursor: pointer; font-size: 16px; color: var(--ink-2);
    border-left: 2px solid transparent;
}
.palette-item[aria-selected="true"] { background: var(--tint); color: var(--ink); border-left-color: var(--accent); }
.palette-hint { font-family: var(--mono); font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.palette-empty { padding: 18px 12px; font-family: var(--mono); font-size: 13px; color: var(--muted); }
.palette-foot { display: flex; gap: 18px; padding: 10px 18px; border-top: 1px solid var(--rule); font-family: var(--mono); font-size: 11.5px; color: var(--faint); }

/* ---------- FAQ widget ---------- */
.faq-launcher {
    position: fixed; right: 24px; bottom: 24px; z-index: 120;
    display: inline-flex; align-items: center; gap: 10px;
    padding: 11px 18px 11px 14px; cursor: pointer;
    background: var(--ink); color: var(--bg); border: 0; border-radius: 999px;
    font-family: var(--mono); font-size: 13px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .3);
    transition: transform .3s var(--ease);
}
.faq-launcher:hover { transform: translateY(-3px); }
.faq-launcher-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse-accent 2.2s infinite; }
@keyframes pulse-accent { 0%, 100% { box-shadow: 0 0 0 0 var(--tint); } 50% { box-shadow: 0 0 0 6px transparent; } }
.faq-launcher[aria-expanded="true"] .faq-launcher-dot { animation: none; }

.faq-panel {
    position: fixed; right: 24px; bottom: 84px; z-index: 119;
    display: flex; flex-direction: column;
    width: min(440px, calc(100vw - 32px)); height: min(620px, calc(100dvh - 120px)); min-height: 300px;
    background: var(--bg-2); border: 1px solid var(--rule);
    box-shadow: 0 30px 80px rgba(0, 0, 0, .4);
    overflow: hidden;
}
.faq-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 16px; border-bottom: 1px solid var(--rule); }
.faq-header h2 { font-family: var(--display); font-weight: 400; font-size: 24px; line-height: 1; }
.faq-header p { font-family: var(--mono); font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.faq-close { display: grid; place-items: center; width: 32px; height: 32px; background: none; border: 1px solid var(--rule); color: var(--ink); cursor: pointer; }
.faq-close:hover { border-color: var(--accent); color: var(--accent); }
.faq-conversation { flex: 1; min-height: 0; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.faq-message { max-width: 90%; padding: 10px 13px; font-size: 15.5px; line-height: 1.5; overflow-wrap: anywhere; }
.faq-assistant-message { align-self: flex-start; background: var(--bg); border: 1px solid var(--rule); }
.faq-user-message { align-self: flex-end; background: var(--accent); color: var(--accent-ink); }
.faq-message-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.faq-message-links a { font-family: var(--mono); font-size: 12.5px; color: var(--accent); border-bottom: 1px solid currentColor; }
.faq-user-message .faq-message-links a { color: inherit; }
.faq-suggestions { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.faq-suggestions button {
    text-align: left; max-width: 100%; padding: 7px 11px; cursor: pointer;
    background: none; border: 1px solid var(--rule); font-family: var(--mono); font-size: 12.5px; color: var(--ink-2);
    transition: border-color .2s, color .2s;
}
.faq-suggestions button:hover { border-color: var(--accent); color: var(--ink); }
.faq-form { display: grid; grid-template-columns: 1fr 38px; gap: 8px; padding: 12px; border-top: 1px solid var(--rule); }
.faq-form input { min-width: 0; padding: 9px 12px; background: var(--bg); border: 1px solid var(--rule); font-size: 15px; color: var(--ink); }
.faq-form input:focus { outline: none; border-color: var(--accent); }
.faq-form button { display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); border: 0; cursor: pointer; }

/* Retrieval answers */
.faq-message p + p, .faq-message p + .faq-quote { margin-top: 8px; }
.faq-message > p:first-child b { color: var(--accent); font-weight: 500; }
.faq-lead { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.faq-assistant-message { max-width: 100%; }
.faq-quote { margin: 10px 0 0; padding: 2px 0 2px 12px; border-left: 2px solid var(--accent); }
.faq-quote-text { font-size: 15px; line-height: 1.55; color: var(--ink); }
.faq-quote-text mark { background: var(--tint); color: var(--ink); padding: 0 2px; box-shadow: inset 0 -1px 0 var(--accent); }
.faq-source {
    margin-top: 6px; padding: 0; background: none; border: 0; cursor: pointer; text-align: left;
    font-family: var(--mono); font-size: 11.5px; color: var(--muted); transition: color .2s;
}
.faq-source:hover { color: var(--accent); }
.faq-starter { border-style: dashed !important; }

.faq-followups { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--rule); }
.faq-followups button {
    padding: 5px 10px; cursor: pointer; background: var(--bg-2); border: 1px solid var(--rule); border-radius: 999px;
    font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); transition: border-color .2s, color .2s;
}
.faq-followups button:hover { border-color: var(--accent); color: var(--ink); }

.faq-typing { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.faq-typing i { width: 18px; height: 6px; background: radial-gradient(circle, var(--accent) 2px, transparent 2.5px) 0 50% / 6px 6px repeat-x; animation: typing-dots .9s steps(4) infinite; }
@keyframes typing-dots { from { width: 0; } to { width: 24px; } }

/* Retrieval trace */
.faq-trace { margin-top: 12px; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.faq-trace summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); }
.faq-trace summary::-webkit-details-marker { display: none; }
.faq-trace summary::before { content: '▸'; color: var(--accent); transition: transform .2s; }
.faq-trace[open] summary::before { transform: rotate(90deg); }
.faq-trace summary:hover { color: var(--accent); }
.trace-query { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 10px; }
.trace-key { color: var(--faint); margin-right: 4px; text-transform: uppercase; letter-spacing: .08em; font-size: 10px; }
.trace-term { padding: 1px 6px; border: 1px solid var(--rule); color: var(--ink); cursor: help; }
.trace-term.syn { border-style: dashed; color: var(--muted); }
.trace-term.typo { border-color: var(--accent); color: var(--accent); }
.trace-term.unknown { text-decoration: line-through; color: var(--faint); }
.trace-note { margin-top: 6px; color: var(--accent); }
.trace-list { margin-top: 10px; display: grid; gap: 2px; }
.trace-list li {
    display: grid; grid-template-columns: 14px 44px 34px 1fr auto; gap: 2px 8px; align-items: center;
    padding: 4px 6px; opacity: .55;
}
.trace-list li.picked { opacity: 1; background: var(--tint); }
.trace-rank { color: var(--faint); }
.trace-bar { height: 4px; background: var(--rule); position: relative; }
.trace-bar i { position: absolute; inset: 0 auto 0 0; background: var(--ink-2); }
.trace-list li.picked .trace-bar i { background: var(--accent); }
.trace-score { color: var(--ink); text-align: right; }
.trace-src { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trace-pick { color: var(--faint); text-align: right; }
.trace-list li.picked .trace-pick { color: var(--accent); }
.trace-snip { grid-column: 2 / -1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.trace-foot { margin-top: 8px; color: var(--faint); line-height: 1.5; }

/* Source jump highlight */
.faq-flash { animation: faq-flash 2.6s var(--ease); }
@keyframes faq-flash {
    0%, 35% { background-color: var(--tint); box-shadow: 0 0 0 8px var(--tint), 0 0 0 9px var(--accent); }
    100% { background-color: transparent; box-shadow: 0 0 0 8px transparent, 0 0 0 9px transparent; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .site-nav { gap: 16px; }
    .site-nav a { font-size: 12.5px; }
    .award-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .award:nth-child(4) { border-left: 0; padding-left: 0; }
}

@media (max-width: 960px) {
    :root { --gutter: 28px; }
    .topbar-inner { flex-wrap: wrap; height: auto; padding-top: 12px; gap: 10px 20px; }
    .topbar-actions { margin-left: auto; }
    .site-nav {
        order: 3; width: 100%; margin: 0 calc(var(--gutter) * -1); padding: 4px var(--gutter) 12px;
        overflow-x: auto; scrollbar-width: none;
        mask-image: linear-gradient(90deg, #000 85%, transparent);
        -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent);
    }
    .site-nav::-webkit-scrollbar { display: none; }
    :root { --topbar: 104px; }
    .hero { grid-template-columns: minmax(0, 1fr); min-height: 0; gap: 48px; }
    .split, .role, .project-featured { grid-template-columns: minmax(0, 1fr); gap: 24px; }
    .about-block { gap: 32px; }
    .row { grid-template-columns: 1fr auto; gap: 10px 24px; }
    .row-date { grid-column: 1 / -1; padding-top: 0; }
    .skill-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .post-row { grid-template-columns: 1fr auto; gap: 8px 24px; }
    .post-date { grid-column: 1 / -1; padding-top: 0; }
    main > section { padding: 80px 0 72px; }
    .about-block { padding-top: 80px; }
    .blog-interactive { margin: 2em 0; }
}

@media (max-width: 640px) {
    :root { --gutter: 16px; }
    body { font-size: 17px; }
    .brand-name { display: none; }
    .hero-title { margin: 16px 0 22px; }
    .lede, .sec-sub { font-size: 18px; }
    .mmr-stage { aspect-ratio: 1 / 1; }
    .marquee-track span { font-size: 24px; }
    .stats { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .stat, .stat:nth-child(even) { padding: 22px 0; border-right: 0; }
    .stat:nth-child(odd) { border-right: 0; }
    .skill-grid { grid-template-columns: 1fr; }
    .award-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .award, .award + .award { padding: 22px 12px 24px 0; border-left: 0; }
    .award:nth-child(even) { padding-left: 16px; border-left: 1px solid var(--rule); }
    .award-num { font-size: 34px; }
    .timeline-label { font-size: 10.5px; }
    .timeline-years span { font-size: 10px; padding-left: 4px; }
    .row-metric b { font-size: 36px; }
    .blog-announcement-date { display: none; }
    .faq-launcher { right: 16px; bottom: 16px; }
    .faq-panel { right: 16px; bottom: 72px; width: calc(100vw - 32px); }
    .footer { padding-bottom: 96px; }
    .palette { padding-top: 10vh; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
    .marquee-track { animation: none; }
    .js .reveal, .js .hero-line, .js .hero .eyebrow, .js .hero .lede, .js .hero-actions, .js .fig-mmr { opacity: 1; transform: none; }
    .timeline-bar { transform: none; }
    .timeline-label { opacity: 1; }
}
