/* Prefill home. Same visual system as learn.prefill.here (nullfuse primitives):
   black & white, yellow only as highlight, no radius, no blur, steps() motion. */

@font-face { font-family: 'Geist Variable'; font-style: normal; font-display: swap; font-weight: 100 900; src: url(/fonts/geist-latin-wght-normal.woff2) format('woff2'); }
@font-face { font-family: 'Geist Mono Variable'; font-style: normal; font-display: swap; font-weight: 100 900; src: url(/fonts/geist-mono-latin-wght-normal.woff2) format('woff2'); }
@font-face { font-family: 'EB Garamond Variable'; font-style: normal; font-display: swap; font-weight: 400 800; src: url(/fonts/eb-garamond-latin-wght-normal.woff2) format('woff2'); }
@font-face { font-family: 'EB Garamond Variable'; font-style: italic; font-display: swap; font-weight: 400 800; src: url(/fonts/eb-garamond-latin-wght-italic.woff2) format('woff2'); }

:root {
  color-scheme: light;
  --bg: oklch(1 0 0);
  --surface: oklch(0.985 0 0);
  --surface-2: oklch(0.958 0 0);
  --border: oklch(0.88 0 0);
  --ink: oklch(0.14 0 0);
  --fg: oklch(0.14 0 0);
  --fg-muted: oklch(0.45 0 0);
  --fg-subtle: oklch(0.58 0 0);
  --accent: oklch(0.14 0 0);
  --accent-fg: oklch(1 0 0);
  --sun: oklch(0.89 0.15 95);
  --sun-fg: oklch(0.14 0 0);
  --sage: oklch(0.68 0.16 150);
  --shadow: oklch(0.14 0 0);
  --bevel-light: oklch(1 0 0 / 0.55);
  --bevel-dark: oklch(0 0 0 / 0.1);
  --px: 2px;

  --font-sans: 'Geist Variable', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'Geist Mono Variable', ui-monospace, 'SF Mono', Menlo, monospace;
  --font-serif: 'EB Garamond Variable', Garamond, 'Times New Roman', serif;

  --gutter: 16px;
  --header-h: 52px;
  --wide: 68rem;
}
.dark {
  color-scheme: dark;
  --bg: oklch(0.1 0 0);
  --surface: oklch(0.155 0 0);
  --surface-2: oklch(0.2 0 0);
  --border: oklch(0.3 0 0);
  --ink: oklch(0.97 0 0);
  --fg: oklch(0.97 0 0);
  --fg-muted: oklch(0.72 0 0);
  --fg-subtle: oklch(0.56 0 0);
  --accent: oklch(0.97 0 0);
  --accent-fg: oklch(0.1 0 0);
  --sun: oklch(0.87 0.15 95);
  --sage: oklch(0.75 0.16 150);
  --shadow: oklch(0.42 0 0);
  --bevel-light: oklch(1 0 0 / 0.14);
  --bevel-dark: oklch(0 0 0 / 0.35);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; font-family: var(--font-sans); -webkit-font-smoothing: antialiased; }
body { margin: 0; background: var(--bg); color: var(--fg); font-size: 0.9375rem; line-height: 1.6; overflow-x: hidden; }
::selection { background: var(--sun); color: var(--sun-fg); }
:focus-visible { outline: 2px dashed var(--ink); outline-offset: 3px; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
svg { image-rendering: pixelated; }

.wrap { max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter); }
.muted { color: var(--fg-muted); }
.label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-subtle);
}

/* ── pixel primitives ─────────────────────────────────── */
.pixel {
  --bevel-a: var(--bevel-dark);
  --bevel-b: var(--bevel-light);
  box-shadow:
    inset calc(var(--px) * -1) calc(var(--px) * -1) 0 0 var(--bevel-a),
    inset var(--px) var(--px) 0 0 var(--bevel-b),
    calc(var(--px) * -1) 0 0 0 var(--ink),
    var(--px) 0 0 0 var(--ink),
    0 calc(var(--px) * -1) 0 0 var(--ink),
    0 var(--px) 0 0 var(--ink),
    var(--drop, 0px) calc(var(--px) + var(--drop, 0px)) 0 0 var(--shadow);
}
/* Solid band over the whole glyph box, so letters with tails (p, g, y) stay inside it. */
.swash {
  background: var(--sun);
  padding: 0 0.12em;
  color: var(--sun-fg);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.cursor {
  display: inline-block;
  width: 0.5em;
  height: 0.95em;
  background: var(--accent);
  animation: blink 1s steps(1, end) infinite;
}
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ── buttons ──────────────────────────────────────────── */
.btn {
  --drop: var(--px);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1.1rem;
  background: var(--surface);
  color: var(--fg);
  font-size: 0.875rem;
  font-weight: 560;
  line-height: 1.2;
  text-decoration: none;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { --bevel-a: var(--bevel-light); --bevel-b: var(--bevel-dark); --drop: 0px; transform: translateY(var(--px)); filter: none; }
.btn--primary { background: var(--accent); color: var(--accent-fg); }
.btn--sun { background: var(--sun); color: var(--sun-fg); }

/* ── top bar ──────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--header-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 var(--gutter);
  background: var(--bg);
  border-bottom: var(--px) solid var(--border);
}
.topbar__nav { display: flex; gap: 1.1rem; }
.topbar__nav a { font-size: 0.8125rem; font-weight: 550; text-decoration: none; color: var(--fg-muted); }
.topbar__nav a:hover { background: var(--sun); color: var(--sun-fg); }
.wordmark {
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.wordmark .logo { margin-right: 0.5rem; }
.theme { justify-self: end; width: 36px; height: 36px; display: grid; place-items: center; }
.theme:hover { background: var(--surface-2); }
.dark .only-light, html:not(.dark) .only-dark { display: none; }

/* ── hero ─────────────────────────────────────────────── */
.hero { padding: 5rem 0 4rem; }
.hero__grid { display: grid; gap: 3.5rem; align-items: center; }
@media (min-width: 960px) { .hero__grid { grid-template-columns: 1.05fr 1fr; gap: 4rem; } }
.hero__copy > * { animation: rise 400ms steps(4, end) both; }
.hero__copy > :nth-child(2) { animation-delay: 80ms; }
.hero__copy > :nth-child(3) { animation-delay: 160ms; }
.hero__copy > :nth-child(4) { animation-delay: 240ms; }
.display {
  font-family: var(--font-serif);
  font-weight: 450;
  font-size: clamp(2.75rem, 1.5rem + 5vw, 5rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0 0 1.4rem;
}
.display em { font-style: italic; }
.lead { font-size: 1.125rem; line-height: 1.55; color: var(--fg-muted); max-width: 32rem; margin: 0 0 2rem; }
.ctas { display: flex; flex-wrap: wrap; gap: 1rem; }

/* ── request timeline (hero figure) ───────────────────── */
.timeline { margin: 0; padding: 1.25rem; background: var(--surface); --drop: 6px; }
.timeline__head { display: flex; justify-content: flex-end; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.lane { display: grid; grid-template-columns: 4.5rem 1fr; gap: 0.75rem; align-items: center; margin-bottom: 0.9rem; }
.lane__name { font-family: var(--font-mono); font-size: 0.75rem; font-weight: 600; }
.lane__name small { display: block; white-space: nowrap; font-weight: 400; color: var(--fg-subtle); font-size: 0.625rem; letter-spacing: 0.04em; margin-top: 0.15rem; }
.cells { display: grid; grid-template-columns: repeat(16, 1fr); gap: 3px; }
.cell { aspect-ratio: 1; background: var(--surface-2); }
.lane--prefill .cell.on { background: var(--ink); }
.lane--decode .cell.on { background: var(--sun); box-shadow: inset 0 0 0 var(--px) var(--ink); }
.lane--decode .cell.next { background: var(--ink); animation: blink 0.5s steps(1, end) infinite; }
.timeline__foot {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 1.25rem;
  border-top: var(--px) solid var(--border);
  padding-top: 1rem;
  gap: 0.75rem;
}
.stat b { display: block; font-family: var(--font-mono); font-size: 1.25rem; font-weight: 600; letter-spacing: -0.02em; margin-top: 0.45rem; font-variant-numeric: tabular-nums; }
.stat .label { white-space: nowrap; }
.flag { color: var(--sun-fg); background: var(--sun); padding: 0.2rem 0.35rem; }
.flag[hidden] { display: inline-block; visibility: hidden; }
.timeline__note { margin: 0.9rem 0 0; font-size: 0.75rem; color: var(--fg-subtle); }

/* ── sections ─────────────────────────────────────────── */
.section { padding: 5rem 0; border-top: var(--px) solid var(--border); }
.section__head { display: grid; gap: 0.9rem; margin-bottom: 2.75rem; max-width: 40rem; }
.h2 {
  font-family: var(--font-serif);
  font-weight: 450;
  font-size: clamp(2rem, 1.4rem + 2vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 0;
}
.section__head p { margin: 0; font-size: 1.0625rem; color: var(--fg-muted); line-height: 1.6; }

/* phases */
.phases { display: grid; gap: 1.5rem; }
@media (min-width: 760px) { .phases { grid-template-columns: 1fr 1fr; gap: 2rem; } }
.phase { padding: 1.5rem; background: var(--surface); --drop: 4px; }
.phase h3 { font-family: var(--font-serif); font-weight: 500; font-size: 1.75rem; margin: 0 0 0.4rem; letter-spacing: -0.01em; }
.phase p { margin: 0 0 1.25rem; color: var(--fg-muted); }
.phase ul { list-style: none; margin: 0; padding: 1rem 0 0; border-top: var(--px) solid var(--border); display: grid; gap: 0.4rem; font-size: 0.9375rem; font-weight: 550; }
.phase li::before { content: ''; display: inline-block; width: 6px; height: 6px; background: var(--ink); margin: 0 0.6rem 0.15em 0; }
.phases__note { margin: 2rem 0 0; max-width: 40rem; font-size: 1.0625rem; }

/* projects */
.projects { list-style: none; margin: 0; padding: 0; border-top: var(--px) solid var(--ink); }
.project { border-bottom: var(--px) solid var(--border); }
.project a, .project > div {
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: 1rem;
  align-items: center;
  padding: 1.5rem 0.75rem;
  text-decoration: none;
}
.project a:hover { background: var(--sun); color: var(--sun-fg); }
.project a:hover .muted, .project a:hover .label { color: var(--sun-fg); }
.project__num { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--fg-subtle); }
.project__title { font-family: var(--font-serif); font-size: 1.75rem; line-height: 1.1; display: block; }
.project__title small { font-family: var(--font-mono); font-size: 0.75rem; color: var(--fg-subtle); margin-left: 0.5rem; letter-spacing: 0; }
.project__desc { display: block; margin-top: 0.35rem; }
.status { display: inline-flex; align-items: center; gap: 0.45rem; }
.status::before { content: ''; width: 8px; height: 8px; background: var(--fg-subtle); }
.status--live::before { background: var(--sage); animation: blink 1.6s steps(1, end) infinite; }
.project--soon { color: var(--fg-subtle); }
@media (max-width: 560px) {
  .project a, .project > div { grid-template-columns: 1fr; gap: 0.5rem; }
  .project__num { display: none; }
}

/* principles */
.principles { display: grid; gap: 2.5rem; }
@media (min-width: 760px) { .principles { grid-template-columns: repeat(3, 1fr); gap: 2rem; } }
.principle svg { display: block; margin-bottom: 1rem; }
.principle h3 { font-size: 1.0625rem; font-weight: 650; margin: 0 0 0.4rem; letter-spacing: -0.01em; }
.principle p { margin: 0; color: var(--fg-muted); }

/* closing band */
.band { background: var(--accent); color: var(--accent-fg); padding: 4.5rem 0; }
.band__inner { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 2rem; }
.band .h2 { max-width: 34rem; }
.band .btn { --shadow: var(--sun); }

/* footer */
.footer { padding: 2.5rem 0 3rem; font-size: 0.8125rem; }
.footer__row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; }
.footer nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
.footer nav a { text-decoration: none; font-weight: 550; }
.footer nav a:hover { background: var(--sun); color: var(--sun-fg); }
.link { text-decoration: underline; text-decoration-thickness: var(--px); text-underline-offset: 3px; text-decoration-color: var(--border); }
.link:hover { background: var(--sun); color: var(--sun-fg); }

@media (max-width: 520px) {
  .hero { padding: 3rem 0 3rem; }
  .section { padding: 3.5rem 0; }
  .topbar__nav a:nth-child(n+2) { display: none; }
  .lane { grid-template-columns: 3.75rem 1fr; gap: 0.5rem; }
  .stat b { font-size: 1.05rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
