/* ============================================================
   HOT POTATO GAMES — brand guidelines document styles
   Reads tokens.css for every brand value. No hex here.
   ============================================================ */

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 1.6;
  color: var(--ink);
  background: var(--surface);
  transition: background var(--dur-normal) var(--ease-out), color var(--dur-normal) var(--ease-out);
}

img { max-width: 100%; display: block; }

h1, h2, h3, h4 { line-height: 1.15; text-wrap: balance; margin: 0; }
p { max-width: 65ch; }

a { color: var(--orange-700); }
a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--brand-orange);
  outline-offset: 2px;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: var(--surface);
  padding: var(--sp-2) var(--sp-4);
  z-index: 99;
}
.skip:focus { left: 0; }

/* ---- Shell: sidebar + document ---- */
.shell { display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr); }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: var(--sp-5) var(--sp-4);
  background: linear-gradient(180deg, #E16416 0%, #E19816 60%, #E1C916 100%);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}
.sidebar-mark { display: flex; align-items: center; gap: var(--sp-2); }
.sidebar-mark img { width: 44px; height: 44px; border-radius: 50%; }
.sidebar-mark span {
  font-family: var(--font-display);
  font-size: 0.82rem;
  line-height: 1.2;
  color: var(--ink);
}
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex;
  gap: var(--sp-2);
  align-items: baseline;
  padding: 0.4rem 0.55rem;
  border-radius: var(--r-sm);
  color: var(--ink);
  opacity: 0.82;
  text-decoration: none;
  font-size: var(--text-body-sm);
}
.nav a .n { font-family: var(--font-mono); font-size: var(--text-label); color: var(--orange-900); }
.nav a:hover { opacity: 1; background: rgba(15, 12, 7, 0.12); }
.nav a.active { opacity: 1; background: var(--burrow-brown); color: var(--brand-gold); font-weight: 700; }

.sidebar-actions { margin-top: auto; display: flex; flex-direction: column; gap: var(--sp-2); }
.btn {
  font: inherit;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  border: var(--border);
  border-radius: var(--r-md);
  padding: 0.55rem 1rem;
  background: var(--brand-sienna);
  color: var(--ink);
  box-shadow: var(--sh-card);
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.btn:hover { background: var(--brand-gold); transform: translate(-1px, -1px); box-shadow: var(--sh-pop); }
.btn:active { transform: translate(2px, 2px); box-shadow: none; }
.btn--quiet { background: transparent; color: inherit; box-shadow: none; border-color: currentColor; }

.burger {
  display: none;
  position: fixed;
  top: var(--sp-3);
  right: var(--sp-3);
  z-index: 60;
}

/* ---- Sections ---- */
.sec { padding: var(--section-pad) clamp(1.25rem, 5vw, 5rem); }
.sec--warm { background: var(--surface-warm); }
.sec--dark { background: var(--burrow-brown); color: var(--surface); }
.sec--dark p { color: var(--surface); }
.sec-inner { max-width: var(--max-w); margin: 0 auto; }
.sec-inner--wide { max-width: var(--max-w-wide); }

.sec-head { margin-bottom: var(--sp-6); max-width: var(--max-w-narrow); }
.sec-head .kicker {
  font-family: var(--font-mono);
  font-size: var(--text-label);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--orange-700);
  margin: 0 0 var(--sp-2);
}
.sec--dark .sec-head .kicker { color: var(--brand-gold); }
.sec-head h2 { font-family: var(--font-display); font-size: var(--text-h1); font-weight: 400; }
.sec-head .sub { color: var(--muted); font-size: var(--text-body-lg); margin: var(--sp-3) 0 0; }
.sec--dark .sec-head .sub { color: var(--surface); opacity: 0.8; }

.status {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-label);
  letter-spacing: 0.1em;
  padding: 0.2rem 0.6rem;
  border: 2px solid var(--orange-700);
  border-radius: var(--r-pill);
  color: var(--orange-700);
  margin-bottom: var(--sp-3);
}
.sec--dark .status { border-color: var(--brand-gold); color: var(--brand-gold); }

/* ---- Cover ---- */
.cover { min-height: 100vh; display: flex; align-items: center; }
.cover-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: var(--sp-7);
  align-items: center;
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
}
.cover-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-hero);
  line-height: 0.95;
  margin: 0;
}
.cover-title .accent { color: var(--brand-orange); }
.cover-tag { font-size: var(--text-body-lg); font-weight: 700; margin: var(--sp-4) 0 0; }
.cover-meta { font-family: var(--font-mono); font-size: var(--text-caption); color: var(--muted); margin-top: var(--sp-2); }
.cover-logo { width: min(280px, 60%); margin: 0 auto; }
.cover-logo img { width: 100%; height: auto; filter: drop-shadow(6px 6px 0 rgba(0, 0, 0, 0.18)); }

.toc { margin-top: var(--sp-6); columns: 2; column-gap: var(--sp-6); max-width: 40rem; }
.toc a {
  display: flex;
  gap: var(--sp-2);
  align-items: baseline;
  padding: 0.3rem 0;
  text-decoration: none;
  color: inherit;
  break-inside: avoid;
}
.toc a:hover { color: var(--orange-700); }
.toc .n { font-family: var(--font-mono); font-size: var(--text-label); color: var(--orange-700); }

/* ---- Prose & structure primitives ---- */
.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-6); align-items: start; }
.lede { font-size: var(--text-body-lg); }

.deflist { margin: 0; }
.deflist > div { padding: var(--sp-3) 0; border-bottom: 2px solid var(--surface-warm); }
.sec--warm .deflist > div { border-bottom-color: var(--paper); }
.deflist dt { font-weight: 800; font-size: var(--text-h4); }
.deflist dd { margin: 0.25rem 0 0; color: var(--muted); }

.numbered { list-style: none; margin: 0; padding: 0; counter-reset: rule; }
.numbered li {
  counter-increment: rule;
  display: grid;
  grid-template-columns: 2.4rem minmax(0, 1fr);
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-bottom: 2px solid var(--surface-warm);
}
.numbered li::before {
  content: counter(rule, decimal-leading-zero);
  font-family: var(--font-mono);
  color: var(--orange-700);
  font-size: var(--text-body-sm);
  padding-top: 0.2rem;
}
.numbered strong { display: block; }

/* ---- Spec tables ---- */
.spec { width: 100%; border-collapse: collapse; font-size: var(--text-body-sm); }
.spec th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: var(--text-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 var(--sp-3) var(--sp-2) 0;
  border-bottom: var(--border);
}
.spec td { padding: var(--sp-2) var(--sp-3) var(--sp-2) 0; border-bottom: 2px solid var(--surface-warm); vertical-align: top; }
.sec--dark .spec td { border-bottom-color: var(--field-olive); }
/* Label + value columns never wrap to one-word-per-line inside a half-width duo;
   only the trailing description column reflows. */
.spec th:first-child, .spec td:first-child { white-space: nowrap; }
.spec .mono { font-family: var(--font-mono); font-size: var(--text-caption); white-space: nowrap; }
.pass, .fail { font-family: var(--font-mono); font-size: var(--text-label); letter-spacing: 0.06em; }
.pass { color: var(--orange-700); }
.fail { color: var(--orange-900); text-decoration: underline; }
.sec--dark .pass { color: var(--brand-gold); }

/* ---- Cards (chunky, hard-shadow — the HPG surface language) ---- */
.card {
  background: var(--paper);
  border: var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-card);
  padding: var(--sp-4);
}

/* ---- Do / Don't ---- */
.dosdonts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-5); }
.dd-col h3 { font-family: var(--font-mono); font-size: var(--text-body-sm); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: var(--sp-3); }
.dd-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.dd-col li { padding-left: 1.6rem; position: relative; }
.dd-col li::before { position: absolute; left: 0; font-weight: 800; }
.dd-do li::before { content: '✓'; color: var(--orange-700); }
.dd-dont li::before { content: '✕'; color: var(--orange-900); }
.sec--dark .dd-do li::before { color: var(--brand-gold); }
.sec--dark .dd-dont li::before { color: var(--orange-300); }

/* ---- Logo section ---- */
.logo-stage {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-4);
}
.logo-tile {
  border: var(--border);
  border-radius: var(--r-lg);
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  padding: var(--sp-4);
}
.logo-tile img { width: min(160px, 70%); }
.logo-tile figcaption { font-family: var(--font-mono); font-size: var(--text-label); margin-top: var(--sp-2); }
.logo-tile--cream { background: var(--surface); }
.logo-tile--dark { background: var(--field-olive); color: var(--surface); }
.logo-tile--orange { background: var(--brand-orange); }

.clearspace {
  position: relative;
  display: inline-block;
  border: 2px dashed var(--subtle);
  padding: var(--sp-5);
}
.clearspace img { width: 140px; }
.clearspace .cs-label {
  position: absolute;
  font-family: var(--font-mono);
  font-size: var(--text-label);
  color: var(--muted);
}

/* ---- Color section ---- */
.swatch-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-4); }
.swatch {
  border: var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--sh-card);
  background: var(--paper);
}
.swatch .chip { height: 110px; }
.swatch .meta { padding: var(--sp-3); }
.swatch .meta .name { font-weight: 800; }
.swatch .meta .hex { font-family: var(--font-mono); font-size: var(--text-caption); color: var(--muted); }
.swatch-row--secondary .swatch .chip { height: 64px; }

.ramp { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: var(--border); border-radius: var(--r-md); overflow: hidden; }
.ramp .step { height: 72px; display: flex; align-items: flex-end; padding: var(--sp-1); }
.ramp .step span { font-family: var(--font-mono); font-size: var(--text-label); background: var(--paper); color: var(--ink); padding: 0.05rem 0.3rem; border-radius: 3px; }

.gradient-strip { height: 72px; border: var(--border); border-radius: var(--r-md); }
.gradient-strip--brand { background: var(--gradient-brand); }
.gradient-strip--cta { background: var(--gradient-cta); }

/* ---- Typography section ---- */
.type-specimen { display: flex; flex-direction: column; gap: var(--sp-3); }
.type-row { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: var(--sp-4); align-items: baseline; padding: var(--sp-3) 0; border-bottom: 2px solid var(--surface-warm); }
.type-row .demo { overflow-wrap: anywhere; }
.type-row .spec-cell { font-family: var(--font-mono); font-size: var(--text-label); color: var(--muted); text-align: right; }
.t-hero { font-family: var(--font-display); font-size: var(--text-hero); line-height: 0.95; }
.t-h1 { font-family: var(--font-display); font-size: var(--text-h1); }
.t-h2 { font-family: var(--font-display); font-size: var(--text-h2); }
.t-h3 { font-weight: 800; font-size: var(--text-h3); }
.t-body-lg { font-size: var(--text-body-lg); }
.t-body { font-size: var(--text-body); }
.t-caption { font-size: var(--text-caption); color: var(--muted); }
.t-mark { font-family: var(--font-mark); font-size: var(--text-h1); }
.t-accent { font-family: var(--font-accent); font-size: var(--text-h2); }
.t-mono { font-family: var(--font-mono); font-size: var(--text-body-sm); }

/* ---- Iconography ---- */
.icon-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--sp-3); }
.icon-cell {
  border: var(--border);
  border-radius: var(--r-md);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  background: var(--paper);
}
.icon-cell svg { width: 28px; height: 28px; stroke: var(--ink); }
.icon-cell--accent svg { stroke: var(--brand-orange); }

/* ---- Iconography in context — device mockups ---- */
.mockups { display: flex; gap: var(--sp-6); flex-wrap: wrap; align-items: flex-start; }
.device { margin: 0; }
.device .screen {
  border: var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-pop);
  background: var(--field-olive);
  color: var(--surface);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.device--wide .screen { width: 480px; max-width: 100%; aspect-ratio: 16 / 9; }
.device--tall .screen { width: 236px; aspect-ratio: 9 / 16; }
.device figcaption { font-family: var(--font-mono); font-size: var(--text-label); color: var(--muted); margin-top: var(--sp-2); }
.device .ic { width: 20px; height: 20px; stroke: currentColor; flex-shrink: 0; }
.hud { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2) var(--sp-3); }
.hud--top { justify-content: space-between; background: rgba(0,0,0,0.28); border-bottom: 2px solid rgba(0,0,0,0.35); }
.stat { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-weight: 700; font-size: var(--text-caption); }
.stat--accent { color: var(--brand-orange); }
.playfield {
  flex: 1;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  text-align: center;
  background: radial-gradient(circle at 50% 42%, rgba(225,100,22,0.20), transparent 68%);
}
.pf-title { font-family: var(--font-display); font-size: 1.05rem; letter-spacing: 0.04em; }
.pf-sub { font-family: var(--font-mono); font-size: var(--text-label); opacity: 0.72; }
.hud--bottom { justify-content: center; gap: var(--sp-3); padding-bottom: var(--sp-3); }
.act { display: grid; place-items: center; width: 42px; height: 42px; border: 2px solid var(--surface); border-radius: var(--r-md); }
.act--accent { background: var(--brand-orange); border-color: var(--ink); color: var(--ink); }
.tabbar { display: flex; justify-content: space-around; padding: var(--sp-2) 0 calc(var(--sp-2) + 2px); background: rgba(0,0,0,0.3); border-top: 2px solid rgba(0,0,0,0.35); }
.tab { display: grid; place-items: center; gap: 3px; opacity: 0.62; }
.tab em { font-style: normal; font-family: var(--font-mono); font-size: 0.58rem; letter-spacing: 0.04em; }
.tab--active { opacity: 1; color: var(--brand-orange); }
@media (max-width: 640px) { .device--wide .screen { width: 100%; } }
.icon-label { font-family: var(--font-mono); font-size: var(--text-label); color: var(--muted); text-align: center; margin-top: 0.35rem; }

/* ---- Photography / illustration ---- */
.art-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); }
.art-grid figure { margin: 0; border: var(--border); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-card); background: var(--paper); }
.art-grid img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.art-grid figcaption { padding: var(--sp-2) var(--sp-3); font-family: var(--font-mono); font-size: var(--text-label); color: var(--muted); }

/* ---- Mascots ---- */
.roster { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-4); }
.fighter { border: var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--paper); box-shadow: var(--sh-card); }
.fighter .name .dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--ink); margin-right: 0.45rem; }
.fighter .body { padding: var(--sp-3); }
.fighter .body .name { font-family: var(--font-display); font-size: var(--text-h4); }
.fighter .body p { font-size: var(--text-body-sm); color: var(--muted); margin: 0.3rem 0 0; }

/* ---- UI components ---- */
.ui-demo { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; }
.chip-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  border: 2px solid var(--ink);
  border-radius: var(--r-pill);
  padding: 0.15rem 0.7rem;
  background: var(--brand-gold);
  color: var(--ink);
}
.input-demo {
  font: inherit;
  border: var(--border);
  border-radius: var(--r-md);
  padding: 0.55rem 0.9rem;
  background: var(--paper);
  color: var(--ink);
  width: min(280px, 100%);
}
.input-demo:focus-visible { outline: 3px solid var(--brand-orange); outline-offset: 2px; }

.game-tile {
  width: 240px;
  border: var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--paper);
  box-shadow: var(--sh-card);
  transition: transform var(--dur-fast) var(--ease-bounce), box-shadow var(--dur-fast) var(--ease-out);
}
.game-tile:hover { transform: translate(-2px, -2px) rotate(-0.5deg); box-shadow: var(--sh-pop); }
.game-tile img { aspect-ratio: 16 / 10; object-fit: cover; }
.game-tile .body { padding: var(--sp-3); }
.game-tile .body .name { font-family: var(--font-display); font-size: 0.95rem; }
.game-tile .body p { margin: 0.2rem 0 0; font-size: var(--text-caption); color: var(--muted); }

.device {
  width: 300px;
  border: var(--border);
  border-radius: 36px;
  background: var(--field-olive);
  padding: 14px;
  box-shadow: var(--sh-pop);
  margin: 0 auto;
}
.device-screen { border-radius: 24px; overflow: hidden; background: var(--surface); display: flex; flex-direction: column; }
.device-bar { background: var(--field-olive); color: var(--brand-gold); font-family: var(--font-display); font-size: 0.7rem; text-align: center; padding: 0.5rem; }
.device-body { padding: var(--sp-3); display: flex; flex-direction: column; gap: var(--sp-3); }
.leader-row { display: flex; justify-content: space-between; align-items: center; border: 2px solid var(--ink); border-radius: var(--r-md); padding: 0.45rem 0.7rem; background: var(--paper); font-size: var(--text-body-sm); }
.leader-row .rank { font-family: var(--font-mono); color: var(--orange-700); font-size: var(--text-caption); }
.leader-row .score { font-family: var(--font-display); font-size: 0.85rem; }
.leader-row--top { background: var(--brand-gold); }

/* ---- Layout section ---- */
.container-diagram { display: flex; flex-direction: column; gap: var(--sp-2); }
.container-diagram .bar {
  border: 2px dashed var(--muted);
  border-radius: var(--r-sm);
  padding: 0.4rem var(--sp-3);
  font-family: var(--font-mono);
  font-size: var(--text-label);
  color: var(--muted);
}
.spacing-ruler { display: flex; align-items: flex-end; gap: var(--sp-3); }
.spacing-ruler .block { background: var(--brand-orange); border: 2px solid var(--ink); border-radius: 3px; width: 34px; }
.spacing-ruler .lbl { font-family: var(--font-mono); font-size: var(--text-label); color: var(--muted); text-align: center; margin-top: 0.3rem; }

/* ---- Shadows & borders section (09) ---- */
.elev-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-5); }
.elev-grid figure,
.radius-row figure { margin: 0; }
.demo-plate {
  height: 88px;
  background: var(--brand-sienna);
  border: var(--border);
  border-radius: var(--r-md);
}
.radius-row { display: flex; flex-wrap: wrap; gap: var(--sp-4); }
.radius-plate {
  width: 76px;
  height: 76px;
  background: var(--paper);
  border: var(--border);
  box-shadow: var(--sh-card);
}
.demo-cap {
  font-family: var(--font-mono);
  font-size: var(--text-label);
  color: var(--muted);
  text-align: center;
  margin-top: var(--sp-2);
}

/* ---- AI policy ---- */
.stance {
  font-family: var(--font-display);
  font-size: var(--text-h2);
  max-width: 24ch;
  margin: 0 0 var(--sp-5);
}
.callout {
  border: var(--border);
  border-radius: var(--r-lg);
  background: var(--paper);
  box-shadow: var(--sh-card);
  padding: var(--sp-4);
  max-width: var(--max-w-narrow);
}
.sec--dark .callout { background: var(--field-olive); }

/* ---- Motion section (the demos must move) ---- */
.motion-demos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-3); }
.m-demo { margin: 0; text-align: center; }
.m-demo figcaption { font-family: var(--font-mono); font-size: var(--text-label); color: var(--surface); opacity: 0.7; margin-top: var(--sp-2); }
.m-chip {
  width: 84px;
  height: 84px;
  margin: 0 auto;
  border: var(--border);
  border-radius: var(--r-lg);
  background: var(--brand-sienna);
  box-shadow: var(--sh-card);
  display: block;
  padding: 0;
  cursor: default;
}
.m-chip--breathe { animation: breathe 3s var(--ease-smooth) infinite; }
.m-chip--float { background: var(--brand-gold); animation: float 3s var(--ease-smooth) infinite; }
.m-chip--wobble { background: var(--brand-orange); }
.m-demo:hover .m-chip--wobble { animation: wobble var(--dur-slow) var(--ease-bounce); }
.m-chip--snap { background: var(--orange-300); cursor: pointer; }
.m-chip--snap:active { animation: snap var(--dur-slow) var(--ease-squash); }

.stagger-demo { display: flex; flex-direction: column; gap: var(--sp-2); max-width: 22rem; }
.s-bar {
  border: 2px solid var(--ink);
  border-radius: var(--r-md);
  background: var(--paper);
  color: var(--ink);
  padding: 0.45rem 0.7rem;
  font-size: var(--text-body-sm);
  font-weight: 700;
}
.stagger-demo.play .s-bar { animation: slide-up-bounce var(--dur-slow) var(--ease-squash) both; }
.stagger-demo.play .s-bar:nth-child(2) { animation-delay: var(--stagger); }
.stagger-demo.play .s-bar:nth-child(3) { animation-delay: calc(var(--stagger) * 2); }
.stagger-demo.play .s-bar:nth-child(4) { animation-delay: calc(var(--stagger) * 3); }

@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.09) rotate(-1deg); }
}
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-16px) rotate(3deg); }
}
@keyframes wobble {
  0%, 100% { transform: rotate(0) scale(1); }
  20% { transform: rotate(-8deg) scale(1.05); }
  50% { transform: rotate(6deg) scale(1.03); }
  80% { transform: rotate(-3deg); }
}
@keyframes snap {
  0% { transform: scale(1); }
  30% { transform: scale(1.15); }
  55% { transform: scale(0.95); }
  75% { transform: scale(1.05); }
  100% { transform: scale(1); }
}
@keyframes slide-up-bounce {
  0% { opacity: 0; transform: translateY(30px); }
  60% { opacity: 1; transform: translateY(-5px); }
  80% { transform: translateY(2px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ---- Placeholders & invitation zones ---- */
.placeholder {
  border: 3px dashed var(--orange-700);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  color: var(--orange-700);
  background: transparent;
}
.placeholder::before { content: 'PLACEHOLDER — '; font-weight: 700; }

.invite {
  border: 1px dashed var(--subtle);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  color: var(--muted);
  max-width: 34rem;
}
.js .invite { opacity: 0; transition: opacity var(--dur-slow) var(--ease-out) 2s; }
.js .invite.vis { opacity: 1; }

/* ---- Alternate toggles (the A/B controls) ---- */
.alt-control {
  display: inline-flex;
  gap: var(--sp-2);
  align-items: center;
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  border: 2px dashed var(--subtle);
  border-radius: var(--r-md);
  padding: var(--sp-2) var(--sp-3);
}
.alt-control .btn { font-size: var(--text-caption); padding: 0.3rem 0.7rem; box-shadow: none; }
.alt-control .btn[aria-pressed='true'] { background: var(--ink); color: var(--surface); }

/* ---- Reveal (js-gated; fails visible) ---- */
.rv { /* visible by default */ }
.js .rv { opacity: 0; transform: translateY(16px); transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out); }
.js .rv.vis { opacity: 1; transform: none; }
.js .rv-d1.vis { transition-delay: 60ms; }
.js .rv-d2.vis { transition-delay: 120ms; }
.js .rv-d3.vis { transition-delay: 180ms; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .rv, .js .invite { opacity: 1; transform: none; transition: none; }
  .game-tile, .btn { transition: none; }
  .m-chip, .stagger-demo.play .s-bar { animation: none !important; }
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .duo, .dosdonts, .art-grid { grid-template-columns: 1fr; }
  .roster { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .icon-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .swatch-row, .logo-stage { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cover-grid { grid-template-columns: 1fr; }
  .cover-logo { order: -1; width: min(200px, 50%); margin: 0; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 30% 0 0; z-index: 50; transform: translateX(-100%); transition: transform var(--dur-normal) var(--ease-out); height: 100dvh; }
  .sidebar.open { transform: none; }
  .burger { display: inline-block; }
  .swatch-row, .logo-stage, .roster { grid-template-columns: 1fr; }
  .type-row { grid-template-columns: 1fr; }
  .type-row .spec-cell { text-align: left; }
  .toc { columns: 1; }
}

/* ---- Print ---- */
@media print {
  .sidebar, .burger, .invite, .alt-control, .skip, [data-stagger-replay] { display: none !important; }
  .shell { display: block; }
  .rv { opacity: 1 !important; transform: none !important; }
  .sec { break-before: page; padding: 1.5cm 0; }
  .cover { min-height: auto; break-before: auto; }
  body { background: white; }
  .sec--dark { background: var(--burrow-brown); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .chip, .ramp .step, .gradient-strip, .fighter .bubble { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
