@font-face { font-family: "Licht Serif"; src: url("/fonts/licht/LichtSerif-Light.woff2") format("woff2"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Licht Serif"; src: url("/fonts/licht/LichtSerif-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Geist"; src: url("/fonts/Geist-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Geist"; src: url("/fonts/Geist-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/fonts/GeistMono-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/fonts/GeistMono-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --void: #000;
  --plate: #0b0a08;
  --rule: #2a2418;
  --rule-strong: #4a3f27;
  --gold: #e3b04b;
  --gold-dim: #8c6b2a;
  --gold-ink: #1a1408;
  --text: #ede6d6;
  --text-2: #9a9284;
  --text-3: #5e584d;
  --danger: #e5484d;

  --serif: "Licht Serif", Georgia, "Times New Roman", serif;
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --ease: cubic-bezier(0.2, 0.9, 0.1, 1);
  --t-fast: 90ms;
  --t: 140ms;

  --gutter: clamp(16px, 4vw, 56px);
  --max: 1320px;
  --cut: 10px;
}

* { box-sizing: border-box; }
html { background: var(--void); color-scheme: dark; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--void);
  color: var(--text);
  font: 400 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
::selection { background: var(--gold); color: var(--gold-ink); }
a { color: inherit; }
img, svg, canvas { display: block; }
html { scrollbar-color: var(--rule-strong) var(--void); scrollbar-width: thin; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--void); }
::-webkit-scrollbar-thumb { background: var(--rule-strong); }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dim); }

:focus-visible { outline: 1px solid var(--gold); outline-offset: 3px; }

.skip { position: absolute; left: -9999px; top: 8px; z-index: 10; background: var(--gold); color: var(--gold-ink); padding: 8px 12px; font: 500 13px var(--mono); }
.skip:focus { left: 8px; }

kbd {
  display: inline-block;
  font: 500 0.78em/1 var(--mono);
  color: var(--gold);
  border: 1px solid var(--gold-dim);
  padding: 0.28em 0.45em 0.24em;
  margin: 0 0.12em;
  vertical-align: 0.08em;
  letter-spacing: 0.02em;
}

/* ---------- top bar ---------- */
.bar {
  position: sticky; top: 0; z-index: 5;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: 24px;
  height: 56px;
  padding: 0 var(--gutter);
  background: var(--void);
  border-bottom: 1px solid var(--rule);
}
.mark { display: inline-flex; align-items: center; gap: 10px; font: 500 13px var(--mono); letter-spacing: 0.32em; text-decoration: none; }
.mark-glyph { flex: none; display: block; }
.bar nav { display: flex; gap: 28px; }
.bar nav a, .bar-gh {
  font: 400 12px var(--mono); text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--text-2); text-decoration: none;
  transition: color var(--t-fast) var(--ease);
}
.bar nav a:hover, .bar-gh:hover { color: var(--gold); }
.bar-gh { justify-self: end; }

/* ---------- shared ---------- */
.label {
  margin: 0;
  font: 400 11px/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
}
.idx { color: var(--gold); margin-right: 10px; }
.idx::after { content: " —"; color: var(--text-3); }

h1, h2 { font-family: var(--serif); font-weight: 300; letter-spacing: -0.015em; margin: 0; }
h2 { font-size: clamp(30px, 3.6vw, 48px); line-height: 1.06; max-width: 18ch; }

.btn {
  --c: var(--cut);
  display: inline-flex; align-items: center; justify-content: center;
  height: 46px; padding: 0 22px;
  font: 500 14px var(--sans); letter-spacing: 0.01em; text-decoration: none;
  clip-path: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, 0 100%, 0 var(--c));
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.btn-gold { background: var(--gold); color: var(--gold-ink); }
.btn-gold:hover { background: #f0c063; }
.btn-gold:active { background: var(--gold-dim); }
.btn-line { color: var(--text); box-shadow: inset 0 0 0 1px var(--rule-strong); }
.btn-line:hover { color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold-dim); }

.sect {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(72px, 10vw, 128px) var(--gutter) 0;
}
.sect-head {
  display: grid; grid-template-columns: minmax(180px, 1fr) 3fr; gap: 24px;
  align-items: baseline;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  margin-bottom: clamp(36px, 5vw, 64px);
}
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.prose p { margin: 0 0 1.1em; color: var(--text-2); max-width: 52ch; font-size: 16px; }
.prose p:first-child { color: var(--text); }
.prose em { font-style: normal; color: var(--gold); }
.caption { margin: 28px 0 0; color: var(--text-2); max-width: 64ch; }
.note { margin-top: 18px; font: 400 11px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); }

.caret {
  display: inline-block; width: 1px; height: 1.05em; margin-left: 1px;
  background: var(--gold); vertical-align: -0.15em;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---------- hero ---------- */
.hero {
  max-width: var(--max); margin: 0 auto;
  min-height: calc(100svh - 56px);
  padding: clamp(40px, 7vw, 96px) var(--gutter) clamp(48px, 6vw, 80px);
  display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(32px, 5vw, 80px);
  align-items: center;
}
.hero h1 {
  font-size: clamp(52px, 7.2vw, 124px);
  line-height: 0.98;
  margin: 28px 0 28px;
}
.hero h1 em { font-style: normal; color: var(--gold); }
.lede { margin: 0; font-size: clamp(16px, 1.35vw, 18px); color: var(--text-2); max-width: 44ch; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 36px 0 22px; }
.meta { margin: 0; font: 400 12px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-2); }
.meta span { color: var(--gold-dim); margin: 0 6px; }

.instrument { margin: 0; justify-self: center; width: 100%; max-width: 520px; }
.instrument-frame { position: relative; aspect-ratio: 1; }
#iris { width: 100%; height: 100%; }
.corner { position: absolute; width: 18px; height: 18px; border-color: var(--rule-strong); border-style: solid; border-width: 0; }
.corner.tl { top: 0; left: 0; border-top-width: 1px; border-left-width: 1px; }
.corner.tr { top: 0; right: 0; border-top-width: 1px; border-right-width: 1px; }
.corner.bl { bottom: 0; left: 0; border-bottom-width: 1px; border-left-width: 1px; }
.corner.br { bottom: 0; right: 0; border-bottom-width: 1px; border-right-width: 1px; }
.readout {
  display: grid; grid-template-columns: repeat(3, 1fr) auto; gap: 0;
  margin-top: 14px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  font: 400 11px/1.3 var(--mono); letter-spacing: 0.08em; text-transform: uppercase;
}
.readout > div { padding: 10px 12px 10px 0; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.readout span { color: var(--text-3); }
.readout b { font-weight: 400; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.mic-btn {
  align-self: center;
  background: none; border: 1px solid var(--rule-strong); color: var(--text-2);
  font: 400 11px var(--mono); letter-spacing: 0.08em; text-transform: uppercase;
  padding: 9px 12px; cursor: pointer;
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.mic-btn:hover, .mic-btn[aria-pressed="true"] { color: var(--gold); border-color: var(--gold-dim); }

/* Live transcription under the hero instrument. */
.live { margin-top: 14px; border-bottom: 1px solid var(--rule); padding-bottom: 14px; }
.live-head { display: grid; gap: 6px; font: 400 11px/1.4 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; }
.live-model { color: var(--gold-dim); }
.live-status { color: var(--text-2); text-transform: none; letter-spacing: 0.02em; }
.live[data-state="ready"] .live-status { color: var(--gold); }
.live[data-state="error"] .live-status { color: var(--text-2); }
.live-track { display: block; height: 1px; background: var(--rule); overflow: hidden; }
.live-track i { display: block; height: 100%; background: var(--gold); transform-origin: left; transform: scaleX(0); transition: transform 200ms linear; }
.live[data-state="ready"] .live-track, .live[data-state="error"] .live-track { visibility: hidden; }
.live-text { margin: 14px 0 0; min-height: 4.8em; font-size: 17px; line-height: 1.6; color: var(--text); overflow-wrap: anywhere; }
.live-now { color: var(--gold); }
.live-text .caret { display: inline-block; width: 1px; height: 1.1em; margin-left: 2px; vertical-align: -0.15em; background: var(--gold); animation: blink 1.1s steps(1) infinite; }
.live-note { margin: 10px 0 0; font-size: 12px; line-height: 1.5; color: var(--text-3); }
.live-note a { color: var(--text-2); }

/* Chamfered plates: clip-path removes the outline at the cut, so draw the diagonal back. */
.chamfer { position: relative; }
.chamfer::before, .chamfer::after {
  content: ""; position: absolute; width: calc(var(--c) * 1.4142); height: 1px;
  background: var(--rule-strong); pointer-events: none;
}
.chamfer::before { left: 0; top: var(--c); transform-origin: 0 0; transform: rotate(-45deg); }
.chamfer::after { right: 0; bottom: var(--c); transform-origin: 100% 100%; transform: rotate(-45deg); }
.btn-gold.chamfer::before, .btn-gold.chamfer::after { display: none; }
.btn-line.chamfer:hover::before, .btn-line.chamfer:hover::after { background: var(--gold-dim); }

/* ---------- 01 flow ---------- */
.flow { display: grid; grid-template-columns: minmax(220px, 1fr) 2.2fr; gap: clamp(28px, 5vw, 72px); align-items: center; }
.steps { list-style: none; margin: 0; padding: 0; }
.steps li {
  display: grid; grid-template-columns: 32px 1fr; grid-template-rows: auto auto; column-gap: 12px;
  padding: 18px 0; border-bottom: 1px solid var(--rule);
  color: var(--text-3);
  transition: color var(--t) var(--ease);
}
.steps li:first-child { border-top: 1px solid var(--rule); }
.step-n { grid-row: span 2; font: 400 12px/1.9 var(--mono); color: var(--text-3); transition: color var(--t) var(--ease); }
.step-t { font: 400 22px/1.25 var(--serif); color: inherit; }
.step-d { font-size: 13px; color: var(--text-3); }
.steps li.on { color: var(--text); }
.steps li.on .step-n { color: var(--gold); }
.steps kbd { font-size: 12px; }

.stage {
  position: relative;
  height: 340px;
  border: 1px solid var(--rule);
  background: var(--void);
  overflow: hidden;
}
.field { position: absolute; left: 7%; right: 7%; top: 40px; }
.field-label { font: 400 11px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); }
.field-text { margin: 12px 0 0; font-size: clamp(16px, 1.6vw, 20px); line-height: 1.5; min-height: 3em; color: var(--text); }

.pill {
  --c: 9px;
  position: absolute; left: 50%; bottom: 36px;
  display: flex; align-items: center; gap: 12px;
  height: 46px; padding: 0 18px 0 8px; max-width: 86%;
  background: var(--plate);
  box-shadow: inset 0 0 0 1px var(--rule-strong);
  clip-path: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, 0 100%, 0 var(--c));
  transform: translate(-50%, 8px); opacity: 0;
  transition: opacity 140ms var(--ease), transform 180ms var(--ease);
}
.pill.show { opacity: 1; transform: translate(-50%, 0); }
.pill-iris { width: 34px; height: 34px; flex: none; }
.pill-status { font: 500 10px var(--mono); letter-spacing: 0.16em; color: var(--gold); flex: none; }
.pill-text { font-size: 14px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: clip; direction: rtl; text-align: left; min-width: 0; }
.pill-text:empty { display: none; }

/* ---------- 02 seam ---------- */
.seam { margin: 0; border-top: 1px solid var(--rule); }
.seam-row { display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--rule); align-items: baseline; }
.seam-row p { margin: 0; font: 300 clamp(20px, 2vw, 26px)/1.3 var(--serif); }
.seam-tag { font: 400 11px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); }
.seam-punct { color: var(--gold); display: inline-block; transition: opacity var(--t) var(--ease), transform var(--t) var(--ease); }
.seam-punct.gone { opacity: 0; transform: translateY(-6px); }
.seam-new { color: var(--text-2); }
.seam-out p, #seam-out { color: var(--text); }
#seam-out b { color: var(--gold); font-weight: 400; }

/* ---------- 03 fix ---------- */
.fix { margin: 0; }
.fix-line { margin: 0; font: 300 clamp(22px, 2.2vw, 30px)/1.6 var(--serif); }
.fix-after { color: var(--text-2); margin-top: 26px; }
.fix-after b { color: var(--gold); font-weight: 400; }
.chunk { position: relative; color: var(--gold); white-space: nowrap; }
.chunk::before { /* HUD bracket under the chunk */
  content: ""; position: absolute; left: -2px; right: -2px; bottom: -6px; height: 7px;
  border: 1px solid var(--gold-dim); border-top: 0;
}
.chunk-tag {
  position: absolute; left: -2px; top: calc(100% + 8px);
  font: 400 10px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold-dim);
  white-space: nowrap;
}
.popup {
  --c: 10px;
  margin-top: 44px;
  padding: 18px 20px 14px;
  background: var(--plate);
  box-shadow: inset 0 0 0 1px var(--rule-strong);
  clip-path: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, 0 100%, 0 var(--c));
  max-width: 460px;
}
.popup-row { display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 12px; padding: 8px 0; }
.popup-k { font: 400 11px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); }
.popup-chip { justify-self: start; font: 400 13px var(--mono); color: var(--gold); border: 1px solid var(--gold-dim); padding: 5px 9px; }
.popup-input { font-size: 17px; border-bottom: 1px solid var(--gold); padding: 4px 0 6px; }
.popup-foot { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--rule); font: 400 11px var(--mono); color: var(--text-3); }
.popup-foot kbd { font-size: 10px; color: var(--text-2); border-color: var(--rule-strong); }

/* ---------- 04 timeline ---------- */
.timeline { margin: 0; }
.timeline svg { width: 100%; height: auto; overflow: visible; }
.tl-grid line { stroke: var(--rule-strong); stroke-width: 1; }
.tl-ticks line { stroke: var(--rule-strong); stroke-width: 1; }
.tl-ticks text, .tl-keys text, .tl-span text { font: 400 11px var(--mono); letter-spacing: 0.12em; fill: var(--text-3); }
.tl-keys line { stroke: var(--gold); stroke-width: 1; }
.tl-keys text { fill: var(--gold); }
.tl-scroll { overflow-x: auto; }
.tl-wave line { stroke: var(--text-3); stroke-width: 1.5; stroke-linecap: butt; }
.tl-wave line.in { stroke: var(--gold); }
.tl-span path { fill: none; stroke: var(--gold-dim); stroke-width: 1; }
.tl-span text { fill: var(--text-3); }
.tl-span .tl-cap { fill: var(--gold); }

/* ---------- 05 models ---------- */
.table-wrap { overflow-x: auto; border-top: 1px solid var(--rule-strong); }
.models { width: 100%; border-collapse: collapse; font: 400 13px/1.4 var(--mono); }
.models th, .models td { text-align: left; padding: 16px 20px 16px 0; border-bottom: 1px solid var(--rule); vertical-align: baseline; white-space: nowrap; }
.models thead th { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-2); font-weight: 400; padding-top: 12px; padding-bottom: 12px; }
.models tbody th { font: 400 18px var(--serif); color: var(--text); }
.models td { color: var(--text-2); font-variant-numeric: tabular-nums; }
.models .is-default th, .models .is-default td:first-of-type { color: var(--gold); }
.tag { font: 500 10px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold-ink); background: var(--gold); padding: 3px 6px; margin-left: 10px; vertical-align: 3px; }

/* ---------- 06 figures ---------- */
.figures { margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--rule); }
.figures > div { padding: 22px 28px 8px 0; }
.figures > div + div { padding-left: 28px; border-left: 1px solid var(--rule); }
.figures dt { font: 400 11px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); }
.figures dd { margin: 14px 0 12px; font: 300 clamp(44px, 5.2vw, 72px)/1 var(--serif); color: var(--text); letter-spacing: -0.02em; }
.figures > div:first-child dd { color: var(--gold); }
.figures p { margin: 0; color: var(--text-2); font-size: 14px; max-width: 32ch; }

/* ---------- 07 cli + install ---------- */
.code {
  margin: 0; padding: 22px 24px; overflow-x: auto;
  background: var(--plate); box-shadow: inset 0 0 0 1px var(--rule);
  font: 400 13px/1.75 var(--mono); color: var(--text);
}
.code .c { color: var(--text-3); }
.code b { color: var(--gold); font-weight: 400; }
.install { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.install li { display: grid; grid-template-columns: 32px 1fr; gap: 12px; padding: 18px 0; border-bottom: 1px solid var(--rule); }
.install .step-n { color: var(--gold); }
.install b { font: 400 21px/1.3 var(--serif); }
.install b kbd { font-size: 12px; }
.install p { margin: 6px 0 0; color: var(--text-2); font-size: 14px; }
.install a { color: var(--gold); text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* ---------- 08 credits ---------- */
.credits { list-style: none; margin: 0; padding: 0; columns: 3 260px; column-gap: 40px; }
.credits li { break-inside: avoid; display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.credits a { text-decoration: none; transition: color var(--t-fast) var(--ease); }
.credits a:hover { color: var(--gold); }
.credits span { font: 400 11px var(--mono); letter-spacing: 0.06em; color: var(--text-2); text-align: right; white-space: nowrap; }

/* ---------- footer ---------- */
.foot { max-width: var(--max); margin: clamp(96px, 12vw, 160px) auto 0; padding: 0 var(--gutter) 40px; }
.foot-big { margin: 0 0 32px; font: 300 clamp(64px, 13vw, 200px)/0.9 var(--serif); letter-spacing: -0.03em; color: var(--text); }
.foot-big span { display: block; font: 400 12px var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-3); margin-top: 18px; }
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 18px; border-top: 1px solid var(--rule); font: 400 12px var(--mono); color: var(--text-3); }
.foot-row a { color: var(--text-2); text-decoration: none; }
.foot-row a:hover { color: var(--gold); }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(8px); transition: opacity 260ms var(--ease), transform 260ms var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .instrument { max-width: 440px; justify-self: start; }
  .flow { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
  .split-rev .prose { order: -1; }
}
@media (max-width: 760px) {
  .bar { grid-template-columns: 1fr auto; }
  .bar nav { display: none; }
  .sect-head { grid-template-columns: 1fr; gap: 14px; }
  .figures { grid-template-columns: 1fr; }
  .figures > div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--rule); }
  .readout { grid-template-columns: repeat(3, 1fr); }
  .mic-btn { grid-column: 1 / -1; margin: 0 0 10px; }
  .stage { height: 300px; }
  .seam-row { grid-template-columns: 1fr; gap: 6px; }
  .popup-row { grid-template-columns: 1fr; gap: 6px; }
  .credits span { white-space: normal; }
  .chunk-tag { display: none; }
  .tl-scroll svg { min-width: 640px; }
}
@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; }
  .reveal { opacity: 1; transform: none; }
}
