/* Wordkeeper Dojo, the site. Shared by every page.

   Built from the app's design system (WordBattle/Theme): the plain stage,
   surface1 cards with a hairline or a class ring at .38, neon glow plus a
   hard lip for depth, and the app's five faces. Every colour below is a DS
   token; nothing is invented for the web.

   /assets/* is cached for a year (see _headers), so a change to this file
   ships under a new name: site.v2.css, and every page's <link> with it. */

:root {
  /* Canvas and surfaces (DS.bg, surface1–3, hairline) */
  --stage: #06060D;
  --deep: #050509;
  --s1: #0E0E18;
  --s2: #12121E;
  --s3: #1C1C28;
  --hair: #26262E;

  /* Text, five steps used by role (DS.text … textFaint) */
  --text: #E4E4EE;
  --soft: #B7B7CB;
  --muted: #9A9AB0;
  --dim: #7C7C90;
  --faint: #6C6C7F;
  --on: #06060D;

  /* Class colours (DS.brand, defense, intel, special, speed, legend, power) */
  --brand: #FF2D9B;
  --cyan: #00CFFF;
  --amber: #FF8A1E;
  --violet: #A06BFF;
  --lime: #B6F02C;
  --gold: #E9C558;
  --red: #FF4D6D;

  /* DS.R */
  --r-xs: 6px; --r-sm: 10px; --r-md: 12px; --r-lg: 14px; --r-xl: 16px; --r-xxl: 20px;

  /* Faces (Typeface.swift) */
  --impact: "Luckiest Guy", Impact, sans-serif;
  --display: Anton, Impact, "Arial Narrow", sans-serif;
  --accent: Bungee, sans-serif;
  --body: Roboto, system-ui, -apple-system, sans-serif;
  --mono: "Roboto Mono", ui-monospace, monospace;

  /* Motion: the app's rise and pop, as curves */
  --rise: cubic-bezier(.22, 1, .36, 1);
  --pop: cubic-bezier(.34, 1.56, .64, 1);

  --gutter: 24px;
  --max: 1120px;
  color-scheme: dark;
}
@media (max-width: 600px) { :root { --gutter: 16px; } }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--stage);
  color: var(--text);
  font: 400 17px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; }
a { color: var(--brand); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--lime); outline-offset: 3px; border-radius: 4px;
}
::selection { background: rgba(255, 45, 155, .35); }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--text); color: var(--on); padding: 8px 12px; border-radius: var(--r-sm); }
.skip:focus { left: 8px; }

/* ---- Type ---------------------------------------------------------------- */

.eyebrow {
  margin: 0 0 12px;
  font: 400 12px/1.2 var(--accent); letter-spacing: .2em; text-transform: uppercase;
  color: var(--brand);
}
.h2 {
  margin: 0 0 16px;
  font: 400 clamp(34px, 5.4vw, 60px)/1 var(--display);
  letter-spacing: .005em; text-transform: uppercase; text-wrap: balance;
}
.h2 em { font-style: normal; color: var(--brand); }
.lede { margin: 0; max-width: 34em; font-size: 20px; line-height: 1.5; color: var(--soft); }
.lede strong { color: var(--text); font-weight: 500; }
.mono { font-family: var(--mono); }

/* ---- Buttons ------------------------------------------------------------- */

/* The app's ArcadeButton: a pill, a bright fill with near-black text, and
   the hard lip that makes it read as a key. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 28px; border: 0; border-radius: 999px;
  background: var(--brand); color: var(--on);
  font: 400 14px/1 var(--accent); letter-spacing: .14em; text-transform: uppercase;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  box-shadow: 0 4px 0 rgba(0,0,0,.4), 0 0 24px rgba(255,45,155,.35);
  transition: transform .12s var(--rise), box-shadow .12s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.4), 0 0 16px rgba(255,45,155,.3); }
.btn.ghost {
  background: transparent; color: var(--text);
  box-shadow: inset 0 0 0 1px var(--hair);
}
.btn.ghost:hover { box-shadow: inset 0 0 0 1px var(--muted); }
.btn.small { min-height: 40px; padding: 0 18px; font-size: 12px; }

/* Apple's badge, unpadded and never stretched (it is 2.9916:1). */
.badge { display: inline-block; line-height: 0; transition: transform .12s var(--rise); }
.badge img { display: block; height: 56px; width: auto; aspect-ratio: 119.66407 / 40; }
.badge:hover { transform: translateY(-2px); }

/* ---- Cards --------------------------------------------------------------- */

.card {
  background: var(--s1); border: 1px solid var(--hair); border-radius: var(--r-lg);
}
.card.ring { border-color: color-mix(in srgb, var(--c, var(--brand)) 38%, transparent);
             box-shadow: 0 0 24px color-mix(in srgb, var(--c, var(--brand)) 18%, transparent); }

/* ---- The bar ------------------------------------------------------------- */

.bar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(6, 6, 13, .82);
  -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.bar.lift { border-bottom-color: var(--hair); }
.bar .wrap { display: flex; align-items: center; gap: 12px; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; flex: none; }
.logo img { width: 32px; height: 32px; border-radius: 8px; }
.logo span { font: 400 20px/1 var(--impact); letter-spacing: .06em; padding-top: 3px; }
.logo b { font-weight: 400; color: var(--brand); }
.bar nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.bar nav a.link {
  display: flex; align-items: center; min-height: 44px; padding: 0 12px;
  font: 400 12px/1 var(--accent); letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); text-decoration: none;
}
.bar nav a.link:hover { color: var(--text); }
.bar .btn { margin-left: 8px; }
@media (max-width: 820px) { .bar nav a.link { display: none; } }
@media (max-width: 420px) {
  .logo { gap: 8px; } .logo img { width: 28px; height: 28px; }
  .logo span { font-size: 17px; }
  .bar .btn { margin-left: 0; padding: 0 14px; font-size: 11px; letter-spacing: .1em; }
}

/* ---- Sections ------------------------------------------------------------ */

.sec { padding-top: 112px; }
@media (max-width: 700px) { .sec { padding-top: 80px; } }
.sec-head { max-width: 760px; margin-bottom: 40px; }

/* ---- The phone ----------------------------------------------------------- */

.phone {
  position: relative; padding: 8px; border-radius: 42px;
  background: linear-gradient(#2b2b38, #101019);
  box-shadow: 0 0 0 1px rgba(255,255,255,.06), 0 30px 60px -20px rgba(0,0,0,.9);
}
.phone img { display: block; width: 100%; border-radius: 34px; }

/* ---- Footer -------------------------------------------------------------- */

.foot { margin-top: 112px; border-top: 1px solid var(--hair); padding: 32px 0 48px; color: var(--dim); font-size: 14px; }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--text); }
.foot .tag { margin-left: auto; font: 400 12px/1 var(--accent); letter-spacing: .14em; color: var(--faint); text-transform: uppercase; }
.foot .credit { flex-basis: 100%; font-size: 12px; color: var(--faint); }
.foot .credit a { color: var(--dim); text-decoration: underline; }
@media (max-width: 600px) { .foot .tag { margin-left: 0; flex-basis: 100%; } }

/* ==========================================================================
   THE ROUND — a playable sample of the app's Upgrade question
   ========================================================================== */

.round {
  --c: var(--cyan);
  position: relative; width: 100%; max-width: 440px;
  background: var(--s1); border-radius: var(--r-xxl);
  border: 1px solid color-mix(in srgb, var(--c) 38%, transparent);
  box-shadow: 0 0 40px color-mix(in srgb, var(--c) 16%, transparent), 0 30px 60px -24px rgba(0,0,0,.9);
  padding: 20px; transition: border-color .4s, box-shadow .4s;
}
.round-top { display: flex; align-items: center; gap: 12px; }
.round-face {
  flex: none; width: 52px; height: 52px; border-radius: 50%; overflow: hidden;
  box-shadow: 0 0 0 2px var(--c), 0 0 18px color-mix(in srgb, var(--c) 55%, transparent);
  transition: box-shadow .4s;
}
.round-face img { display: block; width: 100%; height: 100%; object-fit: cover; }
.round-who { min-width: 0; flex: 1; }
.round-who b { display: block; font: 400 20px/1.05 var(--display); text-transform: uppercase; letter-spacing: .02em; }
.round-who span { display: block; font: 400 10px/1.4 var(--accent); letter-spacing: .16em; color: var(--c); text-transform: uppercase; }
.round-meta { font: 400 12px/1 var(--mono); color: var(--dim); white-space: nowrap; }

.round-track { height: 6px; margin: 16px 0 0; border-radius: 999px; background: var(--s3); overflow: hidden; }
.round-track i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--c); transition: width .35s ease-out, background .4s; }

.round-ask { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 18px 0 12px; }
.round-ask p { margin: 0; font-size: 15px; color: var(--soft); }
.clock { position: relative; flex: none; width: 40px; height: 40px; }
.clock svg { display: block; width: 100%; height: 100%; transform: rotate(-90deg); }
.clock circle { fill: none; stroke-width: 3; }
.clock .bg { stroke: var(--s3); }
.clock .fg { stroke: var(--lime); stroke-linecap: round; stroke-dasharray: 113.1; stroke-dashoffset: 0; }
.clock.warn .fg { stroke: var(--red); }
.clock span { position: absolute; inset: 0; display: grid; place-items: center; font: 500 13px/1 var(--mono); color: var(--text); }
.clock.warn span { color: var(--red); }

.round-q {
  margin: 0 0 16px; padding: 18px 16px; text-align: center;
  background: var(--deep); border: 1px solid color-mix(in srgb, var(--c) 38%, transparent); border-radius: var(--r-lg);
  font: 500 19px/1.45 var(--body); color: var(--text); text-wrap: balance;
}
.round-q mark { background: none; color: var(--text); box-shadow: inset 0 -0.45em 0 color-mix(in srgb, var(--c) 30%, transparent); padding: 0 .1em; border-radius: 2px; }
.round-q mark.done { color: var(--on); background: var(--lime); box-shadow: none; padding: 0 .2em; }

.opts { display: grid; gap: 10px; }
.opt {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; min-height: 54px; padding: 0 18px; text-align: left; cursor: pointer;
  background: var(--s2); color: var(--text); border: 1px solid var(--hair); border-radius: var(--r-md);
  font: 400 24px/1 var(--display); letter-spacing: .01em;
  box-shadow: 0 3px 0 rgba(0,0,0,.4);
  transition: transform .1s, border-color .15s, background .15s;
}
.opt:hover:not(:disabled) { border-color: var(--muted); }
.opt:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,.4); }
.opt:disabled { cursor: default; }
.opt small { font: 400 10px/1 var(--accent); letter-spacing: .14em; text-transform: uppercase; }
.opt.right { background: color-mix(in srgb, var(--lime) 14%, var(--s2)); border-color: var(--lime); }
.opt.right small { color: var(--lime); }
.opt.wrong { background: color-mix(in srgb, var(--red) 12%, var(--s2)); border-color: var(--red); color: var(--soft); }
.opt.wrong small { color: var(--red); }
.opt.out { opacity: .38; }

.reveal-card {
  margin-top: 12px; padding: 14px 16px; border-radius: var(--r-md);
  background: var(--deep); border: 1px solid var(--hair);
  font-size: 15px; color: var(--soft);
}
.reveal-card[hidden] { display: none; }
.reveal-card .say { font: 400 13px/1 var(--mono); color: var(--lime); }
.reveal-card p { margin: 6px 0 0; }
.reveal-card .why { color: var(--dim); font-size: 14px; }
.round-next { width: 100%; margin-top: 14px; }

.round-end { text-align: center; padding: 8px 4px 4px; }
.round-end[hidden] { display: none; }
.round-end .score { margin: 6px 0 4px; font: 400 64px/1 var(--impact); letter-spacing: .04em; color: var(--brand); text-shadow: 0 0 28px rgba(255,45,155,.5); }
.round-end h3 { margin: 0 0 8px; font: 400 26px/1.1 var(--display); text-transform: uppercase; }
.round-end p { margin: 0 auto 20px; max-width: 30em; color: var(--soft); font-size: 15px; }
.round-end .row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; align-items: center; }
.round-end .faces { display: flex; justify-content: center; gap: 6px; margin: 4px 0 14px; }
.round-end .faces span { width: 30px; height: 30px; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 2px var(--hair); }
.round-end .faces span.won { box-shadow: 0 0 0 2px var(--lime); }
.round-end .faces img { display: block; width: 100%; height: 100%; object-fit: cover; }
.round-end .faces span:not(.won) img { filter: grayscale(1) brightness(.6); }

/* ---- Motion -------------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
  @keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
  @keyframes pop { 0% { opacity: 0; transform: scale(.86); } 60% { opacity: 1; transform: scale(1.04); } 100% { transform: none; } }
  @keyframes shake { 0%,100% { transform: none; } 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
  .rise { animation: rise .6s var(--rise) both; }
  .rise.d1 { animation-delay: .08s; } .rise.d2 { animation-delay: .16s; } .rise.d3 { animation-delay: .24s; } .rise.d4 { animation-delay: .32s; }
  .opt.right { animation: pop .4s var(--pop); }
  .opt.wrong { animation: shake .35s ease-out; }
  .round-end .score { animation: pop .55s var(--pop) both; }
  .js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s var(--rise); }
  .js .reveal.in { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
