/* LLMCraft — waitlist landing. Dark chronicle register, zero monospace.
 * Type architecture (per genre font audit): proportional pixel display
 * (Pixelify Sans) over neutral proportional body (IBM Plex Sans) — the
 * minecraft.net split. Both variable woff2, self-hosted, OFL. */

@font-face {
  font-family: "Pixelify Sans";
  src: url("/fonts/PixelifySans-var.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans";
  src: url("/fonts/IBMPlexSans-var.woff2") format("woff2");
  font-weight: 100 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans";
  src: url("/fonts/IBMPlexSans-Italic-var.woff2") format("woff2");
  font-weight: 100 700;
  font-style: italic;
  font-display: swap;
}

:root {
  --bg: #07070e;
  --bg-raise: #0d0d1a;
  --panel: #0b0b15;
  --panel-edge: #262637;
  --ink: #e8dcbb;
  --dim: #a3977a;
  --faint: #6d654f;
  --gold: #d9a83e;
  --gold-dim: #8a6d2a;
  --red: #cc4a3f;
  --green: #7fc97f;
  --font: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --font-display: "Pixelify Sans", "Trebuchet MS", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: radial-gradient(ellipse 120% 60% at 50% -10%, var(--bg-raise) 0%, var(--bg) 55%) fixed var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--gold); color: #0b0b14; }

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

a { color: var(--gold); text-decoration-color: var(--gold-dim); text-underline-offset: 3px; }
a:hover { color: var(--ink); }

.wrap { max-width: 74rem; margin: 0 auto; padding: 0 1.25rem; }

/* ---------- masthead strip ---------- */

.masthead {
  border-bottom: 1px solid var(--panel-edge);
  padding: 0.55rem 0;
  text-align: center;
  color: var(--faint);
  font-size: 0.75rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
}

/* ---------- hero ---------- */

.hero { text-align: center; padding: 4.5rem 0 2.75rem; }

.eyebrow {
  color: var(--gold);
  letter-spacing: 0.38em;
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 500;
}

.wordmark {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 11vw, 7rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.05;
  margin: 0.5rem 0 0.4rem;
  text-shadow: 0 0 32px rgba(217, 168, 62, 0.25);
}

.headline {
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  font-style: italic;
  color: var(--ink);
}

.subhead {
  color: var(--dim);
  max-width: 46rem;
  margin: 0.9rem auto 2.2rem;
  font-size: 1.04rem;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gold);
  background: #12101e;
  border: 2px solid var(--gold);
  padding: 0.8rem 1.8rem;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

.btn:hover {
  background: var(--gold);
  color: #0b0b14;
  box-shadow: 0 0 28px rgba(217, 168, 62, 0.35);
}

.roster-count {
  display: block;
  margin-top: 1rem;
  color: var(--faint);
  font-style: italic;
  font-size: 0.95rem;
  min-height: 1.4em;
}

/* ---------- sections & headings ---------- */

section { padding: 3.25rem 0; }

.rule-head {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 0.75rem;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink);
}

.rule-head::before,
.rule-head::after {
  content: "";
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, transparent, var(--gold-dim));
}

.rule-head::after {
  background: linear-gradient(90deg, var(--gold-dim), transparent);
}

.section-intro {
  text-align: center;
  color: var(--dim);
  max-width: 44rem;
  margin: 0 auto 2.5rem;
  font-style: italic;
}

/* ---------- gif panels ---------- */

.panorama { padding-top: 0; }

.dispatch-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.6rem;
}

.gif {
  border: 1px solid var(--panel-edge);
  background: var(--panel);
  box-shadow: 0 0 0 4px #090912, 0 14px 44px rgba(0, 0, 0, 0.55);
}

.gif-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.45rem 0.85rem;
  border-bottom: 1px solid var(--panel-edge);
  color: var(--dim);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0.04em;
}

.gif-head .dot { color: var(--red); }

.gif-head .gif-dl {
  color: inherit;
  text-decoration: none;
}

.gif-head .gif-dl::after {
  content: " ↓";
  color: var(--gold-dim);
}

.gif-head .gif-dl:hover {
  color: var(--gold);
  text-decoration: underline;
}

.gif-head .loop { color: var(--gold-dim); white-space: nowrap; }

.gif-screen { position: relative; background: var(--panel); }

.gif-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.022) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 58%, rgba(0, 0, 0, 0.32));
}

.gif canvas { display: block; width: 100%; height: auto; cursor: pointer; }

.gif figcaption {
  padding: 0.6rem 0.85rem 0.8rem;
  color: var(--dim);
  font-style: italic;
  font-size: 0.93rem;
}

.gif--missing { display: none; }

/* ---------- features ---------- */

.features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.6rem;
  margin-top: 2.25rem;
}

.feature {
  border: 4px double var(--gold-dim);
  background: #0a0a12;
  padding: 1.6rem 1.7rem;
}

.feature h3 {
  font-family: var(--font-display);
  color: var(--gold);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  margin-bottom: 0.55rem;
}

.feature h3::before { content: "◆ "; color: var(--gold-dim); }

.feature p { color: var(--dim); }

/* ---------- edge strip ---------- */

.edge {
  border-top: 1px solid var(--panel-edge);
  border-bottom: 1px solid var(--panel-edge);
  background: rgba(13, 13, 26, 0.5);
  text-align: center;
}

.edge-body { color: var(--dim); max-width: 44rem; margin: 0.75rem auto 1.6rem; }

.stack-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
}

.tag {
  border: 1px solid var(--panel-edge);
  color: var(--dim);
  padding: 0.35rem 0.85rem;
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.tag--live { border-color: var(--gold-dim); color: var(--gold); }

/* ---------- final call ---------- */

.final-call { text-align: center; padding: 4rem 0 4.5rem; }

.final-call .lede {
  font-size: 1.3rem;
  font-style: italic;
  margin-bottom: 1.6rem;
}

/* ---------- footer ---------- */

footer {
  border-top: 1px solid var(--panel-edge);
  padding: 2.2rem 0 2.8rem;
  text-align: center;
  color: var(--faint);
  font-size: 0.9rem;
}

footer p + p { margin-top: 0.4rem; }

/* ---------- waitlist dialog ---------- */

dialog {
  border: 4px double var(--gold-dim);
  background: #0b0b14;
  color: var(--ink);
  padding: 0;
  max-width: 30rem;
  width: calc(100% - 2rem);
  margin: auto;
  box-shadow: 0 0 0 6px #07070e, 0 24px 80px rgba(0, 0, 0, 0.7);
}

dialog::backdrop { background: rgba(3, 3, 8, 0.82); }

.dlg-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.2rem;
  border-bottom: 1px solid var(--panel-edge);
}

.dlg-head h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--gold);
}

.dlg-close {
  background: none;
  border: 1px solid var(--panel-edge);
  color: var(--dim);
  font-family: inherit;
  font-size: 1rem;
  line-height: 1;
  padding: 0.3rem 0.55rem;
  cursor: pointer;
}

.dlg-close:hover { color: var(--ink); border-color: var(--gold-dim); }

.dlg-body { padding: 1.3rem 1.45rem 1.55rem; }

.dlg-body .dlg-note { color: var(--dim); font-style: italic; margin-bottom: 1.2rem; }

.field label {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--dim);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.field input[type="email"] {
  width: 100%;
  background: #060609;
  border: 1px solid var(--panel-edge);
  color: var(--ink);
  font-family: inherit;
  font-size: 1.02rem;
  padding: 0.75rem 0.95rem;
}

.field input[type="email"]:focus {
  border-color: var(--gold);
  outline: none;
  box-shadow: 0 0 0 3px rgba(217, 168, 62, 0.18);
}

.dlg-body .btn { width: 100%; margin-top: 1.1rem; }

/* Honeypot — real settlers never see this. */
.hp { position: absolute; left: -9999px; top: -9999px; }

.status {
  min-height: 1.5em;
  margin-top: 0.9rem;
  font-style: italic;
  font-size: 0.98rem;
}

.status--ok { color: var(--green); }
.status--err { color: var(--red); }

.privacy {
  color: var(--faint);
  font-size: 0.8rem;
  line-height: 1.55;
  margin-top: 1.1rem;
}

.noscript-note {
  padding: 2rem 1.25rem;
  color: var(--dim);
  text-align: center;
}

/* ---------- responsive ---------- */

@media (max-width: 860px) {
  .dispatch-grid, .features { grid-template-columns: 1fr; }
  .hero { padding-top: 3rem; }
  section { padding: 2.5rem 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}

/* ---------- APEX PROTOCOL additions ---------- */

/* circuit lap list */
.laps {
  list-style: none;
  counter-reset: none;
  max-width: 58rem;
  margin: 0 auto;
}

.laps li {
  display: grid;
  grid-template-columns: 3rem 14rem 1fr;
  gap: 1rem;
  align-items: baseline;
  padding: 0.95rem 0.5rem;
  border-bottom: 1px solid var(--panel-edge);
}

.laps li:first-child { border-top: 1px solid var(--panel-edge); }

.lap-no {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--gold-dim);
}

.lap-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--gold);
  letter-spacing: 0.02em;
}

.lap-tease { color: var(--dim); font-style: italic; }

/* code cards — the only fixed-width text on the page (real code, per the
   genre audit: mono is reserved for code, never for prose or UI). */
.code-card {
  border: 1px solid var(--panel-edge);
  background: #0a0a12;
  margin-bottom: 1.1rem;
}

.code-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 0.9rem;
  border-bottom: 1px solid var(--panel-edge);
  color: var(--dim);
  font-family: var(--font-display);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
}

.code-head button {
  background: none;
  border: 1px solid var(--panel-edge);
  color: var(--dim);
  font-family: var(--font-display);
  font-size: 0.8rem;
  padding: 0.25rem 0.7rem;
  cursor: pointer;
}

.code-head button:hover { color: var(--gold); border-color: var(--gold-dim); }

.code-card pre {
  margin: 0;
  padding: 0.95rem 1.1rem;
  overflow-x: auto;
  color: var(--ink);
}

.code-card code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.86rem;
  line-height: 1.55;
  white-space: pre;
}

.fine { color: var(--faint); font-size: 0.86rem; margin-top: 0.9rem; }

/* classification table */
.lb {
  width: 100%;
  max-width: 52rem;
  margin: 0 auto;
  border-collapse: collapse;
}

.lb th {
  text-align: left;
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid var(--gold-dim);
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.lb td {
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--panel-edge);
  color: var(--dim);
}

.lb tbody tr:first-child td { color: var(--ink); }

.lb-pos { font-family: var(--font-display); color: var(--gold-dim); }
.lb-time { font-variant-numeric: tabular-nums; color: var(--ink); }
.lb-pen { color: var(--red); font-size: 0.9rem; }

@media (max-width: 700px) {
  .laps li { grid-template-columns: 2.2rem 1fr; }
  .laps .lap-tease { grid-column: 2; }
}

/* ---------- live timing ---------- */

.sub-head {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin: 2rem 0 0.7rem;
}

.timing-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.6rem;
  padding: 0.7rem 1rem;
  border: 1px solid var(--panel-edge);
  background: #0a0a12;
  color: var(--dim);
  font-size: 0.9rem;
}

.timing-bar .stat b { color: var(--ink); font-variant-numeric: tabular-nums; }

.live-flag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  letter-spacing: 0.1em;
  color: var(--faint);
}

.live-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--faint);
  box-shadow: none;
}

.live-dot--on {
  background: var(--red);
  box-shadow: 0 0 10px var(--red);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse { 50% { opacity: 0.35; } }

/* cars on track */

.ontrack { display: flex; flex-direction: column; gap: 2px; }

.car {
  display: grid;
  grid-template-columns: 13rem 7rem 1fr 6rem 4.5rem;
  gap: 1rem;
  align-items: center;
  padding: 0.6rem 0.9rem;
  background: #0a0a12;
  border-left: 3px solid var(--gold-dim);
}

.car-handle { color: var(--ink); }
.car-tag { color: var(--faint); font-size: 0.8rem; margin-left: 0.5rem; }

.car-track { display: flex; gap: 4px; }

.pip {
  width: 100%; height: 10px;
  background: #1a1a26;
  border: 1px solid var(--panel-edge);
}

.pip--done { background: var(--gold-dim); border-color: var(--gold-dim); }
.pip--active { background: var(--gold); border-color: var(--gold); animation: pulse 1.4s ease-in-out infinite; }

.car-corner { color: var(--dim); font-size: 0.88rem; }
.car-time { color: var(--ink); font-variant-numeric: tabular-nums; text-align: right; }
.car-pen { color: var(--faint); font-size: 0.85rem; text-align: right; }
.car-pen--hit { color: var(--red); }

/* race radio */

.radio {
  border: 1px solid var(--panel-edge);
  background: #0a0a12;
  padding: 0.5rem 0.9rem;
  min-height: 4rem;
  max-height: 15rem;
  overflow-y: auto;
}

.radio .section-intro { margin: 0.6rem 0; text-align: left; }

.radio-line {
  display: flex;
  gap: 0.9rem;
  padding: 0.28rem 0;
  border-bottom: 1px solid rgba(38, 38, 55, 0.5);
  font-size: 0.92rem;
}

.radio-line:last-child { border-bottom: none; }
.radio-t { color: var(--faint); font-variant-numeric: tabular-nums; }
.radio-msg { color: var(--dim); }
.radio-line--go .radio-msg { color: var(--ink); }
.radio-line--pen .radio-msg { color: var(--red); }
.radio-line--fin .radio-msg { color: var(--gold); }

/* corner difficulty bars */

.cbars { display: flex; flex-direction: column; gap: 0.4rem; }

.cbar {
  display: grid;
  grid-template-columns: 14rem 1fr 4rem;
  gap: 1rem;
  align-items: center;
}

.cbar-name { color: var(--dim); font-size: 0.9rem; }
.cbar-rail { height: 12px; background: #12121c; border: 1px solid var(--panel-edge); }
.cbar-fill { height: 100%; background: var(--gold-dim); }
.cbar-val { color: var(--ink); font-variant-numeric: tabular-nums; font-size: 0.9rem; text-align: right; }

/* classification extras */

.lb-scroll { overflow-x: auto; }
.lb-gap { color: var(--dim); font-variant-numeric: tabular-nums; }
.lb-splits { white-space: nowrap; }

.split {
  display: inline-block;
  min-width: 2.6rem;
  margin-right: 3px;
  padding: 0.12rem 0.3rem;
  background: #12121c;
  border: 1px solid var(--panel-edge);
  color: var(--dim);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

@media (max-width: 860px) {
  .car { grid-template-columns: 1fr 5rem; grid-auto-rows: auto; gap: 0.4rem; }
  .car-track { grid-column: 1 / -1; }
  .car-corner { grid-column: 1; }
  .cbar { grid-template-columns: 9rem 1fr 3.5rem; }
}
