@font-face {
  font-family: "Marcellus";
  src: url("/assets/fonts/marcellus-regular.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Nunito";
  src: url("/assets/fonts/nunito-variable.ttf") format("truetype");
  font-display: swap;
  font-weight: 200 1000;
}

/* Tatami Daylight — sampled from production art (docs/redesign/02_RICE_CLICKER_VISUAL_DNA.md).
   The page is rice paper in a sunlit room; wood frames it; gold is the reward. */
:root {
  /* Field and ink */
  --cream: #fdf9e7;
  --parchment: #fbeed3;
  --parchment-deep: #f3ddb4;
  --porcelain: #f7f1e0;
  --ink: #33241a;
  --ink-soft: #5c4632;
  --ink-wood: #21140f;

  /* Wood register (header beam, footer board, milestone banners) */
  --wood: #543c24;
  --wood-dark: #35231b;
  --wood-deep: #2b1c14;
  --text-on-wood: #fdf3da;
  --text-on-wood-soft: #e8d3a8;
  --text-on-image: #fff6df;
  --text-on-image-muted: #ead8b6;
  --text-on-light: #2b1a11;
  --text-on-light-muted: #5c4632;
  --hero-copy-scrim: linear-gradient(90deg, rgb(25 12 7 / 86%) 0%, rgb(25 12 7 / 66%) 34%, rgb(25 12 7 / 18%) 72%, transparent 100%);
  --focus-ring: #f8d36f;

  /* Gold — reward, CTAs, live numbers. Bronze carries borders and links. */
  --gold: #f0b41c;
  --gold-soft: #f6d066;
  --bronze: #b46c24;
  --bronze-ink: #8a5a1c;

  /* Rare accents */
  --indigo: #3c5a7c;
  --jade: #55795c;
  --warning: #8a5a1c;
  --danger: #a4483d;
  --danger-deep: #7c211a;

  /* Surfaces and lines */
  --line-wood: #d9bc8d;
  --line-gold: #e0b45c;
  --shadow-warm: 0 14px 34px rgb(84 60 36 / 20%);
  --shadow-lift: 0 6px 18px rgb(84 60 36 / 16%);

  /* Shape */
  --radius-sm: 0.7rem;
  --radius-md: 1.1rem;
  --radius-lg: 1.8rem;
  --content: 72rem;
  --focus: 3px solid #2f6fb8;

  /* Type */
  --font-display: "Marcellus", Georgia, serif;
  --font-body: "Nunito", system-ui, sans-serif;

  /* Spacing scale (used across page styles) */
  --space-1: 0.35rem;
  --space-2: 0.6rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2.25rem;
  --space-6: 3.5rem;

  /* Motion */
  --settle-duration: 550ms;
  --settle-ease: cubic-bezier(0.22, 0.9, 0.32, 1.05);

  /* Compatibility aliases for pages not yet redesigned (Stage C). */
  --rice-paper: var(--cream);
  --toasted-paper: var(--parchment-deep);
  --gold-light: var(--gold-soft);
  --gold-300: var(--gold-soft);
  --gold-400: var(--gold);
  --cream-100: var(--cream);
  --wood-800: var(--wood-dark);
  --wood-900: var(--wood-deep);
  --deep-lacquer: var(--wood-dark);
  --deep-lacquer-soft: var(--wood);
  --text-on-dark: var(--text-on-wood);
  --text-on-paper: var(--ink);
  --shadow: var(--shadow-warm);
}

@layer reset, tokens, base, components, layout, utilities;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html { scroll-behavior: smooth; }
  body, h1, h2, h3, p, figure { margin: 0; }
  img, picture { display: block; max-width: 100%; }
  img { height: auto; }
  button, input { font: inherit; }
}

@layer base {
  body {
    min-width: 20rem;
    color: var(--ink);
    background:
      radial-gradient(circle at 84% -4rem, rgb(246 208 102 / 22%), transparent 30rem),
      radial-gradient(circle at 8% 20rem, rgb(251 238 211 / 70%), transparent 38rem),
      linear-gradient(178deg, #fdf6dd, var(--cream) 34%, #f8eecf 100%);
    font-family: var(--font-body);
    font-size: 1.05rem;
    line-height: 1.65;
  }

  /* Faint woven rice-paper grain — pure CSS, no payload. */
  body::before {
    position: fixed;
    inset: 0;
    z-index: -1;
    content: "";
    pointer-events: none;
    opacity: 0.5;
    background:
      repeating-linear-gradient(0deg, rgb(84 60 36 / 2.5%) 0 1px, transparent 1px 7px),
      repeating-linear-gradient(90deg, rgb(84 60 36 / 2%) 0 1px, transparent 1px 9px);
  }

  h1, h2, h3 {
    color: var(--ink-wood);
    font-family: var(--font-display);
    font-weight: 400;
    line-height: 1.12;
    text-wrap: balance;
  }

  h1 { font-size: clamp(2.5rem, 6vw, 4.6rem); }
  h2 { font-size: clamp(1.8rem, 3.4vw, 2.9rem); }
  h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); }
  a { color: var(--bronze-ink); text-underline-offset: 0.22em; }
  a:hover { color: var(--ink-wood); }
  :focus-visible { outline: var(--focus); outline-offset: 4px; }
  ::selection { color: var(--ink-wood); background: var(--gold-soft); }
}

@layer components {
  /* ---------- Access ---------- */
  .skip-link {
    position: fixed;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 100;
    padding: 0.8rem 1rem;
    color: var(--cream);
    background: var(--wood-deep);
    border-radius: var(--radius-sm);
    transform: translateY(-160%);
  }
  .skip-link:focus { transform: translateY(0); }

  /* ---------- Header: the wood beam ---------- */
  .site-header {
    color: var(--text-on-wood);
    background:
      linear-gradient(180deg, #3f2a1d, var(--wood-dark) 62%, #2e1d15);
    border-bottom: 3px solid var(--bronze);
    box-shadow: 0 1px 0 rgb(240 180 28 / 45%), 0 10px 26px rgb(43 28 20 / 22%);
  }
  .site-header__inner {
    display: flex;
    width: min(calc(100% - 2rem), var(--content));
    min-height: 4.6rem;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-inline: auto;
  }
  .brand {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    gap: 0.7rem;
    color: var(--text-on-wood);
    text-decoration: none;
  }
  .brand:hover { color: var(--gold-soft); }
  .brand img { width: 2.7rem; height: 2.7rem; object-fit: contain; filter: drop-shadow(0 2px 4px rgb(0 0 0 / 35%)); }
  .brand b { font-family: var(--font-display); font-size: 1.35rem; font-weight: 400; letter-spacing: 0.02em; }

  .secondary-home-button {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1.1rem;
    color: var(--text-on-wood);
    background: rgb(255 235 190 / 8%);
    border: 1px solid rgb(240 180 28 / 55%);
    text-decoration: none;
    border-radius: 999px;
    font-weight: 800;
  }
  .secondary-home-button:hover { color: var(--gold-soft); background: rgb(255 235 190 / 14%); }

  /* ---------- Footer: the wood board ---------- */
  .site-footer {
    margin-top: clamp(3rem, 8vw, 5.5rem);
    color: var(--text-on-wood);
    background: linear-gradient(180deg, #3a2719, var(--wood-deep));
    border-top: 3px solid var(--bronze);
    box-shadow: inset 0 1px 0 rgb(240 180 28 / 40%);
  }
  .site-footer__inner {
    display: grid;
    width: min(calc(100% - 2rem), var(--content));
    grid-template-columns: minmax(14rem, 0.7fr) minmax(0, 1.3fr);
    align-items: center;
    gap: 1.5rem 2rem;
    margin-inline: auto;
    padding-block: 2.2rem;
  }
  .site-footer b { font-family: var(--font-display); font-size: 1.2rem; font-weight: 400; }
  .site-footer p { margin-top: 0.3rem; color: var(--text-on-wood-soft); font-size: 0.95rem; }
  .site-footer nav ul { display: flex; flex-wrap: wrap; gap: 0.2rem 0.4rem; justify-content: flex-end; margin: 0; padding: 0; list-style: none; }
  .site-footer nav a {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    padding: 0.4rem 0.8rem;
    color: var(--text-on-wood);
    text-decoration: none;
    border-radius: 999px;
    font-weight: 700;
  }
  .site-footer nav a:hover { color: var(--gold-soft); background: rgb(255 235 190 / 9%); }
  .footer-note { grid-column: 1 / -1; margin: 0; font-size: 0.85rem; color: var(--text-on-wood-soft); }

  /* ---------- Rice divider (replaces <hr>) ---------- */
  .rice-divider {
    width: min(100%, 40rem);
    height: 1.4rem;
    margin: 0 auto;
    background: url("/assets/rice-clicker/divider-rice.webp") center / contain no-repeat;
  }

  /* ---------- Voice ---------- */
  .eyebrow {
    color: var(--bronze-ink);
    font-size: 0.82rem;
    font-weight: 850;
    letter-spacing: 0.14em;
    text-transform: uppercase;
  }

  /* ---------- Buttons: the game's parchment lozenge ---------- */
  .ornate-button, .quiet-button {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    padding: 0.78rem 1.5rem;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 850;
    text-decoration: none;
    transition: transform 140ms ease;
  }
  .ornate-button {
    min-width: 13rem;
    min-height: 54px;
    color: var(--ink-wood);
    background: url("/assets/rice-clicker/button-idle.webp") center / 100% 100% no-repeat;
    font-size: 1.16rem;
    text-shadow: 0 1px rgb(255 255 255 / 60%);
    filter: drop-shadow(0 5px 10px rgb(84 60 36 / 30%));
  }
  .ornate-button:hover {
    color: var(--cream);
    background-image: url("/assets/rice-clicker/button-hover.webp");
    text-shadow: 0 1px rgb(0 0 0 / 40%);
  }
  .ornate-button:active {
    transform: translateY(1px) scale(0.97);
    color: var(--ink-wood);
    background-image: url("/assets/rice-clicker/button-pressed.webp");
    text-shadow: 0 1px rgb(255 255 255 / 60%);
  }
  .ornate-button:disabled, .ornate-button[aria-disabled="true"] {
    cursor: not-allowed;
    filter: saturate(0.25) drop-shadow(0 3px 6px rgb(84 60 36 / 18%));
    opacity: 0.75;
    background-image: url("/assets/rice-clicker/button-disabled.webp");
  }
  .quiet-button {
    color: var(--ink);
    background: linear-gradient(180deg, #fff7e0, var(--parchment));
    border: 1px solid var(--bronze);
    box-shadow: inset 0 0 0 2px rgb(255 255 255 / 55%), var(--shadow-lift);
  }
  .quiet-button:hover { background: #fff3cd; }
  .quiet-button:active { transform: translateY(1px) scale(0.98); }
  .text-link { color: var(--bronze-ink); font-weight: 800; text-underline-offset: 0.25em; }

  .danger-button {
    min-height: 48px;
    margin-top: 1.2rem;
    padding: 0.8rem 1.2rem;
    color: #fff;
    background: var(--danger);
    border: 2px solid #7c2a20;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 900;
  }
  a.danger-button { display: inline-flex; align-items: center; text-decoration: none; }

  /* ---------- Panels: porcelain rail, wood band, gold keyline ---------- */
  .paper-card, .porcelain-panel {
    position: relative;
    padding: 2rem;
    color: var(--ink);
    background: linear-gradient(160deg, #fffaea, var(--cream) 70%);
    border: 1px solid var(--bronze);
    border-radius: var(--radius-md);
    box-shadow:
      0 0 0 5px var(--porcelain),
      0 0 0 6px var(--line-wood),
      var(--shadow-warm);
  }
  .paper-card--dark {
    color: var(--text-on-wood);
    background: linear-gradient(160deg, #46301f, var(--wood-deep));
  }
  .paper-card--dark h1, .paper-card--dark h2, .paper-card--dark h3 { color: var(--gold-soft); }
  .paper-card .icon-art { width: 4rem; margin-bottom: 1rem; }
  .paper-card p { margin-block: 0.65rem 1rem; }
  .paper-card img[data-fallback].is-missing { visibility: hidden; }

  /* Dark milestone register — the game's journey-banner mood. Use sparingly. */
  .ornate-panel {
    position: relative;
    min-height: 15rem;
    padding: clamp(2.5rem, 7vw, 5rem);
    isolation: isolate;
    color: var(--text-on-wood);
  }
  .ornate-panel h1, .ornate-panel h2, .ornate-panel h3 { color: var(--gold-soft); }
  .ornate-panel::before {
    position: absolute;
    inset: 0;
    z-index: -1;
    content: "";
    background: url("/assets/rice-clicker/panel-dark.webp") center / 100% 100% no-repeat;
    filter: drop-shadow(var(--shadow-warm));
  }
  .ornate-panel__content { max-width: 46rem; margin-inline: auto; text-align: center; }

  .image-fallback {
    display: grid;
    width: 4rem;
    height: 4rem;
    place-items: center;
    color: var(--ink);
    background: var(--parchment);
    border: 2px dashed var(--bronze);
    border-radius: 50%;
    font-weight: 900;
  }

  /* ---------- Chips and states ---------- */
  .chip-row, .button-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.4rem;
  }
  .status-chip {
    display: inline-flex;
    min-height: 32px;
    align-items: center;
    padding: 0.28rem 0.8rem;
    color: var(--ink);
    background: var(--porcelain);
    border: 1px solid var(--line-wood);
    border-left-width: 4px;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 800;
  }
  .status-chip--success { border-left-color: var(--jade); }
  .status-chip--progress { border-left-color: var(--gold); }
  .status-chip--warning { border-left-color: var(--warning); }
  .status-chip--danger { border-left-color: var(--danger); }

  .stat-value { display: block; color: var(--bronze-ink); font-family: var(--font-display); font-size: 2.2rem; }
  .stat-label { font-size: 0.88rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; }

  .alert-stack { display: grid; gap: 0.75rem; margin-top: 2rem; }
  .alert {
    display: grid;
    grid-template-columns: minmax(8rem, 0.35fr) 1fr;
    gap: 1rem;
    padding: 1rem 1.2rem;
    color: var(--ink);
    background: var(--parchment);
    border-left: 0.35rem solid var(--gold);
    border-radius: var(--radius-sm);
  }
  .alert--warning { border-color: var(--warning); }
  .alert--danger { border-color: var(--danger); }

  /* ---------- Forms ---------- */
  .example-form {
    padding: clamp(1.3rem, 4vw, 2rem);
    color: var(--ink);
    background: var(--cream);
    border: 1px solid var(--bronze);
    border-radius: var(--radius-md);
    box-shadow: 0 0 0 5px var(--porcelain), 0 0 0 6px var(--line-wood), var(--shadow-lift);
  }
  /* ---------- Motion primitives ---------- */
  html.js [data-settle] { opacity: 0; translate: 0 16px; }
  html.js [data-settle].is-settled {
    opacity: 1;
    translate: 0 0;
    transition: opacity var(--settle-duration) ease, translate var(--settle-duration) var(--settle-ease);
  }
  html.js [data-settle="pop"] { scale: 0.94; translate: 0 10px; }
  html.js [data-settle="pop"].is-settled {
    scale: 1;
    transition: opacity var(--settle-duration) ease, translate var(--settle-duration) var(--settle-ease), scale var(--settle-duration) var(--settle-ease);
  }

  .drift-grain {
    position: absolute;
    width: clamp(1.1rem, 2vw, 1.7rem);
    pointer-events: none;
    animation: grain-drift 7s ease-in-out infinite alternate;
  }
  .drift-grain img { width: 100%; height: auto; }
  .drift-grain--slow { animation-duration: 9.5s; }
  .drift-grain--fast { animation-duration: 5.5s; }
  html.page-hidden .drift-grain { animation-play-state: paused; }
  @keyframes grain-drift {
    from { transform: translateY(-6%) rotate(12deg); }
    to { transform: translateY(10%) rotate(26deg); }
  }
}

@layer components {
  .launch-page {
    --launch-paper: #f7ebd0;
    --launch-paper-deep: #e7c98f;
    --launch-green: #657044;
    --launch-wood: #432719;
    --launch-ink: #24150f;
    --launch-gold: #e6a928;
    color: var(--launch-ink);
    background: var(--launch-paper);
  }

  .launch-page .launch-header {
    color: var(--launch-paper);
    background: rgb(36 21 15 / 88%);
    border: 0;
    border-bottom: 1px solid rgb(247 235 208 / 18%);
    box-shadow: none;
    backdrop-filter: blur(10px);
  }

  .launch-page .launch-header .brand { color: inherit; }
  .launch-page .launch-header .brand:focus-visible,
  .launch-footer__brand:focus-visible { outline: 4px solid var(--focus-ring); outline-offset: 4px; }
  .brand__logo { display: block; flex: 0 0 auto; }
  .brand__logo img { display: block; width: auto; height: 3rem; object-fit: contain; }
  .site-footer__brand { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 0.75rem; }
  .site-footer__brand .brand__logo { grid-row: 1 / span 2; }
  .site-footer__brand p { margin: 0; }

  .launch-nav-play,
  .rice-button {
    display: inline-flex;
    min-height: 3rem;
    align-items: center;
    justify-content: center;
    padding: 0.76rem 1.35rem;
    color: var(--launch-ink);
    font: 800 0.98rem/1 var(--font-body);
    letter-spacing: 0.01em;
    text-decoration: none;
    border: 2px solid var(--launch-ink);
    border-radius: 0.75rem;
    background: var(--launch-paper);
    box-shadow: 4px 4px 0 var(--launch-ink);
    cursor: pointer;
    transition: transform 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
  }
  .launch-nav-play { min-height: 2.65rem; padding: 0.62rem 1.1rem; background: var(--launch-gold); }
  .rice-button:hover,
  .launch-nav-play:hover { background: #f2c24e; transform: translate(-1px, -1px); }
  .rice-button:active,
  .launch-nav-play:active { box-shadow: 1px 1px 0 var(--launch-ink); transform: translate(2px, 2px); }
  .rice-button--primary { background: var(--launch-gold); }
  .rice-button--quiet { background: rgb(247 235 208 / 92%); }
  .rice-button--large { min-height: 3.65rem; padding-inline: 2rem; font-size: 1.08rem; }
  .rice-button:focus-visible,
  .launch-nav-play:focus-visible,
  .game-layer__back:focus-visible { outline: 4px solid var(--focus-ring); outline-offset: 4px; }

  .launch-kicker {
    margin: 0 0 0.85rem;
    color: inherit;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
  }

  .launch-page .launch-hero {
    color: var(--text-on-image);
    background: var(--launch-ink);
  }
  .launch-scene__background,
  .launch-scene__background img,
  .progress-stage__background,
  .progress-stage__background img { width: 100%; height: 100%; }
  .launch-scene__background img,
  .progress-stage__background img { display: block; object-fit: cover; }
  .launch-hero__light {
    background:
      linear-gradient(90deg, rgb(23 12 8 / 80%) 0%, rgb(23 12 8 / 48%) 45%, transparent 72%),
      linear-gradient(0deg, rgb(23 12 8 / 48%), transparent 50%);
  }
  .launch-hero__copy {
    position: relative;
    z-index: 3;
    padding: clamp(1rem, 2.4vw, 2rem);
    margin-inline-start: clamp(-2rem, -2.4vw, -1rem);
    color: var(--text-on-image);
    background: none;
  }
  .launch-hero__copy::before {
    content: "";
    position: absolute;
    inset: -0.65rem -1rem;
    z-index: -1;
    pointer-events: none;
    background: var(--hero-copy-scrim);
    filter: blur(0.35rem);
    border-radius: 1.35rem;
  }
  .launch-hero__copy h1,
  .growth-story h2,
  .community-act h2,
  .final-act h2 {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 400;
    letter-spacing: -0.025em;
    text-wrap: balance;
  }
  .launch-hero__copy h1 { max-width: 12ch; color: var(--text-on-image); font-size: clamp(3.05rem, 6.4vw, 6.1rem); line-height: 1.03; }
  .launch-hero__logo { display: block; width: clamp(6rem, 9vw, 8.5rem); margin: 0 0 1rem; }
  .launch-hero__logo img { display: block; width: 100%; height: auto; filter: drop-shadow(0 0.8rem 1.2rem rgb(20 9 5 / 30%)); }
  .launch-hero__copy h1 span { display: block; color: #ffe3a0; }
  .launch-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1.8rem; }

  .bowl-theatre__bowl { display: block; object-fit: contain; pointer-events: none; user-select: none; transform: scale(1.25); transform-origin: center bottom; filter: drop-shadow(0 18px 16px rgb(30 13 6 / 42%)); }
  .bowl-theatre__bowl img { display: block; width: 100%; height: auto; }

  .growth-story { color: var(--text-on-light); background: var(--launch-paper); }
  .growth-story__intro { text-align: center; }
  .growth-story__intro h2 { max-width: 16ch; margin-inline: auto; color: var(--text-on-light); font-size: clamp(2.6rem, 5vw, 5.2rem); line-height: 1.02; }
  .community-act h2,
  .final-act h2 { font-size: clamp(2.6rem, 5vw, 5.2rem); line-height: 0.98; }
  .growth-story__intro > p:last-child {
    max-width: 40rem;
    margin: clamp(1.25rem, 2.2vw, 1.75rem) auto 0;
    color: var(--text-on-light-muted);
    font-size: clamp(1.02rem, 2vw, 1.22rem);
    line-height: 1.5;
  }
  .growth-step { opacity: 0.42; transition: opacity 240ms ease, transform 240ms ease; }
  .growth-step.is-active { opacity: 1; transform: translateX(0.6rem); }
  .growth-step__art { display: none; }
  .growth-step h3 { margin: 0; color: var(--launch-wood); font-size: clamp(2rem, 3vw, 3.35rem); line-height: 1.02; }
  .growth-step > p:last-child { max-width: 25rem; margin: 0.75rem 0 0; color: var(--text-on-light-muted); }

  .progress-stage { overflow: hidden; border-radius: 1.7rem 1.7rem 4.5rem 1.7rem; background: var(--launch-wood); box-shadow: 0 1.5rem 4rem rgb(66 38 22 / 26%); }
  .progress-stage__background { opacity: 0; transition: opacity 500ms ease; }
  .progress-stage[data-progress-stage="drop"] .progress-stage__background--drop,
  .progress-stage[data-progress-stage="automate"] .progress-stage__background--automate,
  .progress-stage[data-progress-stage="prestige"] .progress-stage__background--prestige { opacity: 1; }
  .progress-stage__background--drop img,
  .growth-step__art--drop img { object-position: center 54%; }
  .progress-stage__background--automate img,
  .growth-step__art--automate img { object-position: center 50%; }
  .progress-stage__background--prestige img,
  .growth-step__art--prestige img { object-position: center 48%; }

  .community-act {
    color: var(--text-on-image);
    background:
      radial-gradient(circle at 18% 48%, rgb(230 169 40 / 18%), transparent 28%),
      var(--launch-wood);
  }
  .community-act h2 { color: #fff4cf; }
  .community-act__spirit { object-fit: contain; filter: drop-shadow(0 1.2rem 2rem rgb(0 0 0 / 35%)); }
  .community-act__label { margin: 2.2rem 0 0.2rem; color: #efca6b; font-size: 0.75rem; font-weight: 900; letter-spacing: 0.15em; text-transform: uppercase; }
  .community-act__total { margin: 0; color: #fff4cf; font: 400 clamp(2.6rem, 6vw, 6.6rem)/0.95 var(--font-display); font-variant-numeric: tabular-nums; }
  .community-act__status { margin: 0.65rem 0 0; color: #f6dfb6; font-size: 0.9rem; max-width: 42rem; }
  .community-act__copy > p:not(.community-act__label, .community-act__total, .community-act__status) { max-width: 42rem; color: var(--text-on-image-muted); }
  .community-act__copy .rice-button { margin-top: 1rem; }

  .final-act { color: var(--text-on-light); background: var(--launch-paper-deep); }
  .final-act h2 { color: var(--text-on-light); line-height: 1.02; }
  .final-act h2 { display: grid; gap: 0.2rem; line-height: 1; }
  .final-act__headline span { display: block; }
  .final-act h2 + p { max-width: 34rem; margin-top: clamp(1rem, 2vw, 1.4rem); color: var(--text-on-light-muted); }
  .final-act__logo { object-fit: contain; filter: drop-shadow(0 1.2rem 1.7rem rgb(67 39 25 / 28%)); }

  .launch-page .launch-footer { color: var(--launch-paper); background: var(--launch-ink); border: 0; }
  .launch-footer__brand { display: flex; align-items: center; gap: 0.75rem; color: var(--text-on-image); text-decoration: none; }
  .launch-footer__brand .brand__logo img { height: 3.4rem; }
  .launch-footer__brand p { display: grid; margin: 0; }
  .launch-footer__brand span { color: #d9c7a5; font-size: 0.8rem; }

  .game-layer { color: var(--launch-paper); background: var(--launch-ink); }
  /*
   * The layer is sized to the VISIBLE viewport so the canvas never hides under
   * the mobile browser's toolbars. In landscape those toolbars make the visible
   * area shorter than the screen, which left the website painted in the strip
   * around the game. This backdrop fills the screen directly beneath the layer.
   *
   * It hangs off the body, not the layer: .game-layer is transformed, which
   * makes it the containing block for its own fixed-position children, so a
   * backdrop inside it resolves against the layer and gets clipped by its
   * overflow instead of covering the screen.
   */
  body.game-is-open::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 199; /* immediately below .game-layer */
    background: var(--launch-ink);
    pointer-events: none;
  }
  .game-layer[hidden] { display: none; }
  .game-layer__back {
    min-height: 2.75rem;
    padding: 0.65rem 1rem;
    color: var(--launch-paper);
    font-weight: 800;
    border: 1px solid rgb(247 235 208 / 45%);
    border-radius: 999px;
    background: rgb(36 21 15 / 88%);
    cursor: pointer;
  }
  .game-loader { text-align: center; }
  .game-loader__logo { object-fit: contain; }
  .game-loader__bowl { position: relative; width: min(16rem, 56vw); margin: -2.6rem auto -1.5rem; }
  .game-loader__bowl > img:first-child { width: 100%; height: auto; }
  .game-loader__grain { position: absolute; top: 6%; left: 44%; width: 14%; height: auto; }
  .game-loader__message { font: 400 clamp(1.5rem, 3vw, 2.5rem)/1 var(--font-display); }
  .game-loader progress { width: min(26rem, 72vw); height: 0.75rem; accent-color: var(--launch-gold); }
  .game-layer[data-game-state="failed"] .game-loader progress { display: none; }
  .game-layer canvas {
    display: block;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    max-width: none;
    max-height: none;
    background: var(--launch-ink);
    outline: 0;
  }

}

.faq-search {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr) auto;
  gap: var(--space-2) var(--space-3);
  align-items: center;
  margin-block-end: var(--space-5);
}
.faq-search .icon-art, .faq-search img { width: 100%; }
.faq-search label { grid-column: 2 / -1; font-weight: 800; }
.faq-search input {
  grid-column: 2;
  min-height: 48px;
  padding: 0.6rem 0.85rem;
  color: var(--ink);
  background: #fffdf4;
  border: 2px solid #9b7a4a;
  border-radius: 0.55rem;
}
.faq-search p { margin: 0; }
.faq-list { display: grid; gap: var(--space-2); }
.faq-item { border: 1px solid var(--line-wood); border-radius: var(--radius-md); background: var(--parchment); }
.faq-item summary { display: flex; gap: var(--space-3); align-items: center; justify-content: space-between; padding: var(--space-4); cursor: pointer; font-weight: 800; }
.faq-item summary span { display: grid; gap: 0.2rem; }
.faq-item summary small { color: var(--bronze-ink); font-weight: 700; }
.faq-item summary a { padding: 0.4rem; }
.faq-answer { padding: 0 var(--space-4) var(--space-4); }
.legal-layout {
  display: grid;
  grid-template-columns: minmax(13rem, 0.28fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 6rem);
  padding-block: var(--space-6);
}
.legal-toc { position: sticky; top: 1.5rem; align-self: start; padding: var(--space-4); border: 1px solid var(--line-wood); border-radius: var(--radius-md); background: var(--porcelain); }
.legal-toc h2 { font-size: 1.2rem; }
.legal-toc ol { padding-inline-start: 1.3rem; }
.legal-copy { max-width: 52rem; }
.legal-section { padding-block: var(--space-5); border-block-end: 1px solid var(--line-wood); scroll-margin-top: 2rem; }
.legal-section li + li { margin-block-start: var(--space-2); }
.back-to-top { display: inline-block; margin-block-start: var(--space-3); font-size: 0.9rem; }
.legal-operator-smallprint {
  margin-block-start: var(--space-6);
  padding-block-start: var(--space-4);
  border-block-start: 1px solid var(--line-wood);
  color: var(--bronze-ink);
  font-size: clamp(0.78rem, 0.75rem + 0.15vw, 0.84rem);
  line-height: 1.6;
}
.legal-operator-smallprint p { margin-block: 0.55rem; }

.credits-ledger { display: grid; gap: var(--space-3); }
.credits-ledger > article { padding: var(--space-5); border-inline-start: 0.22rem solid var(--gold); background: var(--porcelain); }
.music-credit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(12rem, 0.4fr); gap: var(--space-5); align-items: center; }
.credits-logo-card {
  display: block;
  width: min(100%, 18rem);
  aspect-ratio: 16 / 9;
  justify-self: end;
  padding: 0;
  overflow: hidden;
  background: transparent;
  border: 1px solid rgb(240 180 28 / 28%);
  border-radius: 18px;
  box-shadow: 0 0.75rem 1.8rem rgb(38 18 12 / 16%);
}
.credits-logo-card picture { display: block; width: 100%; height: 100%; }
.credits-logo-card img { display: block; width: 100%; height: 100%; object-fit: cover; }

.credits-link { display: inline-flex; align-items: center; min-height: 44px; max-width: 100%; overflow-wrap: anywhere; }
.credits-thanks { padding-block: clamp(4rem, 9vw, 7rem); text-align: center; }
.credits-thanks h2 { color: var(--bronze-ink); font-size: clamp(2.25rem, 5vw, 4.25rem); line-height: 1; }
.credits-thanks__message { max-width: 38rem; margin: 1.5rem auto 0; font-size: clamp(1.08rem, 1rem + 0.35vw, 1.35rem); line-height: 1.55; }
.credits-thanks__copyright { margin-top: 2.25rem; font-weight: 800; }

.contact-card { display: grid; min-width: 0; grid-template-rows: auto 1fr auto; align-content: start; gap: var(--space-3); }
.contact-card p { margin: 0; }
.contact-address { display: inline-flex; align-items: center; min-width: 0; max-width: 100%; min-height: 44px; overflow-wrap: anywhere; word-break: break-word; font-weight: 800; }

/* Un-layered mobile overrides for the un-layered page blocks above
   (layered rules cannot beat them, so these live at the same precedence). */
@media (max-width: 52rem) {
  .launch-hero { grid-template-columns: 1fr; min-height: auto; }
  .launch-hero__emblem { grid-row: 1; }
  .launch-hero__emblem img { width: min(11rem, 44vw); }
  .launch-hero__copy .button-row { flex-direction: column; align-items: stretch; }
  .legal-layout,
  .music-credit { grid-template-columns: minmax(0, 1fr); }
  .credits-logo-card { justify-self: start; }
  .legal-toc { position: static; }
}

@media (max-width: 36rem) {
  .contact-address { width: 100%; }
}

/* Optional support line, the final item on the Credits page. Deliberately
   quieter than the credits above it: smaller type, muted colour and generous
   space so it reads as a footnote rather than a call to action. */
.support-hosting {
  padding-block: clamp(3.5rem, 8vw, 6rem) clamp(2.5rem, 6vw, 4rem);
  text-align: center;
}
.support-hosting__link {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  max-width: 100%;
  padding: 0.75rem 1.25rem;
  border-radius: 0.75rem;
  color: var(--ink-soft);
  text-decoration: none;
}
.support-hosting__mark { display: block; color: var(--bronze-ink); line-height: 0; }
.support-hosting__title { font-weight: 800; font-size: 1rem; letter-spacing: 0.01em; }
.support-hosting__url {
  max-width: 100%;
  font-size: 0.9rem;
  /* Long URL must never push the page sideways on a narrow screen. */
  overflow-wrap: anywhere;
  word-break: break-word;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.support-hosting__link:hover .support-hosting__url,
.support-hosting__link:focus-visible .support-hosting__url { color: var(--bronze-ink); }
.support-hosting__link:focus-visible {
  outline: 0.18rem solid var(--gold);
  outline-offset: 0.25rem;
}

/* ---------------------------------------------------------------------------
   Content pages restyled after the home page: a warm dark ground, cream text,
   gold display headings and thin gold hairlines. Replaces the light parchment
   cards and, deliberately, every coloured left-edge rule — accent colour now
   comes from the heading and the hairline, not a stripe down one side.

   Deliberately un-layered: the rules it supersedes live in @layer components,
   and un-layered rules outrank layered ones regardless of specificity.
--------------------------------------------------------------------------- */
.help-page,
.legal-page,
.credits-page,
.contact-page {
  --page-ink: #24150f;
  --page-cream: #f7ebd0;
  --page-gold: #e6a928;
  --page-gold-soft: #f3cf7a;
  --page-panel: rgb(29 17 12 / 78%);
  --page-hairline: rgb(230 169 40 / 24%);
  --page-muted: #d9c39a;
  color: var(--page-cream);
  background:
    radial-gradient(circle at 82% -6rem, rgb(230 169 40 / 20%), transparent 34rem),
    radial-gradient(circle at 6% 26rem, rgb(120 74 34 / 34%), transparent 40rem),
    var(--page-ink);
  background-attachment: fixed;
}

/* Type */
.help-page h1, .legal-page h1, .credits-page h1, .contact-page h1,
.help-page h2, .legal-page h2, .credits-page h2, .contact-page h2,
.help-page h3, .legal-page h3, .credits-page h3, .contact-page h3 { color: var(--page-gold-soft); }
.help-page .eyebrow, .legal-page .eyebrow, .credits-page .eyebrow, .contact-page .eyebrow { color: var(--page-gold); }
.help-page p, .legal-page p, .credits-page p, .contact-page p,
.help-page li, .legal-page li, .credits-page li, .contact-page li { color: var(--page-cream); }
.help-page .page-hero__lede, .legal-page .page-hero__lede,
.credits-page .page-hero__lede, .contact-page .page-hero__lede { color: var(--page-muted); }
.help-page a, .legal-page a, .credits-page a, .contact-page a { color: var(--page-gold); text-underline-offset: 0.2em; }
.help-page a:hover, .legal-page a:hover, .credits-page a:hover, .contact-page a:hover { color: var(--page-gold-soft); }
.help-page strong, .legal-page strong, .credits-page strong, .contact-page strong { color: var(--page-gold-soft); }

/* Panels: one shared treatment, no left-edge stripe anywhere. */
.help-page .paper-card, .legal-page .paper-card, .credits-page .paper-card, .contact-page .paper-card,
.help-page .faq-item, .legal-page .faq-item,
.help-page .legal-toc, .legal-page .legal-toc, .credits-page .legal-toc,
.credits-page .credits-ledger > article,
.contact-page .contact-card,
.help-page .alert, .legal-page .alert, .credits-page .alert, .contact-page .alert {
  border: 1px solid var(--page-hairline);
  border-inline-start: 1px solid var(--page-hairline);
  border-left: 1px solid var(--page-hairline);
  border-radius: var(--radius-md);
  background: var(--page-panel);
  color: var(--page-cream);
  box-shadow: 0 0.6rem 1.6rem rgb(0 0 0 / 28%);
}
.help-page .paper-card--dark, .legal-page .paper-card--dark,
.credits-page .paper-card--dark, .contact-page .paper-card--dark { background: rgb(20 12 8 / 82%); }

/* Callouts keep their meaning through the heading colour, not a stripe. */
.help-page .alert, .legal-page .alert, .credits-page .alert, .contact-page .alert { padding: 1.1rem 1.3rem; }
.help-page .alert b, .legal-page .alert b, .credits-page .alert b, .contact-page .alert b { color: var(--page-gold-soft); }
.legal-page .alert--warning, .help-page .alert--warning { border-color: rgb(226 184 76 / 45%); }
.legal-page .alert--danger, .help-page .alert--danger { border-color: rgb(230 83 83 / 45%); }

/* Status chips: colour moves to the dot, the stripe goes. */
.help-page .status-chip, .legal-page .status-chip, .contact-page .status-chip {
  border: 1px solid var(--page-hairline);
  border-left-width: 1px;
  background: rgb(29 17 12 / 70%);
  color: var(--page-cream);
}

/* FAQ */
.help-page .faq-item summary { color: var(--page-cream); }
.help-page .faq-item summary small { color: var(--page-gold); }
.help-page .faq-item[open] { border-color: rgb(230 169 40 / 42%); }
.help-page .faq-search { color: var(--page-cream); }
.help-page .faq-search input {
  border: 1px solid var(--page-hairline);
  border-radius: var(--radius-sm);
  background: rgb(14 8 5 / 70%);
  color: var(--page-cream);
}
.help-page .faq-search input::placeholder { color: rgb(217 195 154 / 75%); }
.help-page .faq-search input:focus-visible { outline: 0.16rem solid var(--page-gold); outline-offset: 0.15rem; }

/* Legal structure */
.legal-page .legal-section, .credits-page .legal-section { border-block-end: 1px solid var(--page-hairline); }
.legal-page .back-to-top, .credits-page .back-to-top { color: var(--page-gold); }

/* Credits */
.credits-page .credits-thanks h2 { color: var(--page-gold-soft); }
.credits-page .credits-thanks__copyright { color: var(--page-muted); }
.credits-page .credits-logo-card { border: 1px solid var(--page-hairline); border-radius: var(--radius-md); }
.credits-page .support-hosting__link { color: var(--page-muted); }
.credits-page .support-hosting__mark { color: var(--page-gold); }
.credits-page .support-hosting__link:hover .support-hosting__url,
.credits-page .support-hosting__link:focus-visible .support-hosting__url { color: var(--page-gold-soft); }

/* Contact */
.contact-page .contact-address { color: var(--page-gold); }

/* Section rules and hero art sit on the dark ground. */
.help-page .section-heading, .legal-page .section-heading,
.credits-page .section-heading, .contact-page .section-heading { color: var(--page-cream); }
.help-page .page-hero, .legal-page .page-hero, .credits-page .page-hero, .contact-page .page-hero { color: var(--page-cream); }

@media (forced-colors: active) {
  .help-page .paper-card, .legal-page .paper-card, .credits-page .paper-card, .contact-page .paper-card,
  .help-page .faq-item, .legal-page .legal-toc, .contact-page .contact-card { border: 1px solid CanvasText; }
}

/* Community total: the digits span the page rather than being abbreviated, so
   a single grain landing is still visible in the last place. Size is derived
   from how many characters there are (set by launch-community.js) instead of a
   fixed clamp, so the figure keeps filling the width as the number grows.
   The 1.72 factor is the usable width per character for this display face. */
.community-act__total {
  --chars: 18;
  width: 100%;
  margin: 0;
  color: #fff4cf;
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 0.95;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-size: clamp(1.6rem, calc(1.29 * 94vw / var(--chars)), 8.25rem);
  text-shadow: 0 0.06em 0.5em rgb(0 0 0 / 35%);
}
/* Before the real total arrives the placeholder is prose, not digits. */
.community-act__total:not(.community-act__total--measured) {
  white-space: normal;
  font-size: clamp(1.5rem, 4vw, 2.6rem);
}
/* Keeps the spirit clear of the figure as the digits grow. */
.community-act__intro { margin-bottom: clamp(0.5rem, 2vw, 1.5rem); }

/* Optional support line, the last item in every footer. Quieter than the
   footer navigation above it, centred, and never a call to action. */
.footer-support {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  max-width: 100%;
  margin-top: 1.25rem;
  padding: 0.6rem 1rem;
  border-radius: 0.6rem;
  color: inherit;
  opacity: 0.82;
  text-align: center;
  text-decoration: none;
}
.footer-support:hover, .footer-support:focus-visible { opacity: 1; }
.footer-support__mark { display: block; line-height: 0; }
.footer-support__title { font-size: 0.86rem; font-weight: 800; }
.footer-support__url {
  max-width: 100%;
  font-size: 0.8rem;
  /* Never let the URL push a narrow screen sideways. */
  overflow-wrap: anywhere;
  word-break: break-word;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.footer-support:focus-visible { outline: 0.16rem solid var(--gold); outline-offset: 0.2rem; }
/* Credits already ends with the fuller version, so the footer copy is
   redundant there. */
.credits-page .footer-support { display: none; }

/* The "On this page" list is a sticky sidebar only when it genuinely sits
   beside the text. Once the layout stacks it becomes a full-width block, and
   sticking would drag it down the page over the content. Short viewports
   (landscape phones) are excluded too: a sticky list taller than the screen
   would occupy most of it. Un-layered so it also beats the base sticky rule. */
@media (max-width: 52rem), (max-height: 34rem) {
  .legal-toc { position: static; top: auto; }
}

@layer layout {
  main {
    width: min(calc(100% - 2rem), var(--content));
    margin-inline: auto;
  }

  .section { padding-block: clamp(3.2rem, 7vw, 6rem); }
  .section-title { margin-top: 2.5rem; text-align: center; }
  h1.section-title { margin-top: 0; }
  .section-heading { max-width: 46rem; margin-bottom: 2rem; }
  .section-heading > p:last-child { margin-top: 0.8rem; color: var(--ink-soft); }

  /* ---------- Home hero (Stage C will restructure; readable on the light field now) ---------- */
  .hero {
    display: grid;
    min-height: min(44rem, calc(100svh - 5.5rem));
    grid-template-columns: 1.15fr 0.85fr;
    align-items: center;
    gap: clamp(2rem, 7vw, 7rem);
    padding-block: clamp(3.5rem, 8vw, 7rem);
  }
  .hero__lede { max-width: 42rem; margin-top: 1.25rem; color: var(--ink-soft); font-size: clamp(1.08rem, 2vw, 1.3rem); }
  .hero__actions { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 2rem; }
  .hero__mark { position: relative; justify-self: center; }
  .hero__mark img { width: min(25rem, 42vw); filter: drop-shadow(0 1.6rem 1.6rem rgb(84 60 36 / 30%)); }
  .grain-trail {
    position: absolute;
    z-index: 2;
    width: 1rem;
    height: 1.8rem;
    background: linear-gradient(135deg, #fff8df, #d8b573);
    border-radius: 85% 35%;
    box-shadow: 0 0 1rem rgb(240 180 28 / 45%);
    transform: rotate(28deg);
  }
  .grain-trail--one { top: -2rem; left: 50%; }
  .grain-trail--two { top: 0.5rem; left: 39%; scale: 0.72; }
  .grain-trail--three { top: 2.4rem; left: 57%; scale: 0.52; }

  .page-hero {
    display: grid;
    min-height: 24rem;
    grid-template-columns: 1fr minmax(12rem, 0.35fr);
    align-items: center;
    gap: clamp(2rem, 7vw, 6rem);
    padding-block: clamp(3rem, 7vw, 6rem);
  }
  .page-hero__lede { max-width: 45rem; margin-top: 1rem; color: var(--ink-soft); font-size: 1.15rem; }
  .page-hero__art { justify-self: center; }
  .page-hero__art .icon-art { display: block; width: min(15rem, 30vw); }
  .page-hero__art img { width: 100%; height: auto; filter: drop-shadow(0 1rem 1.2rem rgb(84 60 36 / 30%)); }

  .content-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-block: 1.5rem; }
  .compact-reading { max-width: 58rem; margin-inline: auto; }

  /* ---------- Full-bleed painted scene band ---------- */
  .scene-band {
    position: relative;
    isolation: isolate;
    margin-inline: calc(50% - 50vw);
    padding: clamp(3rem, 7vw, 6.5rem) max(5vw, calc((100vw - 76rem) / 2));
    overflow: hidden;
  }
  .scene-band__art { position: absolute; inset: 0; z-index: -2; }
  .scene-band__art img { width: 100%; height: 100%; object-fit: cover; }
  /* Sunlight veil: art stays visible, copy stays readable, edges melt into the paper field. */
  .scene-band__veil {
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
      linear-gradient(180deg, var(--cream) 0%, rgb(253 249 231 / 0%) 12%, rgb(253 249 231 / 0%) 88%, var(--cream) 100%),
      linear-gradient(100deg, rgb(253 246 221 / 88%) 0%, rgb(253 246 221 / 72%) 30%, rgb(253 246 221 / 14%) 60%, rgb(253 246 221 / 4%) 100%);
  }
  .scene-band--dusk .scene-band__veil {
    background:
      linear-gradient(180deg, var(--cream) 0%, rgb(43 28 20 / 0%) 20%, rgb(43 28 20 / 0%) 80%, var(--cream) 100%),
      linear-gradient(100deg, rgb(43 28 20 / 88%) 0%, rgb(43 28 20 / 66%) 40%, rgb(43 28 20 / 22%) 100%);
  }


  /* ---------- Coming soon: launch hero ---------- */
  .launch-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(13rem, 0.9fr);
    gap: clamp(2rem, 6vw, 6rem);
    align-items: center;
    min-height: min(36rem, 72svh);
    color: var(--text-on-wood);
  }
  .launch-hero__copy h1 { color: var(--cream); }
  .launch-hero__copy > p { max-width: 32rem; margin-top: 1.2rem; font-size: clamp(1.1rem, 2vw, 1.3rem); }
  .launch-hero__copy .button-row { justify-content: flex-start; margin-top: 2rem; }
  .launch-hero__emblem { justify-self: center; }
  .launch-hero__emblem img { width: min(21rem, 32vw); filter: drop-shadow(0 1.4rem 1.4rem rgb(0 0 0 / 45%)); }
  .launch-links { margin-top: 2.5rem; }
  .launch-links .button-row { justify-content: center; }


  /* ---------- Legacy footer helpers ---------- */
  .site-footer nav ul { flex-wrap: wrap; }

  @media (max-width: 62rem) {
  }

  @media (max-width: 52rem) {
    .site-header__inner { gap: 0.7rem; }
    .brand { margin-inline-end: auto; }
    .hero { grid-template-columns: 1fr; min-height: auto; }
    .hero__mark { grid-row: 1; }
    .hero__mark img { width: min(17rem, 70vw); }
    .content-grid { grid-template-columns: 1fr; }
    .page-hero { grid-template-columns: 1fr; min-height: auto; }
    .page-hero__copy { grid-row: 2; }
    .page-hero__art { grid-row: 1; }
    .page-hero__art .icon-art { width: min(12rem, 58vw); }
    .site-footer__inner { grid-template-columns: 1fr; align-items: flex-start; }
    .site-footer nav ul { justify-content: flex-start; }
    .legal-layout { grid-template-columns: 1fr; }
    .legal-toc { position: static; }
    .music-credit { grid-template-columns: 1fr; }
  }

  @media (max-width: 36rem) {
    .site-header__inner { padding-block: 0.6rem; }
    .site-footer nav ul { display: grid; grid-template-columns: 1fr; }
    .hero__actions, .button-row { align-items: stretch; flex-direction: column; }
    .ornate-button, .quiet-button { width: 100%; }
    .alert { grid-template-columns: 1fr; gap: 0.2rem; }
    .ornate-panel { padding: 3.5rem 2rem; }
    .faq-search { grid-template-columns: 2.6rem 1fr; }
    .faq-search input, .faq-search p { grid-column: 1 / -1; }
  }
}

@layer layout {
  .not-found-page { min-height: 100svh; }
  .not-found-content {
    display: grid;
    min-height: calc(100svh - 4.6rem);
    place-content: center;
    justify-items: center;
    gap: 1rem;
    padding: 2rem;
    text-align: center;
  }
  .not-found-content h1 { margin: 0; }

  .launch-page { overflow-x: clip; }
  .launch-page .launch-header { position: fixed; inset: 0 0 auto; z-index: 80; }
  .launch-page .launch-header .site-header__inner { width: min(calc(100% - 3rem), 86rem); min-height: 4.5rem; }
  .launch-page .launch-header .brand { margin-inline-end: auto; }
  .launch-page main { width: 100%; max-width: none; }

  .launch-page .launch-hero {
    position: relative;
    display: grid;
    overflow: clip;
    min-height: 100svh;
    grid-template-columns: minmax(0, 0.88fr) minmax(28rem, 1.12fr);
    align-items: center;
    gap: 2rem;
    padding: clamp(7rem, 13vh, 9.5rem) max(5vw, calc((100vw - 86rem) / 2)) 7rem;
    isolation: isolate;
  }
  .launch-hero__scene,
  .launch-hero__light { position: absolute; inset: 0; z-index: -2; }
  .launch-hero__light { z-index: -1; }
  .launch-hero__copy { position: relative; z-index: 3; max-width: 44rem; }
  .bowl-theatre { position: relative; min-height: min(66vw, 43rem); align-self: end; }
  .bowl-theatre__position { position: absolute; right: 15%; bottom: 13%; z-index: 2; width: min(30vw, 25rem); transform: translateX(-33px); }
  .bowl-theatre__bowl { width: 100%; height: auto; }
  .launch-hero__paper-edge {
    position: absolute;
    inset: auto 0 -1px;
    height: clamp(3.8rem, 7vw, 7rem);
    background: var(--launch-paper);
    clip-path: polygon(0 58%, 18% 34%, 39% 67%, 63% 22%, 82% 54%, 100% 31%, 100% 100%, 0 100%);
  }

  .growth-story { padding: clamp(5rem, 9vw, 9rem) max(4vw, calc((100vw - 86rem) / 2)); }
  .growth-story__intro { max-width: 62rem; margin: 0 auto clamp(3rem, 7vw, 6rem); }
  .growth-story__sticky { display: grid; grid-template-columns: minmax(16rem, 0.6fr) minmax(32rem, 1.4fr); gap: clamp(2rem, 6vw, 6rem); }
  .growth-story__steps { display: grid; align-content: start; }
  .growth-step { display: grid; min-height: 78vh; align-content: center; padding: 2rem 1rem 2rem 0; }
  .progress-stage { position: sticky; top: 6.2rem; height: calc(100vh - 8.2rem); min-height: 34rem; }
  .progress-stage__background { position: absolute; inset: 0; }

  .community-act {
    position: relative;
    display: grid;
    min-height: 82svh;
    align-content: center;
    /* Single column: the spirit and headline pair above, and the running
       total spans the full width beneath so individual grains stay legible
       however large the number grows. */
    grid-template-columns: 1fr;
    gap: clamp(2rem, 5vw, 4rem);
    padding: clamp(5rem, 9vw, 9rem) max(3vw, 1rem);
    overflow: hidden;
  }
  .community-act__intro {
    display: grid;
    grid-template-columns: minmax(12rem, 0.4fr) minmax(20rem, 1fr);
    align-items: center;
    gap: clamp(1.5rem, 5vw, 5rem);
    width: min(100%, 76rem);
    margin-inline: auto;
  }
  .community-act__figure { width: 100%; text-align: center; }
  .community-act__spirit { width: min(24vw, 18rem); height: auto; justify-self: end; transform: rotate(-5deg); }
  .community-act__copy { max-width: 48rem; }
  .community-act__copy .rice-button { margin-top: 1rem; }

  .final-act {
    display: grid;
    min-height: 70svh;
    grid-template-columns: minmax(15rem, 0.55fr) minmax(25rem, 1fr);
    align-items: center;
    gap: clamp(2rem, 7vw, 7rem);
    padding: clamp(4rem, 8vw, 8rem) max(5vw, calc((100vw - 70rem) / 2));
  }
  .final-act__logo { width: min(31vw, 24rem); height: auto; justify-self: end; }
  .final-act .rice-button { margin-top: 1rem; }

  .launch-page .launch-footer .site-footer__inner { width: min(calc(100% - 3rem), 86rem); grid-template-columns: 1fr auto auto; }
  .launch-page .launch-footer nav ul { gap: 1rem; }

  .game-layer {
    position: fixed;
    top: var(--game-viewport-center-y, 50dvh);
    left: var(--game-viewport-center-x, 50dvw);
    z-index: 200;
    display: grid;
    width: var(--game-viewport-width, 100dvw);
    height: var(--game-viewport-height, 100dvh);
    max-width: none;
    max-height: none;
    place-items: center;
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: none;
    transform: translate(-50%, -50%);
  }
  .game-layer__back {
    position: absolute;
    bottom: max(0.75rem, env(safe-area-inset-bottom));
    left: max(0.75rem, env(safe-area-inset-left));
    z-index: 4;
  }
  .game-loader { position: relative; z-index: 2; display: grid; place-items: center; width: min(42rem, calc(100% - 2rem)); }
  .game-loader__logo { width: min(13rem, 42vw); height: auto; }
  .game-layer canvas { position: absolute; inset: 0; }
  .mobile-orientation-warning {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: grid;
    width: 100%;
    height: 100dvh;
    place-items: center;
    padding:
      max(env(safe-area-inset-top), 0px)
      max(env(safe-area-inset-right), 0px)
      max(env(safe-area-inset-bottom), 0px)
      max(env(safe-area-inset-left), 0px);
    overflow: hidden;
    overscroll-behavior: none;
    background: #f9dda0;
    touch-action: none;
  }
  .mobile-orientation-warning[hidden] { display: none; }
  .mobile-orientation-warning img { width: 100%; height: 100%; object-fit: contain; }
  .game-layer--orientation-blocked .game-loader,
  .game-layer--orientation-blocked canvas { pointer-events: none; }
  html.game-is-open,
  body.game-is-open {
    width: 100%;
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
  }
  body.mobile-orientation-is-active { overflow: hidden; overscroll-behavior: none; }

  @media (max-width: 62rem) {
    .launch-page .launch-hero { grid-template-columns: minmax(0, 0.9fr) minmax(23rem, 1.1fr); }
    .growth-story__sticky { grid-template-columns: minmax(13rem, 0.55fr) minmax(26rem, 1.45fr); gap: 2rem; }
    .progress-stage { min-height: 31rem; }
  }

  @media (min-width: 50.01rem) and (max-height: 56.25rem) {
    .launch-page .launch-hero { padding-top: 5.7rem; padding-bottom: 3rem; }
    .launch-hero__logo { width: 5rem; margin-bottom: 0.5rem; }
    .launch-hero__copy h1 { font-size: clamp(3.05rem, 5.7vw, 4.8rem); }
    .launch-actions { margin-top: 1rem; }
    .bowl-theatre { min-height: calc(100svh - 5.7rem); }
  }

  @media (max-width: 50rem) {
    .game-layer__back {
      min-height: 2.25rem;
      padding: 0.45rem 0.7rem;
      font-size: 0.8rem;
    }
    .launch-page .launch-header {
      transition: transform 180ms ease;
      will-change: transform;
    }
    .launch-page .launch-header.is-scroll-hidden {
      transform: translateY(calc(-100% - env(safe-area-inset-top)));
      pointer-events: none;
    }
    .launch-page .launch-header:focus-within {
      transform: translateY(0);
      pointer-events: auto;
    }
    .launch-page .launch-header .site-header__inner { width: min(calc(100% - 1.25rem), 86rem); gap: 0.65rem; }
    .launch-page .launch-header .brand { order: 1; }
    .launch-nav-play { min-width: 5rem; order: 3; }

    .launch-page .launch-hero { min-height: 100svh; grid-template-columns: 1fr; align-content: start; gap: 0; padding: 5.65rem 1rem 3.75rem; }
    .launch-hero__light { background: linear-gradient(180deg, rgb(23 12 8 / 76%) 0%, rgb(23 12 8 / 34%) 49%, rgb(23 12 8 / 68%) 100%); }
    .launch-hero__copy { margin-inline-start: 0; text-align: center; --hero-copy-scrim: linear-gradient(180deg, rgb(25 12 7 / 78%) 0%, rgb(25 12 7 / 52%) 72%, transparent 100%); }
    .launch-hero__logo { width: 4.6rem; margin: 0 auto 0.4rem; }
    .launch-hero__copy h1 { font-size: clamp(2.75rem, 12vw, 3.85rem); }
    .launch-hero__copy > p:not(.launch-kicker) { margin-inline: auto; }
    .launch-actions { justify-content: center; gap: 0.65rem; margin-top: 1rem; }
    .launch-actions .rice-button { min-height: 3rem; padding: 0.62rem 0.9rem; font-size: 0.9rem; }
    .bowl-theatre { min-height: 35svh; margin-top: clamp(1.5rem, 5vw, 2rem); }
    .bowl-theatre__position { right: 21%; bottom: 7%; width: 58%; }

    .growth-story { padding: 5rem 1.2rem; }
    .growth-story__intro { margin-bottom: 2rem; }
    .growth-story__sticky { display: block; }
    .growth-story__steps { gap: 1.25rem; }
    .progress-stage { display: none; }
    .growth-step {
      position: relative;
      width: 94%;
      justify-self: start;
      min-height: 0;
      align-content: start;
      overflow: visible;
      padding: 0 0 1.25rem;
      color: var(--text-on-light);
      opacity: 1;
    }
    .growth-step__art { display: block; width: 100%; aspect-ratio: 16 / 9; margin-bottom: 1.25rem; overflow: hidden; border-radius: 1rem 1rem 3.2rem 1rem; box-shadow: 0 1rem 2.5rem rgb(66 38 22 / 22%); }
    .growth-step__art img { display: block; width: 100%; height: 100%; object-fit: cover; }
    .growth-step.is-active { transform: none; }
    .growth-step h3 { color: var(--launch-wood); }
    .growth-step > p:last-child { color: var(--text-on-light-muted); }
    .community-act { min-height: auto; grid-template-columns: 1fr; gap: 1.5rem; padding: 5rem 0.8rem; text-align: center; }
    .community-act__intro { grid-template-columns: 1fr; gap: 0.5rem; }
    .community-act__spirit { width: min(12rem, 45vw); justify-self: center; margin-bottom: -1rem; }
    .community-act__copy > p:not(.launch-kicker, .community-act__label, .community-act__total) { margin-inline: auto; }
    .community-act__total { overflow-wrap: anywhere; }

    .final-act { min-height: auto; grid-template-columns: 1fr; gap: 0; padding: 4.5rem 1.2rem; text-align: center; }
    .final-act__logo { width: min(14rem, 55vw); justify-self: center; }
    .launch-page .launch-footer .site-footer__inner { width: min(calc(100% - 2rem), 86rem); grid-template-columns: 1fr; }
    .launch-page .launch-footer nav ul { display: flex; flex-wrap: wrap; }
  }

  @media (max-width: 50rem) and (prefers-reduced-motion: reduce) {
    .launch-page .launch-header { transition: none; }
  }

  @media (min-width: 36.01rem) and (max-width: 50rem) {
    .bowl-theatre { margin-top: clamp(9rem, 27vw, 13rem); }
  }

  @media (max-height: 48rem) {
    .game-loader__logo { width: min(8rem, 32vw); }
    .game-loader__bowl { width: min(11rem, 42vw); margin: -1.6rem auto -1rem; }
    .game-loader__message { margin-block: 0.35rem; }
  }

  @media (max-width: 24rem) {
    .launch-actions { display: grid; }
    .launch-actions .rice-button { width: 100%; }
  }
}

@layer utilities {
  [hidden] { display: none !important; }

  .visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    clip-path: inset(50%);
    overflow: hidden;
    white-space: nowrap;
    border: 0;
  }

  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
      scroll-behavior: auto !important;
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
    }
    /* Settle/pop entrances never hide content under reduced motion. */
    html.js [data-settle] { opacity: 1 !important; translate: none !important; scale: none !important; }
    .drift-grain { animation: none !important; }
  }

  @media (forced-colors: active) {
    body::before, .ornate-panel::before, .hero__mark, .icon-art, .drift-grain, .rice-divider, .scene-band__art, .scene-band__veil { display: none; }
    .paper-card, .paper-card--dark, .porcelain-panel {
      color: CanvasText;
      background: Canvas;
      border: 2px solid CanvasText;
      box-shadow: none;
    }
    .ornate-button, .quiet-button, .status-chip, .secondary-home-button { color: ButtonText; background: ButtonFace; border: 2px solid ButtonText; }
    .site-header, .site-footer { border-color: CanvasText; }
  }
}

@media (prefers-reduced-motion: reduce) {
  .launch-page *,
  .launch-page *::before,
  .launch-page *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .launch-page .growth-step { opacity: 1; transform: none; }
  .launch-page .progress-stage__background { transition: none; }
}

@media (forced-colors: active) {
  .launch-page .launch-hero__scene,
  .launch-page .bowl-theatre,
  .launch-page .progress-stage,
  .launch-page .community-act__spirit,
  .launch-page .final-act__logo,
  .launch-page .game-loader__bowl { display: none; }
  .launch-page .launch-hero,
  .launch-page .community-act,
  .launch-page .final-act,
  .launch-page .game-layer { color: CanvasText; background: Canvas; }
  .launch-page .rice-button,
  .launch-page .launch-nav-play,
  .launch-page .game-layer__back { color: ButtonText; background: ButtonFace; border: 2px solid ButtonText; box-shadow: none; }
}

@media print {
  .site-header,
  .site-footer,
  .page-hero__art,
  .legal-toc,
  .back-to-top { display: none !important; }

  body,
  .legal-page { background: white !important; color: black !important; }
  body::before { display: none; }
  main { width: 100%; max-width: none; }
  .page-hero { min-height: 0; padding-block: 1rem; }
  .legal-layout { display: block; padding: 0; }
  .legal-copy { max-width: none; }
  a { color: black !important; text-decoration: underline; }
  .legal-section { break-inside: avoid; }
}
