/* ==========================================================================
   Nikhil Mourya · portfolio
   "Graphite & Brass": warm graphite, paper-white type, a silver-print portrait
   and one muted brass accent, used sparingly. Slate for the rare second state.
   Flat colour, no glows. No framework.
   ========================================================================== */

:root {
  /* palette: every colour on the site (CSS and canvases) comes from these */
  --bg: #0b0b0a;              /* graphite */
  --bg-1: #111110;
  --bg-2: #171715;
  --fg: #ecebe6;              /* paper */
  --fg-rgb: 236, 235, 230;
  --w-rgb: 236, 233, 224;     /* hairlines and washes */
  --hi-rgb: 250, 244, 230;    /* brightest glyphs in the hero field */
  --accent: #cdb07c;          /* brass: the headline word, live dots, key numbers */
  --accent-rgb: 205, 176, 124;
  --accent-ink: #17120a;      /* text on the accent */
  --accent-2: #cdb07c;        /* labels: decoded glyphs, cursor trail (brass too, for now) */
  --accent-2-rgb: 205, 176, 124;
  --accent-3: #93a3b4;        /* slate, the rare second state: swapped, refused, rejected */
  --accent-3-rgb: 147, 163, 180;
  --portrait-lo: 10, 10, 9;   /* silver print: shadows, mids, highlights */
  --portrait-mid: 126, 124, 119;
  --portrait-hi: 242, 238, 227;

  --fg-2: rgba(var(--fg-rgb), 0.64);
  --fg-3: rgba(var(--fg-rgb), 0.42);
  --fg-4: rgba(var(--fg-rgb), 0.22);
  --line: rgba(var(--w-rgb), 0.07);
  --line-2: rgba(var(--w-rgb), 0.11);
  --line-3: rgba(var(--w-rgb), 0.2);

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

  --max: 1160px;
  --pad: 32px;
  --r: 14px;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);

  color-scheme: dark;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
/* grain: a whisper of texture so the graphite does not read as a flat screen colour */
body::after {
  content: ''; position: fixed; inset: 0; z-index: 90; pointer-events: none;
  opacity: 0.035;
  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='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 0.98  0 0 0 0 0.94  0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p, dl, dd, ol, ul, figure, pre { margin: 0; }
ol, ul { padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
strong { font-weight: 500; color: var(--fg); }
code { font: 400 0.86em var(--mono); color: var(--fg); background: var(--bg-2); border: 1px solid var(--line-2); padding: 1px 6px; border-radius: 6px; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.skip {
  position: fixed; top: 10px; left: 10px; z-index: 200;
  padding: 10px 14px; border-radius: 8px; background: var(--fg); color: var(--bg);
  font: 500 13px/1 var(--sans); transform: translateY(-200%);
}
.skip:focus { transform: none; }

/* ---------- primitives ---------- */
.wrap { position: relative; width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }
.dim { color: var(--fg-3); }
.accent { color: var(--accent); }

.led {
  display: inline-block; flex: none;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.16);
  animation: led 2.6s ease-in-out infinite;
}
@keyframes led { 50% { box-shadow: 0 0 0 5px rgba(var(--accent-rgb), 0.04); } }

.cursor {
  display: inline-block;
  width: 0.08em; height: 0.82em;
  margin-left: 0.08em;
  vertical-align: -0.06em;
  background: var(--accent);
  animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.viz__label { font: 400 11px/1.4 var(--mono); color: var(--fg-3); }

.tag { display: inline-flex; align-items: center; gap: 12px; font: 400 13px/1 var(--mono); color: var(--fg-2); }
.tag span { color: var(--accent); }
.tag span::after { content: ''; display: inline-block; width: 18px; height: 1px; margin-left: 12px; vertical-align: middle; background: var(--line-3); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  height: 46px; padding: 0 20px;
  border-radius: 10px;
  border: 1px solid transparent;
  font: 500 15px/1 var(--sans);
  white-space: nowrap;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
.btn span { transition: transform 0.2s var(--ease); }
.btn:hover span { transform: translate(2px, -1px); }
.btn--primary { background: var(--fg); color: var(--bg); }
.btn--primary:hover { background: var(--accent); color: var(--accent-ink); }
.btn--ghost { border-color: var(--line-3); color: var(--fg); background: rgba(var(--w-rgb), 0.02); }
.btn--ghost:hover { border-color: var(--fg-3); background: rgba(var(--w-rgb), 0.05); }
.btn--sm { height: 38px; padding: 0 14px; font-size: 14px; border-radius: 9px; }
.btn--lg { height: 54px; padding: 0 24px; font-size: 16px; }
.btn.is-copied { color: var(--accent); border-color: rgba(var(--accent-rgb), 0.4); }

.textlink {
  display: inline-flex; align-items: center; gap: 6px;
  font: 500 14px/1 var(--sans);
  color: var(--fg-2);
  padding: 6px 0;
  transition: color 0.2s;
}
.textlink:hover { color: var(--accent); }

.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pills li {
  font: 400 12px/1 var(--mono);
  color: var(--fg-2);
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
}

/* ---------- section scaffolding ---------- */
.section { position: relative; padding: 112px 0; }

/* Axon: a hairline divider with a travelling pulse */
.axon {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: min(var(--max) - 2 * var(--pad), 100% - 2 * var(--pad));
  height: 1px;
  background: var(--line-2);
}
.axon::before, .axon::after {
  content: ''; position: absolute; top: -3px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--bg); border: 1px solid var(--line-3);
}
.axon::before { left: 0; }
.axon::after { right: 0; }
.axon i {
  position: absolute; top: -1px; left: 0; width: 72px; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, transparent, var(--accent));
  opacity: 0;
}
.section.is-lit .axon i { animation: axon 4.2s var(--ease) infinite; }
@keyframes axon {
  0% { left: 0; opacity: 0; }
  10%, 70% { opacity: 1; }
  82%, 100% { left: calc(100% - 72px); opacity: 0; }
}

.shead { display: grid; gap: 20px; margin-bottom: 56px; max-width: 780px; }
.shead__title {
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 450;
  line-height: 1.08;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.shead__desc { max-width: 38em; color: var(--fg-2); font-size: 17px; }

[data-reveal] { opacity: 0; transform: translateY(16px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); transition-delay: var(--d, 0s); }
[data-reveal].is-in { opacity: 1; transform: none; }
.no-js [data-reveal] { opacity: 1; transform: none; }

/* ==========================================================================
   Nav
   ========================================================================== */
.nav { position: fixed; top: 16px; left: 0; right: 0; z-index: 80; padding: 0 16px; pointer-events: none; }
.nav__capsule {
  pointer-events: auto;
  display: flex; align-items: center; gap: 6px;
  width: fit-content; max-width: 100%; margin: 0 auto;
  height: 50px; padding: 0 7px 0 16px;
  border-radius: 999px;
  background: rgba(16, 16, 15, 0.6);
  border: 1px solid var(--line-2);
  -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%);
  box-shadow: 0 12px 32px -18px rgba(0, 0, 0, 0.9);
  transition: background-color 0.3s;
}
.nav.is-scrolled .nav__capsule { background: rgba(13, 13, 12, 0.85); }
.brand { display: inline-flex; align-items: center; gap: 10px; padding-right: 12px; margin-right: 2px; border-right: 1px solid var(--line-2); font-size: 14px; font-weight: 500; letter-spacing: -0.01em; }
.brand__mark { width: 18px; height: 18px; }
.brand__mark path { stroke: var(--fg-4); stroke-width: 1.2; fill: none; }
.brand__mark circle { fill: var(--bg); stroke: var(--fg-2); stroke-width: 1.2; }
.brand__mark .core { fill: var(--accent); stroke: var(--accent); }
.nav__links { display: flex; gap: 2px; }
.nav__links a { padding: 8px 13px; border-radius: 999px; font-size: 14px; color: var(--fg-3); transition: color 0.2s, background-color 0.2s; }
.nav__links a:hover { color: var(--fg); }
.nav__links a.is-active { color: var(--fg); background: rgba(var(--w-rgb), 0.06); }
.nav__status {
  display: inline-flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 13px; margin-left: 2px;
  border-radius: 999px; border: 1px solid var(--line);
  font: 400 12px/1 var(--mono); color: var(--fg-3);
}
.nav__status b { font-weight: 400; color: var(--fg-2); font-variant-numeric: tabular-nums; }
.nav__toggle { display: none; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line-2); position: relative; }
.nav__toggle span { position: absolute; left: 12px; right: 12px; height: 1.5px; background: var(--fg); transition: transform 0.3s var(--ease); }
.nav__toggle span:first-child { top: 15px; }
.nav__toggle span:last-child { top: 21px; }
.nav.is-open .nav__toggle span:first-child { transform: translateY(3px) rotate(45deg); }
.nav.is-open .nav__toggle span:last-child { transform: translateY(-3px) rotate(-45deg); }
.mobile-menu {
  pointer-events: auto;
  max-width: 420px; margin: 10px auto 0; padding: 8px;
  border-radius: 18px; border: 1px solid var(--line-2);
  background: rgba(13, 13, 12, 0.95);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.mobile-menu a { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 12px; font-size: 20px; letter-spacing: -0.02em; }
.mobile-menu a:hover { background: rgba(var(--w-rgb), 0.05); }
.mobile-menu a span { font: 400 11px/1 var(--mono); color: var(--accent); }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 136px 0 56px;
  overflow: hidden;
  isolation: isolate;
}
.hero__field {
  position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1;
  opacity: 0.8;
  -webkit-mask-image: radial-gradient(ellipse 75% 70% at 68% 40%, #000 35%, transparent 100%), linear-gradient(#000 55%, transparent 82%);
  -webkit-mask-composite: source-in;
  mask-image: radial-gradient(ellipse 75% 70% at 68% 40%, #000 35%, transparent 100%), linear-gradient(#000 55%, transparent 82%);
  mask-composite: intersect;
}
.hero__grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr); gap: 48px; align-items: center; }

.status-pill {
  display: inline-flex; align-items: center; gap: 10px;
  height: 32px; padding: 0 14px 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: rgba(16, 16, 15, 0.7);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font-size: 13px; font-weight: 500;
  margin-bottom: 32px;
  transition: border-color 0.2s;
}
.status-pill:hover { border-color: var(--line-3); }
.status-pill__sep { width: 1px; height: 13px; background: var(--line-3); }
.status-pill__dim { color: var(--fg-3); font-weight: 400; }

.hero__title {
  font-size: clamp(38px, 3.9vw, 56px);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.045em;
}
.hero__title .line { display: block; white-space: nowrap; }
.hero__key { color: var(--accent); }
.hero__prompt { margin-bottom: 18px; font: 400 14px/1.4 var(--mono); color: var(--fg-3); }
.hero__prompt .p { color: var(--accent); margin-right: 4px; }
.hero__prompt .s { color: rgba(var(--accent-rgb), 0.75); }
.hero__name { color: var(--fg); }
.tk-new { animation: tkIn 0.5s var(--ease); }
@keyframes tkIn { from { color: var(--accent); } }
.hero__gen { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin-top: 18px; font: 400 12px/1.4 var(--mono); color: var(--fg-3); cursor: help; }
.hero__gen b { font-weight: 500; color: var(--fg-2); font-variant-numeric: tabular-nums; }
.hero__gen span { white-space: nowrap; }
.hero__gen i { font-style: normal; color: var(--fg-4); }

.hero__lede { margin-top: 22px; max-width: 34em; font-size: clamp(16px, 1.3vw, 18px); line-height: 1.65; color: var(--fg-2); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }

/* Portrait */
.portrait {
  justify-self: end;
  width: 100%; max-width: 240px;
  border-radius: var(--r);
  border: 1px solid var(--line-2);
  background: var(--bg-1);
  overflow: hidden;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.9);
}
.portrait__bar, .portrait__foot {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  height: 36px; padding: 0 14px;
  font: 400 11px/1 var(--mono); color: var(--fg-2);
}
.portrait__bar { border-bottom: 1px solid var(--line); }
.portrait__bar > span:first-child { display: inline-flex; align-items: center; gap: 8px; }
.portrait__foot { border-top: 1px solid var(--line); color: var(--fg-3); }
.portrait__foot { gap: 8px; padding: 0 12px; font-size: 10.5px; white-space: nowrap; }
.portrait__img { position: relative; aspect-ratio: 4 / 5; background: #080807; }
.portrait__img canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.portrait__img::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.08) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at 50% 42%, transparent 68%, rgba(8, 8, 7, 0.3));
}
.loss { display: inline-flex; align-items: center; gap: 6px; }
.loss svg { flex: none; width: 38px; height: 14px; }
.loss path { fill: none; stroke: var(--accent); stroke-width: 1.2; }
.loss b { font-weight: 400; color: var(--fg-2); font-variant-numeric: tabular-nums; min-width: 32px; text-align: right; }

/* Facts row */
.facts {
  display: grid; grid-template-columns: repeat(4, 1fr);
  margin-top: 80px; padding-top: 22px;
  border-top: 1px solid var(--line-2);
}
.facts > div { padding-right: 20px; }
.facts dt { font: 400 11px/1 var(--mono); color: var(--fg-3); margin-bottom: 8px; }
.facts dd { font-size: 15px; color: var(--fg-2); line-height: 1.45; }
.facts a { color: var(--fg); border-bottom: 1px solid var(--line-3); transition: color 0.2s, border-color 0.2s; }
.facts a:hover { color: var(--accent); border-color: var(--accent); }

/* ==========================================================================
   About
   ========================================================================== */
.about { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 64px; align-items: start; }
.about__text > p { font-size: 17px; line-height: 1.7; color: var(--fg-2); max-width: 36em; }
.about__text > p + p { margin-top: 18px; }
.about__text > p:first-child { font-size: 21px; line-height: 1.55; color: var(--fg); letter-spacing: -0.012em; }
.stack { margin-top: 40px; border-top: 1px solid var(--line); }
.stack__row { display: grid; grid-template-columns: 110px 1fr; gap: 16px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--line); }
.stack__k { font: 400 12px/1.4 var(--mono); color: var(--fg-3); }

.info { border-radius: var(--r); border: 1px solid var(--line-2); background: var(--bg-1); }
.info__bar { display: flex; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); font: 400 12px/1 var(--mono); color: var(--fg-2); }
.info__bar .p { color: var(--accent); }
.info dl { padding: 6px 16px 10px; font: 400 13px/1.4 var(--mono); }
.info dl div { display: grid; grid-template-columns: 80px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.info dl div:last-child { border-bottom: 0; }
.info dt { color: var(--fg-3); }
.info dd { color: var(--fg); }
.info dd a:hover { color: var(--accent); }
.info .ok { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); }

/* ==========================================================================
   Experience
   ========================================================================== */
.timeline { position: relative; border-top: 1px solid var(--line-2); }
.role { position: relative; display: grid; grid-template-columns: 140px 1fr; gap: 32px; padding: 36px 0; border-bottom: 1px solid var(--line); }
.role__dot { position: absolute; left: 110px; top: 44px; width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--line-3); background: var(--bg); transition: border-color 0.4s; }
.role.is-in .role__dot { border-color: var(--accent); }
.role__dot.is-live { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.14); }
.role__when { font: 400 13px/1.9 var(--mono); color: var(--fg-3); }
.role__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; }
.role h3 { font-size: 24px; font-weight: 500; letter-spacing: -0.025em; line-height: 1.2; }
.role h3 a { transition: color 0.2s; }
.role h3 a span { color: var(--fg-4); font-size: 0.7em; transition: color 0.2s; }
.role h3 a:hover, .role h3 a:hover span { color: var(--accent); }
.role__title { font: 400 13px/1.4 var(--mono); color: var(--fg-3); }
.role__text { margin-top: 12px; color: var(--fg-2); max-width: 44em; }
.role__points { margin-top: 14px; display: grid; gap: 8px; color: var(--fg-2); max-width: 46em; }
.role__points li { position: relative; padding-left: 20px; }
.role__points li::before { content: ''; position: absolute; left: 0; top: 0.8em; width: 8px; height: 1px; background: var(--fg-4); }
.role__nums { display: flex; flex-wrap: wrap; gap: 12px 40px; margin-top: 22px; }
.role__nums b { display: block; font-size: 24px; font-weight: 500; letter-spacing: -0.03em; line-height: 1.1; color: var(--accent); font-variant-numeric: tabular-nums; }
.role__nums span { font-size: 13px; color: var(--fg-3); }

.honors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; margin-top: 48px; }
.honor { padding-top: 18px; border-top: 1px solid var(--line-2); }
.honor__k { font: 400 12px/1 var(--mono); color: var(--fg-3); }
.honor b { display: block; margin-top: 10px; font-size: 17px; font-weight: 500; letter-spacing: -0.015em; }
.honor > span:last-child { display: block; margin-top: 4px; font-size: 14px; color: var(--fg-3); }

/* ==========================================================================
   Projects
   ========================================================================== */
.feature {
  display: grid; grid-template-columns: 1.2fr 0.8fr;
  margin-bottom: 20px;
  border-radius: 18px;
  border: 1px solid var(--line-2);
  background: linear-gradient(180deg, rgba(var(--w-rgb), 0.02), rgba(var(--w-rgb), 0.008));
  overflow: hidden;
}
.feature__info { padding: 36px 40px 34px; display: flex; flex-direction: column; }
.feature--flip .feature__info { order: 2; }
.feature__top { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.feature__kicker { font: 400 12px/1 var(--mono); color: var(--accent); }
.feature__meta { display: inline-flex; gap: 14px; font: 400 12px/1 var(--mono); color: var(--fg-3); }
.feature__meta a { transition: color 0.2s; }
.feature__meta a:hover { color: var(--fg); }
.feature__meta b { font-weight: 400; color: var(--fg-2); font-variant-numeric: tabular-nums; }
.feature__name { margin-top: 16px; font-size: clamp(28px, 2.8vw, 36px); font-weight: 500; letter-spacing: -0.035em; line-height: 1; }
.feature__tagline { margin-top: 12px; font-size: 17px; line-height: 1.45; color: var(--fg); max-width: 28em; }
.feature__text { margin-top: 12px; font-size: 15px; color: var(--fg-2); max-width: 38em; }
.feature__credit { margin-top: 10px; font-size: 13.5px; color: var(--fg-3); }
.feature__credit a { color: var(--fg-2); border-bottom: 1px solid var(--line-3); }
.feature__credit a:hover { color: var(--accent); border-color: var(--accent); }
.feature__links { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: auto; padding-top: 26px; }

.metrics { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 24px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.metrics > div { padding: 16px 16px 14px 0; }
.metrics > div + div { padding-left: 16px; border-left: 1px solid var(--line); }
.metrics dd { font-size: 22px; font-weight: 500; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.metrics .is-hot dd { color: var(--accent); }
.metrics dt { margin-top: 8px; font-size: 12.5px; line-height: 1.4; color: var(--fg-3); }

.feature__viz {
  display: flex; flex-direction: column; gap: 16px;
  padding: 22px 24px 26px;
  border-left: 1px solid var(--line);
  background: radial-gradient(rgba(var(--w-rgb), 0.05) 1px, transparent 1.2px) 0 0 / 18px 18px, rgba(0, 0, 0, 0.25);
}
.feature--flip .feature__viz { border-left: 0; border-right: 1px solid var(--line); }
.viz__head { display: flex; justify-content: space-between; align-items: center; }
.viz__live { display: inline-flex; align-items: center; gap: 8px; font: 400 11px/1 var(--mono); color: var(--fg-3); }

/* KV simulator */
.kv-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; aspect-ratio: 1; width: 100%; max-width: 270px; margin: auto; }
/* split panel: compact live KV block on top, real recording below */
.feature__viz--split { gap: 18px; }
.kv-mini { display: grid; grid-template-columns: 148px minmax(0, 1fr); gap: 20px; align-items: center; }
.kv-mini .kv-grid { max-width: 148px; gap: 3px; margin: 0; }
.kv-mini .kv-cell { border-radius: 2px; }
.kv-status.kv-status--stack { display: grid; gap: 6px; padding: 0; border: 0; justify-content: start; }
.kv-note { margin-top: 6px; font: 400 12px/1.5 var(--sans); color: var(--fg-3); }
.demo { margin: 0; border-radius: 10px; border: 1px solid var(--line-2); overflow: hidden; background: #080807; }
.demo__bar { display: flex; align-items: center; gap: 10px; height: 30px; padding: 0 10px; border-bottom: 1px solid var(--line); font: 400 11px/1 var(--mono); color: var(--fg-3); }
.demo__dots { display: inline-flex; gap: 5px; }
.demo__dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(var(--w-rgb), 0.12); }
.demo__url { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.demo__bar a { color: var(--fg-3); transition: color 0.2s; }
.demo__bar a:hover { color: var(--accent); }
.demo__video { display: block; width: 100%; height: auto; aspect-ratio: 900 / 510; background: #080807; }
.kv-cell { border-radius: 3px; border: 1px solid var(--line-2); transition: background-color 0.35s, border-color 0.35s; }
.kv-cell[data-s] { border-color: transparent; }
.kv-cell[data-s="0"] { background: var(--accent); }
.kv-cell[data-s="1"] { background: rgba(var(--accent-rgb), 0.45); }
.kv-cell[data-s="2"] { background: rgba(var(--fg-rgb), 0.8); }
.kv-cell[data-s="3"] { background: rgba(var(--fg-rgb), 0.3); }
.kv-cell.is-new { animation: blockIn 0.5s var(--ease); }
.kv-cell.is-freed { animation: blockOut 0.6s var(--ease); }
.kv-cell.is-swapped { animation: blockSwap 0.7s var(--ease); }
@keyframes blockIn { from { transform: scale(0.5); } to { transform: none; } }
@keyframes blockOut { from { background: rgba(var(--fg-rgb), 0.4); } to { background: transparent; } }
@keyframes blockSwap { from { background: var(--accent-3); } to { background: transparent; } }
.kv-status {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px;
  padding-top: 12px; border-top: 1px solid var(--line);
  font: 400 11px/1.4 var(--mono); color: var(--fg-3); font-variant-numeric: tabular-nums;
}
.kv-status b { font-weight: 400; color: var(--fg); }
.kv-status .swap b { color: var(--accent-3); }

/* diamond graph */
.graph { width: 100%; max-width: 300px; margin: auto; }
.feature__viz--split .graph { max-width: 190px; margin: -6px auto -10px; }
.feature__viz--split .term pre { padding: 9px 12px; font-size: 11px; line-height: 1.7; }
.graph .edge { stroke: var(--line-3); stroke-width: 1.2; fill: none; }
.graph .node rect { fill: var(--bg-1); stroke: var(--line-3); }
.graph .node text { fill: var(--fg); font: 500 13px var(--mono); }
.graph .node .op { fill: var(--fg-3); font-size: 10px; font-weight: 400; }
.graph .node--x rect { stroke: var(--accent); }
.graph .grad { fill: var(--accent); }
.graph .acc { font: 500 11px var(--mono); fill: var(--accent); }
.graph .side { font: 400 10px var(--mono); fill: var(--fg-4); }

.term { border-radius: 10px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.35); }
.term pre { padding: 12px 14px; overflow-x: auto; font: 400 11.5px/1.85 var(--mono); color: var(--fg-2); }
.term .p { color: var(--accent); }
.term .c { color: var(--fg); }
.term .ok { color: var(--accent); }
.term .m { color: var(--fg-4); }
.term__line { opacity: 0; transition: opacity 0.4s; }
.is-in .term__line { opacity: 1; }
.is-in .term__line:nth-child(2) { transition-delay: 0.6s; }
.is-in .term__line:nth-child(3) { transition-delay: 1.2s; }
.is-in .term__line:nth-child(4) { transition-delay: 1.8s; }


/* index lists: more work + writing */
.index { margin-top: 88px; }
.index__caption { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 14px; }
.index__caption h3 { font-size: 24px; font-weight: 500; letter-spacing: -0.025em; }
.index ul { border-top: 1px solid var(--line-2); }
.writing__intro { margin-bottom: 28px; color: var(--fg-2); max-width: 40em; }

/* ==========================================================================
   Contact + footer
   ========================================================================== */
.contact { padding-bottom: 96px; }
.contact__title {
  margin-top: 24px;
  font-size: clamp(38px, 5.6vw, 76px); font-weight: 500; line-height: 1.02; letter-spacing: -0.045em;
  max-width: 12em;
  text-wrap: balance;
}
.contact__lede { margin-top: 26px; max-width: 34em; font-size: 18px; color: var(--fg-2); }
.mail { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }
.footer { border-top: 1px solid var(--line); }
/* contact links as one paragraph, then the ending reads like a sign-off, not a sitemap */
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.elsewhere { max-width: 40em; margin-top: 72px; padding-top: 28px; border-top: 1px solid var(--line-2); font-size: 19px; line-height: 1.7; letter-spacing: -0.01em; color: var(--fg-2); }
.elsewhere .social b { font-weight: 500; color: var(--fg); border-bottom: 1px solid rgba(var(--accent-rgb), 0.45); transition: color 0.2s, border-color 0.2s; }
.elsewhere .social:hover b { color: var(--accent); border-color: var(--accent); }
.outro { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px 56px; align-items: end; padding: 64px 0 40px; }
.outro__note { max-width: 26em; padding-bottom: 14px; font-size: 16px; line-height: 1.6; color: var(--fg-2); }
.outro__note span { display: block; margin-top: 4px; font: 400 12px/1.5 var(--mono); color: var(--fg-3); }
.footer__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 0; padding: 18px 0 34px; border-top: 1px solid var(--line); font: 400 12px/1.4 var(--mono); color: var(--fg-3); }
.footer__inner > * + *:not([hidden])::before { content: '·'; margin: 0 12px; color: var(--fg-4); }
.footer__inner .eos { color: var(--accent); }
.footer__inner a, .footer__inner button { color: var(--fg-2); transition: color 0.2s; }
.footer a:hover { color: var(--accent); }

/* ==========================================================================
   Additions: token hover, highlights, contributions, lab, palette, footer map
   ========================================================================== */

/* hero phrase that splits into tokens on hover */
.tok { position: relative; cursor: help; border-bottom: 1px dashed var(--line-3); outline: none; }
.tok .t { position: relative; padding: 0 1px; border-radius: 3px; transition: background-color 0.25s; }
.tok.is-split .t:nth-child(odd) { background: rgba(var(--accent-rgb), 0.16); }
.tok.is-split .t:nth-child(even) { background: rgba(var(--fg-rgb), 0.1); }
.tok__tip {
  position: absolute; left: 0; top: calc(100% + 8px); z-index: 5;
  padding: 6px 9px; border-radius: 7px; border: 1px solid var(--line-2); background: var(--bg-2);
  font: 400 11px/1 var(--mono); color: var(--fg-2); white-space: nowrap;
  opacity: 0; transform: translateY(-3px); transition: opacity 0.2s, transform 0.2s; pointer-events: none;
}
.tok__tip b { color: var(--accent); font-weight: 400; }
.tok.is-split .tok__tip { opacity: 1; transform: none; }

.tzdiff { display: block; margin-top: 3px; font: 400 12px/1.3 var(--mono); color: var(--fg-3); }
.facts dd b { font-weight: 400; font-variant-numeric: tabular-nums; }

/* ask this page */
.ask { margin-top: 72px; }
.ask__note { max-width: 30em; font-size: 13px; color: var(--fg-3); text-align: right; }
.ask__form {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 6px 6px 16px; border-radius: 12px;
  border: 1px solid var(--line-2); background: rgba(var(--w-rgb), 0.02);
  transition: border-color 0.2s;
}
.ask__form:focus-within { border-color: rgba(var(--accent-rgb), 0.5); }
.ask__prompt { font: 400 16px/1 var(--mono); color: var(--accent); }
.ask__form input { flex: 1; min-width: 0; height: 38px; background: none; border: 0; outline: none; color: var(--fg); font: 400 15px/1 var(--sans); }
.ask__form input::placeholder { color: var(--fg-4); }
.ask__chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ask__chips button {
  padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line-2);
  font: 400 12px/1 var(--mono); color: var(--fg-3); transition: color 0.2s, border-color 0.2s;
}
.ask__chips button:hover { color: var(--fg); border-color: var(--line-3); }
.ask__chips button.is-trick { border-style: dashed; }
.ask__lineage { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; align-items: baseline; margin-top: 16px; font: 400 12px/1.5 var(--mono); color: var(--fg-3); }
.ask__lineage > span { grid-row: span 2; color: var(--fg-4); }
.ask__lineage a { width: fit-content; }
.ask__lineage a { color: var(--fg-3); transition: color 0.2s; }
.ask__lineage a b { font-weight: 500; color: var(--accent); }
.ask__lineage a:hover { color: var(--fg); }
.ask__out { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.ask__answer { font-size: 19px; line-height: 1.5; letter-spacing: -0.01em; color: var(--fg); max-width: 44em; min-height: 1.5em; }
.ask.is-refusing .ask__answer { color: var(--accent-3); }
.ask__src { margin-top: 8px; font-size: 13px; color: var(--fg-3); }
.ask__jump { color: var(--accent); font: inherit; }
.ask__jump:hover { text-decoration: underline; text-underline-offset: 3px; }
.ask__why { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 28px; margin-top: 20px; }
.ask__track { position: relative; height: 6px; border-radius: 6px; background: rgba(var(--w-rgb), 0.06); }
.ask__track i { position: absolute; inset: 0 auto 0 0; border-radius: 6px; background: var(--accent); transition: width 0.6s var(--ease), background-color 0.3s; }
.ask.is-refusing .ask__track i { background: var(--accent-3); }
.ask__mark { position: absolute; left: 50%; top: -4px; bottom: -4px; width: 1px; background: var(--fg-2); }
.ask__meter p { margin-top: 10px; font: 400 12px/1.5 var(--mono); color: var(--fg-3); }
.ask__meter b { font-weight: 500; color: var(--fg); }
.ask__hits { display: grid; gap: 2px; }
.ask__hits button {
  display: grid; grid-template-columns: 44px 120px minmax(0, 1fr); gap: 12px; align-items: baseline; width: 100%;
  padding: 6px 8px; border-radius: 8px; text-align: left; font: 400 12px/1.4 var(--mono); color: var(--fg-3);
  transition: background-color 0.2s, color 0.2s;
}
.ask__hits button:hover { background: rgba(var(--w-rgb), 0.04); color: var(--fg-2); }
.ask__score { color: var(--accent); text-align: right; font-variant-numeric: tabular-nums; }
.ask__where { color: var(--fg-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ask__snip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--sans); font-size: 13px; }
.ask__none { font: 400 12px/1.5 var(--mono); color: var(--fg-3); padding: 6px 8px; }
.is-cited { animation: cited 2.2s var(--ease); border-radius: 10px; }
@keyframes cited { 0%, 60% { box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.8); } 100% { box-shadow: 0 0 0 2px transparent; } }

/* highlights */
.highlights { margin-top: 72px; }
.hl { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 18px; align-items: baseline; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 15px; color: var(--fg); }
.hl b { font-weight: 500; font-variant-numeric: tabular-nums; }
.hl em { flex: none; font: 400 12px/1 var(--mono); font-style: normal; color: var(--fg-3); }
a.hl { transition: color 0.2s; }
a.hl:hover { color: var(--accent); }
a.hl:hover em { color: var(--fg-2); }

/* contributions */
.contrib { margin-top: 22px; }
.contrib__total { margin: -4px 0 16px; font-size: 14px; color: var(--fg-3); }
.contrib__total b { color: var(--fg); font-weight: 500; font-variant-numeric: tabular-nums; }
.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 11px; margin-right: 6px; }
.eq i { width: 3px; height: 100%; border-radius: 1px; background: var(--accent); transform-origin: bottom; animation: eq 0.9s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -0.3s; }
.eq i:nth-child(3) { animation-delay: -0.6s; }
@keyframes eq { 0%, 100% { transform: scaleY(0.3); } 50% { transform: scaleY(1); } }
.contrib__scroll { overflow-x: auto; padding-bottom: 6px; }
.contrib__svg { display: block; min-width: 720px; width: 100%; height: auto; }
.contrib__svg text { font: 400 9px var(--mono); fill: var(--fg-4); }
.contrib__svg rect { rx: 2px; }
.contrib__legend { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 10px; font: 400 11px/1 var(--mono); color: var(--fg-4); }
.contrib__legend i { width: 10px; height: 10px; border-radius: 2px; }
[data-l="0"] { background: rgba(var(--w-rgb), 0.05); fill: rgba(var(--w-rgb), 0.05); }
[data-l="1"] { background: rgba(var(--accent-rgb), 0.25); fill: rgba(var(--accent-rgb), 0.25); }
[data-l="2"] { background: rgba(var(--accent-rgb), 0.45); fill: rgba(var(--accent-rgb), 0.45); }
[data-l="3"] { background: rgba(var(--accent-rgb), 0.7); fill: rgba(var(--accent-rgb), 0.7); }
[data-l="4"] { background: var(--accent); fill: var(--accent); }


/* lab */
.lab__note { font-size: 14px; color: var(--fg-3); }
.lab__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.toy { display: flex; flex-direction: column; }
.toy__stage {
  position: relative; height: 210px; padding: 18px;
  border-radius: 14px; border: 1px solid var(--line-2);
  background: radial-gradient(rgba(var(--w-rgb), 0.04) 1px, transparent 1.2px) 0 0 / 16px 16px, rgba(0, 0, 0, 0.25);
  display: flex; flex-direction: column; justify-content: center; gap: 14px;
  overflow: hidden;
}
.toy__stage--canvas { padding: 0; }
.toy__stage canvas { width: 100%; height: 100%; }
.toy__readout { position: absolute; left: 12px; bottom: 10px; font: 400 11px/1 var(--mono); color: var(--fg-3); font-variant-numeric: tabular-nums; }
.toy__ctrl { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 12px; min-height: 38px; }
.toy__ctrl label { flex: 1; display: grid; gap: 6px; font: 400 11px/1 var(--mono); color: var(--fg-3); }
.toy__ctrl label b { font-weight: 400; color: var(--fg); margin-left: 6px; }
.toy__ctrl--static { font: 400 11px/1 var(--mono); color: var(--fg-4); }
.toy h4 { margin-top: 14px; font-size: 16px; font-weight: 500; letter-spacing: -0.01em; }
.toy > p { margin-top: 4px; font-size: 14px; color: var(--fg-3); line-height: 1.5; }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 18px; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 2px; background: var(--line-3); border-radius: 2px; }
input[type="range"]::-moz-range-track { height: 2px; background: var(--line-3); border-radius: 2px; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -6px; border-radius: 50%; background: var(--fg); border: 0; transition: background-color 0.2s; }
input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--fg); border: 0; }
input[type="range"]:hover::-webkit-slider-thumb { background: var(--accent); }

.toy__prompt { font: 400 13px/1.5 var(--mono); color: var(--fg-2); }
.toy__blank { color: var(--accent); border-bottom: 1px dashed rgba(var(--accent-rgb), 0.5); transition: color 0.2s; }
.toy__bars { display: grid; gap: 5px; }
.bar { display: grid; grid-template-columns: 110px 1fr 38px; gap: 8px; align-items: center; font: 400 11px/1 var(--mono); color: var(--fg-3); }
.bar__track { height: 6px; border-radius: 6px; background: rgba(var(--w-rgb), 0.05); overflow: hidden; }
.bar__fill { height: 100%; border-radius: 6px; background: var(--fg-3); transition: width 0.3s var(--ease), background-color 0.2s; }
.bar.is-top .bar__fill { background: var(--accent); }
.bar.is-picked { color: var(--fg); }
.bar b { font-weight: 400; text-align: right; font-variant-numeric: tabular-nums; }

.toy__sent { display: flex; flex-wrap: wrap; gap: 6px; font: 400 14px/1 var(--mono); }
.toy__sent span {
  padding: 7px 8px; border-radius: 6px; border: 1px solid var(--line-2); color: var(--fg-2);
  cursor: default; transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.toy__sent span.is-q { border-color: var(--accent); color: var(--fg); }
.toy__sent span.is-masked { opacity: 0.3; }
.toy__hint { font: 400 11px/1.4 var(--mono); color: var(--fg-4); min-height: 16px; }

/* nav palette trigger */
.nav__cmd { display: inline-flex; gap: 3px; align-items: center; height: 34px; padding: 0 9px; border-radius: 999px; border: 1px solid var(--line); transition: border-color 0.2s; }
.nav__cmd:hover { border-color: var(--line-3); }
kbd { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 5px; border: 1px solid var(--line-2); background: var(--bg-2); font: 400 10px/1 var(--mono); color: var(--fg-2); }
.mobile-menu button { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px; border-radius: 12px; font-size: 20px; letter-spacing: -0.02em; color: var(--fg-2); text-align: left; }
.mobile-menu button span { font: 400 11px/1 var(--mono); color: var(--accent); }

/* command palette */
.cmdk { position: fixed; inset: 0; z-index: 150; display: grid; place-items: start center; padding: 14vh 16px 16px; }
.cmdk[hidden] { display: none; }
.cmdk__backdrop { position: absolute; inset: 0; background: rgba(5, 5, 4, 0.6); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: fade 0.15s; }
.cmdk__panel {
  position: relative; width: 100%; max-width: 600px;
  border-radius: 16px; border: 1px solid var(--line-2); background: rgba(16, 16, 15, 0.96);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.9);
  overflow: hidden; animation: pop 0.18s var(--ease);
}
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(0.99); } }
.cmdk__input { display: flex; align-items: center; gap: 10px; padding: 0 16px; height: 54px; border-bottom: 1px solid var(--line); font: 400 16px/1 var(--mono); color: var(--accent); }
.cmdk__input input { flex: 1; height: 100%; background: none; border: 0; outline: none; color: var(--fg); font: 400 15px/1 var(--sans); }
.cmdk__input input::placeholder { color: var(--fg-4); }
.cmdk__list { max-height: min(52vh, 420px); overflow-y: auto; padding: 6px; }
.cmdk__group { padding: 10px 10px 6px; font: 400 11px/1 var(--mono); color: var(--fg-4); }
.cmdk__item { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 10px 12px; border-radius: 9px; font-size: 14.5px; color: var(--fg-2); cursor: pointer; }
.cmdk__item small { font: 400 11px/1 var(--mono); color: var(--fg-4); white-space: nowrap; }
.cmdk__item[aria-selected="true"] { background: rgba(var(--w-rgb), 0.06); color: var(--fg); }
.cmdk__item[aria-selected="true"] small { color: var(--accent); }
.cmdk__empty { padding: 28px 12px; text-align: center; font-size: 14px; color: var(--fg-3); }
.cmdk__foot { display: flex; gap: 18px; padding: 10px 16px; border-top: 1px solid var(--line); font: 400 11px/1 var(--mono); color: var(--fg-4); }
.cmdk__foot span { display: inline-flex; align-items: center; gap: 4px; }

/* contact time line */
.contact__time { display: inline-flex; align-items: center; gap: 10px; margin-top: 14px; font: 400 13px/1.4 var(--mono); color: var(--fg-3); }
.contact__time b { font-weight: 400; color: var(--fg); font-variant-numeric: tabular-nums; }

/* binary cursor trail (assets/js/trail.js); below the palette, above the page */
.cursor-trail { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 95; }

/* quote row after Writing: same hairline language as the lists above */
.quote {
  display: grid; grid-template-columns: auto 1fr auto; gap: 14px 18px; align-items: baseline;
  margin-top: 88px; padding: 26px 0;
  border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line);
}
.quote__mark { font-size: 34px; line-height: 0.5; color: var(--accent); transform: translateY(9px); }
.quote__text {
  margin: 0; max-width: 40em;
  font-size: 20px; font-weight: 400; line-height: 1.45; letter-spacing: -0.015em; color: var(--fg);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}
.quote__by { display: inline-flex; align-items: center; gap: 12px; font: 400 12px/1.3 var(--mono); color: var(--fg-3); white-space: nowrap; }
[data-quote-by] { display: inline-block; transition: opacity 0.35s var(--ease), transform 0.35s var(--ease); }
.quote__by .mine { color: var(--accent); }
.quote__next {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 10px; border-radius: 999px;
  border: 1px solid var(--line-2); color: var(--fg-3);
  font: 400 11px/1 var(--mono);
  transition: color 0.2s, border-color 0.2s;
}
.quote__next span { display: inline-block; transition: transform 0.4s var(--ease); }
.quote__next:hover { color: var(--accent); border-color: rgba(var(--accent-rgb), 0.5); }
.quote__next:hover span { transform: rotate(180deg); }
.quote.is-swapping .quote__text, .quote.is-swapping [data-quote-by] { opacity: 0; transform: translateY(4px); }

/* signature: writes itself when the footer comes into view */
.sig { display: block; width: 260px; height: auto; overflow: visible; margin: -18px 0 -8px -6px; }
.sig__text { font-family: 'Mrs Saint Delafield', cursive; font-size: 66px; fill: var(--fg); stroke: var(--fg); stroke-width: 0.6; }
.sig__pen { transition: width 2.4s cubic-bezier(0.45, 0.05, 0.25, 1); }
.sig__flourish { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-dasharray: 320; stroke-dashoffset: 320; opacity: 0.85; transition: stroke-dashoffset 0.9s var(--ease) 2.2s; }
.sig.is-signed .sig__pen { width: 330px; }
.sig.is-signed .sig__flourish { stroke-dashoffset: 0; }
.no-js .sig__pen { width: 330px; }
.visits b { font-weight: 400; color: var(--fg-2); font-variant-numeric: tabular-nums; }

/* footer sitemap */
.footer__cmd { display: inline-flex; align-items: center; gap: 6px; font: 400 12px/1 var(--mono); }
.footer__cmd:hover { color: var(--fg); }
.footer__cmd .on-kbd { display: inline-flex; align-items: center; gap: 6px; }
.footer__cmd .on-touch { display: none; }
@media (hover: none) { .footer__cmd .on-kbd { display: none; } .footer__cmd .on-touch { display: inline; } }

/* ==========================================================================
   Reach (quiet) + showcase: speculative decoding
   ========================================================================== */
.facts__sub { display: block; margin-top: 3px; font: 400 12px/1.3 var(--mono); color: var(--fg-3); }
.writing__stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 8px 0 56px; padding: 22px 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.writing__stats span { display: flex; flex-direction: column; gap: 8px; padding-right: 20px; font: 400 12px/1.4 var(--mono); color: var(--fg-3); }
.writing__stats span + span { padding-left: 24px; border-left: 1px solid var(--line); }
.writing__stats b { font-family: var(--sans); font-size: 26px; font-weight: 500; line-height: 1; letter-spacing: -0.03em; color: var(--fg); font-variant-numeric: tabular-nums; }
.writing__stats span:nth-child(2) b { color: var(--accent); }
.textlink__meta { color: var(--fg-3); font-weight: 400; }
.textlink:hover .textlink__meta { color: inherit; }

/* speculative decoding */
.spec {
  margin-bottom: 20px; padding: 26px 28px 22px;
  border-radius: 16px; border: 1px solid var(--line-2);
  background: radial-gradient(rgba(var(--w-rgb), 0.035) 1px, transparent 1.2px) 0 0 / 16px 16px, rgba(0, 0, 0, 0.22);
}
.spec__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; }
.spec__head h4 { font-size: 18px; font-weight: 500; letter-spacing: -0.015em; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.spec__tag { font: 400 11px/1 var(--mono); color: var(--accent); }
.spec__head p { margin-top: 6px; max-width: 46em; font-size: 14.5px; line-height: 1.55; color: var(--fg-3); }
.spec__head p b { color: var(--fg); font-weight: 500; }
.spec__out {
  min-height: 92px; margin: 22px 0 18px; padding: 16px 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  font: 400 17px/2 var(--mono); color: var(--fg-2);
  display: flex; flex-wrap: wrap; align-content: flex-start; white-space: pre;
}
.tk { border-radius: 4px; transition: background-color 0.2s, color 0.2s, opacity 0.25s; }
.tk.is-draft { color: var(--fg-3); background: rgba(var(--w-rgb), 0.05); outline: 1px dashed var(--line-3); outline-offset: -1px; }
.tk.is-ok { color: var(--accent-ink); background: var(--accent); }
.tk.is-bad { color: var(--accent-3); background: rgba(var(--accent-3-rgb), 0.12); text-decoration: line-through; }
.tk.is-dropped { opacity: 0.2; }
.tk.is-fix { color: var(--bg); background: var(--fg); }
.tk.is-free { color: var(--fg); box-shadow: inset 0 -2px 0 rgba(var(--accent-rgb), 0.7); border-radius: 0; }
.tk.is-target { color: var(--fg-2); }
.spec__bottom { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 24px 40px; align-items: end; }
.spec__ctrl { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.spec__ctrl label { display: grid; gap: 6px; font: 400 11px/1 var(--mono); color: var(--fg-3); }
.spec__ctrl label b { font-weight: 400; color: var(--fg); margin-left: 6px; }
.spec__stats { display: grid; grid-template-columns: repeat(4, 1fr); border-left: 1px solid var(--line); }
.spec__stats div { padding: 0 14px; border-right: 1px solid var(--line); }
.spec__stats dt { font: 400 10.5px/1.3 var(--mono); color: var(--fg-3); min-height: 28px; }
.spec__stats dd { margin-top: 6px; font-size: 22px; font-weight: 500; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.spec__stats div:last-child dd { color: var(--accent); }
.spec__legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 18px; font: 400 11px/1 var(--mono); color: var(--fg-3); }
.spec__legend span::before { content: ''; display: inline-block; width: 10px; height: 10px; margin-right: 7px; vertical-align: -1px; border-radius: 3px; }
.k-draft::before { outline: 1px dashed var(--line-3); outline-offset: -1px; background: rgba(var(--w-rgb), 0.05); }
.k-ok::before { background: var(--accent); }
.k-bad::before { background: rgba(var(--accent-3-rgb), 0.55); }
.k-fix::before { background: var(--fg); }

/* ==========================================================================
   Writing: latest row + private publishing panel (assets/js/publish.js)
   ========================================================================== */
.writing__links { display: inline-flex; align-items: center; gap: 18px; }
.writing__add {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 12px; border-radius: 999px;
  border: 1px dashed rgba(var(--accent-rgb), 0.45); color: var(--accent);
  font: 400 12px/1 var(--mono); transition: background-color 0.2s, border-color 0.2s;
}
.writing__add:hover { background: rgba(var(--accent-rgb), 0.08); border-style: solid; }
.writing__add[hidden] { display: none; }

.latest { margin: 0 0 48px; }
.latest__row {
  position: relative;
  display: grid; grid-template-columns: 120px minmax(0, 1fr) auto 20px; gap: 24px; align-items: baseline;
  padding: 18px 0; border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line);
}
.latest__row::before {
  content: ''; position: absolute; inset: -1px -16px; border-radius: 10px;
  background: rgba(var(--w-rgb), 0.03); opacity: 0; transition: opacity 0.2s; pointer-events: none;
}
.latest__row:hover::before { opacity: 1; }
.latest__k { display: inline-flex; align-items: center; gap: 8px; font: 400 12px/1.4 var(--mono); color: var(--fg-3); white-space: nowrap; }
.latest__k b { font-weight: 400; color: var(--accent); }
.latest__k i { width: 3px; height: 3px; border-radius: 50%; background: var(--fg-4); }
.latest__main { display: grid; gap: 6px; }
.latest__t { font-size: 19px; font-weight: 500; letter-spacing: -0.015em; line-height: 1.3; transition: color 0.2s; }
.latest__note { font-size: 15px; line-height: 1.55; color: var(--fg-2); max-width: 44em; }
.latest__where { font: 400 12px/1.4 var(--mono); color: var(--fg-3); white-space: nowrap; }
.latest__go { color: var(--fg-4); justify-self: end; transition: color 0.2s, transform 0.2s var(--ease); }
.latest__row:hover .latest__t, .latest__row:hover .latest__go { color: var(--accent); }
.latest__row:hover .latest__go { transform: translate(2px, -2px); }

.publish {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  padding: 0; margin: auto; overflow: auto;
  border-radius: 16px; border: 1px solid var(--line-2);
  background: rgba(16, 16, 15, 0.97); color: var(--fg);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.9);
}
.publish[open] { animation: pop 0.18s var(--ease); }
.publish::backdrop { background: rgba(5, 5, 4, 0.62); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.publish__panel { display: grid; }
.publish__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 20px 22px 16px; border-bottom: 1px solid var(--line); }
.publish__head h2 { margin-top: 6px; font-size: 21px; font-weight: 500; letter-spacing: -0.02em; }
.publish__k { font: 400 11px/1.3 var(--mono); color: var(--fg-3); }
.publish__x { padding: 4px; }
.publish__body { display: grid; gap: 14px; padding: 20px 22px 6px; }
.publish__body[hidden] { display: none; }
.publish__hint { margin-top: -4px; font: 400 12px/1.5 var(--mono); color: var(--fg-3); }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.field { display: grid; gap: 7px; }
.field[hidden] { display: none; }
.field > span { font: 400 11px/1 var(--mono); color: var(--fg-3); }
.field em { font-style: normal; color: var(--fg-4); margin-left: 4px; }
.field input, .field select, .field textarea {
  width: 100%; min-width: 0; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line-2); background: rgba(var(--w-rgb), 0.025); color: var(--fg);
  font: 400 15px/1.4 var(--sans); outline: none; transition: border-color 0.2s, background-color 0.2s;
  color-scheme: dark;
}
.field textarea { resize: vertical; min-height: 76px; }
.field input::placeholder, .field textarea::placeholder { color: var(--fg-4); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: rgba(var(--accent-rgb), 0.55); background: rgba(var(--w-rgb), 0.04); }
.field select { appearance: none; -webkit-appearance: none; padding-right: 30px; background-image: linear-gradient(45deg, transparent 50%, var(--fg-3) 50%), linear-gradient(135deg, var(--fg-3) 50%, transparent 50%); background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.publish__list { margin: 14px 22px 0; padding-top: 14px; border-top: 1px solid var(--line); }
.publish__list ul { margin-top: 8px; display: grid; }
.publish__list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.publish__list li.is-editing .publish__item b { color: var(--accent); }
.publish__item { display: grid; gap: 2px; min-width: 0; }
.publish__item b { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.publish__item small { font: 400 11px/1.3 var(--mono); color: var(--fg-3); }
.publish__list button { padding: 5px 9px; border-radius: 7px; font: 400 11px/1 var(--mono); color: var(--fg-3); transition: color 0.2s, background-color 0.2s; }
.publish__list button:hover { color: var(--fg); background: rgba(var(--w-rgb), 0.05); }
.publish__list button[data-armed="1"] { color: var(--accent-3); }
.publish__foot { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 18px 22px 20px; margin-top: 12px; border-top: 1px solid var(--line); }
.publish__foot [hidden] { display: none; }
.publish__msg { flex: 1; min-width: 0; font: 400 12px/1.4 var(--mono); color: var(--fg-3); }
.publish__msg[data-kind="ok"] { color: var(--accent); }
.publish__msg[data-kind="err"] { color: var(--accent-3); }
.publish button:disabled { opacity: 0.5; cursor: progress; }

/* ==========================================================================
   Chapters: counts on the tags, git-log highlights, the "Right now" strip,
   the Work index and the Writing library
   ========================================================================== */
.tag__n { font-style: normal; color: var(--fg-3); }
.tag__n b { font-weight: 400; color: var(--fg-2); }
.tag__n::before { content: '·'; margin-right: 12px; color: var(--fg-4); }

/* highlights, as a git log */
.hl__cmd { font: 400 12px/1 var(--mono); color: var(--fg-4); }
.gitlog { border-top: 1px solid var(--line-2); }
.gitlog li[data-more] { display: none; }
.gitlog.is-all li[data-more] { display: block; animation: logIn 0.45s var(--ease) both; }
@keyframes logIn { from { opacity: 0; transform: translateY(-4px); } }
.hl__hash { padding: 0; border: 0; background: none; font: 400 12px/1 var(--mono); color: var(--accent); letter-spacing: 0.02em; }
.hl__msg i { margin-right: 4px; font: 400 12.5px/1 var(--mono); font-style: normal; color: var(--fg-3); }
.gitlog__more, .shelf__more {
  margin-top: 14px; padding: 8px 13px; border-radius: 999px;
  border: 1px dashed var(--line-3); font: 400 12px/1 var(--mono); color: var(--fg-3);
  transition: color 0.2s, border-color 0.2s;
}
.gitlog__more:hover, .shelf__more:hover { color: var(--accent); border-color: rgba(var(--accent-rgb), 0.5); }

/* right now */
.now { margin-top: 88px; }
.now__note { font: 400 12px/1 var(--mono); color: var(--fg-3); }
.now__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line); }
.now__cell { display: grid; align-content: start; gap: 8px; min-width: 0; padding: 20px 22px 22px 0; }
.now__cell + .now__cell { padding-left: 22px; border-left: 1px solid var(--line); }
.now__cell[hidden] { display: none; }
.now__k { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font: 400 12px/1.3 var(--mono); color: var(--fg-3); }
.now__k b { font-weight: 400; color: var(--fg-2); font-variant-numeric: tabular-nums; }
.now__v { font-size: 16px; font-weight: 500; line-height: 1.35; letter-spacing: -0.01em; color: var(--fg); overflow-wrap: anywhere; transition: color 0.2s; }
.now__sub { font-size: 13.5px; color: var(--fg-3); }
a.now__cell:hover .now__v { color: var(--accent); }
.now__song { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; align-items: center; }
.now__art { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; background: var(--bg-2); }
.now__songmeta { display: grid; gap: 2px; min-width: 0; }
.now__songmeta > * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now__status { display: inline-flex; align-items: center; }
#spotify.is-live .now__status { color: var(--accent); }

/* filter chips, shared by Work and Writing */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px;
  border-radius: 999px; border: 1px solid var(--line-2);
  font: 400 12.5px/1 var(--mono); color: var(--fg-3); white-space: nowrap;
  transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}
.chips button i { font-style: normal; color: var(--fg-4); transition: color 0.2s; }
.chips button:hover { color: var(--fg); border-color: var(--line-3); }
.chips button[aria-pressed="true"] { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.chips button[aria-pressed="true"] i { color: rgba(23, 18, 10, 0.55); }

/* work: one index, rows open in place */
.works .chips { margin-bottom: 16px; }
.wx__list { border-top: 1px solid var(--line-2); }
.wx { border-bottom: 1px solid var(--line); }
.wx[hidden] { display: none; }
.wx__row { position: relative; display: grid; grid-template-columns: 200px minmax(0, 1fr) auto 14px; gap: 24px; align-items: baseline; width: 100%; padding: 18px 0; text-align: left; }
.wx__row::before { content: ''; position: absolute; inset: -1px -16px; border-radius: 10px; background: rgba(var(--w-rgb), 0.03); opacity: 0; transition: opacity 0.2s; pointer-events: none; }
.wx__row:hover::before { opacity: 1; }
.wx__name { font-size: 17px; font-weight: 500; letter-spacing: -0.015em; transition: color 0.2s; }
.wx__row:hover .wx__name, .wx.is-open .wx__name { color: var(--accent); }
.wx__q { font-size: 15px; line-height: 1.5; color: var(--fg-2); }
.wx__stat { font: 400 12px/1.4 var(--mono); color: var(--fg-3); text-align: right; white-space: nowrap; }
.wx__chev { position: relative; width: 12px; height: 12px; align-self: center; justify-self: end; }
.wx__chev::before, .wx__chev::after { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--fg-3); transition: transform 0.35s var(--ease), background-color 0.2s; }
.wx__chev::after { transform: rotate(90deg); }
.wx.is-open .wx__chev::after { transform: rotate(0deg); }
.wx__row:hover .wx__chev::before, .wx__row:hover .wx__chev::after { background: var(--accent); }
.wx__body { display: grid; grid-template-rows: 0fr; visibility: hidden; transition: grid-template-rows 0.4s var(--ease), visibility 0s 0.4s; }
.wx.is-open .wx__body { grid-template-rows: 1fr; visibility: visible; transition: grid-template-rows 0.4s var(--ease); }
.wx__inner { min-height: 0; overflow: hidden; padding-left: 224px; }
.wx__text { max-width: 46em; font-size: 15px; line-height: 1.65; color: var(--fg-2); }
.wx__meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font: 400 12px/1.5 var(--mono); color: var(--fg-3); }
.wx__cat { color: var(--accent); }
.wx__links { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 6px 0 20px; }

/* writing: the library */
.lib__bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px 24px; margin-bottom: 26px; }
.lib__tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.lib__search, .lib__sort {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px;
  border-radius: 999px; border: 1px solid var(--line-2); transition: border-color 0.2s;
}
.lib__search { font: 400 13px/1 var(--mono); color: var(--accent); }
.lib__search:focus-within, .lib__sort:focus-within { border-color: rgba(var(--accent-rgb), 0.5); }
.lib__search input { width: 140px; min-width: 0; background: none; border: 0; outline: none; color: var(--fg); font: 400 13.5px/1 var(--sans); }
.lib__search input::placeholder { color: var(--fg-4); }
.lib__sortk { font: 400 12px/1 var(--mono); color: var(--fg-4); }
.lib__sort select { appearance: none; -webkit-appearance: none; background: none; border: 0; outline: none; color: var(--fg); font: 400 12.5px/1 var(--mono); cursor: pointer; }
.lib__sort option { background: var(--bg-2); color: var(--fg); }
.shelf + .shelf { margin-top: 36px; }
.shelf__h { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line-2); font-size: 17px; font-weight: 500; letter-spacing: -0.01em; }
.shelf__h .series__meta { font: 400 12px/1 var(--mono); color: var(--fg-3); white-space: nowrap; }
.shelf.is-flat { border-top: 1px solid var(--line-2); }
.art { position: relative; display: grid; grid-template-columns: 52px minmax(0, 1fr) 64px 132px 14px; gap: 16px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; color: var(--fg-2); transition: color 0.2s; }
.is-flat .art { grid-template-columns: 52px minmax(0, 1fr) 150px 64px 132px 14px; }
.art::before { content: ''; position: absolute; inset: -1px -16px; border-radius: 10px; background: rgba(var(--w-rgb), 0.03); opacity: 0; transition: opacity 0.2s; pointer-events: none; }
.art:hover { color: var(--fg); }
.art:hover::before { opacity: 1; }
.art__n { font: 400 11px/1 var(--mono); color: var(--fg-4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.art:hover .art__n { color: var(--accent); }
.art__t { line-height: 1.4; }
.art__flag { display: inline-block; margin-left: 10px; padding: 3px 7px; border-radius: 999px; border: 1px solid var(--line-2); font: 400 10.5px/1 var(--mono); font-style: normal; color: var(--fg-3); vertical-align: 2px; white-space: nowrap; }
.art__flag.is-new { color: var(--accent); border-color: rgba(var(--accent-rgb), 0.45); }
.art__s { font: 400 12px/1.3 var(--mono); color: var(--fg-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.art__d { font: 400 12px/1 var(--mono); color: var(--fg-3); white-space: nowrap; text-align: right; }
.art__v { display: grid; grid-template-columns: minmax(0, 1fr) 38px; gap: 10px; align-items: center; }
.art__v i { height: 3px; border-radius: 3px; background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.8) calc(var(--w) * 100%), rgba(var(--w-rgb), 0.06) 0); }
.art__v b { font: 400 11.5px/1 var(--mono); color: var(--fg-3); text-align: right; font-variant-numeric: tabular-nums; }
.art__go { justify-self: end; color: var(--fg-4); transition: color 0.2s, transform 0.2s var(--ease); }
.art:hover .art__go { color: var(--accent); transform: translate(2px, -2px); }
.lib__empty { padding: 28px 0; border-top: 1px solid var(--line-2); color: var(--fg-3); }
.lib__empty button { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.lib__foot { display: flex; justify-content: flex-end; margin-top: 18px; }

/* ==========================================================================
   The playful layer (assets/js/fun.js)
   ========================================================================== */
/* precision slider under the portrait */
.quant { display: grid; gap: 6px; padding: 10px 12px 12px; border-top: 1px solid var(--line); }
.quant__k { display: flex; justify-content: space-between; font: 400 10.5px/1 var(--mono); color: var(--fg-3); }
.quant__k b { font-weight: 400; color: var(--accent); }
.quant input { height: 14px; }
.quant__note { font: 400 10.5px/1.35 var(--mono); color: var(--fg-3); min-height: 14px; }

/* temperature dial over the About paragraphs */
.temp { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 22px; }
.temp__k { font: 400 12px/1 var(--mono); color: var(--fg-3); }
.temp__opts { display: inline-flex; padding: 3px; border-radius: 999px; border: 1px solid var(--line-2); }
.temp__opts button { display: inline-flex; align-items: baseline; gap: 6px; height: 28px; padding: 0 12px; border-radius: 999px; font: 400 12px/28px var(--mono); color: var(--fg-3); transition: color 0.2s, background-color 0.2s; }
.temp__opts button small { font-size: 10.5px; color: var(--fg-4); transition: color 0.2s; }
.temp__opts button:hover { color: var(--fg); }
.temp__opts button[aria-checked="true"] { background: rgba(var(--w-rgb), 0.07); color: var(--fg); }
.temp__opts button[aria-checked="true"] small { color: var(--accent); }
[data-temp-p] { transition: opacity 0.22s var(--ease), filter 0.22s var(--ease); }
[data-temp-p].is-resampling { opacity: 0; filter: blur(3px); }

/* reading meter in the nav: chapters in the KV cache + tokens decoded */
.nav__status { cursor: help; }
.kvm { display: inline-flex; gap: 2px; }
.kvm i { width: 5px; height: 9px; border-radius: 1px; border: 1px solid var(--line-3); transition: background-color 0.4s, border-color 0.4s; }
.kvm i.is-on { background: var(--accent); border-color: var(--accent); }
.kvm i.is-hit { animation: kvHit 0.7s var(--ease); }
@keyframes kvHit { 0% { background: var(--fg); border-color: var(--fg); } }
.nav__tok b { display: inline-block; min-width: 4ch; text-align: right; font-weight: 400; color: var(--fg-2); font-variant-numeric: tabular-nums; }
.kv-sum { color: var(--fg-3); }


/* contact: the agent that learns to say hi */
.agent { display: grid; grid-template-columns: 216px minmax(0, 1fr); gap: 28px; align-items: center; margin: 56px 0 0; max-width: 680px; }
.agent canvas { width: 216px; height: 216px; border-radius: 10px; border: 1px solid var(--line-2); background: rgba(0, 0, 0, 0.2); }
.agent__cap { display: grid; gap: 10px; justify-items: start; }
.agent__k { font: 400 12px/1.3 var(--mono); color: var(--fg-3); }
.agent__t { font-size: 19px; font-weight: 500; line-height: 1.35; letter-spacing: -0.015em; }
.agent__stats { display: flex; flex-wrap: wrap; gap: 4px 16px; font: 400 12px/1.4 var(--mono); color: var(--fg-3); }
.agent__stats b { font-weight: 400; color: var(--fg); font-variant-numeric: tabular-nums; }

/* lab: tokenizer */
.tokz { margin-top: 20px; padding: 24px 28px 22px; border-radius: 16px; border: 1px solid var(--line-2); background: radial-gradient(rgba(var(--w-rgb), 0.035) 1px, transparent 1.2px) 0 0 / 16px 16px, rgba(0, 0, 0, 0.22); }
.tokz__head h4 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; font-size: 18px; font-weight: 500; letter-spacing: -0.015em; }
.tokz__head p { margin-top: 6px; max-width: 48em; font-size: 14.5px; line-height: 1.55; color: var(--fg-3); }
.tokz__in { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding: 0 14px; height: 46px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(var(--w-rgb), 0.02); font: 400 16px/1 var(--mono); color: var(--accent); transition: border-color 0.2s; }
.tokz__in:focus-within { border-color: rgba(var(--accent-rgb), 0.5); }
.tokz__in input { flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: none; color: var(--fg); font: 400 15px/1 var(--sans); }
.tokz__out { display: flex; flex-wrap: wrap; gap: 3px; min-height: 40px; margin: 16px 0 14px; font: 400 15px/1.9 var(--mono); white-space: pre; }
.tokz__out span { padding: 0 3px; border-radius: 4px; color: var(--fg); }
.tokz__out span:nth-child(odd) { background: rgba(var(--accent-rgb), 0.18); }
.tokz__out span:nth-child(even) { background: rgba(var(--w-rgb), 0.08); }
.tokz__out i { font-style: normal; color: var(--fg-4); }
.tokz__stats { display: flex; flex-wrap: wrap; gap: 6px 22px; font: 400 12px/1.4 var(--mono); color: var(--fg-3); }
.tokz__stats b { font-weight: 400; color: var(--fg); font-variant-numeric: tabular-nums; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 22px; z-index: 160; transform: translate(-50%, 12px);
  padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(16, 16, 15, 0.94);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  font: 400 12.5px/1.3 var(--mono); color: var(--fg-2); white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity 0.25s, transform 0.25s var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast b { font-weight: 500; color: var(--accent); }

/* backtick terminal */
.tx {
  position: fixed; left: 50%; bottom: 24px; z-index: 155; transform: translateX(-50%);
  width: min(640px, calc(100vw - 32px)); border-radius: 14px; border: 1px solid var(--line-2);
  background: rgba(12, 12, 11, 0.97); box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.9);
  font: 400 13px/1.6 var(--mono); color: var(--fg-2); animation: pop 0.18s var(--ease);
}
.tx[hidden] { display: none; }
.tx__bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 11.5px; }
.tx__bar span:first-child { display: inline-flex; align-items: center; gap: 8px; color: var(--fg-2); }
.tx__out { max-height: min(46vh, 340px); overflow-y: auto; padding: 12px 14px 4px; }
.tx__l { overflow-wrap: anywhere; }
.tx__l + .tx__l { margin-top: 4px; }
.tx__l b { font-weight: 500; color: var(--fg); }
.tx__l a { color: var(--fg); border-bottom: 1px solid var(--line-3); }
.tx__l a:hover { color: var(--accent); }
.tx__l.is-err { color: var(--accent-3); }
.tx__l.is-ok { color: var(--accent); }
.tx__dim { color: var(--fg-3); }
.tx__p { color: var(--accent); }
.tx__in { display: flex; align-items: center; gap: 10px; padding: 10px 14px 12px; }
.tx__in input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: var(--fg); font: inherit; }

/* Konami: debug mode outlines every chapter and labels what it costs */
.debug main > section { outline: 1px dashed rgba(var(--accent-rgb), 0.55); outline-offset: -1px; }
.debug main > section::after {
  content: attr(data-debug); position: absolute; top: 8px; right: 8px; z-index: 5;
  padding: 4px 8px; border-radius: 6px; background: var(--accent); color: var(--accent-ink);
  font: 400 11px/1.2 var(--mono);
}
.debug .wrap { outline: 1px dotted rgba(var(--w-rgb), 0.18); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1040px) {
  .nav__status { display: none; }
  .wx__row { grid-template-columns: 170px minmax(0, 1fr) 14px; }
  .wx__stat { display: none; }
  .wx__inner { padding-left: 194px; }
  .art, .is-flat .art { grid-template-columns: 44px minmax(0, 1fr) 64px 110px 14px; }
  .art__s { display: none; }
  .hero__grid { grid-template-columns: 1fr; gap: 44px; }
  .hero__title { font-size: clamp(40px, 6.4vw, 60px); }
  .portrait { justify-self: start; }
  .feature { grid-template-columns: 1fr; }
  .feature--flip .feature__info { order: 0; }
  .feature__viz, .feature--flip .feature__viz { border: 0; border-top: 1px solid var(--line); }
  .about { grid-template-columns: 1fr; gap: 40px; }
  .info { max-width: 520px; }
    .lab__grid { grid-template-columns: 1fr 1fr; }
  .spec__bottom { grid-template-columns: 1fr; }
  }

@media (max-width: 880px) {
  .nav__links, .nav__status, .nav__cmd { display: none; }
  .nav__toggle { display: inline-block; }
  .nav__capsule { width: 100%; justify-content: space-between; padding: 0 6px 0 14px; }
  .brand { border-right: 0; }
  .role { grid-template-columns: 1fr; gap: 8px; padding: 30px 0 30px 24px; }
  .role__dot { left: 0; top: 38px; }
  .honors { grid-template-columns: 1fr; gap: 20px; }
}

@media (max-width: 680px) {
  .elsewhere { font-size: 17px; margin-top: 56px; }
  .outro { grid-template-columns: 1fr; gap: 8px; padding-top: 48px; }
  .footer__inner { flex-direction: column; align-items: flex-start; gap: 7px; }
  .footer__inner > * + *:not([hidden])::before { display: none; }
  .agent { grid-template-columns: 1fr; gap: 18px; }
  .tokz { padding: 22px 18px 18px; }
  .temp__opts button small { display: none; }
  .wx__row { grid-template-columns: minmax(0, 1fr) 14px; gap: 6px 12px; }
  .wx__q { grid-column: 1; }
  .wx__chev { grid-column: 2; grid-row: 1; }
  .wx__inner { padding-left: 0; }
  .art, .is-flat .art { grid-template-columns: 34px minmax(0, 1fr) 40px 14px; gap: 10px; }
  .art__d { display: none; }
  .art__v { grid-template-columns: 1fr; }
  .art__v i { display: none; }
  .lib__tools { width: 100%; }
  .lib__search { flex: 1; }
  .lib__search input { width: 100%; }
  .hl { grid-template-columns: 64px minmax(0, 1fr); gap: 12px; }
  .hl em, .hl__cmd { display: none; }
  .now__cell, .now__cell + .now__cell { padding: 18px 0; border-left: 0; }
  .now__cell + .now__cell { border-top: 1px solid var(--line); }
  .shelf__h { flex-direction: column; gap: 6px; }
  :root { --pad: 20px; }
  .section { padding: 88px 0; }
  .shead { margin-bottom: 40px; }
  .hero { padding-top: 112px; }
  .hero__title { font-size: clamp(34px, 10vw, 48px); }
  .hero__title .line { white-space: normal; }
  .hero__field { opacity: 0.4; }
  .portrait { max-width: 210px; }
  .loss > span { display: none; }
  .status-pill { white-space: nowrap; font-size: 12px; gap: 8px; padding: 0 12px 0 10px; }
  .facts { grid-template-columns: 1fr 1fr; gap: 20px 0; margin-top: 56px; }
  .feature__info { padding: 28px 22px; }
  .feature__viz { padding: 20px 18px; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metrics > div:first-child { grid-column: 1 / -1; border-bottom: 1px solid var(--line); }
  .metrics > div:nth-child(2) { padding-left: 0; border-left: 0; }
  .stack__row { grid-template-columns: 1fr; gap: 10px; }
  .mail .btn { flex: 1 1 100%; justify-content: space-between; }
  .mail .btn--lg { font-size: 14px; }
  .lab__grid { grid-template-columns: 1fr; }
  .ask__note { text-align: left; }
  .ask__lineage { grid-template-columns: 1fr; }
  .ask__lineage > span { grid-row: auto; }
  .ask .index__caption { flex-direction: column; align-items: flex-start; gap: 6px; }
  .ask__why { grid-template-columns: 1fr; gap: 16px; }
  .ask__hits button { grid-template-columns: 40px minmax(0, 1fr); }
  .ask__snip { display: none; }
  .ask__answer { font-size: 17px; }
  .writing__stats { grid-template-columns: 1fr 1fr; row-gap: 20px; }
  .latest__row { grid-template-columns: minmax(0, 1fr) 20px; gap: 8px 12px; }
  .latest__k, .latest__main, .latest__where { grid-column: 1; }
  .latest__go { grid-column: 2; grid-row: 1; }
  .writing .index__caption { flex-wrap: wrap; }
  .writing__stats span:nth-child(3) { padding-left: 0; border-left: 0; }
  .writing__stats b { font-size: 22px; }
  .sig { width: 220px; }
  .spec { padding: 22px 18px 18px; }
  .spec__head { flex-direction: column; gap: 14px; }
  .spec__out { font-size: 15px; }
  .spec__ctrl { grid-template-columns: 1fr; }
  .spec__stats { grid-template-columns: 1fr 1fr; row-gap: 14px; }
  .hl { font-size: 14.5px; }
    .cmdk { padding-top: 10vh; }
  .quote { grid-template-columns: auto 1fr; margin-top: 64px; }
  .quote__by { grid-column: 2; white-space: normal; }
  .quote__text { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; }
  [data-reveal] { opacity: 1; transform: none; }
}
