/* ==========================================================================
   Sharoon Sharif · "Tape-out", ink & cobalt
   Light theme or dark theme, following the OS; the header toggle overrides
   and remembers the choice. Flat surfaces, thin grey lines, one blue accent.
   ========================================================================== */

@font-face {
  font-family: "Geist";
  src: url("../fonts/geist-latin-wght.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("../fonts/geist-mono-latin-wght.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/instrument-serif-latin-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/instrument-serif-latin-400-italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --font-display: "Instrument Serif", "Iowan Old Style", Georgia, serif;

  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 14px;
  --header-h: 60px;
  --ease: cubic-bezier(.2, .7, .2, 1);

  /* dark */
  --bg: #0b0c0f;
  --bg-elev: #111318;
  --tile: #111317;
  --tile-2: #171a20;
  --line: #22252b;
  --line-strong: #30343c;
  --ink: #ecedf0;
  --ink-2: #b9bec8;
  --ink-3: #9aa1ad;
  --accent: #7c9dff;
  --accent-2: #a3bbff;
  --accent-ink: #0b0c0f;
  --signal: var(--accent);
  --gold: var(--ink-2);
  --die-sub: #0f1115;
  --die-line: #2c3038;
  --die-fill: #15181d;
  --glow: rgba(124, 157, 255, .12);
  color-scheme: dark;
}

:root[data-theme="light"] {
  /* light */
  --bg: #ffffff;
  --bg-elev: #f6f7f9;
  --tile: #ffffff;
  --tile-2: #f4f5f7;
  --line: #e6e8ec;
  --line-strong: #d3d7de;
  --ink: #0b0d12;
  --ink-2: #3d434f;
  --ink-3: #5b616e;
  --accent: #2b59e8;
  --accent-2: #1e45c4;
  --accent-ink: #ffffff;
  --signal: var(--accent);
  --gold: var(--ink-2);
  --die-sub: #fafbfc;
  --die-line: #c9ced6;
  --die-fill: #f2f4f7;
  --glow: rgba(43, 89, 232, .08);
  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  font: 400 16px/1.62 var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-2); }
img { max-width: 100%; height: auto; display: block; }
strong { font-weight: 600; color: var(--ink); }
em { font-style: italic; }
kbd { font-family: var(--font-mono); font-size: .78em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: color-mix(in oklab, var(--accent) 35%, transparent); color: var(--ink); }

.mono { font-family: var(--font-mono); letter-spacing: .02em; }
.sprite { display: none; }
.icon { width: 1em; height: 1em; flex: none; }
.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; }
.print-only { display: none; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 200; padding: 8px 14px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 12px; }
[hidden] { display: none !important; }

.led { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter);
  height: var(--header-h); display: flex; align-items: center; gap: 20px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; }
.brand-mark { width: 20px; height: 20px; border-radius: 5px; position: relative; background: var(--accent); }
.brand-mark::after { content: ""; position: absolute; inset: 5px; border: 1.5px solid var(--accent-ink); border-radius: 2px; }

.site-nav { margin-left: auto; }
.site-nav ul { display: flex; gap: 2px; margin: 0; padding: 0; list-style: none; }
.site-nav a {
  display: block; padding: 7px 10px; border-radius: 8px;
  font: 500 13px/1 var(--font-sans); color: var(--ink-2); text-decoration: none;
  transition: color .2s, background-color .2s;
}
.site-nav a:hover { color: var(--ink); background: var(--tile-2); }
.site-nav a[aria-current="true"] { color: var(--accent); background: transparent; }

.header-actions { display: flex; align-items: center; gap: 8px; }
.cmdk-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 8px 0 10px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--tile);
  color: var(--ink-3); font: 500 13px var(--font-sans); cursor: pointer;
  transition: border-color .2s, color .2s;
}
.cmdk-btn:hover { border-color: var(--line-strong); color: var(--ink); }
.cmdk-btn kbd, .updated kbd, .cmdk-input kbd {
  padding: 2px 6px; border: 1px solid var(--line); border-radius: 5px; background: var(--bg-elev); color: var(--ink-3);
}
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0;
  border: 1px solid var(--line); border-radius: 9px; background: var(--tile); color: var(--ink-2); cursor: pointer;
  transition: border-color .2s, color .2s;
}
.icon-btn:hover { border-color: var(--line-strong); color: var(--ink); }
.icon-btn .icon { width: 17px; height: 17px; }
.theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }
.menu-btn { display: none; }

.progress {
  position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: var(--accent);
  transform-origin: 0 50%; transform: scaleX(0);
}

/* ---------- Layout ---------- */
main { display: block; }
.section, .hero { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding-top: clamp(72px, 10vw, 120px); }

.sec-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 28px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.sec-no { font-size: 12px; color: var(--accent); padding: 3px 7px; border: 1px solid color-mix(in oklab, var(--accent) 45%, transparent); border-radius: 6px; transform: translateY(-6px); }
.sec-head h2 { margin: 0; font: 400 clamp(2.3rem, 4.6vw, 3.4rem)/1 var(--font-display); letter-spacing: -.01em; }
.sec-aside { margin: 0 0 0 auto; color: var(--ink-3); font-size: 14px; }

/* ---------- Hero ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: clamp(28px, 5vw, 64px);
  align-items: center; padding-top: clamp(40px, 7vw, 88px); padding-bottom: 12px; position: relative;
}
.kicker { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 0 0 22px; font-size: 12px; color: var(--ink-3); }
.focus-tag b { color: var(--accent); font-weight: 500; }
.hero h1 { margin: 0; font: 400 clamp(3.6rem, 9.6vw, 7.6rem)/.9 var(--font-display); letter-spacing: -.025em; }
.hero h1 .n2 { font-style: italic; color: var(--accent); }
.lede { max-width: 34ch; margin: 22px 0 14px; font-size: clamp(1.15rem, 1.9vw, 1.42rem); line-height: 1.45; color: var(--ink); text-wrap: balance; }
.lede em { font-family: var(--font-display); font-size: 1.12em; color: var(--accent); }
.role { margin: 0 0 26px; font-size: 12.5px; color: var(--ink-3); }

.links { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 28px; padding: 0; list-style: none; }
.links a {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--tile);
  color: var(--ink); font-size: 14px; font-weight: 500; text-decoration: none;
  transition: border-color .2s, transform .2s var(--ease), background-color .2s;
}
.links a:hover { border-color: var(--line-strong); }
.links a.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.links a.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.links .icon { width: 16px; height: 16px; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--tile); max-width: 520px; }
.stats li + li { border-left: 1px solid var(--line); }
.stats a { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; color: inherit; text-decoration: none; transition: background-color .2s; }
.stats a:hover { background: var(--tile-2); }
.stats .num { font: 400 2.2rem/1 var(--font-display); color: var(--ink); font-variant-numeric: tabular-nums; }
.stats .lbl { font: 500 10.5px/1.2 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }

/* ---------- Die map ---------- */
.die-wrap { margin: 0; position: relative; }
.die { width: 100%; height: auto; display: block; }
.die-sub { fill: var(--die-sub); stroke: var(--line-strong); stroke-width: 1; }
.die pattern rect, .die pattern path { fill: var(--die-line); }
.die #hatch path { stroke: var(--die-line); stroke-width: 1; fill: none; }
.die #sram rect { fill: color-mix(in oklab, var(--ink-3) 30%, var(--die-sub)); }
.die #pe rect { fill: color-mix(in oklab, var(--accent) 18%, var(--die-sub)); }
.die-seal { fill: none; stroke: var(--die-line); stroke-width: 2; stroke-dasharray: 1 3; }
.die-routes path { fill: none; stroke: var(--die-line); stroke-width: 2; }
.die-routes .bus { stroke-width: 4; stroke: color-mix(in oklab, var(--die-line) 60%, transparent); }
.die-pkts path { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 3 97; opacity: .9; }
.die-mark { font: 500 9px var(--font-mono); letter-spacing: .14em; fill: var(--ink-3); }

.blk { cursor: pointer; outline: none; }
.blk-body, .blk-static .blk-body { fill: var(--die-fill); stroke: var(--die-line); stroke-width: 1.5; transition: fill .25s, stroke .25s; }
.blk-fill { opacity: .9; transition: opacity .25s; }
.blk-name { font: 600 12px var(--font-mono); letter-spacing: .08em; fill: var(--ink); }
.blk-sub { font: 500 8.5px var(--font-mono); letter-spacing: .1em; fill: var(--ink-3); }
.blk-wave { fill: none; stroke: var(--accent); stroke-width: 1.75; opacity: .85; }
.blk-noc circle { fill: var(--die-sub); stroke: var(--accent); stroke-width: 1.5; }
.blk-noc path { stroke: var(--die-line); stroke-width: 1.5; fill: none; }
.blk:hover .blk-body, .blk:focus-visible .blk-body, .blk.on .blk-body {
  fill: color-mix(in oklab, var(--accent) 10%, var(--die-fill)); stroke: var(--accent);
}
.blk:hover .blk-name, .blk:focus-visible .blk-name, .blk.on .blk-name { fill: var(--accent); }
.blk:focus-visible .blk-body { stroke-width: 3; }
.die-cap { display: flex; justify-content: space-between; gap: 12px; margin-top: 12px; font-size: 11.5px; color: var(--ink-3); }
.die-readout { color: var(--ink-2); text-align: right; }

/* ---------- Tiles, bento ---------- */
.bento { display: grid; gap: 14px; }
.tile {
  position: relative; isolation: isolate;
  padding: 22px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--tile);
  transition: border-color .2s;
}
.spot:hover { border-color: var(--line-strong); }
.tile > :first-child { margin-top: 0; }
.tile > :last-child { margin-bottom: 0; }
.tile-label { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }


.about-grid { grid-template-columns: 1.05fr 1.4fr 1fr; grid-template-areas: "p bio now" "p bio stack" "int int free"; }
.tile-portrait { grid-area: p; padding: 0; overflow: hidden; margin: 0; }
.tile-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 70%; aspect-ratio: 4 / 5; }
.tile-bio { grid-area: bio; }
.tile-bio .bio { font-size: 1.08rem; color: var(--ink); }
.tile-bio p { color: var(--ink-2); }
.tile-now { grid-area: now; }
.tile-now p:last-child { color: var(--ink-2); }
.tile-stack { grid-area: stack; }
.tile-interests { grid-area: int; }
.tile-free { grid-area: free; }
.tile-free p:last-child { color: var(--ink-2); }
.stack { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; counter-reset: s; font-size: 13px; }
.stack li { counter-increment: s; display: flex; align-items: center; gap: 10px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-elev); color: var(--ink-2); }
.stack li::before { content: "L" counter(s); color: var(--accent); font-size: 11px; }
.stack li:last-child { border-color: var(--accent); color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.chips li { padding: 6px 11px; border: 1px solid var(--line); border-radius: 999px; font-size: 13.5px; color: var(--ink-2); background: var(--bg-elev); }

.theme-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.theme { grid-column: span 2; display: flex; flex-direction: column; }
.t-isa, .t-accel { grid-column: span 3; }
.t-swarm { grid-column: span 4; }
.tile-other { grid-column: span 2; }
.theme h3 { margin: 6px 0 8px; font: 400 1.7rem/1.1 var(--font-display); letter-spacing: -.005em; }
.theme > p:not(.tile-label):not(.card-links) { margin: 0 0 14px; color: var(--ink-2); font-size: 15px; }
.theme.on, .theme.match { border-color: var(--accent); }
.theme.match .tile-label::after { content: "· matches focus"; color: var(--accent); }
.diagram { width: 100%; max-width: 360px; height: auto; margin: 4px 0 10px; overflow: visible; }
.d-box { fill: var(--bg-elev); stroke: var(--line-strong); stroke-width: 1; }
.d-box.hot { fill: color-mix(in oklab, var(--accent) 8%, var(--bg-elev)); stroke: var(--accent); }
.d-box.dim { stroke-dasharray: 3 3; }
.d-node { fill: var(--bg-elev); stroke: var(--accent); }
.d-txt { font: 600 9.5px var(--font-mono); letter-spacing: .06em; fill: var(--ink); text-anchor: middle; }
.d-sub { font: 500 7.5px var(--font-mono); letter-spacing: .1em; fill: var(--ink-3); text-anchor: middle; }
.d-wire { fill: none; stroke: var(--line-strong); stroke-width: 1.5; }
.d-pulse { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 4 96; stroke-dashoffset: 100; opacity: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; padding: 0; list-style: none; }
.tags li { padding: 3px 8px; border-radius: 6px; font: 500 11.5px var(--font-mono); color: var(--ink-3); background: var(--bg-elev); border: 1px solid var(--line); }
.card-links { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: auto 0 0; padding-top: 12px; border-top: 1px dashed var(--line); font-size: 12.5px; }
.card-links a { text-decoration: none; }
.card-links a:hover { text-decoration: underline; }
.compact { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; font-size: 14px; color: var(--ink-2); }
.compact li { padding-left: 14px; position: relative; }
.compact li::before { content: ""; position: absolute; left: 0; top: .7em; width: 6px; height: 1px; background: var(--accent); }

/* ---------- News ---------- */
.news { margin: 0; padding: 0; list-style: none; border-left: 1px solid var(--line); margin-left: 6px; }
.news li { position: relative; display: grid; grid-template-columns: 110px 1fr; gap: 18px; padding: 12px 0 12px 22px; }
.news li::before { content: ""; position: absolute; left: -5px; top: 21px; width: 9px; height: 9px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); }
.news li:first-child::before { background: var(--accent); }
.news time { font-size: 12.5px; color: var(--ink-3); padding-top: 3px; }
.news p { margin: 0; color: var(--ink-2); }

/* ---------- Publications ---------- */
.pub-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--tile);
  font: 500 12.5px var(--font-mono); letter-spacing: .02em; color: var(--ink-2); text-decoration: none; cursor: pointer;
  transition: border-color .2s, color .2s, background-color .2s;
}
.btn:hover { border-color: var(--line-strong); color: var(--ink); }
.pub-filters .btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.filter-count { min-height: 1.4em; margin: 6px 0 4px; font-size: 12px; color: var(--ink-3); }
.pub-group { margin-top: 26px; }
.pub-group > h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font: 500 12px var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.pub-group > h3::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.pubs { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.pub {
  position: relative; padding: 18px 20px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--tile); transition: border-color .25s, transform .25s var(--ease);
}
.pub:hover { border-color: var(--line-strong); }
.pub:target, .pub.match { border-color: var(--accent); box-shadow: 0 0 0 3px var(--glow); }
.pub-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
.pub-addr { font: 500 11px var(--font-mono); color: var(--ink-3); margin-right: 2px; }
.badge { padding: 2px 8px; border-radius: 999px; font: 500 10.5px var(--font-mono); letter-spacing: .06em; text-transform: uppercase; border: 1px solid var(--line); color: var(--ink-2); }
.badge.status-published { color: var(--accent); border-color: color-mix(in oklab, var(--accent) 45%, transparent); }
.badge.status-under-review, .badge.status-submitted { color: var(--ink-2); border-color: var(--line-strong); }
.badge.status-in-preparation { color: var(--ink-3); border-style: dashed; }
.badge.featured, .badge.award, .badge.match { color: var(--accent); border-color: color-mix(in oklab, var(--accent) 55%, transparent); }
.pub-title { margin: 0 0 4px; font-size: 1.06rem; font-weight: 550; line-height: 1.4; color: var(--ink); text-wrap: pretty; }
.pub-authors { margin: 0 0 2px; font-size: 14px; color: var(--ink-2); }
.pub-authors strong { color: var(--ink); text-decoration: underline; text-decoration-color: color-mix(in oklab, var(--accent) 70%, transparent); text-underline-offset: 3px; }
.pub-venue { margin: 0; font-size: 14px; color: var(--ink-3); }
.pub-venue em { font-family: var(--font-display); font-size: 1.12em; color: var(--ink-2); }
.pub-summary { margin: 10px 0 0; font-size: 14px; color: var(--ink-2); }
.pub-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.pub-actions .btn { min-height: 28px; padding: 0 10px; font-size: 11.5px; }
.pub-abstract { margin-top: 12px; padding: 14px 16px; border-radius: 10px; background: var(--bg-elev); font-size: 14px; color: var(--ink-2); }
.pub-abstract p { margin: 0; }
.pub-bibtex { margin: 12px 0 0; padding: 14px 16px; overflow-x: auto; border-radius: 10px; background: var(--bg-elev); font: 12px/1.5 var(--font-mono); color: var(--ink-2); white-space: pre; }
mark.todo { background: var(--glow); color: var(--ink); padding: 0 4px; border-radius: 4px; }

/* ---------- Talks gallery ---------- */
.gallery { display: grid; grid-template-columns: 1.5fr 1.5fr 1fr; gap: 14px; }
.shot { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.shot-btn { display: block; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--tile); cursor: zoom-in; position: relative; }
.shot-btn img { width: 100%; height: 340px; object-fit: cover; transition: transform .6s var(--ease), filter .4s; }
.shot-tall .shot-btn img { object-position: 50% 45%; }
.shot-btn:hover img { transform: scale(1.035); }
.shot figcaption { font-size: 14px; color: var(--ink-2); }
.shot figcaption .mono { display: block; margin-bottom: 2px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.honors { margin: 34px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.honors li { display: flex; justify-content: space-between; gap: 18px; padding: 14px 2px; border-bottom: 1px solid var(--line); color: var(--ink-2); }
.honors .when { flex: none; font-size: 12.5px; color: var(--ink-3); }

.lightbox { padding: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--tile); color: var(--ink); max-width: min(1100px, 94vw); max-height: 94vh; overflow: hidden; }
.lightbox::backdrop { background: rgba(5, 6, 8, .78); backdrop-filter: blur(6px); }
.lightbox img { max-width: 100%; max-height: 80vh; width: auto; margin: 0 auto; }
.lightbox-cap { margin: 0; padding: 12px 18px 16px; font-size: 14px; color: var(--ink-2); }
.lightbox-close { position: absolute; top: 10px; right: 10px; background: color-mix(in oklab, var(--tile) 85%, transparent); }

/* ---------- Experience ---------- */
.two-col { display: grid; grid-template-columns: 1.5fr 1fr; gap: clamp(24px, 4vw, 56px); }
.col-head { margin: 0 0 14px; font-size: 12px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.timeline { margin: 0; padding: 0; list-style: none; }
.timeline > li { position: relative; padding: 0 0 26px 24px; border-left: 1px solid var(--line); }
.timeline > li:last-child { padding-bottom: 4px; }
.timeline > li::before { content: ""; position: absolute; left: -4px; top: 9px; width: 7px; height: 7px; border-radius: 2px; background: var(--bg); border: 1.5px solid var(--accent); transform: rotate(45deg); }
.entry-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px; }
.entry-head h4 { margin: 0; font-size: 1.04rem; font-weight: 600; }
.when { font-size: 12.5px; color: var(--ink-3); }
.where { margin: 2px 0 6px; color: var(--accent); font-size: 14px; }
.timeline p, .timeline ul { color: var(--ink-2); font-size: 14.5px; margin: 0; }
.timeline ul { padding-left: 18px; }

/* ---------- Footer ---------- */
.site-footer { margin-top: clamp(80px, 12vw, 140px); border-top: 1px solid var(--line); background: var(--bg-elev); }
.footer-inner { max-width: var(--wrap); margin: 0 auto; padding: 56px var(--gutter) 40px; }
.contact-line { max-width: 40ch; margin: 0 0 18px; font: 400 clamp(1.6rem, 3.6vw, 2.5rem)/1.2 var(--font-display); color: var(--ink); }
.big-link { color: var(--accent); text-decoration: none; border-bottom: 1px solid color-mix(in oklab, var(--accent) 50%, transparent); font-style: italic; }
.footer-meta { display: flex; align-items: center; gap: 8px; color: var(--ink-3); }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; }
.footer-links a { color: var(--ink-2); text-decoration: none; }
.footer-links a:hover { color: var(--accent); }
.chess { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); }
.chess .hint { font-size: 12px; color: var(--ink-3); }
.updated { margin-top: 28px; font-size: 12px; color: var(--ink-3); }

/* ---------- Command palette ---------- */
.cmdk { padding: 0; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--tile); color: var(--ink); width: min(640px, 92vw); margin-top: 12vh; box-shadow: 0 24px 64px -24px rgba(0, 0, 0, .45); overflow: hidden; }
.cmdk::backdrop { background: rgba(5, 6, 8, .55); backdrop-filter: blur(4px); }
.cmdk-input { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--ink-3); }
.cmdk-input .icon { width: 18px; height: 18px; }
.cmdk-input input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: 400 16px var(--font-sans); }
.cmdk-list { list-style: none; margin: 0; padding: 8px; max-height: min(420px, 56vh); overflow-y: auto; }
.cmdk-list .grp { padding: 10px 10px 4px; font: 500 10.5px var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.cmdk-list [role="option"] { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 10px; border-radius: 8px; cursor: pointer; color: var(--ink-2); font-size: 14.5px; }
.cmdk-list [role="option"] .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmdk-list [role="option"] .k { flex: none; font: 500 11px var(--font-mono); color: var(--ink-3); }
.cmdk-list [aria-selected="true"] { background: var(--tile-2); color: var(--ink); box-shadow: inset 2px 0 0 var(--accent); }
.cmdk-list .empty { padding: 18px 10px; color: var(--ink-3); font-size: 14px; }
.cmdk-foot { display: flex; gap: 16px; margin: 0; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 11px; color: var(--ink-3); }

/* ---------- Theme switch: circular reveal from the toggle ---------- */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { animation: theme-reveal .6s var(--ease); }
@keyframes theme-reveal {
  from { clip-path: circle(0 at var(--vt-x, 100%) var(--vt-y, 0)); }
  to { clip-path: circle(var(--vt-r, 150vmax) at var(--vt-x, 100%) var(--vt-y, 0)); }
}

/* ---------- Motion (only when the visitor hasn't asked for less) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hero-copy > *, .die-wrap { animation: rise .9s var(--ease) both; }
  .hero-copy > :nth-child(2) { animation-delay: .06s; }
  .hero-copy > :nth-child(3) { animation-delay: .14s; }
  .hero-copy > :nth-child(4) { animation-delay: .2s; }
  .hero-copy > :nth-child(6) { animation-delay: .26s; }
  .hero-copy > :nth-child(7) { animation-delay: .32s; }
  .die-wrap { animation-delay: .18s; animation-duration: 1.2s; }
  .die-pkts path { animation: packet 5.5s linear infinite; }
  .die-pkts path:nth-child(2) { animation-duration: 7s; animation-delay: -2s; }
  .die-pkts path:nth-child(3) { animation-duration: 4.5s; animation-delay: -1s; }
  .theme:hover .d-pulse, .theme.on .d-pulse { opacity: 1; animation: pulse 1.6s linear infinite; }

  @supports (animation-timeline: view()) {
    .reveal { animation: reveal linear both; animation-timeline: view(); animation-range: entry 0% entry 55%; }
  }
  @supports (animation-timeline: scroll()) {
    .progress { animation: grow linear both; animation-timeline: scroll(root block); }
  }
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes reveal { from { opacity: 0; transform: translateY(26px) scale(.985); } }
@keyframes grow { to { transform: scaleX(1); } }
@keyframes packet { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }
@keyframes pulse { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }

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

/* ---------- Responsive ---------- */
@media (max-width: 1040px) {
  .site-nav a { padding: 7px 7px; }
  .cmdk-btn-label { display: none; }
}
@media (max-width: 900px) {
  .menu-btn { display: inline-grid; }
  .site-nav {
    position: absolute; top: calc(var(--header-h) + 1px); left: 0; right: 0; margin: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
    display: none; padding: 8px var(--gutter) 14px;
  }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; }
  .site-nav a { padding: 12px 8px; font-size: 15px; }
  .header-actions { margin-left: auto; }
  .hero { grid-template-columns: 1fr; }
  .die-wrap { max-width: 520px; width: 100%; justify-self: center; }
  .about-grid { grid-template-columns: 1fr 1fr; grid-template-areas: "p bio" "p bio" "now stack" "int int" "free free"; }
  .theme-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .theme, .t-isa, .t-accel, .t-swarm, .tile-other { grid-column: span 1; }
  .t-swarm, .tile-other { grid-column: span 2; }
  .gallery { grid-template-columns: 1fr 1fr; }
  .shot-tall { grid-column: span 2; }
  .shot-tall .shot-btn img { height: 420px; }
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 15.5px; }
  .about-grid { grid-template-columns: 1fr; grid-template-areas: "p" "bio" "now" "stack" "int" "free"; }
  .tile-portrait img { aspect-ratio: 4 / 5; }
  .theme-grid { grid-template-columns: 1fr; }
  .t-swarm, .tile-other { grid-column: span 1; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats li:nth-child(3) { border-left: 0; }
  .stats li:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .gallery { grid-template-columns: 1fr; }
  .shot-tall { grid-column: auto; }
  .shot-btn img { height: auto; aspect-ratio: 4 / 3; }
  .shot-tall .shot-btn img { height: auto; aspect-ratio: 4 / 5; }
  .news li { grid-template-columns: 1fr; gap: 2px; }
  .sec-aside { margin-left: 0; width: 100%; }
  .honors li { flex-direction: column; gap: 2px; }
  .die-cap { flex-direction: column; }
  .die-readout { text-align: left; }
  .pub { padding: 16px; }
}

/* ---------- Print ---------- */
@media print {
  :root, :root[data-theme="light"] { --bg: #fff; --tile: #fff; --ink: #000; --ink-2: #222; --ink-3: #444; --line: #ccc; --accent: #000; --accent-2: #000; }
  .site-header, .skip-link, .die-wrap, .gallery, .cmdk, .lightbox, .pub-filters, .filter-count, .pub-actions, .stats, .links, .diagram, .chess, .tile-portrait, .tile-stack, .updated kbd { display: none !important; }
  .print-only { display: block; }
  .hero { display: block; padding-top: 0; }
  .hero h1 { font-size: 34pt; }
  .tile, .pub { box-shadow: none; border-color: #ccc; break-inside: avoid; }
  .section { padding-top: 24px; }
  .about-grid, .theme-grid, .two-col { display: block; }
  .theme, .tile { margin-bottom: 10px; }
  a { color: #000; text-decoration: none; }
  .reveal { animation: none !important; opacity: 1 !important; transform: none !important; }
}
