/* Robot Toes — shared theme.
   A dark display case: blue-black ground, foil accents (cyan, magenta, yellow),
   Unbounded for display, Sora for body, Chakra Petch for labels. The three faces
   are self-hosted under /assets/fonts/ (SIL Open Font License); every rule
   declares a system fallback so the page holds before the files arrive.
   No inline styles anywhere: the CSP is style-src 'self'. */

@font-face { font-family: "Unbounded"; font-style: normal; font-weight: 200 900; font-display: swap; src: url("/assets/fonts/unbounded-latin.woff2") format("woff2"); }
@font-face { font-family: "Sora"; font-style: normal; font-weight: 100 800; font-display: swap; src: url("/assets/fonts/sora-latin.woff2") format("woff2"); }
@font-face { font-family: "Chakra Petch"; font-style: normal; font-weight: 500; font-display: swap; src: url("/assets/fonts/chakra-petch-500-latin.woff2") format("woff2"); }
@font-face { font-family: "Chakra Petch"; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/fonts/chakra-petch-700-latin.woff2") format("woff2"); }

@property --gx { syntax: "<percentage>"; inherits: true; initial-value: 50%; }

:root {
  color-scheme: dark;
  /* ground and surfaces */
  --bg: #07080f;
  --bg-2: #0c0f1e;
  --surface: #12162a;
  --surface-2: #181d36;
  --line: #242a48;
  --line-2: #323a62;
  /* text */
  --ink: #eef0ff;
  --ink-2: #c4c8e6;
  --muted: #8b90b3;
  --dim: #5c6188;
  /* foil accents */
  --foil-1: #4ff2ff;
  --foil-2: #ff4fd8;
  --foil-3: #ffe66d;
  --coral: #ff7a8a;
  --mint: #6df0b3;
  /* section bands: translucent so the starfield and nebula stay visible, alternating lighter and darker */
  --band-light: rgba(24, 29, 54, .42);
  --band-dark: rgba(3, 4, 10, .5);
  --panel: rgba(18, 22, 42, .82);
  --panel-2: rgba(24, 29, 54, .85);
  /* legacy names used across the game shell, kept as aliases of the new palette */
  --paper: var(--ink);
  --paper-2: var(--ink-2);
  --copper: var(--foil-2);
  --copper-dark: #c2189f;
  --amber: var(--foil-3);
  --cyan: var(--foil-1);
  --aqua: var(--foil-1);
  --teal: #2b7cff;
  --navy: var(--surface-2);
  --orange: var(--foil-2);
  --shadow: 0 30px 90px rgba(0, 0, 0, .45);
  --radius: 20px;
  --max: 1240px;
  --display: "Unbounded", "Arial Black", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --body: "Sora", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --label: "Chakra Petch", "Bahnschrift", "Segoe UI", system-ui, sans-serif;
  --mono: var(--label);
  --serif: var(--display);
  --ease-out: cubic-bezier(.22, .8, .2, 1);
  --gx: 50%;
  --px: 0;
  --py: 0;
  font-family: var(--body);
  scroll-behavior: smooth;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { background: var(--bg); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: .03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

/* ---------- ambient: starfield and nebula, painted by theme.js behind everything ---------- */
.sky { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.nebula { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.nebula i { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .4; mix-blend-mode: screen; transform: translate(calc(var(--px) * 18px), calc(var(--py) * 18px)); transition: transform 1.2s var(--ease-out); }
.nebula i:nth-child(1) { width: 52vw; height: 52vw; left: -14vw; top: -18vw; background: radial-gradient(circle, #2d3cff 0%, transparent 62%); }
.nebula i:nth-child(2) { width: 40vw; height: 40vw; right: -10vw; top: 8vw; background: radial-gradient(circle, #9a1fbf 0%, transparent 62%); opacity: .28; }
.nebula i:nth-child(3) { width: 44vw; height: 44vw; left: 30vw; bottom: -24vw; background: radial-gradient(circle, #0e8fb3 0%, transparent 62%); opacity: .24; }
main, footer, .site-header { position: relative; z-index: 1; }

a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }

:focus-visible {
  outline: 2px solid var(--foil-1);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  transform: translateY(-160%);
  padding: .75rem 1rem;
  border-radius: 999px;
  background: var(--foil-1);
  color: var(--bg);
  font: 700 .8rem/1 var(--label);
  letter-spacing: .14em;
  text-transform: uppercase;
}
.skip-link:focus { transform: none; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- header ---------- */
.site-header {
  position: absolute;
  inset: 0 0 auto;
  z-index: 10;
  height: 88px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 clamp(1.25rem, 4vw, 4rem);
  color: var(--ink);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .72rem;
  width: max-content;
  text-decoration: none;
  font: 700 .82rem/1 var(--display);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.brand b { color: var(--foil-3); font-weight: 700; }
.brand-mark { display: flex; align-items: flex-end; gap: 2px; height: 24px; transform: rotate(-7deg); }
.brand-mark i { display: block; width: 7px; border-radius: 7px 7px 3px 3px; background: linear-gradient(180deg, var(--foil-1), var(--foil-2)); }
.brand-mark i:nth-child(1) { height: 15px; }
.brand-mark i:nth-child(2) { height: 23px; }
.brand-mark i:nth-child(3) { height: 18px; }

nav { display: flex; align-items: center; gap: clamp(.25rem, 1vw, .5rem); }
nav a {
  position: relative;
  padding: .6rem .9rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink-2);
  font: 600 .72rem/1 var(--label);
  letter-spacing: .18em;
  text-transform: uppercase;
  transition: background .25s ease, color .25s ease;
}
nav a:hover { background: var(--surface-2); color: var(--ink); }
nav a::after { content: none; }

.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: .85rem 1.4rem;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  font: 600 .74rem/1 var(--label);
  letter-spacing: .16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform .25s var(--ease-out), background .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.button:hover { transform: translateY(-2px); background: var(--surface-2); border-color: var(--foil-1); box-shadow: 0 12px 40px -12px rgba(79, 242, 255, .45); }
.button-primary { background: linear-gradient(120deg, var(--foil-1), #7ad7ff 45%, var(--foil-2)); background-size: 200% 100%; color: #0a0d1c; border-color: transparent; box-shadow: 0 12px 40px -10px rgba(79, 242, 255, .35); }
.button-primary:hover { background-position: 100% 0; color: #0a0d1c; box-shadow: 0 14px 44px -10px rgba(255, 79, 216, .55); }
.button-glass { border-color: var(--line-2); color: var(--ink); background: rgba(18, 22, 42, .6); backdrop-filter: blur(12px); }
.button-glass:hover { background: var(--surface-2); }
.button-quiet { justify-self: end; min-height: 40px; padding: .6rem 1rem; background: transparent; color: var(--ink); border-color: var(--line-2); }
.button-outline { margin-top: 1rem; color: var(--foil-3); border-color: rgba(255, 230, 109, .4); background: transparent; }
.button-outline:hover { border-color: var(--foil-3); box-shadow: 0 12px 40px -12px rgba(255, 230, 109, .35); }
.account-dot { width: 8px; height: 8px; border: 1px solid var(--foil-1); border-radius: 50%; box-shadow: 0 0 10px var(--foil-1); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: min(900px, 100svh);
  display: grid;
  align-items: center;
  overflow: hidden;
  background: transparent;
  color: var(--ink);
}
.hero-media, .hero-shade, .hero-grid { position: absolute; inset: 0; }
.hero-media {
  background-image: url('/assets/art/hero-workshop.webp');
  background-size: cover;
  background-position: center;
  transform: scale(1.015);
  filter: saturate(.85);
  mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, .3) 26%, black 60%), linear-gradient(0deg, transparent 0%, black 40%);
  mask-composite: intersect;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, .3) 26%, black 60%), linear-gradient(0deg, transparent 0%, black 40%);
  -webkit-mask-composite: source-in;
  animation: hero-breathe 14s ease-in-out infinite alternate;
}
.hero-shade { background: linear-gradient(90deg, rgba(7, 8, 15, .55) 0%, rgba(7, 8, 15, .35) 32%, rgba(7, 8, 15, .05) 69%, rgba(7, 8, 15, .25) 100%), linear-gradient(0deg, rgba(7, 8, 15, .6), transparent 48%); }
.hero-grid { opacity: .16; background-image: linear-gradient(rgba(79, 242, 255, .18) 1px, transparent 1px), linear-gradient(90deg, rgba(79, 242, 255, .18) 1px, transparent 1px); background-size: 80px 80px; mask-image: linear-gradient(90deg, black, transparent 58%); }
.hero-content { position: relative; z-index: 2; width: min(670px, calc(100% - 2.5rem)); margin-left: max(1.25rem, calc((100vw - var(--max)) / 2)); padding-top: 86px; }
.eyebrow { display: flex; align-items: center; gap: .9rem; margin: 0 0 1.4rem; color: var(--foil-1); font: 600 .69rem/1 var(--label); letter-spacing: .3em; text-transform: uppercase; }
.eyebrow span { color: var(--foil-2); }
.eyebrow::after { content: ""; width: 72px; height: 1px; background: currentColor; opacity: .5; }
.eyebrow.dark { color: var(--foil-1); }
h1, h2, h3, p { margin-top: 0; }
h1, h2 { font-family: var(--display); font-weight: 700; letter-spacing: -.02em; text-wrap: balance; }
h1 {
  margin-bottom: 1.4rem;
  font-size: clamp(2.5rem, 5.8vw, 5.4rem);
  font-weight: 900;
  line-height: .96;
  text-transform: uppercase;
  background: linear-gradient(100deg, #fff 0%, #cfd6ff 16%, var(--foil-1) 30%, #ffffff 44%, var(--foil-2) 58%, #fff 70%, var(--foil-3) 84%, #fff 100%);
  background-size: 260% 100%;
  background-position: var(--gx) 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 28px rgba(79, 242, 255, .16));
}
h1 em { font-style: normal; font-weight: 900; -webkit-text-fill-color: var(--foil-3); color: var(--foil-3); }
h2 { font-size: clamp(2rem, 3.6vw, 3.2rem); line-height: 1.05; }
.hero-copy { max-width: 520px; color: var(--ink-2); font-size: clamp(1rem, 1.6vw, 1.15rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin: 2rem 0 3rem; }
.hero-stats { display: flex; gap: clamp(1.5rem, 4vw, 3.5rem); margin: 0; }
.hero-stats div { display: grid; gap: .3rem; padding-left: 1rem; border-left: 1px solid var(--line-2); }
.hero-stats dt { color: var(--ink); font: 700 1.35rem/1.1 var(--display); font-variant-numeric: tabular-nums; }
.hero-stats dd { margin: 0; color: var(--muted); font: 500 .62rem/1.4 var(--label); letter-spacing: .16em; text-transform: uppercase; }
.hero-caption { position: absolute; right: 3rem; bottom: 2.4rem; z-index: 2; display: flex; align-items: center; gap: .8rem; color: var(--dim); font: 600 .6rem/1 var(--label); letter-spacing: .2em; text-transform: uppercase; }
.signal { width: 6px; height: 6px; border-radius: 50%; background: var(--foil-1); box-shadow: 0 0 12px var(--foil-1); }

/* ---------- sections ---------- */
.section { position: relative; padding: clamp(4rem, 8vw, 7.5rem) max(1.25rem, calc((100vw - var(--max)) / 2)); border-top: 1px solid var(--line); }
.band-light { background: var(--band-light); }
.band-dark { background: var(--band-dark); }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 3rem; margin-bottom: 3rem; }
.section-heading > p { max-width: 455px; margin-bottom: .4rem; color: var(--muted); }
.section-heading h2 { margin-bottom: 0; }
.section-heading.compact { margin-bottom: 3.5rem; }
.play-section { background: var(--band-light); }

/* ---------- game shell ---------- */
.game-shell { display: grid; grid-template-columns: 310px 1fr; min-height: 650px; overflow: hidden; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); color: var(--ink); box-shadow: var(--shadow); }
.game-brief { position: relative; padding: 2rem; background: linear-gradient(155deg, var(--surface-2), var(--bg-2)); border-right: 1px solid var(--line); overflow: hidden; }
.game-brief::after { content: ""; position: absolute; width: 250px; height: 250px; left: -100px; bottom: -100px; border: 1px solid rgba(79, 242, 255, .16); border-radius: 50%; box-shadow: 0 0 0 36px rgba(79, 242, 255, .025), 0 0 0 72px rgba(79, 242, 255, .025); }
.brief-topline { display: flex; align-items: center; gap: .65rem; color: var(--foil-1); font: 600 .65rem/1 var(--label); letter-spacing: .2em; text-transform: uppercase; }
.status-light { width: 7px; height: 7px; border-radius: 50%; background: var(--foil-1); box-shadow: 0 0 12px var(--foil-1); }
.brief-kicker { margin: 5.5rem 0 .65rem; color: var(--foil-2); font: 600 .66rem/1 var(--label); letter-spacing: .24em; text-transform: uppercase; }
.game-brief h3 { margin-bottom: .8rem; font: 700 1.7rem/1.05 var(--display); letter-spacing: -.02em; }
.game-brief > p:not(.brief-kicker) { color: var(--muted); font-size: .9rem; }
.blueprint-meter { margin: 3rem 0 2rem; }
.meter-label { display: flex; justify-content: space-between; margin-bottom: .55rem; color: var(--muted); font: 500 .66rem/1.4 var(--label); letter-spacing: .12em; text-transform: uppercase; }
.meter-label strong { color: var(--foil-3); }
.meter-track { height: 3px; overflow: hidden; border-radius: 999px; background: rgba(255, 255, 255, .1); }
.meter-track i { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--foil-1), var(--foil-2)); transition: width .45s ease; }
.game-meta { margin: 0; border-top: 1px solid var(--line); }
.game-meta div { display: flex; justify-content: space-between; padding: .8rem 0; border-bottom: 1px solid var(--line); }
.game-meta dt { color: var(--muted); font: 500 .66rem/1.4 var(--label); letter-spacing: .14em; text-transform: uppercase; }
.game-meta dd { margin: 0; color: var(--ink-2); font: 700 .72rem/1.4 var(--label); font-variant-numeric: tabular-nums; }
.puzzle-controls { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; margin-top: 1.4rem; }
.puzzle-controls label { display: grid; gap: .4rem; color: var(--muted); font: 600 .58rem/1.3 var(--label); letter-spacing: .16em; text-transform: uppercase; }
.puzzle-controls select { width: 100%; min-height: 38px; padding: .45rem 1.8rem .45rem .65rem; border: 1px solid var(--line-2); border-radius: 999px; background: var(--bg-2); color: var(--ink-2); font: 600 .68rem/1.2 var(--label); letter-spacing: .04em; cursor: pointer; }
.puzzle-controls select:hover { border-color: rgba(79, 242, 255, .5); }
.puzzle-controls .robot-target-control { grid-column: 1 / -1; }
.brief-actions { position: relative; z-index: 2; display: flex; flex-wrap: wrap; gap: .8rem 1rem; margin-top: 2rem; }
.text-action { padding: 0; border: 0; background: none; color: var(--ink-2); cursor: pointer; font: 500 .72rem/1.4 var(--label); letter-spacing: .06em; }
.text-action:hover { color: var(--foil-1); }
.text-action:disabled { opacity: .35; cursor: default; }
.next-action { width: 100%; min-height: 38px; margin-top: .25rem; border: 1px solid rgba(255, 230, 109, .38); border-radius: 999px; color: var(--foil-3); }
.next-action:hover { border-color: var(--foil-3); color: var(--foil-3); }

.board-panel { display: flex; flex-direction: column; padding: clamp(1.5rem, 4vw, 3rem); background: radial-gradient(circle at 55% 45%, rgba(45, 60, 255, .14), transparent 42%), var(--bg-2); }
.board-topline { display: flex; justify-content: space-between; align-items: center; padding-bottom: 1.5rem; border-bottom: 1px solid var(--line); }
.board-topline > div:first-child { display: flex; align-items: baseline; gap: 1rem; }
.overline { color: var(--muted); font: 600 .62rem/1 var(--label); letter-spacing: .2em; text-transform: uppercase; }
.board-topline strong { color: var(--foil-1); font: 700 .7rem/1 var(--label); letter-spacing: .1em; font-variant-numeric: tabular-nums; }
.board-settings { display: flex; gap: .5rem; }
.icon-button { width: 38px; height: 38px; border: 1px solid var(--line-2); border-radius: 50%; background: transparent; color: var(--ink-2); cursor: pointer; }
.icon-button[aria-pressed="true"] { color: var(--foil-3); border-color: rgba(255, 230, 109, .5); }
.puzzle-layout { flex: 1; display: grid; grid-template-columns: minmax(300px, 520px) minmax(110px, 160px); justify-content: center; align-items: center; gap: clamp(1.5rem, 5vw, 4rem); padding: 2rem 0; }
.board-wrap { position: relative; aspect-ratio: 1; width: 100%; max-width: 510px; padding: 12px; border: 1px solid rgba(79, 242, 255, .24); border-radius: 12px; background: linear-gradient(135deg, rgba(79, 242, 255, .08), transparent); box-shadow: 0 0 70px rgba(45, 60, 255, .15); }
.board { display: grid; grid-template-columns: repeat(4, 1fr); width: 100%; height: 100%; border: 2px solid var(--line-2); border-radius: 6px; overflow: hidden; background: var(--surface); }
.cell { position: relative; display: grid; place-items: center; min-width: 0; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(18, 22, 42, .8); color: var(--ink); cursor: pointer; }
.cell:nth-child(4n) { border-right: 0; }
.cell:nth-child(n+13) { border-bottom: 0; }
.cell:nth-child(2), .cell:nth-child(6), .cell:nth-child(10), .cell:nth-child(14) { border-right: 2px solid var(--line-2); }
.cell:nth-child(n+5):nth-child(-n+8) { border-bottom: 2px solid var(--line-2); }
.cell:hover:not(.given) { background: rgba(50, 58, 98, .55); }
.cell.selected { z-index: 2; background: rgba(79, 242, 255, .12); box-shadow: inset 0 0 0 3px var(--foil-1), 0 0 20px rgba(79, 242, 255, .22); }
.cell.peer { background: rgba(50, 58, 98, .4); }
.cell.given { background: rgba(7, 8, 15, .7); cursor: default; }
.cell.given::after { content: ""; position: absolute; top: 8px; right: 8px; width: 5px; height: 5px; background: var(--foil-2); transform: rotate(45deg); }
.cell.conflict { background: rgba(255, 122, 138, .18); box-shadow: inset 0 0 0 2px var(--coral); }
.cell img { width: 82%; height: 82%; object-fit: contain; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .35)); transition: transform .2s ease; pointer-events: none; }
.cell:hover img { transform: translateY(-2px) scale(1.02); }
.cell .cell-label { position: absolute; inset: auto auto 5px 6px; color: rgba(238, 240, 255, .32); font: 600 .52rem/1 var(--label); letter-spacing: .08em; }
.board-scan { position: absolute; inset: 12px; overflow: hidden; pointer-events: none; }
.board-scan::after { content: ""; position: absolute; left: 0; right: 0; height: 1px; top: -2px; background: linear-gradient(90deg, transparent, var(--foil-1), transparent); box-shadow: 0 0 12px var(--foil-1); opacity: .35; animation: scan 7s linear infinite; }
.toe-tray > p { color: var(--muted); font: 600 .62rem/1 var(--label); letter-spacing: .2em; text-transform: uppercase; }
.toe-options { display: grid; gap: .7rem; }
.toe-option { position: relative; display: grid; grid-template-columns: 52px 1fr; align-items: center; gap: .55rem; width: 100%; min-height: 66px; padding: .35rem .55rem; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, .025); color: var(--ink-2); text-align: left; cursor: pointer; }
.toe-option:hover, .toe-option.selected { border-color: rgba(79, 242, 255, .55); background: rgba(79, 242, 255, .08); color: var(--ink); }
.toe-option img { width: 50px; height: 50px; object-fit: contain; }
.toe-option span { font: 500 .66rem/1.2 var(--label); letter-spacing: .06em; }
.toe-option kbd { position: absolute; top: 4px; right: 5px; color: var(--dim); font: 600 .55rem/1 var(--label); }
.game-status { min-height: 1.5rem; margin: 0; padding-top: 1rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; text-align: center; }
.game-status.success { color: var(--foil-3); }
.game-status.error { color: var(--coral); }
.noscript { padding: 1rem; border-radius: 12px; background: var(--surface-2); color: var(--coral); }

/* ---------- how it works ---------- */
.how-section { background: var(--band-dark); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 0; padding: 0; list-style: none; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.steps li { position: relative; min-height: 410px; padding: 2rem; background: var(--panel); }
.step-number { color: var(--foil-2); font: 700 .65rem/1 var(--label); letter-spacing: .2em; }
.step-icon { width: 112px; height: 112px; margin: 4rem 0 2.5rem; }
.mini-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 10px; border: 1px solid var(--line-2); border-radius: 10px; transform: rotate(-5deg); }
.mini-grid i { border: 1px solid rgba(79, 242, 255, .5); border-radius: 4px; background: rgba(79, 242, 255, .08); }
.mini-grid i:first-child, .mini-grid i:last-child { background: var(--foil-2); border-color: var(--foil-2); }
.blueprint-icon { position: relative; border: 1px solid var(--line-2); border-radius: 10px; background-image: linear-gradient(rgba(79, 242, 255, .13) 1px, transparent 1px), linear-gradient(90deg, rgba(79, 242, 255, .13) 1px, transparent 1px); background-size: 14px 14px; transform: rotate(4deg); }
.blueprint-icon::before, .blueprint-icon::after { content: ""; position: absolute; border: 2px solid var(--foil-3); border-radius: 50%; }
.blueprint-icon::before { width: 42px; height: 42px; left: 18px; top: 24px; }
.blueprint-icon::after { width: 28px; height: 18px; right: 12px; bottom: 15px; border-radius: 3px; }
.power-icon { display: grid; place-items: center; border: 1px solid var(--line-2); border-radius: 50%; }
.power-icon i { width: 38px; height: 50px; border: 6px solid var(--foil-1); border-top-color: transparent; border-radius: 0 0 25px 25px; transform: translateY(4px); }
.power-icon::before { content: ""; position: absolute; width: 6px; height: 46px; background: var(--foil-1); border-radius: 4px; transform: translateY(-22px); }
.steps h3 { margin-bottom: .6rem; font: 700 1.3rem/1.15 var(--display); letter-spacing: -.01em; }
.steps p { max-width: 290px; margin: 0; color: var(--muted); font-size: .9rem; }

/* ---------- workshop ---------- */
.workshop-section { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(260px, .8fr) 1.5fr; gap: clamp(3rem, 7vw, 8rem); padding: clamp(5rem, 10vw, 10rem) max(1.25rem, calc((100vw - var(--max)) / 2)); border-top: 1px solid var(--line); background: var(--band-light); color: var(--ink); }
.workshop-copy { align-self: center; }
.workshop-copy h2 { font-size: clamp(2.2rem, 4vw, 3.6rem); line-height: 1; }
.workshop-copy > p:not(.eyebrow) { color: var(--muted); }
.bay-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.robot-bay { position: relative; min-height: 270px; padding: 0; overflow: hidden; isolation: isolate; border: 1px solid var(--line); border-radius: 18px; background: radial-gradient(circle at 50% 70%, rgba(45, 60, 255, .22), transparent 42%), linear-gradient(160deg, var(--panel-2), rgba(12, 15, 30, .85)); color: var(--ink-2); text-align: left; cursor: pointer; transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease; }
.robot-bay:hover { border-color: rgba(79, 242, 255, .48); transform: translateY(-2px); }
.robot-bay::before { content: ""; position: absolute; left: 12%; right: 12%; bottom: 23%; height: 1px; z-index: -1; background: rgba(79, 242, 255, .25); box-shadow: 0 0 25px rgba(79, 242, 255, .28); }
.robot-bay img { position: absolute; width: 64%; height: 64%; left: 18%; top: 10%; object-fit: contain; filter: grayscale(1) brightness(.28) sepia(.25) hue-rotate(160deg) drop-shadow(0 18px 18px rgba(0, 0, 0, .4)); opacity: .72; }
.robot-bay.active { border-color: rgba(255, 230, 109, .78); box-shadow: inset 0 0 0 1px rgba(255, 230, 109, .18), 0 0 34px rgba(255, 230, 109, .08); }
.robot-bay.active::before { background: rgba(255, 230, 109, .48); box-shadow: 0 0 28px rgba(255, 230, 109, .34); }
.robot-bay.activated img { transform-origin: 50% 85%; filter: drop-shadow(0 18px 18px rgba(0, 0, 0, .4)); opacity: 1; animation: robot-idle 4.8s ease-in-out infinite; }
.robot-bay:nth-child(2) img { animation-delay: -.9s; }
.robot-bay:nth-child(3) img { animation-delay: -1.8s; }
.robot-bay:nth-child(4) img { animation-delay: -2.7s; }
.robot-bay.blueprint_in_progress .bay-progress { animation: schematic-pulse 3.2s ease-in-out infinite; }
.robot-bay.blueprint_complete .bay-blueprint { border-style: solid; animation: activation-ready 1.8s ease-in-out infinite; }
.bay-state { position: absolute; z-index: 3; top: .8rem; right: .8rem; display: inline-flex; align-items: center; gap: .38rem; padding: .35rem .55rem; border: 1px solid rgba(79, 242, 255, .22); border-radius: 999px; background: rgba(7, 8, 15, .76); color: var(--muted); font: 600 .5rem/1 var(--label); letter-spacing: .16em; text-transform: uppercase; }
.bay-state i { width: 5px; height: 5px; border-radius: 50%; background: var(--dim); }
.robot-bay.active .bay-state { border-color: rgba(255, 230, 109, .42); color: var(--foil-3); }
.robot-bay.active .bay-state i { background: var(--foil-3); box-shadow: 0 0 9px rgba(255, 230, 109, .8); }
.robot-bay.activated .bay-state { border-color: rgba(79, 242, 255, .36); color: var(--foil-1); }
.robot-bay.activated .bay-state i { background: var(--foil-1); box-shadow: 0 0 9px rgba(79, 242, 255, .82); }
.bay-blueprint { position: absolute; inset: 8% 12% 24%; border: 1px dashed rgba(79, 242, 255, .3); border-radius: 8px; background: linear-gradient(rgba(79, 242, 255, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(79, 242, 255, .035) 1px, transparent 1px); background-size: 18px 18px; }
.bay-blueprint .bay-silhouette, .bay-blueprint .bay-progress { width: 78%; height: 88%; left: 11%; top: 4%; }
.bay-blueprint .bay-silhouette { filter: brightness(.05) sepia(1) hue-rotate(160deg) saturate(2); opacity: .82; }
.bay-blueprint .bay-progress { filter: grayscale(1) sepia(1) hue-rotate(150deg) saturate(3) brightness(1.2) drop-shadow(0 0 10px rgba(79, 242, 255, .48)); opacity: .72; }
.bay-blueprint .bay-toe { width: 23%; height: 30%; left: 3%; top: 65%; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .55)); opacity: 1; }
.bay-blueprint span { position: absolute; right: .6rem; top: .5rem; color: var(--foil-1); font: 700 .62rem/1 var(--label); }
.bay-label { position: absolute; left: 1rem; right: 1rem; bottom: .8rem; display: flex; justify-content: space-between; align-items: end; }
.bay-label strong { font: 700 1rem/1.1 var(--display); letter-spacing: -.01em; }
.bay-label span { color: var(--dim); font: 600 .56rem/1.3 var(--label); letter-spacing: .14em; text-transform: uppercase; }

/* ---------- a game page: no hero, so the header sits in the flow and sticks ---------- */
body.game-page .site-header { position: sticky; inset: auto; background: linear-gradient(to bottom, rgba(7, 8, 15, .94), rgba(7, 8, 15, .72)); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.page-intro { padding: clamp(2.5rem, 5vw, 4rem) max(1.25rem, calc((100vw - var(--max)) / 2)) 0; }
.page-intro h1 { margin: 0 0 1rem; font-size: clamp(2.3rem, 5.4vw, 4rem); }
.page-intro > p:last-child { max-width: 60ch; margin: 0; color: var(--ink-2); font-size: clamp(1rem, 1.5vw, 1.1rem); }
.page-intro + .play-section { border-top: 0; padding-top: clamp(2rem, 4vw, 3rem); }

/* ---------- footer ---------- */
footer { display: grid; grid-template-columns: 1fr 1fr auto; align-items: center; gap: 2rem; padding: 2.5rem max(1.25rem, calc((100vw - var(--max)) / 2)); background: rgba(3, 4, 10, .72); color: var(--muted); border-top: 1px solid var(--line); font: 500 .74rem/1.6 var(--label); letter-spacing: .06em; }
.footer-brand { color: var(--ink); }
footer p { margin: 0; }
footer div { display: flex; gap: 1.2rem; }
footer a, footer button { padding: 0; border: 0; background: none; color: var(--muted); text-decoration: none; cursor: pointer; font: inherit; letter-spacing: .12em; text-transform: uppercase; }
footer a:hover, footer button:hover { color: var(--foil-1); }

/* ---------- reward dialog ---------- */
.reward-dialog { width: min(1080px, calc(100% - 2rem)); max-height: calc(100dvh - 2rem); padding: 0; overflow: auto; border: 1px solid rgba(79, 242, 255, .35); border-radius: 18px; background: var(--bg-2); color: var(--ink-2); box-shadow: 0 35px 120px rgba(0, 0, 0, .72), 0 0 80px rgba(45, 60, 255, .18); }
.reward-dialog::backdrop { background: rgba(4, 5, 12, .82); backdrop-filter: blur(14px); }
.reward-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr); min-height: 650px; }
.reward-copy { padding: clamp(2rem, 5vw, 4.5rem); }
.reward-copy h2 { max-width: 620px; margin: 1rem 0; font-size: clamp(2rem, 3.6vw, 3.4rem); line-height: 1; }
.reward-copy > p:not(.eyebrow, .reward-transition) { color: var(--muted); }
.reward-calculation { margin: 2rem 0 1.5rem; border-top: 1px solid var(--line); }
.reward-calculation div { display: flex; justify-content: space-between; gap: 2rem; padding: .65rem 0; border-bottom: 1px solid var(--line); }
.reward-calculation dt { color: var(--muted); font: 500 .68rem/1.4 var(--label); letter-spacing: .08em; }
.reward-calculation dd { margin: 0; color: var(--ink); font: 700 .74rem/1.4 var(--label); font-variant-numeric: tabular-nums; }
.reward-calculation .reward-total { margin-top: .3rem; border-color: rgba(255, 230, 109, .42); }
.reward-calculation .reward-total dt, .reward-calculation .reward-total dd { color: var(--foil-3); }
.reward-transition { color: var(--ink-2); font: 600 .8rem/1.5 var(--label); letter-spacing: .04em; }
.reward-transition strong { color: var(--ink); }
.component-track { display: grid; grid-template-columns: repeat(5, 1fr); gap: .4rem; padding: 0; margin: 1.7rem 0; list-style: none; }
.component-track li { min-height: 54px; padding: .55rem .35rem; border: 1px solid var(--line); border-radius: 10px; color: var(--dim); font: 600 .5rem/1.35 var(--label); letter-spacing: .06em; text-align: center; text-transform: uppercase; }
.component-track li.complete { border-color: rgba(79, 242, 255, .45); background: rgba(79, 242, 255, .08); color: var(--foil-1); }
.component-track li.revealing { border-color: rgba(255, 230, 109, .65); color: var(--foil-3); box-shadow: 0 0 24px rgba(255, 230, 109, .12); }
.reward-actions { display: flex; flex-wrap: wrap; gap: .7rem; align-items: center; }
.reward-actions .button { min-height: 42px; max-width: 100%; white-space: normal; text-align: center; }
.reveal-stage { position: relative; min-height: 650px; overflow: hidden; background: radial-gradient(circle at 50% 45%, rgba(45, 60, 255, .28), transparent 40%), linear-gradient(155deg, var(--surface-2), var(--bg)); }
.reveal-stage::before, .reveal-stage::after { content: ""; position: absolute; z-index: 1; left: 50%; top: 46%; width: 38%; aspect-ratio: 1; border: 1px solid rgba(79, 242, 255, .55); border-radius: 50%; opacity: 0; transform: translate(-50%, -50%) scale(.25); pointer-events: none; }
.reveal-stage.activated::before { animation: activation-ring 1.15s cubic-bezier(.2, .8, .2, 1) both; }
.reveal-stage.activated::after { border-color: rgba(255, 230, 109, .62); animation: activation-ring 1.15s .16s cubic-bezier(.2, .8, .2, 1) both; }
.blueprint-grid { position: absolute; inset: 0; opacity: .4; background: linear-gradient(rgba(79, 242, 255, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(79, 242, 255, .06) 1px, transparent 1px); background-size: 32px 32px; mask-image: linear-gradient(to bottom, transparent, black 15%, black 85%, transparent); }
.activation-burst { position: absolute; z-index: 3; left: 50%; top: 46%; width: 1px; height: 1px; pointer-events: none; }
.activation-burst i { --angle: 0deg; position: absolute; left: -3px; top: -12px; width: 6px; height: 24px; border-radius: 999px; opacity: 0; background: linear-gradient(var(--foil-1), var(--foil-3)); transform-origin: 50% 12px; }
.activation-burst i:nth-child(2) { --angle: 45deg; }
.activation-burst i:nth-child(3) { --angle: 90deg; }
.activation-burst i:nth-child(4) { --angle: 135deg; }
.activation-burst i:nth-child(5) { --angle: 180deg; }
.activation-burst i:nth-child(6) { --angle: 225deg; }
.activation-burst i:nth-child(7) { --angle: 270deg; }
.activation-burst i:nth-child(8) { --angle: 315deg; }
.reveal-stage.activated .activation-burst i { animation: activation-spark .9s .08s cubic-bezier(.16, .8, .3, 1) both; }
.reveal-stage > img { position: absolute; z-index: 2; inset: 7% 8% 13%; width: 84%; height: 80%; object-fit: contain; transition: opacity .5s ease, filter .5s ease, clip-path .7s cubic-bezier(.2, .8, .2, 1), transform .7s ease; }
.reveal-silhouette { filter: brightness(.05) sepia(1) hue-rotate(160deg) saturate(2) drop-shadow(0 0 30px rgba(79, 242, 255, .24)); opacity: .78; }
.reveal-progress { clip-path: inset(100% 0 0); filter: grayscale(1) sepia(1) hue-rotate(150deg) saturate(3) brightness(1.25) drop-shadow(0 0 18px rgba(79, 242, 255, .65)); opacity: .75; }
.reveal-robot { opacity: 0; transform: scale(.94); filter: drop-shadow(0 25px 30px rgba(0, 0, 0, .48)); }
.reveal-stage.activated .reveal-silhouette, .reveal-stage.activated .reveal-progress { opacity: 0; }
.reveal-stage.activated .reveal-robot { opacity: 1; transform: scale(1); animation: activation-arrive .8s cubic-bezier(.16, .8, .3, 1) both, robot-idle 4.8s .8s ease-in-out infinite; }
.reveal-callout { position: absolute; z-index: 4; left: 1.3rem; right: 1.3rem; bottom: 1.2rem; display: flex; justify-content: space-between; gap: 1rem; padding-top: .8rem; border-top: 1px solid rgba(79, 242, 255, .24); font: 600 .62rem/1.3 var(--label); letter-spacing: .12em; text-transform: uppercase; }
.reveal-callout span { color: var(--muted); }
.reveal-callout strong { color: var(--foil-1); text-align: right; }
.reveal-callout span, .reveal-callout strong { min-width: 0; overflow-wrap: anywhere; }

/* ---------- sign-in gate (card studio) ----------
   The header Sign in button and its dialog live in /account.css. */
.account-status { min-height: 2.7em; padding: .75rem .9rem; border-left: 3px solid var(--foil-2); border-radius: 0 10px 10px 0; background: rgba(255, 255, 255, .04); font: 600 .74rem/1.5 var(--label); letter-spacing: .04em; }
.google-button { width: 100%; justify-content: center; background: #fff; border-color: #fff; color: #1b1f33; }
.google-button:hover { background: #eef0ff; border-color: #eef0ff; }
.google-button:disabled { cursor: wait; opacity: .62; }
.dialog-close { position: absolute; top: 1rem; right: 1rem; width: 38px; height: 38px; border: 1px solid var(--line-2); border-radius: 50%; background: rgba(18, 22, 42, .85); color: var(--ink); cursor: pointer; font-size: 1.5rem; }
.dialog-close:hover { border-color: var(--foil-1); }
.google-placeholder { width: 100%; margin-top: 1rem; background: white; border-color: white; color: #5c6188; cursor: not-allowed; }
.google-placeholder:hover { transform: none; }
.google-placeholder span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #e9edf7; color: #3973d6; font-weight: 900; }

@keyframes scan { to { transform: translateY(500px); } }
@keyframes hero-breathe { to { transform: scale(1.035); } }
@keyframes robot-idle { 0%, 100% { transform: translateY(0) rotate(-.35deg); } 50% { transform: translateY(-7px) rotate(.45deg); } }
@keyframes schematic-pulse { 0%, 100% { opacity: .62; filter: grayscale(1) sepia(1) hue-rotate(150deg) saturate(3) brightness(1.15) drop-shadow(0 0 8px rgba(79, 242, 255, .38)); } 50% { opacity: .9; filter: grayscale(1) sepia(1) hue-rotate(150deg) saturate(3) brightness(1.35) drop-shadow(0 0 16px rgba(79, 242, 255, .66)); } }
@keyframes activation-ready { 0%, 100% { border-color: rgba(79, 242, 255, .32); box-shadow: inset 0 0 0 rgba(79, 242, 255, 0); } 50% { border-color: rgba(255, 230, 109, .68); box-shadow: inset 0 0 28px rgba(255, 230, 109, .08); } }
@keyframes activation-ring { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.25); } 30% { opacity: .82; } 100% { opacity: 0; transform: translate(-50%, -50%) scale(2.6); } }
@keyframes activation-spark { 0% { opacity: 0; transform: rotate(var(--angle)) translateY(-20px) scale(.25); } 35% { opacity: 1; } 100% { opacity: 0; transform: rotate(var(--angle)) translateY(-175px) scale(.8); } }
@keyframes activation-arrive { 0% { opacity: 0; transform: scale(.8) translateY(22px); filter: brightness(2) drop-shadow(0 0 50px rgba(79, 242, 255, .8)); } 65% { opacity: 1; transform: scale(1.035) translateY(-3px); } 100% { opacity: 1; transform: scale(1) translateY(0); filter: drop-shadow(0 25px 30px rgba(0, 0, 0, .48)); } }

@media (max-width: 960px) {
  .site-header { grid-template-columns: 1fr auto; }
  nav { display: none; }
  .hero-content { margin-left: 2rem; }
  .game-shell { grid-template-columns: 1fr; }
  .game-brief { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 2rem; }
  .game-brief .brief-topline, .game-brief .brief-kicker, .game-brief h3, .game-brief > p { grid-column: 1; }
  .brief-kicker { margin-top: 2rem; }
  .blueprint-meter, .game-meta { grid-column: 2; }
  .puzzle-controls { grid-column: 2; }
  .blueprint-meter { margin: 2rem 0 0; }
  .brief-actions { grid-column: 2; }
  .workshop-section { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .site-header { height: 72px; }
  .hero { min-height: 780px; align-items: end; }
  .hero-media { background-position: 61% center; opacity: .88; }
  .hero-shade { background: linear-gradient(0deg, rgba(7, 8, 15, .99) 10%, rgba(7, 8, 15, .7) 62%, rgba(7, 8, 15, .3)); }
  .hero-content { width: auto; margin: 0; padding: 8rem 1.25rem 4rem; }
  h1 { font-size: clamp(2.2rem, 10.5vw, 3.6rem); }
  .hero-caption { display: none; }
  .hero-stats { gap: 1rem; justify-content: space-between; }
  .section-heading { display: block; }
  .section-heading > p { margin-top: 1.5rem; }
  .game-brief { display: block; }
  .brief-kicker { margin-top: 3rem; }
  .puzzle-layout { grid-template-columns: 1fr; }
  .toe-tray > p { text-align: center; }
  .toe-options { grid-template-columns: repeat(4, 1fr); }
  .toe-option { display: grid; grid-template-columns: 1fr; justify-items: center; min-height: 76px; padding: .2rem; text-align: center; }
  .toe-option img { width: 52px; height: 52px; }
  .toe-option span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .steps { grid-template-columns: 1fr; }
  .steps li { min-height: auto; }
  .step-icon { margin: 3rem 0 2rem; }
  .bay-grid { grid-template-columns: 1fr; }
  .robot-bay { min-height: 240px; }
  footer { grid-template-columns: 1fr; }
  .reward-layout { grid-template-columns: 1fr; }
  .reveal-stage { min-height: 420px; order: -1; }
  .reward-copy { padding: 2rem 1.3rem; }
  .component-track { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .component-track li { padding-inline: .15rem; font-size: .45rem; }
}

@media (max-width: 420px) {
  .hero-actions .button { width: 100%; }
  .hero-stats dt { font-size: 1.1rem; }
  .hero-stats dd { font-size: .55rem; }
  .board-panel { padding: 1rem; }
  .board-wrap { padding: 7px; }
  .board-scan { inset: 7px; }
  .cell.given::after { top: 5px; right: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  :root { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .nebula i { transform: none; }
  .robot-bay.activated img, .reveal-stage.activated .reveal-robot { animation: none !important; transform: none; }
  .robot-bay.blueprint_in_progress .bay-progress, .robot-bay.blueprint_complete .bay-blueprint { animation: none !important; }
  .reveal-stage.activated::before { animation: none !important; opacity: .38; transform: translate(-50%, -50%) scale(1.55); }
  .reveal-stage.activated::after { animation: none !important; opacity: .28; transform: translate(-50%, -50%) scale(1.85); }
  .reveal-stage.activated .activation-burst i { animation: none !important; opacity: .7; transform: rotate(var(--angle)) translateY(-128px) scale(.7); }
}

body.reduce-motion *, body.reduce-motion *::before, body.reduce-motion *::after {
  animation-duration: .01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .01ms !important;
}
body.reduce-motion .nebula i { transform: none; }
body.reduce-motion .robot-bay.activated img, body.reduce-motion .reveal-stage.activated .reveal-robot { animation: none !important; transform: none; }
body.reduce-motion .robot-bay.blueprint_in_progress .bay-progress, body.reduce-motion .robot-bay.blueprint_complete .bay-blueprint { animation: none !important; }
body.reduce-motion .reveal-stage.activated::before { animation: none !important; opacity: .38; transform: translate(-50%, -50%) scale(1.55); }
body.reduce-motion .reveal-stage.activated::after { animation: none !important; opacity: .28; transform: translate(-50%, -50%) scale(1.85); }
body.reduce-motion .reveal-stage.activated .activation-burst i { animation: none !important; opacity: .7; transform: rotate(var(--angle)) translateY(-128px) scale(.7); }
