/* Whimbyte — core stylesheet for the Alpha Hunt site. One file, one source of truth.
   wbx-* = site chrome (used by behave.js), ah-* = the game and its landing blocks. */

@font-face { font-family: 'WbxHead'; src: url('/type/head-800.woff2') format('woff2'); font-weight: 800; font-style: normal; font-display: swap; }
@font-face { font-family: 'WbxHead'; src: url('/type/head-700.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'WbxBody'; src: url('/type/body-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'WbxBody'; src: url('/type/body-700.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --night: #0b1411;
  --night-2: #0f1b17;
  --pine: #13221d;
  --moss: #1d332b;
  --line: #264237;
  --mist: #c9d3cf;
  --fog: #8fa39b;
  --ink: #eef3f0;
  --gold: #e8b64a;
  --gold-hi: #ffd98a;
  --gold-deep: #b8862b;
  --ember: #e0643c;
  --calm: #6fbf8f;
  --radius: 14px;
  --wrap: 1160px;
  --font-head: 'WbxHead', 'Avenir Next', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'WbxBody', 'Segoe UI', system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--night);
  color: var(--mist);
  font: 400 17px/1.65 var(--font-body);
  overflow-x: hidden;
}
img, svg { max-width: 100%; }
a { color: var(--gold); text-underline-offset: 3px; }
a:hover { color: var(--gold-hi); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--font-head); color: var(--ink); line-height: 1.15; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
kbd {
  font: 700 13px/1 var(--font-body);
  color: var(--ink);
  background: var(--moss);
  border: 1px solid var(--line);
  border-bottom-width: 3px;
  border-radius: 7px;
  padding: 5px 8px;
  white-space: nowrap;
}

.wbx-wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.wbx-narrow { max-width: 780px; }
.wbx-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wbx-skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--gold); color: var(--night); padding: 10px 14px; border-radius: 8px; font-weight: 700; }
.wbx-skip:focus { top: 12px; }

/* ---------- buttons ---------- */
.wbx-spur {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 20px;
  border-radius: 999px; border: 1.5px solid transparent;
  font: 700 15px/1 var(--font-body); text-decoration: none; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, transform .15s;
}
.wbx-spur:active { transform: translateY(1px); }
.wbx-spur--primary { background: var(--gold); color: #1a1206; }
.wbx-spur--primary:hover { background: var(--gold-hi); color: #1a1206; }
.wbx-spur--outline { background: transparent; color: var(--ink); border-color: rgba(232,182,74,.55); }
.wbx-spur--outline:hover { border-color: var(--gold); color: var(--gold-hi); }
.wbx-spur--ghost { background: transparent; color: var(--mist); border-color: var(--line); min-height: 42px; padding: 8px 12px; }

/* ---------- header ---------- */
.wbx-topbar { position: sticky; top: 0; z-index: 40; background: rgba(11,20,17,.86); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid rgba(38,66,55,.6); }
.wbx-topbar__row { display: flex; align-items: center; gap: 24px; min-height: 66px; }
.wbx-topbar__brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 800 20px/1 var(--font-head); letter-spacing: .01em; }
.wbx-topbar__brand:hover { color: var(--ink); }
.wbx-wayfind { margin-left: auto; }
.wbx-wayfind__list { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.wbx-wayfind__link { display: block; padding: 8px 12px; border-radius: 8px; color: var(--mist); text-decoration: none; font-size: 15px; }
.wbx-wayfind__link:hover, .wbx-wayfind__link[aria-current] { color: var(--gold-hi); background: rgba(232,182,74,.08); }
.wbx-topbar__cta { min-height: 40px; padding: 8px 16px; font-size: 14px; }
.wbx-topbar__cta svg { width: 14px; height: 14px; }
.wbx-burger, .wbx-drawer__close { display: none; background: none; border: 1px solid var(--line); color: var(--ink); border-radius: 10px; width: 44px; height: 44px; align-items: center; justify-content: center; cursor: pointer; }
.wbx-drawer { position: fixed; inset: 0; z-index: 60; background: rgba(8,14,12,.97); padding: 88px 24px 24px; }
.wbx-drawer__list { list-style: none; margin: 0; padding: 0; }
.wbx-drawer__list a { display: block; padding: 14px 4px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; font: 700 22px/1.2 var(--font-head); }
.wbx-drawer__close { display: inline-flex; position: absolute; top: 12px; right: 16px; }

/* ---------- hero + game stage ---------- */
.ah-hero {
  position: relative;
  padding: 28px 0 56px;
  background:
    radial-gradient(900px 420px at 78% -8%, rgba(201,211,207,.13), transparent 70%),
    radial-gradient(700px 500px at 10% 110%, rgba(232,182,74,.08), transparent 70%),
    linear-gradient(180deg, #0a1310 0%, var(--night) 100%);
  overflow: hidden;
}
.ah-hero::before {
  /* moon */
  content: ''; position: absolute; top: 34px; right: 9%; width: 64px; height: 64px; border-radius: 50%;
  background: radial-gradient(circle at 38% 38%, #f4f0e0, #cfc9b2 60%, #a8a28a);
  box-shadow: 0 0 60px 18px rgba(240,236,214,.12);
  opacity: .8;
}
.ah-hero__intro { position: relative; display: grid; grid-template-columns: 1.1fr 1fr; gap: 12px 40px; align-items: end; margin-bottom: 22px; }
.ah-hero__intro .wbx-eyebrow { grid-column: 1 / -1; justify-self: start; margin-bottom: 0; }
.wbx-eyebrow { display: inline-block; margin: 0 0 14px; padding: 6px 12px; border-radius: 999px; background: rgba(232,182,74,.1); color: var(--gold-hi); font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.ah-hero__title { font-size: clamp(34px, 4.6vw, 56px); font-weight: 800; letter-spacing: -.01em; margin: 0; }
.ah-hero__title span { color: var(--gold); display: inline-block; }
.ah-hero__lead { font-size: clamp(16px, 1.6vw, 18px); color: var(--mist); max-width: 640px; margin-bottom: 10px; }
.ah-hero__facts { display: flex; flex-wrap: wrap; gap: 8px 18px; list-style: none; margin: 0; padding: 0; color: var(--fog); font-size: 15px; }
.ah-hero__facts li::before { content: '◆'; color: var(--gold); font-size: 10px; margin-right: 8px; vertical-align: 2px; }

.ah-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  max-height: calc(100vh - 84px);
  max-height: calc(100svh - 84px);
  scroll-margin: 76px 0 8px;
  border-radius: 18px;
  overflow: hidden;
  background: #05090a;
  border: 1px solid rgba(232,182,74,.35);
  box-shadow: 0 30px 80px rgba(0,0,0,.55), 0 0 0 6px rgba(232,182,74,.05);
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.ah-stage.is-playing, .ah-stick, .ah-tbtn { touch-action: none; }
.ah-stage:focus { outline: none; }
.ah-stage:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
.ah-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ah-keys { margin: 12px 0 0; color: var(--fog); font-size: 14px; text-align: center; }

.ah-panel {
  position: absolute; inset: 0; z-index: 5;
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
  background: radial-gradient(circle at 50% 40%, rgba(11,20,17,.55), rgba(5,9,10,.88));
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
.ah-panel[hidden] { display: none; }
.ah-panel__card { max-width: 480px; max-height: 100%; overflow-y: auto; text-align: center; padding: 8px; }
.ah-panel__card--wide { max-width: 640px; }
.ah-kicker { margin: 0 0 8px; color: var(--gold); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.ah-panel__h { font-size: clamp(22px, 3.4vw, 34px); margin-bottom: 10px; }
.ah-panel__p { color: var(--mist); font-size: clamp(14px, 1.7vw, 17px); }
.ah-panel__btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 16px; }
.ah-stars { font-size: 34px; letter-spacing: 6px; color: rgba(232,182,74,.22); margin-bottom: 6px; }
.ah-stars .is-on { color: var(--gold); text-shadow: 0 0 18px rgba(232,182,74,.55); }

.ah-mask { display: flex; justify-content: center; gap: 4px; margin: 4px 0 14px; }
.ah-mask span { width: 34px; height: 44px; background: rgba(232,182,74,.14); clip-path: polygon(50% 0, 100% 22%, 88% 78%, 50% 100%, 12% 78%, 0 22%); }
.ah-mask span.is-on { background: linear-gradient(160deg, var(--gold-hi), var(--gold-deep)); }
.ah-levels { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; text-align: left; }
.ah-levels button {
  width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(19,34,29,.8);
  color: var(--ink); font: 700 15px/1.2 var(--font-body); cursor: pointer; text-align: left;
}
.ah-levels button:hover:not(:disabled) { border-color: var(--gold); }
.ah-levels button:disabled { opacity: .5; cursor: not-allowed; }
.ah-levels .n { color: var(--gold); font-size: 13px; }
.ah-levels .s { color: var(--gold); letter-spacing: 2px; font-size: 14px; white-space: nowrap; }
.ah-levels .b { display: block; color: var(--fog); font-weight: 400; font-size: 13px; }

.ah-bar { position: absolute; top: 10px; right: 10px; z-index: 4; display: flex; gap: 6px; margin-top: 44px; }
.ah-bar[hidden] { display: none; }
.ah-icon { width: 40px; height: 40px; border-radius: 10px; border: 1px solid rgba(255,255,255,.12); background: rgba(5,10,12,.55); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.ah-icon:hover { border-color: var(--gold); }
.ah-icon .ah-x { display: none; }
.ah-icon[aria-pressed="true"] .ah-x { display: inline; }
.ah-icon[aria-pressed="true"] .ah-wave { display: none; }

.ah-touch { display: none; }
.ah-stage--touch.is-playing .ah-touch { display: block; }
.ah-stick {
  position: absolute; left: 22px; bottom: 22px; z-index: 3; width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.06), rgba(255,255,255,.02));
  border: 2px solid rgba(255,255,255,.15);
  touch-action: none;
}
.ah-stick span { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; background: rgba(232,182,74,.45); border: 2px solid rgba(255,217,138,.7); }
.ah-touch__btns { position: absolute; right: 18px; bottom: 22px; z-index: 3; display: flex; flex-direction: column; gap: 12px; }
.ah-tbtn { width: 76px; height: 76px; border-radius: 50%; border: 2px solid rgba(255,255,255,.18); background: rgba(5,10,12,.5); color: var(--ink); font: 700 13px/1 var(--font-body); touch-action: none; }
.ah-tbtn[aria-pressed="true"] { background: rgba(232,182,74,.35); border-color: var(--gold); }
.ah-tbtn.is-cooling { opacity: .4; }
.ah-stage--touch .ah-keys-hint { display: none; }

/* ---------- bands & cards ---------- */
.wbx-band { padding: 76px 0; }
.wbx-band--alt { background: var(--night-2); border-top: 1px solid rgba(38,66,55,.5); border-bottom: 1px solid rgba(38,66,55,.5); }
.wbx-h1 { font-size: clamp(32px, 5vw, 48px); }
.wbx-h2 { font-size: clamp(28px, 4vw, 40px); margin-bottom: 14px; }
.wbx-intro { font-size: 18px; color: var(--mist); max-width: 720px; margin-bottom: 30px; }
.ah-grid { display: grid; gap: 18px; }
.ah-grid--2 { grid-template-columns: repeat(2, 1fr); }
.ah-grid--3 { grid-template-columns: repeat(3, 1fr); }
.ah-card { background: linear-gradient(180deg, rgba(29,51,43,.55), rgba(19,34,29,.55)); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.ah-card p { margin: 0; font-size: 16px; }
.ah-card__h { font-size: 20px; }
.ah-ico { color: var(--gold); margin-bottom: 12px; }
.ah-keys-list { margin: 0; }
.ah-keyrow { display: grid; grid-template-columns: minmax(130px, auto) 1fr; gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid rgba(38,66,55,.6); }
.ah-keyrow:last-child { border-bottom: 0; }
.ah-keyrow dt, .ah-keyrow dd { margin: 0; }
.ah-keyrow dd { font-size: 16px; }

.ah-hunts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.ah-hunt { position: relative; background: rgba(19,34,29,.55); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 20px; }
.ah-hunt::after { content: ''; position: absolute; top: 18px; right: 18px; width: 18px; height: 22px; background: var(--gold); opacity: .8; clip-path: polygon(50% 0, 100% 22%, 88% 78%, 50% 100%, 12% 78%, 0 22%); }
.ah-hunt__num { margin: 0 0 4px; color: var(--gold); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.ah-hunt__h { font-size: 20px; }
.ah-hunt p { font-size: 15px; }
.ah-hunt__facts { display: flex; gap: 14px; margin: 0; padding-top: 12px; border-top: 1px solid rgba(38,66,55,.6); }
.ah-hunt__facts dt { font-size: 12px; color: var(--fog); }
.ah-hunt__facts dd { margin: 0; color: var(--ink); font-weight: 700; }

.ah-split { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: start; }
.ah-states { list-style: none; counter-reset: st; margin: 0; padding: 0; }
.ah-states li { counter-increment: st; position: relative; padding: 0 0 18px 48px; }
.ah-states li::before { content: counter(st); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--moss); border: 1px solid var(--gold-deep); color: var(--gold-hi); font-weight: 700; display: grid; place-items: center; font-size: 14px; }
.ah-states h3 { font-size: 19px; margin-bottom: 4px; }
.ah-states p { margin: 0; font-size: 16px; }
.ah-figure { margin: 0; position: sticky; top: 96px; background: rgba(11,20,17,.6); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.ah-figure figcaption { font-size: 14px; color: var(--fog); margin-top: 8px; }
.ah-fsm { width: 100%; height: auto; color: var(--fog); }
.ah-fsm__node rect { fill: var(--moss); stroke: var(--line); stroke-width: 1.5; }
.ah-fsm__node text { fill: var(--ink); font: 700 17px var(--font-body); text-anchor: middle; }
.ah-fsm__node.is-calm rect { stroke: var(--calm); }
.ah-fsm__node.is-warn rect { stroke: var(--gold); }
.ah-fsm__node.is-hot rect { stroke: var(--ember); fill: #3a1d15; }
.ah-fsm__labels text { fill: var(--fog); font: 400 13px var(--font-body); text-anchor: middle; }

.ah-table { width: 100%; border-collapse: collapse; font-size: 17px; }
.ah-table th, .ah-table td { padding: 12px 0; border-bottom: 1px solid var(--line); text-align: left; font-weight: 400; }
.ah-table td { text-align: right; color: var(--gold-hi); font-weight: 700; font-variant-numeric: tabular-nums; }
.ah-note { color: var(--fog); font-size: 14px; margin-top: 10px; }
.ah-stars-list { list-style: none; margin: 0 0 18px; padding: 0; }
.ah-stars-list li { display: grid; grid-template-columns: 80px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.ah-stars-list__s { color: var(--gold); letter-spacing: 3px; }

/* ---------- FAQ ---------- */
.wbx-qa { border-bottom: 1px solid var(--line); }
.wbx-qa__h { margin: 0; font-size: inherit; }
.wbx-qa__q { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 0; background: none; border: 0; color: var(--ink); font: 700 18px/1.35 var(--font-body); text-align: left; cursor: pointer; }
.wbx-qa__q svg { flex: none; color: var(--gold); transition: transform .2s; }
.wbx-qa__q[aria-expanded="true"] svg { transform: rotate(180deg); }
.wbx-qa__a p { margin: 0 0 18px; }
.ah-sign { color: var(--gold-hi); font-style: italic; }

/* ---------- inner pages ---------- */
.wbx-page { padding-top: 56px; }
.wbx-prose__sec { margin-bottom: 30px; }
.wbx-prose h2 { font-size: 24px; }
.wbx-prose ul { padding-left: 20px; }
.ah-contact { font-style: normal; background: rgba(19,34,29,.55); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 28px; }
.ah-contact p { margin: 0 0 6px; }

/* ---------- footer ---------- */
.wbx-foot { background: #070d0b; border-top: 1px solid var(--line); padding: 56px 0 24px; font-size: 15px; }
.wbx-foot__grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.wbx-foot__h { font-size: 14px; text-transform: uppercase; letter-spacing: .08em; color: var(--fog); margin-bottom: 12px; }
.wbx-foot ul { list-style: none; margin: 0; padding: 0; }
.wbx-foot li { margin-bottom: 8px; }
.wbx-foot li a { color: var(--mist); text-decoration: none; }
.wbx-foot li a:hover { color: var(--gold-hi); }
.wbx-foot__tag { margin: 14px 0 8px; color: var(--fog); max-width: 340px; }
.wbx-foot__bottom { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 36px; padding-top: 20px; border-top: 1px solid rgba(38,66,55,.6); color: var(--fog); font-size: 14px; }
.wbx-foot__bottom p { margin: 0; }

/* ---------- cookie notice ---------- */
.wbx-notice { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 50; }
.wbx-notice[hidden] { display: none; }
.wbx-notice__row { display: flex; gap: 20px; align-items: center; max-width: 960px; background: #101d18; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; box-shadow: 0 18px 50px rgba(0,0,0,.5); font-size: 14px; }
.wbx-notice__row p { margin: 0; }
.wbx-notice__h { font-weight: 700; color: var(--ink); margin-bottom: 4px !important; }
.wbx-notice__actions { display: flex; gap: 8px; flex: none; }
.wbx-notice__actions .wbx-spur { min-height: 40px; padding: 8px 16px; font-size: 14px; }

/* ---------- reveal-on-scroll ---------- */
[data-wbx-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
[data-wbx-reveal].is-in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 1020px) {
  .wbx-wayfind, .wbx-topbar__cta { display: none; }
  .wbx-burger { display: inline-flex; margin-left: auto; }
  .ah-grid--3 { grid-template-columns: repeat(2, 1fr); }
  .ah-hero__intro { grid-template-columns: 1fr; }
  .ah-hunts { grid-template-columns: repeat(2, 1fr); }
  .ah-split { grid-template-columns: 1fr; gap: 28px; }
  .ah-figure { position: static; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .wbx-wrap { padding: 0 16px; }
  .wbx-band { padding: 56px 0; }
  .ah-hero { padding: 26px 0 40px; }
  .ah-hero::before { display: none; }
  .ah-grid--2, .ah-grid--3, .ah-hunts { grid-template-columns: 1fr; }
  .ah-stage { aspect-ratio: 4 / 5; border-radius: 14px; }
  .ah-keys { display: none; }
  .ah-keyrow { grid-template-columns: 1fr; gap: 6px; }
  .wbx-foot__grid { grid-template-columns: 1fr 1fr; }
  .wbx-foot__col--wide { grid-column: 1 / -1; }
  .wbx-notice__row { flex-direction: column; align-items: stretch; }
  .ah-stick { width: 104px; height: 104px; left: 14px; bottom: 14px; }
  .ah-tbtn { width: 64px; height: 64px; }
  .ah-bar { margin-top: 42px; }
  .ah-tbtn { width: 60px; height: 60px; }
}
@media (max-width: 720px) and (orientation: landscape) {
  .ah-stage { aspect-ratio: 16 / 9; }
}
@media (max-height: 520px) and (orientation: landscape) {
  /* landscape phones: the header scrolls away so the game gets the full height */
  .wbx-topbar { position: static; }
  .ah-stage { max-height: calc(100svh - 16px); scroll-margin: 8px 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-wbx-reveal] { opacity: 1; transform: none; transition: none; }
}
