/* Flipside Digital: the site wears the app's clothes. Cream paper, ink outlines, hard shadows,
   sunbursts and pack colors (src/theme/colors.ts), Bricolage Grotesque + Nunito. */

@font-face { font-family: 'Bricolage'; src: url('/assets/fonts/bricolage-800.woff') format('woff'); font-weight: 800; font-display: swap; }
@font-face { font-family: 'Bricolage'; src: url('/assets/fonts/bricolage-600.woff') format('woff'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Nunito'; src: url('/assets/fonts/nunito-600.woff') format('woff'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Nunito'; src: url('/assets/fonts/nunito-800.woff') format('woff'); font-weight: 700 800; font-display: swap; }
@font-face { font-family: 'Nunito'; src: url('/assets/fonts/nunito-900.woff') format('woff'); font-weight: 900; font-display: swap; }

:root {
  --cream: #fff4e2;
  --paper: #fffbf3;
  --ink: #1f1a2e;
  --ink-soft: #5b5470;
  --midnight: #1a1626;
  --night-soft: #b9b2cc;

  --tomato: #ff5a36;
  --sun: #ffc23c;
  --teal: #17b3a3;
  --grape: #7b4fd8;
  --sky: #3e8ef7;
  --gum: #ff6fa8;
  --lime: #8bc34a;
  --tangerine: #ff9a3c;

  --stroke: 3px;
  --shadow-sm: 3px 3px 0 var(--ink);
  --shadow: 6px 6px 0 var(--ink);
  --shadow-lg: 10px 10px 0 var(--ink);
  --r-card: 28px;
  --r-tile: 22px;
  --r-btn: 18px;
  --r-pill: 999px;

  --display: 'Bricolage', 'Arial Black', system-ui, sans-serif;
  --body: 'Nunito', ui-rounded, system-ui, sans-serif;

  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --snap: cubic-bezier(0.2, 0.9, 0.3, 1.2);
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1200px;

  color-scheme: light;
}

/* ── Base ─────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--body);
  font-weight: 600;
  font-size: 18px;
  line-height: 1.55;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
/* Paper grain over everything (pointer-events off). */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.07;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
[hidden] { display: none !important; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: var(--sun); color: var(--ink); }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; border-radius: 8px; }

h1, h2, h3, h4 { font-family: var(--display); font-weight: 800; line-height: 1.02; letter-spacing: -0.025em; margin: 0; }
h1 { font-size: clamp(3rem, 8.5vw, 7.25rem); }
h2 { font-size: clamp(2.3rem, 5.5vw, 4.4rem); }
h3 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); }
p { margin: 0 0 1em; }

.wrap { width: min(var(--max), 100% - 2 * var(--gutter)); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 200; }
.skip:focus { left: 8px; background: var(--paper); padding: 8px 14px; border: var(--stroke) solid var(--ink); border-radius: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.icon { width: 1.15em; height: 1.15em; fill: currentColor; flex: none; }

/* Pack colors as a component variable: --c (fill) and --on (text on it). */
[data-color] { --on: var(--ink); }
[data-color='tomato'] { --c: var(--tomato); }
[data-color='sun'] { --c: var(--sun); }
[data-color='teal'] { --c: var(--teal); }
[data-color='grape'] { --c: var(--grape); --on: var(--paper); }
[data-color='sky'] { --c: var(--sky); }
[data-color='gum'] { --c: var(--gum); }
[data-color='lime'] { --c: var(--lime); }
[data-color='tangerine'] { --c: var(--tangerine); }
[data-color='ink'] { --c: var(--ink); --on: var(--paper); }

/* ── Sunburst ─────────────────────────────────────────────────────────── */

.sunburst {
  position: absolute;
  width: 220vmax;
  aspect-ratio: 1;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  border-radius: 50%;
  background: repeating-conic-gradient(var(--ray, rgba(255, 194, 60, 0.28)) 0deg 7.5deg, transparent 7.5deg 15deg);
  animation: spin 120s linear infinite;
  pointer-events: none;
}
@keyframes spin { to { rotate: 360deg; } }

/* ── Buttons & stickers ───────────────────────────────────────────────── */

.btn {
  --bg: var(--paper);
  --fg: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55em;
  min-height: 56px;
  padding: 0.75em 1.5em;
  border: var(--stroke) solid var(--ink);
  border-radius: var(--r-btn);
  background: var(--bg);
  color: var(--fg);
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.12rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.18s var(--spring), box-shadow 0.18s var(--spring), background-color 0.2s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--ink); }
.btn:active { transform: translate(6px, 6px); box-shadow: 0 0 0 var(--ink); transition-duration: 0.08s; }
.btn--primary { --bg: var(--tomato); }
.btn--sun { --bg: var(--sun); }
.btn--ink { --bg: var(--ink); --fg: var(--paper); border-color: var(--ink); box-shadow: 6px 6px 0 var(--sun); }
.btn--ink:hover { box-shadow: 8px 8px 0 var(--sun); }
.btn--small { min-height: 44px; padding: 0.45em 1em; font-size: 1rem; box-shadow: var(--shadow-sm); border-radius: 14px; }
.btn--small:hover { box-shadow: 5px 5px 0 var(--ink); }
.btn--small:active { transform: translate(3px, 3px); }
.btn[disabled] { opacity: 1; background: #e9e1d2; color: var(--ink-soft); box-shadow: none; transform: none; cursor: not-allowed; }

.sticker {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  padding: 0.35em 0.9em;
  border: var(--stroke) solid var(--ink);
  border-radius: var(--r-pill);
  background: var(--c, var(--paper));
  color: var(--on, var(--ink));
  font-family: var(--display);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
  rotate: var(--tilt, -2deg);
}
.eyebrow {
  font-family: var(--display);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.85rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.3em 1.05em;
  border: var(--stroke) solid var(--ink);
  border-radius: var(--r-pill);
  background: var(--paper);
  font-family: var(--display);
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s var(--spring), box-shadow 0.15s, background 0.15s, color 0.15s;
}
.chip:hover { transform: translateY(-2px) rotate(-1deg); }
.chip[aria-pressed='true'] { background: var(--ink); color: var(--paper); box-shadow: 3px 3px 0 var(--tomato); }

/* Words that sit on a tilted highlighter sticker. */
.mark {
  display: inline-block;
  padding: 0 0.12em 0.04em;
  border: var(--stroke) solid var(--ink);
  border-radius: 0.18em;
  background: var(--c, var(--sun));
  color: var(--on, var(--ink));
  box-shadow: var(--shadow);
  rotate: var(--tilt, -2deg);
  line-height: 0.95;
}

/* ── Header & nav ─────────────────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 14px 0;
  transition: transform 0.35s var(--snap);
}
.site-header.is-hidden { transform: translateY(-110%); }
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 10px 8px 16px;
  border: var(--stroke) solid var(--ink);
  border-radius: 22px;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.brand { display: inline-flex; align-items: center; text-decoration: none; }
.logo { position: relative; height: 38px; aspect-ratio: 1400 / 400; }
.logo img { position: absolute; inset: 0; width: 100%; height: 100%; }
/* The mark sits at translate(20 0) scale(0.39) of the lockup's 1400×400 viewBox. */
.logo .mark-layer { inset: 0 auto auto 1.43%; width: 28.53%; height: 99.84%; }
.logo .mark-back { animation: swap-back 6s var(--snap) infinite; }
.logo .mark-front { animation: swap-front 6s var(--snap) infinite; }
/* Every 6s the two cards slide apart, swap which one is in front, and settle (app: logoIdle). */
@keyframes swap-back {
  0%, 82% { transform: none; z-index: 1; }
  87% { transform: translateX(-14%) rotate(-6deg) scale(1.04); z-index: 1; }
  87.1% { z-index: 2; }
  92%, 100% { transform: none; z-index: 2; }
}
@keyframes swap-front {
  0%, 82% { transform: none; z-index: 2; }
  87% { transform: translateX(14%) rotate(6deg) scale(1.04); z-index: 2; }
  87.1% { z-index: 1; }
  92%, 100% { transform: none; z-index: 1; }
}
.nav-links { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  font-family: var(--display);
  font-weight: 800;
  text-decoration: none;
  transition: background 0.15s, transform 0.15s var(--spring);
}
.nav-links a:hover { background: var(--cream); transform: rotate(-2deg); }
.nav-links a[aria-current='page'] { background: var(--sun); box-shadow: inset 0 0 0 var(--stroke) var(--ink); }
.nav-cta { margin-left: 8px; }
.menu-btn {
  display: none;
  width: 48px;
  height: 48px;
  border: var(--stroke) solid var(--ink);
  border-radius: 14px;
  background: var(--sun);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.menu-btn .icon { width: 26px; height: 26px; }

@media (max-width: 880px) {
  .menu-btn { display: inline-flex; }
  .nav-links {
    position: fixed;
    inset: 0;
    z-index: 60;
    flex-direction: column;
    justify-content: center;
    gap: 14px;
    background: var(--tomato);
    padding: 80px var(--gutter);
    visibility: hidden;
    clip-path: circle(0% at calc(100% - 50px) 44px);
    transition: clip-path 0.55s var(--snap), visibility 0s linear 0.55s;
  }
  .nav-links.is-open { visibility: visible; clip-path: circle(150% at calc(100% - 50px) 44px); transition: clip-path 0.55s var(--snap); }
  .nav-links li { opacity: 0; transform: translateY(30px) rotate(-4deg); transition: 0.4s var(--spring); }
  .nav-links.is-open li { opacity: 1; transform: none; transition-delay: calc(0.12s + var(--i, 0) * 0.06s); }
  .nav-links a {
    font-size: 2.4rem;
    padding: 6px 22px;
    background: var(--paper);
    border: var(--stroke) solid var(--ink);
    border-radius: 18px;
    box-shadow: var(--shadow);
  }
  .nav-links li:nth-child(odd) a { rotate: -2deg; }
  .nav-links li:nth-child(even) a { rotate: 2deg; }
  .nav-cta { margin: 0; }
  .menu-close { position: absolute; top: 22px; right: calc(var(--gutter) + 6px); }
  body.menu-open { overflow: hidden; }
}
@media (min-width: 881px) { .menu-close { display: none; } }

/* ── Flip card (the app's card, on the web) ───────────────────────────── */

.fcard {
  --w: 300px;
  --h: 400px;
  position: relative;
  width: var(--w);
  height: var(--h);
  perspective: 1400px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  border: 0;
  padding: 0;
  background: none;
  text-align: center;
}
.fcard-inner {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transition: transform 0.75s var(--spring);
}
.fcard.is-flipped .fcard-inner { transform: rotateY(180deg); }
.fcard-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  border: var(--stroke) solid var(--ink);
  border-radius: var(--r-card);
  background: var(--paper);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.fcard-back {
  transform: rotateY(180deg);
  /* Rotated 180°, so the hard shadow's x offset is mirrored to land bottom-right on screen. */
  box-shadow: -10px 10px 0 var(--ink);
  background: var(--c);
  color: var(--on);
  justify-content: center;
  align-items: center;
  padding: 26px 22px;
  gap: 14px;
  isolation: isolate;
}
.fcard-back::before {
  content: '';
  position: absolute;
  inset: -50%;
  z-index: -1;
  background: repeating-conic-gradient(rgba(255, 255, 255, 0.16) 0deg 7.5deg, transparent 7.5deg 15deg);
}
.fcard-band {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--c);
  color: var(--on);
  border-bottom: var(--stroke) solid var(--ink);
  font-family: var(--display);
  font-weight: 800;
  font-size: 1rem;
  text-align: left;
}
.fcard-band .num { margin-left: auto; font-size: 0.85rem; }
.fcard-q {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 22px;
  margin: 0;
  font-family: var(--body);
  font-weight: 900;
  font-size: clamp(1.15rem, calc(var(--w) / 14), 1.6rem);
  line-height: 1.25;
}
.fcard-hint {
  padding-bottom: 18px;
  font-family: var(--display);
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.fcard-label { font-family: var(--display); font-weight: 800; letter-spacing: 0.2em; font-size: 0.8rem; text-transform: uppercase; }
.fcard-answer {
  max-width: 100%;
  padding: 10px 18px;
  border: var(--stroke) solid var(--ink);
  border-radius: 16px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  rotate: -2deg;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.4rem, calc(var(--w) / 11), 2.1rem);
  line-height: 1.05;
}
.fcard-fact { margin: 4px 0 0; font-size: 0.98rem; line-height: 1.4; font-weight: 700; }
.fcard:hover .fcard-inner { transform: rotateY(-6deg) rotateX(3deg); }
.fcard.is-flipped:hover .fcard-inner { transform: rotateY(186deg) rotateX(3deg); }

/* ── Reveal on scroll ─────────────────────────────────────────────────── */

.reveal { opacity: 0; transform: translateY(40px) rotate(var(--r, -2deg)) scale(0.97); transition: opacity 0.7s ease, transform 0.9s var(--spring); transition-delay: calc(var(--i, 0) * 80ms); }
.reveal.is-in { opacity: 1; transform: none; }

/* ── Sections ─────────────────────────────────────────────────────────── */

section { position: relative; }
.section { padding: clamp(72px, 11vw, 140px) 0; }
.section-head { max-width: 760px; margin-bottom: clamp(36px, 5vw, 64px); }
.section-head p { font-size: 1.2rem; color: var(--ink-soft); margin-top: 18px; }
.section-head .eyebrow { display: inline-block; margin-bottom: 14px; }
.center { text-align: center; margin-inline: auto; }

/* Hero */
.hero { position: relative; overflow: hidden; padding: clamp(24px, 5vw, 60px) 0 clamp(80px, 10vw, 130px); }
.hero .sunburst { left: 78%; top: 52%; width: 200vmax; }
.hero-grid { position: relative; display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(24px, 4vw, 60px); align-items: center; }
.hero h1 { margin: 22px 0 26px; }
.hero h1 .line { display: block; }
.hero-lede { font-size: clamp(1.15rem, 1.6vw, 1.35rem); max-width: 34ch; margin-bottom: 30px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 16px; }
.hero-note { margin-top: 22px; font-size: 0.98rem; color: var(--ink-soft); }

.deck-stage { position: relative; height: clamp(440px, 46vw, 560px); display: grid; place-items: center; }
.deck-stage .fcard { position: absolute; --w: clamp(240px, 22vw, 300px); --h: calc(var(--w) * 1.36); transition: transform 0.7s var(--spring), opacity 0.4s; }
.deck-stage .fcard[data-slot='0'] { transform: translate(-46%, 6%) rotate(-12deg); z-index: 1; }
.deck-stage .fcard[data-slot='1'] { transform: translate(46%, 2%) rotate(10deg); z-index: 2; }
.deck-stage .fcard[data-slot='2'] { transform: translate(0, -4%) rotate(-2deg); z-index: 3; }
.deck-stage .fcard.is-dealing { opacity: 0; transform: translate(0, -60%) rotate(25deg) scale(0.8); }
.deck-stage .fcard.is-leaving { opacity: 0; transform: translate(140%, 30%) rotate(40deg); }
.deck-controls { position: absolute; bottom: -8px; left: 50%; translate: -50% 0; z-index: 5; display: flex; gap: 12px; }

.float-badge { position: absolute; z-index: 6; animation: bob 4.5s ease-in-out infinite; animation-delay: var(--d, 0s); }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }

.tilt { transform-style: preserve-3d; transition: transform 0.3s ease-out; }

/* Marquee tape */
.tape {
  position: relative;
  z-index: 3;
  border-block: var(--stroke) solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  overflow: hidden;
  rotate: -2deg;
  margin: -24px -2vw;
  box-shadow: 0 8px 0 var(--tomato);
}
.tape--sun { background: var(--sun); color: var(--ink); rotate: 1.5deg; box-shadow: 0 8px 0 var(--ink); margin-top: 22px; }
.tape-track { display: flex; width: max-content; animation: marquee 40s linear infinite; }
.tape--sun .tape-track { animation-direction: reverse; animation-duration: 50s; }
.tape-item { display: flex; align-items: center; gap: 28px; padding: 16px 14px; font-family: var(--display); font-weight: 800; font-size: clamp(1.3rem, 2.4vw, 2rem); white-space: nowrap; }
.tape-item .icon { width: 1.1em; height: 1.1em; color: var(--sun); }
.tape--sun .tape-item .icon { color: var(--tomato); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* How it works */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 3vw, 40px); }
.step {
  position: relative;
  padding: 34px 28px 30px;
  border: var(--stroke) solid var(--ink);
  border-radius: var(--r-card);
  background: var(--c);
  color: var(--on);
  box-shadow: var(--shadow-lg);
  transition: transform 0.35s var(--spring), box-shadow 0.35s var(--spring);
}
.step:nth-child(1) { --r: -3deg; rotate: -3deg; }
.step:nth-child(2) { --r: 2deg; rotate: 2deg; translate: 0 26px; }
.step:nth-child(3) { --r: -1.5deg; rotate: -1.5deg; }
.step:hover { transform: rotate(calc(var(--r) * -1)) scale(1.03); box-shadow: 14px 14px 0 var(--ink); }
.step-num {
  position: absolute;
  top: -26px;
  right: 22px;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border: var(--stroke) solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--display);
  font-size: 1.9rem;
  box-shadow: var(--shadow-sm);
}
.step .icon { width: 56px; height: 56px; margin-bottom: 18px; }
.step h3 { margin-bottom: 10px; }
.step p { margin: 0; font-size: 1.05rem; }

/* Pack shelf */
.shelf-filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 36px; }
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 22px; }
.tile { position: relative; aspect-ratio: 0.82; perspective: 1200px; cursor: pointer; border: 0; padding: 0; background: none; text-align: left; }
.tile-inner { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform 0.7s var(--spring); }
.tile.is-flipped .tile-inner { transform: rotateY(180deg); }
@media (hover: hover) { .tile:hover .tile-inner { transform: rotateY(180deg); } }
.tile-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 16px;
  border: var(--stroke) solid var(--ink);
  border-radius: var(--r-tile);
  background: var(--c);
  color: var(--on);
  box-shadow: var(--shadow);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  isolation: isolate;
}
.tile-face::before {
  content: '';
  position: absolute;
  inset: -40%;
  z-index: -1;
  background: repeating-conic-gradient(from 10deg at 60% 25%, rgba(255, 255, 255, 0.17) 0deg 7.5deg, transparent 7.5deg 15deg);
}
.tile-back { transform: rotateY(180deg); box-shadow: -6px 6px 0 var(--ink); background: var(--paper); color: var(--ink); justify-content: space-between; }
.tile-back::before { display: none; }
.tile-top { display: flex; justify-content: space-between; align-items: flex-start; }
.tile-top .icon { width: 46px; height: 46px; }
.tile-badge { padding: 2px 10px; border: 2.5px solid var(--ink); border-radius: var(--r-pill); background: var(--paper); color: var(--ink); font-family: var(--display); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; }
.tile-title { margin-top: auto; font-family: var(--display); font-weight: 800; font-size: 1.35rem; line-height: 1.05; }
.tile-sub { margin-top: 4px; font-size: 0.85rem; line-height: 1.3; font-weight: 700; opacity: 0.9; }
.tile-desc { font-size: 0.92rem; line-height: 1.4; }
.tile-back .tile-aud { font-family: var(--display); font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); }
.tile--more .tile-face { background: var(--ink); color: var(--paper); justify-content: center; align-items: flex-start; }
.tile--more .tile-title { margin: 0; font-size: 2.6rem; color: var(--sun); }
.tile.is-hidden { display: none; }

/* Dark band with the road */
.band-ink { background: var(--midnight); color: var(--paper); overflow: hidden; }
.band-ink .sunburst { --ray: rgba(255, 255, 255, 0.04); left: 50%; top: 30%; }
.band-ink .section-head p { color: var(--night-soft); }
.road { position: relative; height: 150px; margin: 40px 0 60px; }
.road-strip {
  position: absolute;
  inset: 45px -10vw;
  background: var(--ink);
  border-block: var(--stroke) solid var(--sun);
  background-image: linear-gradient(90deg, var(--sun) 0 50%, transparent 50%);
  background-size: 80px 6px;
  background-repeat: repeat-x;
  background-position: 0 50%;
  animation: road 1.6s linear infinite;
}
@keyframes road { to { background-position: -80px 50%; } }
.car {
  position: absolute;
  top: 18px;
  left: 0;
  width: 112px;
  height: 92px;
  display: grid;
  place-items: center;
  border: var(--stroke) solid var(--ink);
  border-radius: 24px;
  background: var(--tomato);
  box-shadow: 6px 6px 0 #0e0b16;
  translate: var(--x, 0) 0;
  rotate: var(--car-tilt, -3deg);
}
.car .icon { width: 64px; height: 64px; color: var(--ink); }
.signs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.sign {
  padding: 24px 22px;
  border: var(--stroke) solid #0e0b16;
  border-radius: 22px;
  background: var(--c);
  color: var(--on);
  box-shadow: 8px 8px 0 #0e0b16;
}
.sign:nth-child(odd) { rotate: -2deg; }
.sign:nth-child(even) { rotate: 2deg; }
.sign .icon { width: 40px; height: 40px; margin-bottom: 12px; }
.sign h3 { font-size: 1.35rem; margin-bottom: 6px; }
.sign p { margin: 0; font-size: 0.98rem; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.stat { padding: 28px 22px; text-align: center; border: var(--stroke) solid var(--ink); border-radius: var(--r-card); background: var(--paper); box-shadow: var(--shadow); }
.stat:nth-child(odd) { rotate: 1.5deg; }
.stat:nth-child(even) { rotate: -1.5deg; }
.stat-num { display: block; font-family: var(--display); font-weight: 800; font-size: clamp(3rem, 6vw, 5rem); line-height: 1; color: var(--c, var(--tomato)); -webkit-text-stroke: 2.5px var(--ink); paint-order: stroke fill; text-shadow: 4px 4px 0 var(--ink); }
.stat-label { display: block; margin-top: 10px; font-family: var(--display); font-weight: 800; font-size: 1.05rem; }

/* Fact-check stamp section */
.proof { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(30px, 5vw, 70px); align-items: center; }
.proof-list { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 14px; }
.proof-list li { display: flex; gap: 14px; align-items: flex-start; font-size: 1.08rem; }
.proof-list .icon { width: 34px; height: 34px; padding: 6px; border: 2.5px solid var(--ink); border-radius: 50%; background: var(--c); flex: none; margin-top: 2px; }
.stamp-stage { position: relative; display: grid; place-items: center; min-height: 420px; }
.stamp-stage .fcard { --w: clamp(250px, 26vw, 320px); --h: calc(var(--w) * 1.3); rotate: 4deg; }
.stamp {
  position: absolute;
  z-index: 4;
  top: 14%;
  right: 4%;
  padding: 10px 20px;
  border: 5px solid var(--tomato);
  border-radius: 14px;
  color: var(--tomato);
  background: rgba(255, 251, 243, 0.85);
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  rotate: -14deg;
  opacity: 0;
  transform: scale(2.2);
}
.stamp.is-in { animation: stamp 0.55s var(--spring) forwards; }
@keyframes stamp { to { opacity: 1; transform: scale(1); } }

/* CTA band */
.cta {
  position: relative;
  overflow: hidden;
  padding: clamp(50px, 7vw, 90px) clamp(24px, 5vw, 70px);
  border: var(--stroke) solid var(--ink);
  border-radius: 40px;
  background: var(--tomato);
  box-shadow: 14px 14px 0 var(--ink);
  text-align: center;
}
.cta .sunburst { --ray: rgba(255, 255, 255, 0.14); width: 300%; top: 120%; }
.cta h2 { position: relative; max-width: 14ch; margin-inline: auto; }
.cta p { position: relative; font-size: 1.25rem; max-width: 46ch; margin: 18px auto 30px; }
.cta .hero-actions { position: relative; justify-content: center; }
.store-row { position: relative; display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 26px; }
.store-pill { display: inline-flex; align-items: center; gap: 10px; padding: 10px 18px; border: var(--stroke) solid var(--ink); border-radius: 16px; background: var(--ink); color: var(--paper); font-family: var(--display); font-weight: 800; }
.store-pill small { display: block; font-family: var(--body); font-weight: 700; font-size: 0.72rem; opacity: 0.75; letter-spacing: 0.08em; text-transform: uppercase; }

/* Page hero (inner pages) */
.page-hero { position: relative; overflow: hidden; padding: clamp(40px, 7vw, 100px) 0 clamp(50px, 7vw, 90px); }
.page-hero .sunburst { left: 85%; top: 40%; }
.page-hero h1 { font-size: clamp(2.8rem, 7.5vw, 6rem); max-width: 14ch; margin-top: 18px; }
.page-hero .lede { font-size: clamp(1.15rem, 1.7vw, 1.4rem); max-width: 46ch; margin-top: 24px; }
/* Play: keep the hero short so the deck shows above the fold on a laptop. */
.play-hero { padding: clamp(28px, 4vw, 56px) 0 clamp(28px, 3.5vw, 44px); }
.play-hero h1 { font-size: clamp(2.4rem, 5.2vw, 4.4rem); max-width: none; }
.play-hero .lede { margin-top: 16px; }

/* About: story deck */
.story { position: relative; display: grid; gap: clamp(40px, 6vw, 80px); }
.story::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; border-left: 4px dashed var(--ink); opacity: 0.25; }
.chapter { position: relative; width: min(560px, 100%); padding: 34px 32px; border: var(--stroke) solid var(--ink); border-radius: var(--r-card); background: var(--paper); box-shadow: var(--shadow-lg); }
.chapter:nth-child(odd) { justify-self: start; --r: -2deg; rotate: -2deg; }
.chapter:nth-child(even) { justify-self: end; --r: 2deg; rotate: 2deg; }
.chapter .sticker { position: absolute; top: -20px; left: 26px; --tilt: -4deg; }
.chapter h3 { margin: 8px 0 12px; font-size: clamp(1.6rem, 3vw, 2.3rem); }
.chapter p:last-child { margin-bottom: 0; }
.chapter .icon-big { position: absolute; right: -18px; bottom: -18px; width: 76px; height: 76px; padding: 14px; border: var(--stroke) solid var(--ink); border-radius: 50%; background: var(--c); color: var(--on); box-shadow: var(--shadow-sm); }

.values { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 22px; }
.value { padding: 26px; border: var(--stroke) solid var(--ink); border-radius: 24px; background: var(--c); color: var(--on); box-shadow: var(--shadow); transition: transform 0.3s var(--spring); }
.value:hover { transform: rotate(-2deg) translateY(-4px); }
.value .icon { width: 40px; height: 40px; margin-bottom: 12px; }
.value h3 { font-size: 1.4rem; margin-bottom: 8px; }
.value p { margin: 0; font-size: 1rem; }

.mystery { display: flex; flex-wrap: wrap; gap: 28px; justify-content: center; }
.mystery .fcard { --w: 230px; --h: 310px; }
.mystery .fcard:nth-child(1) { rotate: -5deg; }
.mystery .fcard:nth-child(2) { rotate: 3deg; }
.mystery .fcard:nth-child(3) { rotate: -2deg; }
.fcard--blank .fcard-front { background: var(--ink); color: var(--paper); align-items: center; justify-content: center; }
.fcard--blank .fcard-front .big-q { font-family: var(--display); font-size: 7rem; line-height: 1; color: var(--sun); -webkit-text-stroke: 3px var(--paper); }

/* Prose (legal) */
.legal { display: grid; grid-template-columns: 260px 1fr; gap: clamp(30px, 5vw, 70px); align-items: start; padding-bottom: 120px; }
.toc { position: sticky; top: 110px; padding: 22px; border: var(--stroke) solid var(--ink); border-radius: 22px; background: var(--paper); box-shadow: var(--shadow); }
.toc h2 { font-size: 1.3rem; margin-bottom: 12px; }
.toc ol { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; font-size: 0.98rem; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; text-decoration-thickness: 3px; text-decoration-color: var(--sun); }
.prose { max-width: 72ch; }
.prose h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); margin: 2.2em 0 0.6em; scroll-margin-top: 110px; }
.prose h2:first-child { margin-top: 0; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: 0.5em; }
.prose a { text-decoration-thickness: 2px; text-underline-offset: 3px; }
.tldr { position: relative; margin-bottom: 40px; padding: 26px 28px; border: var(--stroke) solid var(--ink); border-radius: 24px; background: var(--sun); box-shadow: var(--shadow); rotate: -1deg; }
.tldr h2 { margin: 0 0 10px !important; font-size: 1.6rem; }
.tldr p { margin: 0; font-size: 1.12rem; }
.meta { color: var(--ink-soft); font-size: 0.98rem; }

/* Support */
.contact-card { display: grid; grid-template-columns: auto 1fr; gap: 26px; align-items: center; padding: clamp(26px, 4vw, 44px); border: var(--stroke) solid var(--ink); border-radius: 32px; background: var(--teal); box-shadow: var(--shadow-lg); rotate: -1deg; }
.contact-card .icon-big { width: 96px; height: 96px; padding: 20px; border: var(--stroke) solid var(--ink); border-radius: 26px; background: var(--paper); box-shadow: var(--shadow-sm); rotate: -6deg; }
.contact-card h2 { font-size: clamp(1.8rem, 4vw, 3rem); }
.email-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 16px; }
.email-link { font-family: var(--display); font-weight: 800; font-size: clamp(1.15rem, 2.4vw, 1.7rem); text-decoration: none; padding: 6px 14px; border: var(--stroke) solid var(--ink); border-radius: 14px; background: var(--paper); box-shadow: var(--shadow-sm); overflow-wrap: anywhere; }
.faq { display: grid; gap: 16px; }
.faq details { border: var(--stroke) solid var(--ink); border-radius: 22px; background: var(--paper); box-shadow: var(--shadow); transition: box-shadow 0.2s, transform 0.2s var(--spring); }
.faq details[open] { box-shadow: 8px 8px 0 var(--c, var(--tomato)), 8px 8px 0 3px var(--ink); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 24px; cursor: pointer; list-style: none; font-family: var(--display); font-weight: 800; font-size: 1.25rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .icon { width: 30px; height: 30px; padding: 4px; border: 2.5px solid var(--ink); border-radius: 50%; background: var(--sun); transition: rotate 0.35s var(--spring); }
.faq details[open] summary .icon { rotate: 45deg; background: var(--tomato); }
.faq .answer { padding: 0 24px 22px; }
.faq .answer p:last-child { margin: 0; }

/* Footer */
.site-footer { position: relative; overflow: hidden; margin-top: 40px; padding: 80px 0 40px; background: var(--ink); color: var(--paper); border-top: var(--stroke) solid var(--ink); }
.site-footer .sunburst { --ray: rgba(255, 255, 255, 0.035); top: 100%; }
.footer-grid { position: relative; display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.footer-logo { width: 220px; }
.footer-tag { margin: 18px 0 0; max-width: 32ch; color: var(--night-soft); }
.site-footer h2 { font-size: 1.1rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--sun); margin-bottom: 14px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-footer ul a { text-decoration: none; font-weight: 800; }
.site-footer ul a:hover { color: var(--sun); }
.footer-base { position: relative; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; margin-top: 60px; padding-top: 24px; border-top: 2px dashed rgba(255, 251, 243, 0.25); font-size: 0.9rem; color: var(--night-soft); }
.footer-base p { margin: 0; max-width: 70ch; }

/* Confetti canvas */
.confetti { position: fixed; inset: 0; z-index: 90; pointer-events: none; }

/* Toast */
.toast { position: fixed; z-index: 95; left: 50%; bottom: 28px; translate: -50% 0; padding: 12px 20px; border: var(--stroke) solid var(--ink); border-radius: 16px; background: var(--ink); color: var(--paper); font-family: var(--display); font-weight: 800; box-shadow: 6px 6px 0 var(--sun); transform: translateY(calc(100% + 60px)); visibility: hidden; transition: transform 0.45s var(--spring), visibility 0s linear 0.45s; }
.toast.is-on { transform: none; visibility: visible; transition: transform 0.45s var(--spring); }

/* 404 */
.lost { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 40px 0 100px; }
.lost .fcard { --w: 280px; --h: 370px; margin: 30px auto; rotate: -4deg; }
.lost .fcard-answer { font-size: 3.4rem; }

/* ── Play: the web demo ───────────────────────────────────────────────── */

.game {
  position: relative;
  max-width: 760px;
  margin-inline: auto;
  padding: clamp(18px, 3vw, 34px);
  border: var(--stroke) solid var(--ink);
  border-radius: 36px;
  background: var(--paper);
  box-shadow: 14px 14px 0 var(--ink);
}
.game-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.game-packs { display: flex; flex-wrap: wrap; gap: 10px; }
.pack-chip[aria-pressed='true'] { background: var(--c); color: var(--on); box-shadow: 3px 3px 0 var(--ink); rotate: -2deg; }
.game-top { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.pill { flex: none; padding: 4px 16px; border: var(--stroke) solid var(--ink); border-radius: var(--r-pill); background: var(--cream); font-family: var(--display); font-weight: 800; box-shadow: var(--shadow-sm); }
.progress { flex: 1; height: 16px; border: var(--stroke) solid var(--ink); border-radius: var(--r-pill); background: var(--cream); overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--tomato); border-right: var(--stroke) solid var(--ink); transition: width 0.5s var(--spring); }
.game-deck { position: relative; height: clamp(430px, 62vh, 520px); display: grid; place-items: center; touch-action: pan-y; }
.game-deck .fcard { position: absolute; --w: min(100%, 400px); --h: min(100%, 500px); width: min(100%, 400px); height: min(100% - 30px, 500px); transition: transform 0.45s var(--spring), opacity 0.35s; }
.game-deck .fcard[data-slot='1'] { transform: translateY(10px) scale(0.96) rotate(-2deg); }
.game-deck .fcard[data-slot='2'] { transform: translateY(20px) scale(0.92) rotate(2deg); }
.game-deck .fcard.is-dealing { transform: translateY(-50px) scale(0.94); opacity: 0; }
.game-deck .fcard[data-slot='0'] { cursor: grab; }
.game-deck .fcard[data-slot='0']:active { cursor: grabbing; }
.game-deck .fcard-q { font-size: clamp(1.3rem, 3.6vw, 1.85rem); }
.game-deck .fcard-answer { font-size: clamp(1.6rem, 4.6vw, 2.5rem); }
.game-deck .fcard-fact { font-size: 1.05rem; }
.game-controls { display: grid; grid-template-columns: 1fr 1.6fr; gap: 14px; margin-top: 22px; }
.game-help { margin: 18px 0 0; text-align: center; color: var(--ink-soft); font-size: 0.92rem; }
kbd { display: inline-block; min-width: 1.8em; padding: 0 6px; border: 2px solid var(--ink); border-radius: 6px; background: var(--cream); font-family: var(--display); font-size: 0.85em; box-shadow: 2px 2px 0 var(--ink); }

.score-bar { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 22px; }
.score-chip {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  padding: 0 18px;
  border: var(--stroke) solid var(--ink);
  border-radius: 16px;
  background: var(--c);
  color: var(--on);
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.1rem;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.12s;
}
.score-chip:active { transform: translate(3px, 3px); box-shadow: none; }
.score-chip .pts { font-size: 1.4rem; }
.score-chip--nobody { background: var(--paper); justify-content: center; }
.plus-one { position: absolute; right: 18px; top: -6px; font-family: var(--display); font-size: 1.6rem; color: var(--ink); animation: plus 0.7s ease-out forwards; pointer-events: none; }
@keyframes plus { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-34px); } }

.score-setup { margin-bottom: 20px; padding: 20px; border: var(--stroke) dashed var(--ink); border-radius: 22px; background: var(--cream); }
.players { display: grid; gap: 10px; margin: 10px 0 14px; }
.player { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; }
.player .dot { width: 30px; height: 30px; border: var(--stroke) solid var(--ink); border-radius: 50%; background: var(--c); }
.player input { min-height: 48px; padding: 0 14px; border: var(--stroke) solid var(--ink); border-radius: 14px; background: var(--paper); font: inherit; font-weight: 800; box-shadow: var(--shadow-sm); }
.icon-btn { width: 48px; height: 48px; display: grid; place-items: center; border: var(--stroke) solid var(--ink); border-radius: 14px; background: var(--paper); cursor: pointer; }
.icon-btn[disabled] { opacity: 0.35; cursor: not-allowed; }
.score-setup-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.cleared { padding: 30px 10px 10px; text-align: center; }
.cleared-stamp {
  display: inline-block;
  padding: 10px 28px;
  border: 6px solid var(--tomato);
  border-radius: 18px;
  color: var(--tomato);
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.6rem, 8vw, 4.6rem);
  rotate: -8deg;
  animation: stamp-in 0.6s var(--spring) both;
}
@keyframes stamp-in { from { opacity: 0; transform: scale(2); } to { opacity: 1; transform: scale(1); } }
.cleared-line { margin: 26px 0 18px; font-size: 1.2rem; }
.winner { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 2rem; margin: 0 0 14px; }
.winner .icon { width: 40px; height: 40px; color: var(--sun); filter: drop-shadow(2px 2px 0 var(--ink)); }
.standings { list-style: none; max-width: 320px; margin: 0 auto 26px; padding: 0; display: grid; gap: 8px; }
.standings li { display: flex; justify-content: space-between; padding: 8px 16px; border: var(--stroke) solid var(--ink); border-radius: 14px; background: var(--c); color: var(--on); font-family: var(--display); font-weight: 800; }

/* ── Responsive ───────────────────────────────────────────────────────── */

@media (max-width: 980px) {
  .hero-grid, .proof { grid-template-columns: 1fr; }
  .deck-stage { margin-top: 10px; }
  .signs, .stats { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
  .legal { grid-template-columns: 1fr; }
  .toc { position: static; }
}
@media (max-width: 720px) {
  body { font-size: 17px; }
  .steps { grid-template-columns: 1fr; gap: 44px; }
  .step:nth-child(2) { translate: 0; }
  .story::before { left: 24px; }
  .chapter:nth-child(n) { justify-self: stretch; }
  .contact-card { grid-template-columns: 1fr; }
  .deck-stage .fcard[data-slot='0'] { transform: translate(-28%, 8%) rotate(-10deg); }
  .deck-stage .fcard[data-slot='1'] { transform: translate(28%, 3%) rotate(9deg); }
  .float-badge { display: none; }
  .tape { margin-inline: -6vw; }
}
@media (max-width: 520px) {
  .signs, .stats { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .shelf { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .tile-title { font-size: 1.1rem; }
  .tile-top .icon { width: 34px; height: 34px; }
  .tile-face { padding: 12px; }
  .tile-desc { font-size: 0.8rem; }
  .hero-actions .btn { width: 100%; }
  .game-packs { flex: 1 1 100%; gap: 8px; }
  .game-head .chip { min-height: 40px; padding: 0.25em 0.8em; font-size: 0.9rem; }
}

/* ── Reduced motion ───────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  .sunburst, .tape-track, .road-strip, .float-badge, .logo .mark-layer { animation: none !important; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .fcard-inner, .tile-inner { transition: none; }
  .fcard-face, .tile-face { transition: opacity 0.2s; }
  /* Crossfade instead of rotating (app: Reduce Motion). */
  .fcard.is-flipped .fcard-inner, .tile.is-flipped .tile-inner { transform: none; }
  .fcard .fcard-back, .tile .tile-back { transform: none; opacity: 0; box-shadow: 10px 10px 0 var(--ink); }
  .fcard.is-flipped .fcard-back, .tile.is-flipped .tile-back { opacity: 1; }
  .fcard.is-flipped .fcard-front, .tile.is-flipped .tile-front { opacity: 0; }
  .fcard:hover .fcard-inner, .fcard.is-flipped:hover .fcard-inner { transform: none; }
  @media (hover: hover) { .tile:hover .tile-inner { transform: none; } }
  .stamp { opacity: 1; transform: none; }
}
