/* Guess the Coaster website. Colours, spacing and radii mirror src/theme/theme.ts (v4).
   Change a value there first, then here. Fonts are self-hosted (no Google requests). */

@font-face { font-family: "Anton"; src: url("fonts/anton-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("fonts/manrope-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("fonts/manrope-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("fonts/manrope-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("fonts/manrope-latin-800-normal.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/jetbrains-mono-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  /* colours (theme.ts names, kebab-case) */
  --deep: #1E3329;
  --deep-raised: #2A4538;
  --deep-line: #3A5A4B;
  --deep-slot: #4A6758;
  --nav: #18291F;
  --on-deep-muted: #B9AE93;
  --bg: #F5ECD9;
  --surface: #FBF6EA;
  --panel: #EDE2C9;
  --panel-2: #E6D9BC;
  --line: #E2D6BB;
  --ink: #3A2E20;
  --label: #74664E;
  --primary: #C8974B;
  --correct: #33805B;
  --far: #ADA08A;
  --celebrate: #F2B33D;
  --gold-panel: #4A3B29;
  --track-dim: #5A4A36;
  --danger: #B4553C;
  --white: #FFFFFF;

  /* spacing scale 2/4/6/8/12/16/20/24/32/48, plus two page-level steps */
  --s2: 2px; --s4: 4px; --s6: 6px; --s8: 8px; --s12: 12px; --s16: 16px;
  --s20: 20px; --s24: 24px; --s32: 32px; --s48: 48px; --s64: 64px; --s96: 96px;

  /* radius */
  --r-tile: 8px; --r-cell: 11px; --r-control: 12px; --r-card: 16px; --r-card-lg: 22px; --r-pill: 999px;

  --display: "Anton", "Impact", "Arial Narrow", sans-serif;
  --ui: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --shadow-card: 0 30px 60px -20px rgba(0, 0, 0, 0.7);
  --rim: inset 0 0 0 2px var(--ink), inset 0 0 0 6px var(--bg), inset 0 0 0 7px var(--line);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--deep);
  color: var(--surface);
  font-family: var(--ui);
  font-weight: 600;
  font-size: 17px;
  line-height: 1.55;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
p { margin: 0 0 var(--s16); }

:focus-visible { outline: 3px solid var(--celebrate); outline-offset: 3px; border-radius: 4px; }
.doc :focus-visible { outline-color: var(--ink); }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--s16); top: var(--s16); background: var(--bg); color: var(--ink); padding: var(--s8) var(--s12); z-index: 10; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 var(--s16); }
@media (min-width: 720px) { .wrap { padding: 0 var(--s32); } }

/* ---------- header ---------- */
.site-head { padding: var(--s20) 0; }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--s16); }
.wordmark {
  font-family: var(--display); font-weight: 400; text-transform: uppercase;
  font-size: 20px; line-height: 1.15; letter-spacing: 0.03em; text-decoration: none; color: var(--surface);
}
.site-head nav { display: flex; gap: var(--s20); align-items: center; }
.site-head nav a { font-weight: 700; font-size: 15px; text-decoration: none; color: var(--on-deep-muted); min-height: 44px; display: inline-flex; align-items: center; }
.site-head nav a:hover { color: var(--surface); }
@media (max-width: 520px) { .site-head nav .hide-sm { display: none; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 var(--s24);
  border-radius: var(--r-control);
  font-family: var(--ui); font-weight: 800; font-size: 16px; line-height: 1.2;
  text-decoration: none; border: 0; cursor: pointer;
  transition: transform 120ms ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: var(--ink); }
.btn-primary:hover, .btn-ink:hover { filter: brightness(1.08); }
.btn-quiet { background: transparent; color: var(--surface); box-shadow: inset 0 0 0 1.5px var(--deep-line); }
.btn-quiet:hover { box-shadow: inset 0 0 0 1.5px var(--on-deep-muted); }

/* ---------- hero ---------- */
.hero { padding: var(--s24) 0 var(--s64); }
.hero .wrap { display: grid; gap: var(--s48); align-items: center; }
@media (min-width: 880px) {
  .hero .wrap { grid-template-columns: 1.1fr 0.9fr; gap: var(--s64); }
  .hero { padding: var(--s48) 0 var(--s96); }
}
.hero h1 {
  font-family: var(--display); font-weight: 400; text-transform: uppercase;
  font-size: clamp(64px, 15vw, 132px); line-height: 0.94; letter-spacing: 0.01em;
  margin: 0 0 var(--s24); color: var(--bg);
}
.hero h1 span { display: block; }
.hero .lede { font-weight: 800; font-size: clamp(20px, 2.6vw, 24px); line-height: 1.3; margin-bottom: var(--s12); color: var(--surface); }
.hero .sub { color: var(--on-deep-muted); max-width: 34em; margin-bottom: var(--s32); }
.actions { display: flex; flex-wrap: wrap; gap: var(--s12); }

/* ---------- the spec card (mirrors COMPONENTS.md SpecCard) ---------- */
.card-stage { display: flex; justify-content: center; }
.speccard {
  position: relative; width: 100%; max-width: 350px; margin: 0;
  background: var(--bg); color: var(--ink);
  border-radius: var(--r-card-lg); padding: var(--s12);
  box-shadow: var(--rim), var(--shadow-card);
  transform: rotate(-1.5deg);
}
.speccard__head { display: flex; justify-content: space-between; align-items: center; padding: var(--s8) var(--s8) var(--s12); }
.caption { font-family: var(--mono); font-weight: 500; font-size: 11px; line-height: 1.2; letter-spacing: 0.14em; text-transform: uppercase; color: var(--label); }
.speccard__left { font-weight: 800; font-size: 14px; }
.speccard__id {
  position: relative; height: 80px; border-radius: var(--r-card); background: var(--ink);
  display: flex; align-items: center; justify-content: center; overflow: hidden; margin-bottom: var(--s8);
}
.speccard__id svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.speccard__id path { fill: none; stroke: var(--track-dim); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.qmarks { position: relative; font-family: var(--display); font-size: 26px; letter-spacing: 0.12em; color: var(--bg); }
.speccard__grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s6); }
.cell {
  min-height: 50px; border-radius: var(--r-cell); padding: var(--s6) var(--s12);
  display: flex; flex-direction: column; justify-content: center; gap: 1px;
}
.cell .k { font-family: var(--mono); font-weight: 500; font-size: 9.5px; line-height: 12px; letter-spacing: 0.12em; text-transform: uppercase; }
.cell .v { font-weight: 800; font-size: 16px; line-height: 18px; }
.cell--match { background: var(--correct); color: var(--white); }
.cell--match .k { color: rgba(255, 255, 255, 0.82); }
.cell--range { background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--ink); }
.cell--range .k, .cell--unknown .k { color: var(--label); }
.cell--unknown {
  background: repeating-linear-gradient(135deg, var(--panel) 0 6px, var(--panel-2) 6px 12px);
  outline: 1.5px dashed var(--line); outline-offset: -1.5px;
}
.cell--unknown .v { color: var(--label); }
.cell--wide { grid-column: 1 / -1; }
.speccard__hints { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s6); margin-top: var(--s8); }
.hint { min-height: 44px; border-radius: var(--r-control); background: var(--panel); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.hint b { font-weight: 800; font-size: 13px; line-height: 16px; }
.hint small { font-family: var(--mono); font-weight: 500; font-size: 9px; letter-spacing: 0.1em; color: var(--ink); }
.stamp {
  position: absolute; right: -16px; bottom: 76px;
  font-family: var(--display); font-size: 26px; line-height: 1; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--celebrate); background: var(--deep);
  padding: var(--s8) var(--s12); border-radius: var(--r-tile);
  box-shadow: inset 0 0 0 2.5px var(--celebrate), 0 10px 24px -8px rgba(0, 0, 0, 0.6);
  transform: rotate(-7deg);
}

/* one orchestrated moment: the card's specs stamp in, then the verdict lands */
@media (prefers-reduced-motion: no-preference) {
  .speccard .cell { animation: stamp-in 380ms cubic-bezier(.2, .9, .3, 1.35) both; }
  .speccard .cell:nth-child(1) { animation-delay: 350ms; }
  .speccard .cell:nth-child(2) { animation-delay: 470ms; }
  .speccard .cell:nth-child(3) { animation-delay: 590ms; }
  .speccard .cell:nth-child(4) { animation-delay: 710ms; }
  .speccard .cell:nth-child(5) { animation-delay: 830ms; }
  .speccard .cell:nth-child(6) { animation-delay: 950ms; }
  .speccard .cell:nth-child(7) { animation-delay: 1070ms; }
  .stamp { animation: verdict 520ms cubic-bezier(.2, .9, .3, 1.3) 1600ms both; }
}
@media (max-width: 420px) { .stamp { right: 4px; font-size: 22px; } }
@keyframes stamp-in {
  from { opacity: 0; transform: scale(1.18); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes verdict {
  0% { opacity: 0; transform: rotate(-2deg) scale(1.45); }
  70% { opacity: 1; transform: rotate(-9deg) scale(0.95); }
  100% { opacity: 1; transform: rotate(-7deg) scale(1); }
}

/* ---------- sections ---------- */
.section { padding: var(--s64) 0; border-top: 1px solid var(--deep-line); }
.section h2 {
  font-family: var(--display); font-weight: 400; text-transform: uppercase;
  font-size: clamp(34px, 5vw, 48px); line-height: 1.05; letter-spacing: 0.01em; margin: 0 0 var(--s32); color: var(--bg);
}
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s32); counter-reset: step; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.steps li { counter-increment: step; }
.steps li::before {
  content: counter(step); display: block;
  font-family: var(--display); font-size: 56px; line-height: 1; color: var(--primary); margin-bottom: var(--s12);
}
.steps h3 { font-weight: 800; font-size: 19px; line-height: 1.3; margin: 0 0 var(--s8); color: var(--surface); }
.steps p { color: var(--on-deep-muted); max-width: 30em; }

.split { display: grid; gap: var(--s32); }
@media (min-width: 760px) { .split { grid-template-columns: 1fr 1fr; gap: var(--s64); } }
.split h3 { font-weight: 800; font-size: 19px; margin: 0 0 var(--s12); color: var(--surface); }
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { padding: var(--s12) 0; border-bottom: 1px solid var(--deep-line); color: var(--on-deep-muted); }
.plain-list li strong { color: var(--surface); font-weight: 800; }

/* ---------- the beta panel (a cream card on deep, like the app) ---------- */
.beta-card {
  background: var(--bg); color: var(--ink); border-radius: var(--r-card-lg);
  box-shadow: var(--rim); padding: var(--s32) var(--s24);
  display: grid; gap: var(--s32); align-items: center;
}
@media (min-width: 760px) { .beta-card { grid-template-columns: 1fr auto; padding: var(--s48); } }
.beta-card h2 { color: var(--ink); margin-bottom: var(--s16); }
.beta-card p { max-width: 32em; }
.beta-card .fine { font-size: 15px; color: var(--label); margin: var(--s16) 0 0; }
.qr { margin: 0; width: 180px; }
.qr img { width: 180px; height: 180px; border-radius: var(--r-tile); box-shadow: inset 0 0 0 1px var(--line); }
.qr figcaption { font-size: 14px; color: var(--label); margin-top: var(--s8); text-align: center; }
@media (max-width: 759px) { .beta-card .qr { display: none; } }

/* ---------- footer ---------- */
.site-foot { padding: var(--s48) 0 var(--s64); color: var(--on-deep-muted); font-size: 15px; }
.site-foot .wrap { display: grid; gap: var(--s16); }
.site-foot nav { display: flex; flex-wrap: wrap; gap: var(--s8) var(--s24); }
.site-foot nav a { font-weight: 700; color: var(--surface); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.site-foot nav a:hover { text-decoration: underline; }
.site-foot p { margin: 0; max-width: 46em; }

/* ---------- document pages (privacy, terms, support, beta) ---------- */
.doc-wrap { padding: var(--s16) 0 var(--s64); }
.doc {
  background: var(--bg); color: var(--ink); border-radius: var(--r-card-lg); box-shadow: var(--rim);
  padding: var(--s32) var(--s20); max-width: 760px; margin: 0 auto;
}
@media (min-width: 720px) { .doc { padding: var(--s48) var(--s64); } }
.doc h1 { font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: clamp(38px, 7vw, 56px); line-height: 1.02; margin: 0 0 var(--s12); }
.doc .updated { color: var(--label); font-size: 15px; margin-bottom: var(--s32); }
.doc h2 { font-weight: 800; font-size: 21px; line-height: 1.3; margin: var(--s32) 0 var(--s12); }
.doc h3 { font-weight: 800; font-size: 17px; margin: var(--s24) 0 var(--s8); }
.doc p, .doc li { max-width: 68ch; }
.doc ul { padding-left: 1.2em; margin: 0 0 var(--s16); }
.doc li { margin-bottom: var(--s6); }
.doc a { color: var(--ink); text-decoration-thickness: 1.5px; text-underline-offset: 3px; overflow-wrap: anywhere; }
.doc a.btn { text-decoration: none; overflow-wrap: normal; text-align: center; }
.doc a.btn-ink { color: var(--bg); }
.doc a.btn-primary { color: var(--ink); }
.doc table { width: 100%; border-collapse: collapse; margin: 0 0 var(--s16); font-size: 15px; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: var(--s8) var(--s8) var(--s8) 0; border-bottom: 1px solid var(--line); }
.doc th { font-weight: 800; }
@media (max-width: 560px) { .doc table, .doc tbody, .doc tr, .doc td, .doc th { display: block; } .doc thead { display: none; } .doc td { border: 0; padding: 0 0 var(--s4); } .doc tr { padding: var(--s8) 0; border-bottom: 1px solid var(--line); } }
.short { background: var(--surface); border-radius: var(--r-card); padding: var(--s20) var(--s24); box-shadow: inset 0 0 0 1px var(--line); margin-bottom: var(--s24); }
.short h2 { margin-top: 0; }
.short ul { margin: 0; }

/* beta page steps */
.join-steps { list-style: none; padding: 0; margin: 0 0 var(--s24); counter-reset: j; }
.join-steps li { counter-increment: j; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: var(--s16); padding: var(--s16) 0; border-bottom: 1px solid var(--line); max-width: none; }
.join-steps li::before { content: counter(j); font-family: var(--display); font-size: 40px; line-height: 1; color: var(--correct); }
.join-steps h2 { margin: 0 0 var(--s6); }
.join-steps p { margin: 0 0 var(--s12); }
.btn-ink { background: var(--ink); color: var(--bg); }
.soon { background: var(--surface); border-radius: var(--r-card); padding: var(--s20) var(--s24); box-shadow: inset 0 0 0 1.5px var(--ink); }
.soon p:last-child { margin-bottom: 0; }
[hidden] { display: none !important; }

/* ---------- the "Keep me posted" form on /beta (stay-in-touch.md) ---------- */
.hello { font-weight: 800; color: var(--ink); margin: calc(-1 * var(--s16)) 0 var(--s24); padding-left: var(--s12); box-shadow: inset 3px 0 0 var(--correct); }
.keep { background: var(--surface); border-radius: var(--r-card); box-shadow: inset 0 0 0 1.5px var(--ink); padding: var(--s24) var(--s20); margin: 0 0 var(--s24); }
@media (min-width: 720px) { .keep { padding: var(--s32); } }
.keep h2 { margin-top: 0; }
.opt { font-weight: 600; color: var(--label); }
.field { margin: 0 0 var(--s16); }
.field > label { display: block; font-weight: 800; font-size: 16px; margin: 0 0 var(--s6); }
.keep input[type="email"], .keep input[type="text"], .keep select {
  display: block; width: 100%; min-height: 48px; padding: var(--s8) var(--s12);
  font-family: var(--ui); font-weight: 600; font-size: 17px; color: var(--ink);
  background: var(--bg); border: 0; border-radius: var(--r-control); box-shadow: inset 0 0 0 1.5px var(--ink);
  -webkit-appearance: none; appearance: none;
}
.keep select {
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px; background-repeat: no-repeat; padding-right: var(--s32);
}
.keep input:focus-visible, .keep select:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.keep input[aria-invalid="true"] { box-shadow: inset 0 0 0 2.5px var(--danger); }
.field > label.consent { display: grid; margin: 0; grid-template-columns: 28px minmax(0, 1fr); gap: var(--s12); align-items: start; min-height: 44px; font-weight: 700; font-size: 16px; cursor: pointer; }
.consent input { width: 24px; height: 24px; margin: 2px 0 0; accent-color: var(--correct); cursor: pointer; }
.fine { font-size: 15px; color: var(--label); }
.field-error { font-size: 15px; font-weight: 700; color: var(--ink); margin: var(--s6) 0 0; padding-left: var(--s12); box-shadow: inset 3px 0 0 var(--danger); }
.form-error { font-weight: 700; color: var(--ink); background: var(--bg); border-radius: var(--r-control); padding: var(--s12) var(--s16); box-shadow: inset 4px 0 0 var(--danger), inset 0 0 0 1px var(--line); }
.ts { margin: 0 0 var(--s16); max-width: 100%; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s8) var(--s24); }
.btn:disabled { opacity: 0.6; cursor: progress; }
.text-link { font-weight: 800; min-height: 44px; display: inline-flex; align-items: center; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.done { outline: none; }
.done h2 { margin-top: 0; }
.doc button.btn { font-family: var(--ui); }
@media (max-width: 360px) { .keep { padding: var(--s16) var(--s12); } }

@media (prefers-reduced-motion: reduce) { .btn { transition: none; } .btn:active { transform: none; } }
