/* NutHouse :: The Game Maker — website styles. Tokens mirror src/app/app.css and the house-and-acorn mark. */

@font-face { font-family: 'Outfit'; src: url('../fonts/outfit-variable.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  /* Brand: bright, warm, for kids. Light mode only. */
  --leaf: #1b7228;        /* links, selection, text accent: 5.6:1 on sand, 4.9:1 on the pale green tints */
  --grass: #5ecb3c;       /* bright surface green: chips, tabs, highlights (dark text on it) */
  --sprout: #9be15d;      /* lime highlight */
  --forest: #1b5e2b;      /* CTA band, footer */
  --acorn: #ff8c1a;       /* primary buttons, emphasis (dark text on it) */
  --acorn-deep: #9a4c0f;  /* brown text, button hover */
  --acorn-text: #ad5c0a;  /* the darkest orange that passes 4.5:1 as text on sand: the Nut in the wordmark */
  --husk: #ffe9cc;        /* soft orange tint */
  --sun: #ffd43b;         /* badges, stars */
  --sky: #8ad8ff;         /* hero top, fun tint */
  --berry: #ff5d8f;       /* "new" badges, confetti */
  --bark: #8b5a2b;        /* neutral brown */
  --bark-shade: #5c3a1a;
  --ink: #241a0e;         /* text, and text on bright colours */
  --sand: #fff6e0;        /* page background */
  --paper: #ffffff;       /* panels */
  --play: #178244;        /* white text passes 4.5:1 on it */
  --spot: #29adff;
  --coin: #ffd43b;
  --danger: #c62828;
  --trigger: #e53950;
  --comment: #fff6a8;
  /* Old names kept as aliases so older rules keep working. */
  --sea: var(--leaf); --sea-2: var(--leaf); --deep: var(--forest); --abyss: var(--forest); --foam: #f3ffe9; --dew: #f3ffe9; --fin: var(--bark); --fin-shade: var(--bark-shade);
  --lily: var(--acorn); --lily-deep: var(--acorn-deep); --lily-dark: var(--acorn); --petal: var(--husk); --leaf-2: var(--grass); --acorn-dark: var(--acorn); --night: var(--forest);

  --bg: var(--sand);
  --bg-2: var(--paper);
  --panel: #ffffff;
  --line: #e8dcc3;
  --fg: var(--ink);
  --muted: #6b6358;
  --accent: var(--sea);
  --accent-fg: #ffffff;
  --accent-soft: rgb(94 203 60 / 0.22);
  --accent-2: var(--lily);
  --accent-2-soft: var(--petal);
  --hero-top: #d7f1ff;
  --hero-bottom: var(--sand);
  --shadow-card: 0 1px 2px rgb(90 60 20 / 0.06), 0 8px 24px rgb(90 60 20 / 0.1);
  --shadow-pop: 0 10px 32px rgb(0 0 0 / 0.3);
  --shadow-dialog: 0 16px 48px rgb(0 0 0 / 0.35);

  --radius: 8px;
  --radius-lg: 14px;
  --radius-xl: 24px;
  --pill: 999px;
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
  --font-mono: ui-monospace, Menlo, Consolas, monospace;
  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: light;
}


/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.55 var(--font-body);
  overflow-x: hidden;
}
img, video, svg, canvas { max-width: 100%; height: auto; display: block; }
.pixel { image-rendering: pixelated; image-rendering: crisp-edges; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.08; letter-spacing: -0.01em; margin: 0 0 0.4em; text-wrap: balance; }
h1 { font-size: clamp(2.6rem, 6.4vw, 4.8rem); }
h2 { font-size: clamp(2rem, 4.2vw, 3rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }
p { margin: 0 0 1em; }
.lead { font-size: clamp(1.1rem, 1.6vw, 1.35rem); color: var(--muted); max-width: 60ch; text-wrap: pretty; }
.muted { color: var(--muted); }
.wrap { width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto; }
:focus-visible { outline: 3px solid var(--spot); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
code, kbd { font-family: var(--font-mono); font-size: 0.92em; }
kbd { background: var(--bg-2); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 1px 7px; }
hr.wave { border: 0; height: 2px; background: var(--line); margin: 0; }

/* ---------- Buttons ---------- */
/* Two button types only. Primary = filled (orange on light, sun on dark surfaces). Secondary = white pill with an ink outline (white on dark surfaces).
   .btn-lg / .btn-sm are sizes, not types. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  font-family: var(--font-display); font-weight: 800; text-transform: uppercase; letter-spacing: -0.02em; font-size: 1.1rem;
  padding: 0.85em 1.6em; border-radius: var(--pill); border: 2px solid transparent;
  color: var(--ink); cursor: pointer; text-decoration: none; white-space: nowrap; line-height: 1.1;
  box-shadow: var(--shadow-card); transition: transform 0.18s cubic-bezier(.2,.8,.2,1), box-shadow 0.18s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px) scale(1.05); box-shadow: 0 14px 30px rgb(0 0 0 / 0.18); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn:focus-visible { outline: 3px solid var(--spot); outline-offset: 2px; }
.btn-primary { background: var(--acorn); border-color: var(--acorn); }
.btn-primary:hover { background: #f07c00; border-color: #f07c00; }
.btn-secondary { background: #ffffff; border-color: var(--ink); }
.btn-secondary:hover { background: var(--sand); border-color: var(--ink); }
/* On dark surfaces: primary turns sun yellow, secondary turns solid white. */
.hero .btn-primary, .cta-band .btn-primary, .section.deep .btn-primary, .site-footer .btn-primary { background: var(--sun); border-color: var(--sun); }
.hero .btn-primary:hover, .cta-band .btn-primary:hover, .section.deep .btn-primary:hover, .site-footer .btn-primary:hover { background: #ffdf66; border-color: #ffdf66; }
.hero .btn-secondary, .cta-band .btn-secondary, .section.deep .btn-secondary, .site-footer .btn-secondary { background: #ffffff; border-color: #ffffff; }
.hero .btn-secondary:hover, .cta-band .btn-secondary:hover, .section.deep .btn-secondary:hover, .site-footer .btn-secondary:hover { background: var(--sand); border-color: var(--sand); }
.btn-lg { font-size: 1.3rem; padding: 0.95em 1.7em; }
.btn-sm { font-size: 0.95rem; padding: 0.65em 1.2em; }
.btn .ico { width: 1.2em; height: 1.2em; }
/* Buttons inside the dark arcade bar follow the dark-surface rule too. */
.arcade-bar .btn-secondary { background: #ffffff; border-color: #ffffff; color: var(--ink); }
@media (max-width: 600px) { .btn { white-space: normal; text-align: center; font-size: 1rem; max-width: 100%; box-sizing: border-box; } .btn-lg { font-size: 1.1rem; padding: 0.9em 1.4em; } .arcade-frame .arcade-bar { flex-wrap: wrap; } .arcade-frame .arcade-bar .btn { flex: 1 1 100%; } }

/* ---------- Chips, badges, eyebrows ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.5em;
  font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em;
  color: var(--accent); margin-bottom: 0.8em; text-transform: uppercase;
}
.eyebrow .num {
  display: inline-grid; place-items: center; width: 2.1em; height: 2.1em; border-radius: var(--pill);
  background: var(--grass); color: var(--ink); font-size: 1em; font-weight: 900; letter-spacing: -0.06em;
  font-variant-numeric: tabular-nums;
}
.chip {
  display: inline-flex; align-items: center; gap: 0.45em;
  padding: 0.35em 0.85em; border-radius: var(--pill); font-size: 0.92rem; font-weight: 600;
  background: var(--bg-2); border: 1px solid var(--line); color: var(--fg);
}
.chip.simple { border-color: color-mix(in srgb, var(--play) 40%, transparent); }
.chip.advanced { border-color: color-mix(in srgb, var(--spot) 50%, transparent); }
.chip.expert { border-color: color-mix(in srgb, #9b59b6 50%, transparent); }
.chip .dot { width: 0.6em; height: 0.6em; border-radius: 50%; background: var(--bark); }
.chip.simple .dot { background: var(--play); }
.chip.advanced .dot { background: var(--spot); }
.chip.expert .dot { background: #9b59b6; }
.chip.trig { border-color: color-mix(in srgb, var(--trigger) 60%, transparent); }
.chip.trig .dot { background: var(--trigger); }
.badge {
  display: inline-flex; align-items: center; gap: 0.4em;
  font-family: var(--font-display); font-weight: 600; font-size: 0.85rem;
  padding: 0.3em 0.8em; border-radius: var(--pill); background: var(--coin); color: #3d3400;
}
.badge.leaf { background: var(--accent); color: #fff; }
.badge.deep { background: var(--deep); color: var(--foam); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color 0.2s, background 0.2s;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.nav { display: flex; align-items: center; gap: 1.2rem; min-height: 76px; }
.brand { display: inline-flex; align-items: center; gap: 0.7rem; font-family: var(--font-display); font-weight: 900; font-size: 2.1rem; color: var(--accent); letter-spacing: -0.03em; }
.brand:hover { text-decoration: none; }
.brand svg, .brand img { width: 48px; height: 48px; flex: none; border-radius: var(--radius); }
.nav-links { display: flex; gap: 0.2rem; margin-left: auto; list-style: none; padding: 0; margin-block: 0; }
.nav-links a { display: inline-block; padding: 0.5rem 0.8rem; border-radius: var(--pill); font-weight: 600; color: var(--fg); }
.nav-links a:hover, .nav-links a[aria-current="page"] { background: var(--accent-soft); text-decoration: none; }
.nav-cta { display: flex; align-items: center; gap: 0.5rem; }
.nav-burger { display: none; width: 44px; height: 44px; border: 1px solid var(--line); background: var(--panel); border-radius: var(--pill); cursor: pointer; place-items: center; color: var(--fg); }
@media (max-width: 900px) {
  .nav-links { display: none; position: absolute; inset: 76px var(--gutter) auto; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 0.6rem; box-shadow: var(--shadow-pop); }
  .nav-links.open { display: flex; }
  .nav-burger { display: grid; margin-left: auto; }
  .nav-cta .btn { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; isolation: isolate; overflow: visible; z-index: 2;
  background: linear-gradient(180deg, #2f8f3a 0%, #1b5e2b 100%); color: #ffffff;
  padding: clamp(3rem, 8vw, 6rem) 0 0;
  min-height: calc(100svh - 76px);
  display: grid; align-items: center;
}
.hero-canvas { position: absolute; inset: 0; z-index: -2; overflow: hidden; }
.hero-canvas canvas { width: 100%; height: 100%; }
/* Dark wash BETWEEN the 3D canvas (z -2) and the copy (z 0): black 55% on the left fading to clear on the right. */
.hero::before { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(90deg, rgb(0 0 0 / 0.55) 0%, rgb(0 0 0 / 0.5) 30%, rgb(0 0 0 / 0.22) 55%, rgb(0 0 0 / 0) 80%), linear-gradient(180deg, rgb(0 0 0 / 0.1) 0%, transparent 30%, rgb(0 0 0 / 0.25) 100%); }
@media (max-width: 900px) { .hero::before { background: linear-gradient(180deg, rgb(0 0 0 / 0.55) 0%, rgb(0 0 0 / 0.5) 55%, rgb(0 0 0 / 0.15) 100%); } }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero h1 { margin-bottom: 0.3em; color: #ffffff; text-shadow: 0 3px 6px rgb(0 0 0 / 0.35), 0 10px 30px rgb(0 0 0 / 0.35); }
.hero .lead, .hero .eyebrow { text-shadow: 0 1px 3px rgb(0 0 0 / 0.5), 0 4px 16px rgb(0 0 0 / 0.35); }
.hero h1 .word { display: inline-block; white-space: nowrap; }
.hero h1 .ch { display: inline-block; will-change: transform, opacity; }
.hero h1 { transform-origin: 20% 60%; }
.hero h1 em { font-style: normal; color: var(--sun); position: relative; white-space: nowrap; }
.hero h1 em::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0.02em; height: 0.18em; border-radius: 4px;
  background: var(--acorn); z-index: -1; transform-origin: left; transform: scaleX(0);
  animation: underline 0.7s var(--ul-delay, 1.1s) cubic-bezier(.2,.8,.2,1) forwards;
}
@keyframes underline { to { transform: scaleX(1); } }
.hero .lead { color: rgb(255 255 255 / 0.92); }
.hero .eyebrow { color: var(--sprout); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.8rem; margin: 1.6rem 0 1rem; }
/* Assurance strip: a white bar straddling the hero's bottom edge, one tick per column. */
.hero-assure { display: grid; grid-template-columns: repeat(4, 1fr); list-style: none; padding: 0; margin: clamp(2rem, 5vw, 4rem) 0 calc(-1 * var(--assure-pull)); position: relative; z-index: 1; background: #ffffff; color: var(--ink); border-radius: var(--radius-lg); box-shadow: 0 18px 40px rgb(0 0 0 / 0.18); overflow: hidden; --assure-pull: 2.6rem; }
.hero-assure li { display: flex; align-items: center; gap: 0.7rem; padding: 1.3rem 1.4rem; font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; line-height: 1.25; letter-spacing: -0.01em; border-left: 1px solid var(--line); text-shadow: none; }
.hero-assure li:first-child { border-left: 0; }
.hero-assure li::before { content: '✓'; color: var(--acorn); font-weight: 900; font-size: 1.3em; flex: none; }
.hero + .marquee { padding-top: calc(0.9rem + 2.6rem); position: relative; z-index: 1; }
@media (max-width: 900px) { .hero-assure { grid-template-columns: 1fr 1fr; margin-top: clamp(5rem, 14vw, 7rem); } .hero-assure li:nth-child(3) { border-left: 0; } .hero-assure li:nth-child(n+3) { border-top: 1px solid var(--line); } }
@media (max-width: 520px) { .hero-assure { grid-template-columns: 1fr; } .hero-assure li { border-left: 0; border-top: 1px solid var(--line); padding: 1rem 1.2rem; font-size: 1.05rem; } .hero-assure li:first-child { border-top: 0; } }
.hero-visual { position: relative; }
.mac-window {
  background: var(--panel); border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: 0 30px 70px rgb(6 47 68 / 0.35), 0 0 0 1px rgb(0 0 0 / 0.06);
}
.mac-bar { display: flex; align-items: center; gap: 6px; padding: 10px 12px; background: var(--bg-2); border-bottom: 1px solid var(--line); }
.mac-bar i { width: 12px; height: 12px; border-radius: 50%; background: #ff5f57; }
.mac-bar i:nth-child(2) { background: #febc2e; }
.mac-bar i:nth-child(3) { background: #28c840; }
.mac-bar span { margin-left: auto; margin-right: auto; font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.mac-window video, .mac-window img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.frag {
  position: absolute; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop); padding: 0.7rem 0.9rem; font-size: 0.9rem; max-width: 300px;
}
.frag-rule { left: -8%; bottom: -10%; }
.frag-score { right: -4%; top: -8%; font-family: var(--font-mono); font-weight: 700; color: var(--coin); background: #1d2b53; border-color: #1d2b53; font-size: 1.2rem; letter-spacing: 0.04em; }
.frag-sprite { right: -6%; bottom: 20%; padding: 0.5rem; }
.frag-sprite img { width: 64px; height: 64px; }
@media (max-width: 900px) {
  .hero { min-height: 0; }
  .hero-grid { grid-template-columns: 1fr; }
  .frag-rule { position: static; max-width: none; margin-top: 0.8rem; }
  .frag-score { right: 8px; top: -14px; font-size: 1rem; }
  .frag-sprite { display: none; }
  .hero-visual { margin-bottom: 1rem; }
}

/* Rule sentence (used in hero fragment and section 04) */
.rule { display: grid; gap: 0.35rem; font-size: 0.95rem; }
.rule .when, .rule .do { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
.rule .kw { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; font-size: 0.75em; letter-spacing: 0.06em; color: var(--muted); min-width: 3.4em; }
.rule .tok { display: inline-flex; align-items: center; gap: 0.35em; padding: 0.15em 0.6em; border-radius: 6px; background: var(--bg-2); border: 1px solid var(--line); font-weight: 600; color: var(--ink); }
.rule .tok.obj { border-color: color-mix(in srgb, var(--accent) 50%, transparent); background: var(--accent-soft); }
.rule .tok.act { border-color: color-mix(in srgb, var(--play) 50%, transparent); }
.rule .tok img { width: 18px; height: 18px; }

/* ---------- Marquee ---------- */
.marquee { overflow: hidden; border-block: 1px solid var(--line); background: var(--bg-2); padding: 0.9rem 0; }
.marquee-track { display: flex; gap: 2.5rem; width: max-content; will-change: transform; animation: marquee 40s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee span { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; color: var(--muted); white-space: nowrap; display: inline-flex; align-items: center; gap: 0.6rem; }
.marquee span::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--grass); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */
.section { padding: clamp(3.5rem, 8vw, 7rem) 0; }
.section.alt { background: var(--bg-2); }
.section.deep { background: var(--forest); color: #f3ffe9; --muted: #cfe8c6; --accent: var(--sprout); --panel: #23703a; --bg-2: #1f6633; --line: #2f8a47; --accent-soft: rgb(155 225 93 / 0.18); }
.section-head { max-width: 760px; margin-bottom: clamp(2rem, 4vw, 3.5rem); }
.section-head.center { margin-inline: auto; text-align: center; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.split.flip > :first-child { order: 2; }
@media (max-width: 860px) { .split, .split.flip { grid-template-columns: 1fr; } .split.flip > :first-child { order: 0; } }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.4rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; }
@media (max-width: 960px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 1.5rem; box-shadow: var(--shadow-card); position: relative;
}
.card h3 { margin-top: 0.4rem; }
.card .num { font-family: var(--font-display); font-weight: 700; color: var(--accent); font-size: 0.95rem; letter-spacing: 0.04em; }
.card p:last-child { margin-bottom: 0; }
.card.link { transition: transform 0.2s ease, box-shadow 0.2s ease; color: inherit; display: block; }
.card.link:hover { transform: translateY(-4px); box-shadow: 0 16px 36px rgb(11 79 108 / 0.16); text-decoration: none; }
.card .art { border-radius: var(--radius); margin: -0.5rem -0.5rem 0.8rem; overflow: hidden; }
.card .art img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; }
@media (max-width: 960px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.4rem 1.5rem; box-shadow: var(--shadow-card); }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; }
.stat .ico { display: inline-grid; place-items: center; width: 56px; height: 56px; flex: none; border-radius: var(--radius-lg); background: var(--accent-soft); color: var(--accent); }
.stat .ico svg { width: 30px; height: 30px; }
.stat b { display: block; font-family: var(--font-display); font-weight: 900; letter-spacing: -0.07em; font-size: clamp(2.8rem, 5vw, 4.2rem); line-height: 1; color: var(--accent); font-variant-numeric: normal; }
.stat span { display: block; margin-top: 0.4rem; font-weight: 700; letter-spacing: -0.02em; }
.stat small { color: var(--muted); }

/* Steps (pinned scroll scene) */
.steps { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.steps-list { display: grid; gap: 1rem; }
.step {
  display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: start;
  padding: 1.2rem 1.3rem; border-radius: var(--radius-lg); border: 1px solid transparent; transition: background 0.3s, border-color 0.3s;
}
.step .n { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; width: 2.4rem; height: 2.4rem; border-radius: var(--pill); display: grid; place-items: center; background: var(--bg-2); border: 1px solid var(--line); color: var(--accent); }
.step h3 { margin: 0.2rem 0 0.3rem; }
.step p { margin: 0; color: var(--muted); }
.step.active { background: var(--panel); border-color: var(--line); box-shadow: var(--shadow-card); }
.step.active .n { background: var(--accent); color: #fff; border-color: var(--accent); }
.steps-stage { position: sticky; top: 90px; }
.steps-stage .mac-window { aspect-ratio: 16 / 10; }
.steps-stage .shot { position: absolute; inset: 0; opacity: 0; transition: opacity 0.5s ease; }
.steps-stage .shot.active { opacity: 1; }
.steps-stage .mac-window { position: relative; }
.steps-stage .mac-window .frame { position: relative; aspect-ratio: 16 / 10; overflow: hidden; }
.steps-stage .mac-window img { width: 100%; height: 100%; object-fit: cover; object-position: top left; aspect-ratio: auto; }
.steps-art { position: absolute; width: 34%; right: -8%; bottom: -10%; filter: drop-shadow(0 10px 20px rgb(0 0 0 / 0.25)); pointer-events: none; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } .steps-stage { position: relative; top: 0; order: -1; margin-bottom: 1rem; } .steps-art { width: 28%; right: 0; bottom: -6%; } }

/* Tabs gallery */
.tabs { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1.2rem; }
.tabs button {
  font-family: var(--font-display); font-weight: 600; font-size: 0.95rem; padding: 0.5em 1em; border-radius: var(--pill);
  border: 1px solid var(--line); background: var(--panel); color: var(--fg); cursor: pointer;
}
.tabs button[aria-selected="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.gallery-panel { display: none; }
.gallery-panel.active { display: block; }
.gallery-panel figure { margin: 0; }
.gallery-panel figcaption { display: flex; flex-wrap: wrap; gap: 0.6rem 1.2rem; align-items: baseline; margin-top: 0.8rem; color: var(--muted); }
.gallery-panel figcaption b { color: var(--fg); }
.gallery-panel .mac-window img { aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; cursor: zoom-in; }

/* Arcade */
.arcade { display: grid; grid-template-columns: 1.4fr 0.8fr; gap: 1.6rem; align-items: start; }
@media (max-width: 960px) { .arcade { grid-template-columns: 1fr; } }
.arcade-frame { position: relative; background: #111; border-radius: var(--radius-lg); overflow: hidden; box-shadow: 0 30px 70px rgb(6 47 68 / 0.35); }
.arcade-frame iframe { width: 100%; aspect-ratio: 4 / 3; border: 0; display: block; background: #1d2b53; }
.arcade-frame .arcade-bar { display: flex; gap: 0.8rem; align-items: center; padding: 0.7rem 1rem; background: #0b0b0e; color: #ddd; font-size: 0.9rem; }
.arcade-frame .arcade-bar kbd { background: #222; border-color: #444; color: #fff; }
.arcade-bar .spacer { flex: 1; }
.arcade-list { display: grid; gap: 0.6rem; }
.game-card {
  display: grid; grid-template-columns: 56px 1fr; gap: 0.9rem; align-items: center; text-align: left;
  padding: 0.8rem 1rem; border-radius: var(--radius-lg); border: 1px solid var(--line); background: var(--panel); color: var(--fg); cursor: pointer; font: inherit;
  transition: border-color 0.2s, transform 0.2s;
}
.game-card:hover { transform: translateX(4px); }
.game-card[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.game-card img { width: 56px; height: 56px; object-fit: contain; }
.game-card b { font-family: var(--font-display); font-size: 1.05rem; display: block; }
.game-card span { color: var(--muted); font-size: 0.9rem; }

/* Modes */
.mode { border: 3px solid var(--grass); }

/* Tutorial ticker */
.ticker { overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.ticker-track { display: flex; gap: 0.6rem; width: max-content; animation: marquee 70s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker .tstep { display: inline-flex; gap: 0.5rem; align-items: center; padding: 0.5rem 0.9rem; border-radius: var(--pill); background: var(--panel); border: 1px solid var(--line); white-space: nowrap; font-weight: 600; font-size: 0.95rem; }
.ticker .tstep i { font-style: normal; color: var(--accent); font-family: var(--font-display); }

/* FAQ */
.faq { max-width: 820px; margin-inline: auto; }
.faq details { border-bottom: 1px solid var(--line); padding: 0.4rem 0; }
.faq summary { cursor: pointer; font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; padding: 0.8rem 2.2rem 0.8rem 0; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; position: absolute; right: 0.3rem; top: 0.6rem; font-size: 1.6rem; color: var(--accent); transition: transform 0.2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--muted); margin: 0 0 1rem; max-width: 70ch; }
.faq details .faq-body { overflow: hidden; }
.faq details[open] .faq-body { animation: faq-open 0.35s cubic-bezier(.2,.8,.2,1) both; }
@keyframes faq-open { from { opacity: 0; transform: translateY(-8px); max-height: 0; } to { opacity: 1; transform: none; max-height: 40rem; } }
.faq summary { transition: color 0.15s; } .faq summary:hover { color: var(--accent); }
@media (prefers-reduced-motion: reduce) { .faq details[open] .faq-body { animation: none; } .btn:hover { transform: none; } }

/* Checklist */
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
.checks li { padding-left: 2rem; position: relative; }
.checks li::before { content: '✓'; position: absolute; left: 0; top: 0; width: 1.4rem; height: 1.4rem; border-radius: 50%; background: var(--play); color: #fff; display: grid; place-items: center; font-size: 0.85rem; font-weight: 700; }

/* CTA band */
.cta-band {
  background: linear-gradient(135deg, var(--leaf) 0%, var(--forest) 100%); color: #f3ffe9;
  border-radius: var(--radius-xl); padding: clamp(2.5rem, 6vw, 4.5rem); position: relative; overflow: hidden; isolation: isolate;
}
.cta-band h2 { color: #fff; }
.cta-band .lead { color: #eaffdf; }
.cta-band .mascot { position: absolute; right: -2%; bottom: -10%; width: clamp(160px, 28%, 340px); z-index: -1; opacity: 0.95; }
.cta-band .bubbles { position: absolute; inset: 0; z-index: -2; background:
  radial-gradient(circle at 20% 80%, rgb(167 230 154 / 0.25) 0 60px, transparent 61px),
  radial-gradient(circle at 70% 20%, rgb(167 230 154 / 0.18) 0 90px, transparent 91px),
  radial-gradient(circle at 90% 70%, rgb(255 236 39 / 0.15) 0 40px, transparent 41px); }
@media (max-width: 700px) { .cta-band .mascot { position: static; width: 180px; margin: 1rem auto 0; } }

/* Footer */
.site-footer { background: #141517; color: #c9ccd1; padding: 3.5rem 0 2rem; margin-top: clamp(3rem, 8vw, 6rem); border-top: 6px solid var(--grass); }
.site-footer a { color: #ffffff; }
.site-footer a:hover { color: var(--grass); text-decoration: none; }
.foot-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 2rem; }
@media (max-width: 800px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 500px) { .foot-grid { grid-template-columns: 1fr; } }
.site-footer h4 { color: var(--grass); font-size: 0.9rem; margin-bottom: 0.9rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.45rem; }
.site-footer .brand { color: #ffffff; }
.site-footer .brand span { color: var(--grass); }
.foot-bottom { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; margin-top: 2.5rem; padding-top: 1.2rem; border-top: 1px solid #2b2d31; font-size: 0.9rem; color: #9ea3aa; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgb(0 0 0 / 0.85); display: none; place-items: center; padding: 2rem; cursor: zoom-out; }
.lightbox.open { display: grid; }
.lightbox img { max-height: 90vh; width: auto; border-radius: var(--radius); box-shadow: var(--shadow-dialog); }

/* Sprites sprinkled around */
.floaters { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.floaters img { position: absolute; width: 40px; height: 40px; opacity: 0.9; }

/* Reveal defaults (GSAP sets final values; keep content visible without JS) */
.reveal { opacity: 1; }
.js-ready .reveal { opacity: 0; transform: translateY(24px); }
.js-ready .reveal.in { opacity: 1; transform: none; transition: opacity 0.7s cubic-bezier(.2,.8,.2,1), transform 0.7s cubic-bezier(.2,.8,.2,1); }
.gsap .reveal, .gsap .reveal.in { opacity: 1; transform: none; transition: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .marquee-track, .ticker-track { animation: none; flex-wrap: wrap; width: auto; }
  .hero h1 em::after { animation: none; transform: none; }
  .js-ready .reveal { opacity: 1; transform: none; }
  .btn, .card.link, .game-card { transition: none; }
}

/* ---------- Display type: Outfit, heavy, all caps ---------- */
h1, h2, h3 { font-weight: 800; text-transform: uppercase; letter-spacing: -0.025em; line-height: 0.92; }
h1 { font-size: clamp(3rem, 7.2vw, 6.3rem); line-height: 0.9; }
h2 { font-size: clamp(2.2rem, 4.4vw, 3.85rem); letter-spacing: -0.02em; line-height: 0.95; }
h3 { font-size: clamp(1.35rem, 2.3vw, 2rem); letter-spacing: -0.015em; line-height: 1.05; }
h4 { font-weight: 800; letter-spacing: -0.01em; }
h4 { font-weight: 800; }
.nav-links a { font-family: var(--font-display); font-weight: 800; text-transform: uppercase; letter-spacing: 0.02em; font-size: 1.01rem; padding: 0.6rem 0.9rem; white-space: nowrap; }
@media (min-width: 1100px) and (max-width: 1280px) { .nav-links a { font-size: 0.9rem; padding: 0.55rem 0.6rem; } }
.brand span { font-weight: 900; letter-spacing: -0.03em; }
.marquee span { font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.88rem; }
.card .num, .step .num, .frag-rule .kw, .site-footer h4, .brand-nav h5, .bk-section h4 { text-transform: uppercase; letter-spacing: 0.1em; }
.section-head { margin-bottom: clamp(2.4rem, 5vw, 4rem); }
.section-head .lead, .hero .lead { margin-top: 0.8em; }
.hero-cta { margin: 2rem 0 1.2rem; gap: 1rem; }
/* App mock-ups on the brand page keep the app's own (system, mixed-case) type. */
.toolbar-demo .bar button, .duo-card button, .play-vs button, .sounds button { font-family: var(--font-body); text-transform: none; letter-spacing: 0; }

/* Cards inside the dark green band become plain white cards, with the light-page tokens restored inside them. */
.section.deep .card { background: #ffffff; color: var(--ink); border-color: transparent; box-shadow: 0 12px 32px rgb(0 0 0 / 0.18); --muted: #6b6358; --accent: var(--leaf); --line: #e8dcc3; --bg-2: var(--sand); --panel: #ffffff; --accent-soft: rgb(94 203 60 / 0.22); }
.section.deep .card .rule .kw { color: var(--leaf); }
.section.deep .rule .tok { background: var(--sand); border-color: #e8dcc3; color: var(--ink); }
.section.deep .rule .tok.obj { background: #e6f6dc; border-color: var(--grass); }
.section.deep .rule .tok.act { border-color: var(--play); }
.rule { font-size: 1rem; gap: 0.5rem; }
.rule .tok { padding: 0.3em 0.7em; }
