/* REL8 · rel-8.ai v3. Tokens and rules: DESIGN.md. */

:root {
  --paper: #F3F1EC;
  --ink: #111110;
  --ink-2: #3D3B37;
  --muted: #6F6B64;
  --signal: #FF4F00;
  --line: rgba(17, 17, 16, .14);
  --field: #FFFFFF;
  --sans: 'Inter Tight', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --gutter: clamp(20px, 4vw, 56px);
  --max: 1440px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 12px; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  caret-color: var(--signal);
}
::selection { background: var(--ink); color: var(--paper); }
h1, h2, h3, p, figure, ul { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
a { color: inherit; text-underline-offset: 4px; text-decoration-thickness: 1px; }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }

/* ---------- header ---------- */
.site-head, main, .site-foot { max-width: var(--max); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.site-head { display: flex; justify-content: space-between; align-items: center; height: 84px; position: relative; }
.site-head::after { content: ""; position: absolute; left: var(--gutter); right: var(--gutter); bottom: 0; border-bottom: 1px solid var(--line); }
.brand { position: relative; display: flex; align-items: center; }
.brand .home { display: block; color: var(--ink); padding: 7px 0; }
.logo { display: block; height: 30px; width: auto; }
/* the 8 is its own link: the easter egg. Invisible 44px hit area over the figure. */
.brand .egg { position: absolute; width: 44px; height: 44px; right: -12px; top: 50%; transform: translateY(-50%); border-radius: 50%; }
.site-head nav { display: flex; gap: 32px; font-size: 15px; }
.site-head nav a { text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
.site-head nav a:hover, .site-head nav a[aria-current] { text-decoration: underline; text-decoration-color: var(--signal); text-decoration-thickness: 2px; text-underline-offset: 6px; }

/* ---------- buttons, links ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font: 500 16px/1 var(--sans); color: var(--paper); background: var(--ink);
  border: 0; border-radius: 999px; padding: 15px 24px; min-height: 48px;
  text-decoration: none; cursor: pointer; transition: transform .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.link-btn { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

/* ---------- pitch screen ---------- */
.pitch { display: flex; flex-direction: column; min-height: calc(100svh - 84px); padding: clamp(24px, 5vh, 56px) 0 0; }
.pitch h1 { font: 500 clamp(48px, 8.4vh, 76px)/1 var(--sans); letter-spacing: -.03em; max-width: 13ch; }
.sub { font-size: 19px; color: var(--ink-2); margin-top: clamp(14px, 2.4vh, 22px); }
.actions { margin-top: clamp(20px, 3.4vh, 30px); }

.trace { position: relative; margin-top: clamp(22px, 4vh, 34px); padding: 50px 0 14px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.trace-short { display: none; }
.lane { display: grid; grid-template-columns: 90px 1fr; align-items: center; }
.lane svg { width: 100%; height: clamp(44px, 6.4vh, 56px); display: block; overflow: visible; }
.lane-label, .mark span { font: 500 11px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.lane-label { color: var(--muted); }
.ln { fill: none; stroke-width: 1.4; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.ln-person { stroke: var(--ink); }
.ln-rel8 { stroke: var(--signal); }
.mark { position: absolute; top: 10px; bottom: 8px; left: calc(90px + (100% - 90px) * var(--at)); border-left: 1px dashed var(--ink); padding-left: 8px; display: flex; flex-direction: column; gap: 3px; }
.mark.m-wait { border-left-color: var(--signal); }
.mark .q { color: var(--ink); white-space: nowrap; }
.mark .a { color: var(--muted); white-space: nowrap; }
.mark.m-wait .a { color: var(--ink); font-weight: 600; }

/* the one authored moment: the trace draws itself once, the labels arrive with it */
@media (prefers-reduced-motion: no-preference) {
  .lane svg { clip-path: inset(0 100% 0 0); animation: draw 1.6s cubic-bezier(.22, .61, .36, 1) .25s forwards; }
  .mark { opacity: 0; animation: arrive .45s ease-out forwards; animation-delay: calc(.25s + 1.6s * var(--at)); }
}
@keyframes draw { to { clip-path: inset(0 0 0 0); } }
@keyframes arrive { to { opacity: 1; } }


.facts { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: clamp(16px, 3.4vh, 28px); border-bottom: 1px solid var(--line); }
.fact { padding: clamp(12px, 2vh, 18px) 24px clamp(14px, 2.4vh, 24px) 0; margin-right: 24px; border-right: 1px solid var(--line); }
.fact:last-child { border-right: 0; margin-right: 0; }
.fact-btn { all: unset; box-sizing: border-box; cursor: pointer; display: flex; justify-content: space-between; align-items: center; width: 100%; min-height: 44px; font: 600 16px var(--sans); color: var(--ink); }
.fact-btn:hover span:first-child { text-decoration: underline; text-decoration-color: var(--signal); text-decoration-thickness: 2px; text-underline-offset: 5px; }
.fact-btn:hover .pm::before, .fact-btn:hover .pm::after { background: var(--signal); }
.fact-btn:focus-visible { outline: 3px solid var(--signal); outline-offset: 4px; border-radius: 4px; }
.pm { position: relative; width: 12px; height: 12px; flex: none; }
.pm::before, .pm::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1.5px; margin-top: -.75px; background: var(--ink); transition: transform .2s ease; }
.pm::after { transform: rotate(90deg); }
.fact-btn[aria-expanded="true"] .pm::after { transform: rotate(0deg); }
.fact p { color: var(--ink-2); font-size: 16px; line-height: 1.45; margin-top: 4px; }
.panels { margin-bottom: clamp(16px, 3vh, 28px); }
.js .panel { display: none; }
.panel { scroll-margin-bottom: 28px; padding: 22px 0 6px; max-width: 62ch; color: var(--ink-2); font-size: 17px; }
.js .panel.open { display: block; }
.panel p + p { margin-top: 10px; }
.people { list-style: none; padding: 0; margin-bottom: 12px; display: grid; gap: 6px; }
.people b { color: var(--ink); font-weight: 600; }

/* ---------- contact ---------- */
.contact { display: grid; grid-template-columns: 1fr 1.15fr; gap: clamp(40px, 7vw, 96px); padding: 64px 0 80px; border-top: 1px solid var(--ink); scroll-margin-top: 0; }
.contact h2 { font: 500 clamp(40px, 5vw, 64px)/1 var(--sans); letter-spacing: -.03em; }
.lead { font-size: 18px; color: var(--ink-2); margin-top: 20px; max-width: 26em; }

.roles { border: 0; padding: 0; margin: 0 0 28px; min-width: 0; }
.roles legend { font: 500 14px var(--sans); margin-bottom: 12px; padding: 0; }
.seg { display: grid; grid-template-columns: repeat(2, 1fr); border: 1px solid var(--ink); border-radius: 12px; overflow: hidden; }
.seg label { position: relative; border-right: 1px solid var(--ink); border-bottom: 1px solid var(--ink); cursor: pointer; }
.seg label:nth-child(2n) { border-right: 0; }
.seg label:nth-child(n+3) { border-bottom: 0; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: block; padding: 13px 16px; font: 500 15px var(--sans); min-height: 56px; }
.seg small { display: block; font: 400 12px var(--sans); opacity: .75; margin-top: 2px; }
.seg input:checked + span { background: var(--ink); color: var(--paper); }
.seg input:focus-visible + span { outline: 3px solid var(--signal); outline-offset: -3px; }
.next, .err { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-2); }
.next { margin-top: 14px; }
.next::before, .err::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--signal); margin-top: 6px; flex: none; }
.err { color: var(--ink); margin-top: 6px; }
.err[hidden] { display: none; }

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { margin-bottom: 20px; display: grid; gap: 6px; }
.field > label { font: 500 14px var(--sans); }
.opt { color: var(--muted); font-weight: 400; }
.field input, .field textarea {
  font: 400 17px var(--sans); color: var(--ink); background: var(--field);
  border: 1px solid var(--line); border-radius: 10px; padding: 13px 14px; width: 100%; min-height: 48px;
}
.field textarea { resize: vertical; min-height: 128px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(255, 79, 0, .35); }
.field [aria-invalid="true"] { border-color: var(--ink); }
.consent { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.consent input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--ink); flex: none; }
.hp { position: absolute; left: -9999px; }
.send-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 4px; }
.send-err { margin-top: 14px; }
.done h3 { font: 500 34px/1.1 var(--sans); letter-spacing: -.02em; }
.done p { margin-top: 10px; color: var(--ink-2); }

/* ---------- footer ---------- */
.site-foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding-top: 12px; padding-bottom: 22px; font-size: 14px; color: var(--muted); position: relative; }
.site-foot::before { content: ""; position: absolute; left: var(--gutter); right: var(--gutter); top: 0; border-top: 1px solid var(--line); }
.site-foot nav { display: flex; gap: 22px; }
.site-foot a, .site-foot .link-btn { text-decoration: none; color: var(--ink-2); display: inline-flex; align-items: center; min-height: 44px; }
.site-foot a:hover, .site-foot .link-btn:hover { text-decoration: underline; }

/* ---------- privacy and imprint ---------- */
.legal { padding-top: 64px; padding-bottom: 96px; }
.prose { max-width: 70ch; font-size: 17px; line-height: 1.6; color: var(--ink-2); }
.prose h1 { font: 500 clamp(44px, 6vw, 72px)/1 var(--sans); letter-spacing: -.03em; color: var(--ink); margin: 0 0 14px; }
.prose h2 { font: 500 clamp(24px, 2.6vw, 30px)/1.15 var(--sans); letter-spacing: -.015em; color: var(--ink); margin: 52px 0 12px; }
.prose h3 { font: 600 17px/1.3 var(--sans); color: var(--ink); margin: 28px 0 8px; }
.prose p, .prose ul, .prose address { margin: 0 0 14px; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: 6px; }
.prose address { font-style: normal; border-left: 2px solid var(--ink); padding: 4px 0 4px 18px; }
.prose a { color: var(--ink); }
.prose .meta { color: var(--muted); font-size: 15px; }
.prose .summary { border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); padding: 6px 0 12px; margin-top: 36px; }
.prose .summary h2 { margin-top: 16px; }

/* ---------- game (play.html): a robot rolls along the voice line and jumps the waves ---------- */
.robo { padding: 48px 0 64px; }
.robo-head h1 { font: 500 clamp(36px, 4.4vw, 56px)/1.02 var(--sans); letter-spacing: -.03em; }
.robo-head .rules { font-size: 18px; color: var(--ink-2); margin-top: 14px; max-width: 40em; }
.robo-bar { display: flex; gap: 28px; align-items: center; margin-top: 28px; padding-bottom: 6px; border-bottom: 1px solid var(--ink); }
.robo-count { font: 500 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink); font-variant-numeric: tabular-nums; }
.robo-best { color: var(--muted); }
.robo-sound { margin-left: auto; display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; background: none; color: var(--ink); cursor: pointer; border-radius: 10px; }
.robo-sound:hover { color: var(--signal); }
.robo-sound .snd-off { display: none; }
.robo-sound[aria-pressed="true"] .snd-on { display: none; }
.robo-sound[aria-pressed="true"] .snd-off { display: inline; }
.robo-stage { margin-top: 14px; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: #F8F7F3; cursor: pointer; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
#room { display: block; width: 100%; }
.after { margin-top: 18px; font-size: 15px; color: var(--ink-2); }
.after a { color: var(--ink); }

/* ---------- cookie notice ---------- */
.cookie { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 30; display: flex; justify-content: center; }
.cookie[hidden] { display: none; }
.cookie-inner {
  max-width: 760px; width: 100%; background: var(--paper); color: var(--ink);
  border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .35);
  padding: 20px 22px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 22px; align-items: center;
}
.cookie-text { display: grid; gap: 4px; font-size: 14px; color: var(--ink-2); }
.cookie-text p { margin: 0; }
.cookie-text a { color: var(--ink); }
.cookie-title { font: 500 20px/1.2 var(--sans); color: var(--ink); }
.cookie-actions { display: flex; gap: 8px; }
.cookie-btn { font: 500 15px/1 var(--sans); padding: 13px 20px; min-height: 44px; border-radius: 999px; cursor: pointer; white-space: nowrap; border: 1px solid var(--ink); background: transparent; color: var(--ink); }
.cookie-btn[data-choice="granted"], .cookie-btn:hover { background: var(--ink); color: var(--paper); }

/* ---------- short screens (laptops): keep the pitch on one screen ---------- */
@media (min-width: 721px) and (max-height: 820px) {
  .site-head { height: 68px; }
  .pitch { min-height: calc(100svh - 68px); }
  .trace { padding-top: 40px; padding-bottom: 8px; }
  .pitch h1 { font-size: clamp(44px, 7.6vh, 64px); }
  .lane svg { height: 40px; }
  }

@media (min-width: 721px) and (max-height: 740px) {
  .pitch { padding-top: 18px; }
  .sub { margin-top: 10px; }
  .actions { margin-top: 16px; }
}

/* ---------- phones ---------- */
@media (max-width: 720px) {
  .site-head { height: 68px; }
  .pitch { min-height: 0; padding-top: 32px; }
  .pitch h1 { font-size: 40px; max-width: none; }
  .sub { font-size: 17px; }
  .trace { padding: 14px 0 58px; }
  .trace-full { display: none; }
  .trace-short { display: block; position: relative; }
  .lane { grid-template-columns: 62px 1fr; }
  .trace-short .mark { top: auto; bottom: -50px; height: 44px; left: calc(62px + (100% - 62px) * var(--at)); }
  .trace-short .mark.m-wait { left: auto; right: 0; align-items: flex-end; border-left: 0; border-right: 1px dashed var(--signal); padding: 0 8px 0 0; }
  .facts { grid-template-columns: 1fr; }
  .fact { border-right: 0; margin-right: 0; padding-right: 0; border-bottom: 1px solid var(--line); }
  .fact:last-child { border-bottom: 0; }
  .js .fact .panel-slot { display: block; }
  .contact { grid-template-columns: 1fr; gap: 36px; padding: 48px 0 64px; }
    .seg { grid-template-columns: 1fr; }
  .seg label, .seg label:nth-child(n+3) { border-right: 0; border-bottom: 1px solid var(--ink); }
  .seg label:last-child { border-bottom: 0; }
  .row2 { grid-template-columns: 1fr; gap: 0; }
  .cookie-inner { grid-template-columns: 1fr; }
  .cookie-btn { flex: 1; }
}
