/* ============================================================
   FIRSTBLOCK — instrument-panel system
   ink black · genesis gold · hairline grid · square blocks
   Archivo 900 display · IBM Plex Mono data
   ============================================================ */
:root {
  --ink: #07090d;
  --ink-2: #0b0e13;
  --panel: rgba(15, 19, 26, 0.82);
  --panel-solid: #0f131a;
  --line: #202836;
  --line-bright: #2e3949;
  --text: #e9e6dd;
  --muted: #8b93a3;
  --gold: #e8a33d;
  --gold-bright: #ffd98a;
  --gold-dim: #8a6224;
  --danger: #d4694f;
  --ok: #7fbf8e;

  --font-display: "Archivo", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;

  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --maxw: 1240px;
}

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

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

body {
  background:
    linear-gradient(rgba(32, 40, 54, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(32, 40, 54, 0.16) 1px, transparent 1px),
    var(--ink);
  background-size: 48px 48px, 48px 48px, auto;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--gold); color: var(--ink); }
a { color: inherit; }
em { font-style: normal; color: var(--gold); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.mono-label {
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  letter-spacing: 0.08em; color: var(--gold);
}
.mono-label.dim, .dim { color: var(--muted); }

/* ---------- panel language: square boxes with title bars ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  position: relative;
  backdrop-filter: blur(6px);
}
.panel::before, .panel::after {
  content: ""; position: absolute; width: 7px; height: 7px;
  border: 1px solid var(--gold); pointer-events: none;
}
.panel::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.panel::after  { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

.panel-bar {
  display: flex; justify-content: space-between; align-items: center;
  gap: var(--s3);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em;
  color: var(--gold);
  border-bottom: 1px solid var(--line);
  padding: 10px 14px;
}
.panel-dot { width: 6px; height: 6px; background: var(--gold); }

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-mono); font-size: 13px; font-weight: 600;
  letter-spacing: 0.08em; text-decoration: none; text-transform: uppercase;
  padding: 14px 26px; border: 1px solid transparent; cursor: pointer;
  transition: background 160ms var(--ease), border-color 160ms var(--ease),
              color 160ms var(--ease), box-shadow 160ms var(--ease), transform 120ms var(--ease);
}
.btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--gold); color: var(--ink);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}
.btn-primary:hover { background: var(--gold-bright); box-shadow: 0 0 24px rgba(232, 163, 61, 0.35); }
.btn-primary:disabled { background: var(--gold-dim); cursor: wait; }
.btn-ghost { border-color: var(--line-bright); color: var(--text); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); box-shadow: inset 0 0 18px rgba(232, 163, 61, 0.08); }
.btn-small { padding: 10px 16px; font-size: 12px; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: var(--s6);
  padding: var(--s3) var(--s5);
  background: color-mix(in srgb, var(--ink) 82%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.wordmark {
  display: inline-flex; align-items: center; gap: var(--s2);
  font-weight: 900; font-size: 16px; letter-spacing: 0.08em; text-decoration: none;
}
.wordmark-block { width: 13px; height: 13px; background: var(--gold); display: inline-block; }
.wordmark-domain { color: var(--gold); font-weight: 700; }
.nav nav { display: flex; gap: var(--s5); margin-left: auto; }
.nav nav a {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.1em;
  color: var(--muted); text-decoration: none; padding: var(--s2) 0;
  border-bottom: 1px solid transparent;
  transition: color 160ms var(--ease), border-color 160ms var(--ease);
}
.nav nav a:hover { color: var(--text); border-color: var(--gold); }
.nav nav a:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.nav-right { display: flex; align-items: center; gap: var(--s4); }
.net-status {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em;
  color: var(--muted); display: inline-flex; align-items: center; gap: 7px;
}
.led { width: 7px; height: 7px; background: var(--ok); border-radius: 50%;
  box-shadow: 0 0 8px var(--ok); animation: blink 2.4s infinite; }
@keyframes blink { 0%, 92% { opacity: 1; } 96% { opacity: 0.3; } 100% { opacity: 1; } }

/* ---------- hero ---------- */
.hero { position: relative; min-height: 92vh; display: flex; align-items: flex-end; overflow: hidden; }
#bg-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  display: block;
}
.hero::before { /* left scrim: copy owns the left half, scene owns the right */
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(90deg,
    rgba(7, 9, 13, 0.92) 0%, rgba(7, 9, 13, 0.72) 34%,
    rgba(7, 9, 13, 0.28) 52%, transparent 68%);
}
.hero::after { /* fade the scene into the page bottom */
  content: ""; position: absolute; inset: auto 0 0 0; height: 160px;
  background: linear-gradient(transparent, var(--ink)); pointer-events: none;
}
.hero-hud { position: absolute; inset: 76px 20px 20px; pointer-events: none; z-index: 2; }
.hud-corner { position: absolute; width: 18px; height: 18px; border: 1px solid var(--line-bright); }
.hud-corner.tl { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.hud-corner.tr { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.hud-corner.bl { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.hud-corner.br { bottom: 0; right: 0; border-left: 0; border-top: 0; }
.hud-readout {
  position: absolute; font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.14em; color: var(--muted); opacity: 0.75;
}
.hud-readout.r1 { top: 8px; right: 28px; }
.hud-readout.r2 { top: 50%; right: 8px; transform: rotate(90deg); transform-origin: right; }
.hud-readout.r3 { bottom: 8px; right: 28px; color: var(--gold); }

.hero-inner {
  position: relative; z-index: 2;
  max-width: var(--maxw); width: 100%;
  margin: 0 auto; padding: var(--s9) var(--s6) var(--s8);
}
.eyebrow {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.16em;
  color: var(--gold); margin-bottom: var(--s4);
}
.hero h1 {
  font-size: clamp(52px, 8.5vw, 118px);
  font-weight: 900; line-height: 0.92; letter-spacing: -0.02em;
  margin-bottom: var(--s5);
  text-shadow: 0 2px 40px rgba(7, 9, 13, 0.9);
}
.h1-gold {
  color: var(--gold);
  -webkit-text-stroke: 0;
}
.lede {
  color: var(--text); opacity: 0.86;
  font-size: 18px; max-width: 52ch; margin-bottom: var(--s6);
  text-shadow: 0 1px 18px rgba(7, 9, 13, 0.9);
}
.hero-ctas { display: flex; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s5); }
.truth-chips { list-style: none; display: flex; gap: var(--s2); flex-wrap: wrap; }
.truth-chips li {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em;
  color: var(--muted);
  border: 1px solid var(--line); background: color-mix(in srgb, var(--ink) 70%, transparent);
  padding: 6px 10px;
}

/* ---------- ticker ---------- */
.ticker {
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  overflow: hidden; background: var(--ink-2);
}
.ticker-track {
  display: inline-flex; gap: var(--s6); white-space: nowrap;
  padding: 10px 0;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em;
  color: var(--gold);
  animation: ticker 46s linear infinite;
}
.ticker-track span:nth-child(even) { color: var(--muted); }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- sections ---------- */
section { scroll-margin-top: 80px; }
.loop, .simulator, .economics, .honesty {
  max-width: var(--maxw); margin: 0 auto;
  padding: var(--s8) var(--s6);
}
.section-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s6);
}
h2 {
  font-size: clamp(28px, 3.8vw, 44px); font-weight: 900;
  letter-spacing: -0.01em; line-height: 1.05; max-width: 24ch;
}
.section-path {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em;
  color: var(--muted);
}
.section-lede { color: var(--muted); max-width: 62ch; margin: calc(-1 * var(--s4)) 0 var(--s5); }

/* ---------- loop ---------- */
.loop-chain {
  list-style: none;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s3);
}
.loop-block { padding: 0 0 var(--s5); }
.loop-block h3 {
  font-size: 19px; font-weight: 900; line-height: 1.15; letter-spacing: 0.01em;
  padding: var(--s4) 14px var(--s3);
}
.loop-block p { font-size: 13.5px; color: var(--muted); padding: 0 14px; }

/* ---------- simulator ---------- */
.curve-card { margin-top: var(--s5); }
.curve-grid {
  display: grid; grid-template-columns: 1.2fr 1fr; gap: var(--s5);
  padding: var(--s5);
}
#curve-svg { width: 100%; height: auto; display: block; margin-bottom: var(--s3); }
.curve-slider-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: var(--s2); }
.slider-value { font-family: var(--font-mono); font-size: 22px; font-weight: 600; color: var(--gold); }
input[type="range"] {
  width: 100%; appearance: none; -webkit-appearance: none;
  height: 3px; background: var(--line); margin: var(--s2) 0 var(--s4);
  cursor: ew-resize;
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none; -webkit-appearance: none;
  width: 18px; height: 18px; background: var(--gold);
  border: 2px solid var(--ink); box-shadow: 0 0 0 1px var(--gold), 0 0 16px rgba(232,163,61,0.5);
}
input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px; background: var(--gold); border-radius: 0;
  border: 2px solid var(--ink); box-shadow: 0 0 0 1px var(--gold);
}
input[type="range"]:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }

.block-track { display: flex; gap: 3px; }
.block-track span {
  flex: 1; height: 9px; background: var(--panel-solid); border: 1px solid var(--line);
  transition: background 200ms var(--ease), border-color 200ms var(--ease), box-shadow 200ms var(--ease);
}
.block-track span.filled { background: var(--gold); border-color: var(--gold); box-shadow: 0 0 8px rgba(232,163,61,0.4); }
.block-track span.overflow { background: var(--danger); border-color: var(--danger); box-shadow: 0 0 8px rgba(212,105,79,0.4); }

.curve-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s4) var(--s3); margin-bottom: var(--s4); }
.curve-stats dt {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em;
  color: var(--muted); margin-bottom: 3px;
}
.curve-stats dd { font-family: var(--font-mono); font-size: 16px; font-weight: 600; }
.curve-warning {
  font-size: 13px; color: var(--danger);
  border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent);
  background: color-mix(in srgb, var(--danger) 7%, transparent);
  padding: var(--s3); margin-bottom: var(--s3);
}
.curve-footnote { font-size: 12px; color: var(--muted); line-height: 1.5; }

/* ---------- economics ---------- */
.receipt-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s3); }
.receipt { padding: var(--s5) var(--s4); }
.receipt-figure {
  font-family: var(--font-mono); font-size: clamp(26px, 2.6vw, 34px); font-weight: 600;
  color: var(--gold); display: block; margin-bottom: var(--s3);
}
.receipt-figure u { text-decoration: none; font-size: 0.55em; color: var(--muted); }
.receipt p { font-size: 13px; color: var(--muted); }

/* ---------- honesty ---------- */
.honesty-list { list-style: none; border-top: 1px solid var(--line); }
.honesty-list li {
  padding: var(--s5) 0; border-bottom: 1px solid var(--line);
  display: grid; grid-template-columns: 300px 1fr; gap: var(--s5);
}
.honesty-list h3 { font-size: 17px; font-weight: 900; letter-spacing: 0.02em; }
.honesty-list p { font-size: 14px; color: var(--muted); max-width: 72ch; }

/* ---------- waitlist ---------- */
.waitlist { max-width: 860px; margin: 0 auto; padding: var(--s8) var(--s6) var(--s9); }
.waitlist-panel { text-align: center; padding-bottom: var(--s6); }
.waitlist-panel h2 { margin: var(--s6) auto var(--s4); padding: 0 var(--s5); font-size: clamp(22px, 2.8vw, 32px); }
.waitlist-panel > p { color: var(--muted); max-width: 52ch; margin: 0 auto var(--s6); padding: 0 var(--s5); }
#waitlist-form { display: flex; gap: var(--s2); justify-content: center; flex-wrap: wrap; padding: 0 var(--s5); }
#waitlist-form input[type="email"] {
  font-family: var(--font-mono); font-size: 14px;
  background: var(--ink-2); color: var(--text);
  border: 1px solid var(--line); padding: 14px 16px; min-width: 300px;
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}
#waitlist-form input[type="email"]::placeholder { color: var(--muted); }
#waitlist-form input[type="email"]:hover { border-color: var(--line-bright); }
#waitlist-form input[type="email"]:focus-visible {
  outline: none; border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold);
}
#waitlist-form input[type="email"][aria-invalid="true"] { border-color: var(--danger); }
.form-note { margin-top: var(--s4); font-family: var(--font-mono); font-size: 13px; color: var(--muted); min-height: 1.5em; }
.form-note.ok { color: var(--ok); }
.form-note.err { color: var(--danger); }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); padding: var(--s7) var(--s6); background: var(--ink-2); }
.footer-grid {
  max-width: var(--maxw); margin: 0 auto var(--s6);
  display: flex; justify-content: space-between; gap: var(--s6); flex-wrap: wrap;
}
.footer-tag { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; color: var(--gold); margin-top: var(--s2); }
.footer-links { display: flex; gap: var(--s5); flex-wrap: wrap; }
.footer-links a {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.1em;
  color: var(--muted); text-decoration: none;
}
.footer-links a:hover { color: var(--gold); }
.footer-legal { max-width: var(--maxw); margin: 0 auto; }
.footer-legal p { font-size: 12px; color: var(--muted); margin-bottom: var(--s3); max-width: 90ch; }
.footer-legal strong { color: var(--text); letter-spacing: 0.02em; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .loop-chain, .receipt-grid { grid-template-columns: repeat(2, 1fr); }
  .curve-grid { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .nav { gap: var(--s3); flex-wrap: wrap; }
  .nav nav { order: 3; width: 100%; margin-left: 0; gap: var(--s4); overflow-x: auto; }
  .nav-right { margin-left: auto; }
  .net-status { display: none; }
  .hero { min-height: 86vh; }
  .hero-inner { padding: var(--s7) var(--s5) var(--s7); }
  #bg-canvas { opacity: 0.5; } /* copy dominates on small screens */
  .hero::before { background: linear-gradient(180deg, rgba(7,9,13,0.55), rgba(7,9,13,0.8)); }
  .loop-chain, .receipt-grid { grid-template-columns: 1fr; }
  .honesty-list li { grid-template-columns: 1fr; gap: var(--s2); }
  .curve-stats { grid-template-columns: repeat(2, 1fr); }
  #waitlist-form { flex-direction: column; }
  #waitlist-form input[type="email"] { min-width: 0; width: 100%; }
  .hud-readout.r2 { display: none; }
}
