/* UNDERSTUDY — shell stylesheet (JOB shell, 2026-11-14).
   Source of truth: mockup/v1/DESIGN.md (§0 frame, §2 fonts, §3 colours, §3b atmosphere, §4 materials, §4b border table, §5 chrome, §10 motion).
   SCALE (LUAT 50): 1 design px at 1920 = var(--u). Everything that has a size uses var(--u), so 1280–2560 keeps the mockup proportions.
   BORDERS (LUAT 56): every border/outline of the site lives in THIS file, as --rule-* tokens + .rule-* classes. Routes use the classes only. */

/* ---------- 1. tokens ---------- */
:root {
  --u: calc(100vw / 1920);

  /* colours — DESIGN §3 */
  --paper: #750F3C;            /* page ground (LOCKED) */
  --ground-deep: #560122;
  --velvet-lo: #6B0A35;
  --velvet-mid: #8F1348;
  --velvet-hi: #A41E54;
  --velvet-glow: #C92B71;
  --vignette: #2A0012;
  --surface: #FDE4BA;          /* cream paper panels */
  --surface-hi: #FFF1D4;       /* nav, chips, light buttons */
  --surface-container: #1E2A30;/* black box: footer, ticket, slate */
  --slate: #283035;
  --ink: #28121F;
  --ink-soft: #5A2A3E;
  --ink-wine: #6F1036;
  --cream-ink: #FFF1D4;
  --rule-paper-c: #D7899A;
  --primary: #13E7A2;
  --primary-hi: #5AFAB7;
  --primary-lip: #0BB37C;
  --primary-ink: #0F2E24;
  --secondary: #FD479C;
  --secondary-soft: #FAC5DC;
  --holds: #F6A53A;
  --disabled: #BDB5B8;
  --spot: #FFE6A8;
  --spot-warm: #FFC66B;
  --nav-divider: #E59BBE;

  /* fonts — DESIGN §2 */
  --f-display: 'Fredoka', 'Nunito', system-ui, sans-serif;
  --f-label: 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif;
  --f-body: 'IBM Plex Sans', system-ui, sans-serif;
  --f-mono: 'IBM Plex Mono', ui-monospace, monospace;

  /* type scale @1920 (never below 12 px) — DESIGN §2 + USER_FIXES type overrides */
  --t-hero: calc(58 * var(--u));
  --t-hero-sub: max(13px, calc(20 * var(--u)));
  --t-section: calc(48 * var(--u));          /* home section / panel titles */
  --t-title: calc(40 * var(--u));            /* inner-route panel titles (USER_FIXES ≤40) */
  --t-countdown: calc(96 * var(--u));        /* only oversized element allowed (#/curtain) */
  --t-number: max(13px, calc(24 * var(--u)));
  --t-body: max(12px, calc(16 * var(--u)));
  --t-cell: max(12px, calc(15 * var(--u)));
  --t-label: max(12px, calc(16 * var(--u)));
  --t-small: max(12px, calc(13 * var(--u)));
  --t-nav: max(12px, calc(15 * var(--u)));

  /* materials — DESIGN §4 */
  --r-panel: calc(16 * var(--u));
  --r-panel-lg: calc(18 * var(--u));
  --r-chip: 999px;
  --r-ctl: calc(12 * var(--u));
  --r-field: calc(8 * var(--u));
  --sh-paper: 0 calc(10 * var(--u)) 0 rgba(60, 0, 20, .35), 0 calc(18 * var(--u)) calc(32 * var(--u)) rgba(40, 0, 15, .45);
  --sh-dark: 0 calc(14 * var(--u)) calc(30 * var(--u)) rgba(0, 0, 0, .45);
  --g-paper: linear-gradient(180deg, #FFF1D4 0%, #FDE4BA 100%);
  --g-dark: linear-gradient(180deg, #283035 0%, #1E2A30 100%);
  --g-cue: linear-gradient(180deg, var(--primary-hi) 0%, var(--primary) 100%);

  /* page frame — DESIGN §0 (frame.json: full bleed, gutters 0, sidebar none; content bands inset 42 / 40 @1920) */
  --frame-gutter: 0px;
  --band-in-l: calc(42 * var(--u));
  --band-in-r: calc(40 * var(--u));
  --gap: calc(21 * var(--u));                /* panel gap (18 mockup px ×1.148) */
  --section-gap: calc(64 * var(--u));        /* 48–96 px band (LUAT 56) */
  --nav-h: calc(78 * var(--u));

  /* ---- BORDER TOKENS (BORDER_TABLE.md → DESIGN §4b). Hairlines never drop below 1 px. ---- */
  --rule-paper-panel: max(1px, calc(2 * var(--u))) solid #FFFFFD;
  --rule-paper-panel-strong: max(1px, calc(3.9 * var(--u))) solid #FDF1DD;
  --rule-callsheet: max(1px, calc(2.4 * var(--u))) solid #EFD5BE;
  --rule-playcard: max(1px, calc(2.3 * var(--u))) solid #D98897;
  --rule-ticket: max(1px, calc(1.8 * var(--u))) solid var(--secondary-soft);
  --rule-ticket-curtain: max(1px, calc(2.2 * var(--u))) solid #FFF0F0;
  --rule-row: max(1px, calc(1.5 * var(--u))) solid var(--rule-paper-c);
  --rule-row-strong: max(1px, calc(2 * var(--u))) solid var(--rule-paper-c);
  --rule-row-dark: max(1px, calc(1.5 * var(--u))) solid #5E566A;
  --rule-cork-row: max(1px, calc(1.5 * var(--u))) solid var(--rule-paper-c);
  --rule-nav-pill: max(1px, calc(2.2 * var(--u))) solid #551444;
  --rule-nav-cell: max(1px, calc(1 * var(--u))) solid var(--nav-divider);
  --rule-nav-bottom: max(1px, calc(2.2 * var(--u))) solid #790933;
  --rule-chip-radio: max(1px, calc(2.3 * var(--u))) solid #7F3747;
  --rule-segmented: max(1px, calc(2.2 * var(--u))) solid #73384C;
  --rule-summary-chip: max(1px, calc(2.2 * var(--u))) solid #7B8183;
  --rule-slate-strip: max(1px, calc(3 * var(--u))) solid #F880B6;
  --rule-slate-strip-soft: max(1px, calc(2.4 * var(--u))) solid #EC8BBB;
  --rule-input: max(1px, calc(2.3 * var(--u))) solid #F3538E;
  --rule-input-dark: max(1px, calc(2.3 * var(--u))) solid #F0DDDB;
  --rule-code-slate: max(1px, calc(2.3 * var(--u))) solid #F79CC4;
  --rule-slate-panel: max(1px, calc(2.3 * var(--u))) solid #FBB1D6;
  --rule-coming-soon: max(1px, calc(3 * var(--u))) solid #ED1977;
  --rule-play-row: max(1px, calc(2.2 * var(--u))) solid #D68FA8;
  --rule-panel-head: max(1px, calc(2.5 * var(--u))) solid #F2DFD6;
  --rule-wallet-panel: max(1px, calc(3.1 * var(--u))) solid #FBBED3;
  --rule-btn-outline-dark: max(1px, calc(3.3 * var(--u))) solid #FBA2C0;
  --rule-footer-top: max(1px, calc(2 * var(--u))) solid var(--nav-divider);
  --rule-focus: 2px solid var(--primary);

  /* motion — DESIGN §10 (one easing family: the fly-rail ease) */
  --ease-rail: cubic-bezier(.22, .9, .24, 1);
  --ease-drop: cubic-bezier(.3, 1.45, .5, 1);
  --d-quick: 180ms;
  --d-cue: 360ms;
  --d-scene: 600ms;
}

@media (max-width: 1023px) {
  :root {
    --u: 0.75px;
    --band-in-l: 16px;
    --band-in-r: 16px;
    --gap: 14px;
    --section-gap: 40px;
    --nav-h: 60px;
  }
}

/* ---------- 2. reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  overflow-x: hidden;
  font: 400 var(--t-body)/1.4 var(--f-body);
  font-variant-numeric: tabular-nums;
  color: var(--cream-ink);
  background-color: var(--paper);
  display: flex;
  flex-direction: column;
}
img, svg, video, canvas { display: block; max-width: 100%; }
h1, h2, h3, h4, p, ul, ol, figure, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
:where(button, input, select, textarea) { border: 0; font: inherit; color: inherit; background: none; }
:where(button) { cursor: pointer; padding: 0; }
:where(table) { border-collapse: collapse; }
:where(fieldset) { border: 0; margin: 0; padding: 0; min-width: 0; }
:focus { outline: none; }
:focus-visible { outline: var(--rule-focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 100; padding: 8px 14px; border-radius: 999px; background: var(--surface-hi); color: var(--ink); font-weight: 700; }
.skip:focus { top: 8px; }

/* ---------- 3. page atmosphere — DESIGN §3b (shared by every route) ---------- */
body::before {               /* vertical gradient + velvet folds + lit pool, scrolls with the page */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(ellipse calc(1400 * var(--u)) calc(700 * var(--u)) at 50% calc(720 * var(--u)), rgba(201, 43, 113, .45), rgba(201, 43, 113, 0) 70%),
    radial-gradient(ellipse calc(1300 * var(--u)) calc(650 * var(--u)) at 50% calc(1700 * var(--u)), rgba(201, 43, 113, .30), rgba(201, 43, 113, 0) 70%),
    repeating-linear-gradient(90deg,
      rgba(107, 10, 53, .60) 0, rgba(151, 19, 74, .55) calc(22 * var(--u)), rgba(164, 30, 84, .35) calc(34 * var(--u)),
      rgba(151, 19, 74, .55) calc(48 * var(--u)), rgba(107, 10, 53, .60) calc(70 * var(--u))),
    linear-gradient(180deg, var(--ground-deep) 0%, var(--paper) 30%, var(--velvet-mid) 100%);
}
body::after {                /* edge vignette + film grain, fixed to the viewport */
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 75% 70% at 50% 45%, rgba(42, 0, 18, 0) 55%, rgba(42, 0, 18, .55) 100%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .5 0'/></filter><rect width='160' height='160' filter='url(%23n)' opacity='.08'/></svg>");
}
body { position: relative; isolation: isolate; }
/* warm spotlight halo (cast, script) — routes opt in with data-route set by the router */
body[data-route="cast"] .page::before,
body[data-route="script"] .page::before {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: calc(600 * var(--u)); height: calc(600 * var(--u));
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(circle at 80% 15%, rgba(255, 198, 107, .25), rgba(255, 198, 107, 0) 65%);
}

/* ---------- 4. page frame — ONE container for every route (DESIGN §0) ---------- */
.page {
  position: relative;
  flex: 1 0 auto;
  width: 100%;
  padding: 0 var(--frame-gutter) var(--section-gap);
  min-height: calc(100vh - var(--nav-h));
  overflow-x: clip; /* the work-light beam (::after translateX 100%) must never widen the document */
}
.page > * { position: relative; z-index: 1; }
/* content band: the measured inset of the home panels (42 / 40 @1920). Full-bleed art bands simply do not use it. */
.band { padding-left: var(--band-in-l); padding-right: var(--band-in-r); }
.band + .band, .band + .bleed, .bleed + .band { margin-top: var(--section-gap); }
.bleed { margin-left: 0; margin-right: 0; }
.grid-3 { display: grid; grid-template-columns: 34fr 26fr 35fr; gap: var(--gap); }
.grid-2 { display: grid; grid-template-columns: 49fr 47fr; gap: var(--gap); }
.stack { display: flex; flex-direction: column; gap: var(--gap); }
@media (max-width: 1279px) and (min-width: 1024px) { .grid-3 { grid-template-columns: 1fr 1fr; } .grid-3 > :last-child { grid-column: 1 / -1; } }
@media (max-width: 1023px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

/* ---------- 5. nav N13 (chrome/nav.html, measured 68 → 78 @1920) ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  padding: 0 calc(18 * var(--u)) 0 calc(22 * var(--u));
  background: var(--surface-hi);
  color: var(--ink-wine);
  border-radius: 0 0 calc(14 * var(--u)) calc(14 * var(--u));
  box-shadow: 0 calc(9 * var(--u)) calc(28 * var(--u)) rgba(93, 21, 60, .33);
}
.brand {
  display: flex;
  align-items: center;
  gap: calc(12 * var(--u));
  min-width: calc(370 * var(--u));
  height: 100%;
}
.brand-mark { height: max(30px, calc(44 * var(--u))); width: auto; aspect-ratio: 2048 / 1226; object-fit: contain; }
.brand-word {
  font: 700 max(14px, calc(22 * var(--u)))/1 var(--f-display);
  letter-spacing: .03em;
  color: var(--ink-wine);
}
.nav-desktop { flex: 1; height: 100%; display: flex; align-items: center; }
.nav-desktop .route, .nav-desktop .social {
  height: calc(44 * var(--u));
  display: flex;
  align-items: center;
  padding: 0 calc(18 * var(--u));
  font: 700 var(--t-nav)/1 var(--f-label);
  letter-spacing: .01em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--ink-wine);
  transition: transform var(--d-quick) var(--ease-rail);
}
.nav-desktop .route { flex: 1.15 1 0; }
.nav-desktop .social { flex: .8 1 0; text-transform: none; }
.nav-desktop .route > span {
  display: inline-flex; align-items: center;
  height: calc(40 * var(--u));
  margin-left: calc(-12 * var(--u));
  padding: 0 calc(12 * var(--u));
  border-radius: var(--r-chip);
}
.nav-desktop .route.is-active > span {
  background: var(--g-cue);
  color: var(--primary-ink);
  box-shadow: 0 0 calc(12 * var(--u)) rgba(19, 231, 162, .3);
}
.nav-desktop .route:hover > span { transform: translateY(calc(-1 * var(--u))); }
.nav-end { display: flex; align-items: center; padding-left: calc(18 * var(--u)); }
.social.is-soon { cursor: default; opacity: .75; }
.menu-btn, .nav-mobile { display: none; }

/* cue button (mint pill) — DESIGN §5 CueButton */
.cue-btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: calc(46 * var(--u));
  padding: 0 calc(24 * var(--u));
  border-radius: var(--r-chip);
  background: var(--g-cue);
  color: var(--primary-ink);
  font: 700 max(13px, calc(16 * var(--u)))/1 var(--f-label);
  letter-spacing: .02em;
  white-space: nowrap;
  box-shadow: 0 calc(5 * var(--u)) 0 var(--primary-lip);
  transition: transform var(--d-quick) var(--ease-rail);
}
.cue-btn:hover { transform: translateY(calc(-2 * var(--u))); }
.cue-btn:active { transform: translateY(calc(3 * var(--u))); }
.cue-btn[disabled], .cue-btn.is-disabled { background: var(--disabled); color: #4A3F44; box-shadow: none; cursor: not-allowed; transform: none; }
.cue-btn--nav { height: calc(46 * var(--u)); padding: 0 calc(26 * var(--u)); font-size: max(12px, calc(15 * var(--u))); }
.cue-btn--big { height: calc(63 * var(--u)); padding: 0 calc(48 * var(--u)); font-size: max(16px, calc(34 * var(--u))); }
[data-launch-done].cue-btn, a[data-launch-done][data-launch="buy"] { background: var(--g-cue); color: var(--primary-ink); cursor: pointer; opacity: 1; }

/* ---------- 6. mobile nav (<1024): brand + Menu, ACT row scrolls with X/Telegram in the first screen; drawer ---------- */
@media (max-width: 1023px) {
  .nav { flex-wrap: wrap; height: auto; padding: 8px 14px 0; border-radius: 0 0 14px 14px; }
  .brand { min-width: 0; height: 48px; flex: 1; }
  .brand-mark { height: 36px; }
  .brand-word { font-size: 18px; }
  .nav-desktop { display: none; }
  .menu-btn {
    display: inline-flex; align-items: center; height: 40px; padding: 0 18px;
    border-radius: 999px; background: var(--g-cue); color: var(--primary-ink);
    font: 700 15px/1 var(--f-label); letter-spacing: .04em; text-transform: uppercase;
  }
  .nav-mobile {
    display: flex; width: 100%; gap: 6px; overflow-x: auto; padding: 8px 0 10px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .nav-mobile::-webkit-scrollbar { display: none; }
  .nav-mobile a {
    flex: 0 0 auto; height: 34px; display: inline-flex; align-items: center; padding: 0 12px;
    border-radius: 999px; background: rgba(117, 15, 60, .08);
    font: 700 14px/1 var(--f-label); white-space: nowrap; color: var(--ink-wine);
  }
  .nav-mobile a.is-active { background: var(--g-cue); color: var(--primary-ink); }
}
.drawer { position: fixed; inset: 0; z-index: 60; background: rgba(42, 0, 18, .6); }
.drawer-sheet {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(86vw, 340px);
  display: flex; flex-direction: column; gap: 18px; padding: 20px 20px 28px;
  background: var(--surface-hi); color: var(--ink-wine);
  box-shadow: -10px 0 30px rgba(0, 0, 0, .35);
  transform: translateX(0); transition: transform var(--d-cue) var(--ease-rail);
}
.drawer[data-state="closing"] .drawer-sheet, .drawer[data-state="opening"] .drawer-sheet { transform: translateX(100%); }
.drawer-close { align-self: flex-end; height: 36px; padding: 0 14px; border-radius: 999px; background: rgba(117, 15, 60, .1); font: 700 14px/1 var(--f-label); text-transform: uppercase; }
.drawer-links { display: flex; flex-direction: column; }
.drawer-links a { display: block; padding: 14px 4px; font: 700 22px/1 var(--f-label); }
.drawer-links a + a { border-top: var(--rule-row); }
.drawer-links a.is-active { color: #0B8F62; }
.drawer-socials { display: flex; gap: 18px; font: 700 18px/1 var(--f-label); }

/* ---------- 7. footer F10 (end credits, chrome/footer.html, 124 @1920) ---------- */
.footer {
  flex: 0 0 auto;
  min-height: calc(124 * var(--u));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: calc(20 * var(--u));
  padding: calc(24 * var(--u)) calc(36 * var(--u));
  background: var(--surface-container);
  color: var(--cream-ink);
  font: 400 max(12px, calc(13 * var(--u)))/1.3 var(--f-body);
  white-space: nowrap;
}
.footer-mark { height: max(36px, calc(48 * var(--u))); width: auto; aspect-ratio: 2048 / 1226; }
.footer .credit { font: 600 max(12px, calc(15 * var(--u)))/1.2 var(--f-label); letter-spacing: .01em; }
.footer .sep { display: block; width: max(1px, calc(1 * var(--u))); height: calc(32 * var(--u)); background: var(--nav-divider); }
.footer .social { font: 700 max(12px, calc(15 * var(--u)))/1 var(--f-label); color: var(--cream-ink); }
@media (max-width: 1023px) {
  .footer { flex-direction: column; gap: 10px; padding: 28px 16px; white-space: normal; text-align: center; }
  .footer .sep { display: none; }
  .footer .social { display: inline-block; }
}

/* ---------- 8. materials (DESIGN §4) — surfaces only, borders come from §9 classes ---------- */
.paper {
  position: relative;
  background: var(--g-paper);
  color: var(--ink);
  border-radius: var(--r-panel);
  box-shadow: var(--sh-paper);
}
.paper.is-notched {          /* ticket notches: half-circle bites at mid-height */
  -webkit-mask: radial-gradient(circle calc(12 * var(--u)) at 0 50%, transparent 98%, #000) left / 51% 100% no-repeat,
                radial-gradient(circle calc(12 * var(--u)) at 100% 50%, transparent 98%, #000) right / 51% 100% no-repeat;
          mask: radial-gradient(circle calc(12 * var(--u)) at 0 50%, transparent 98%, #000) left / 51% 100% no-repeat,
                radial-gradient(circle calc(12 * var(--u)) at 100% 50%, transparent 98%, #000) right / 51% 100% no-repeat;
}
.slate {
  position: relative;
  background: var(--g-dark);
  color: var(--cream-ink);
  border-radius: var(--r-panel);
  box-shadow: var(--sh-dark), inset 0 1px 0 rgba(255, 143, 196, .35);
}
.panel-pad { padding: calc(22 * var(--u)) calc(26 * var(--u)); }
.t-hero { font: 700 var(--t-hero)/1 var(--f-display); letter-spacing: .007em; }
.t-section { font: 700 var(--t-section)/1 var(--f-display); text-transform: uppercase; letter-spacing: .02em; }
.t-title { font: 700 var(--t-title)/1 var(--f-label); text-transform: uppercase; letter-spacing: -.006em; }
.t-label { font: 600 var(--t-label)/1.1 var(--f-label); text-transform: uppercase; letter-spacing: .02em; }
.t-number { font: 700 var(--t-number)/1.1 var(--f-body); letter-spacing: -.006em; font-variant-numeric: tabular-nums; }
.t-cell { font: 400 var(--t-cell)/1.35 var(--f-body); }
.t-small { font: 400 var(--t-small)/1.35 var(--f-body); }
.t-mono { font: 400 var(--t-cell)/1.5 var(--f-mono); }
.t-countdown { font: 700 var(--t-countdown)/.95 var(--f-label); letter-spacing: -.01em; }
.role-chip {
  display: inline-flex; align-items: center; height: calc(32 * var(--u)); padding: 0 calc(14 * var(--u));
  border-radius: var(--r-chip); background: var(--secondary); color: #2A0618;
  font: 700 max(12px, calc(16 * var(--u)))/1 var(--f-label); white-space: nowrap;
}
.role-chip.is-idle { background: var(--surface-hi); color: var(--ink-soft); }
.stamp {
  display: inline-block; padding: calc(4 * var(--u)) calc(14 * var(--u));
  border-radius: calc(8 * var(--u));
  font: 700 calc(30 * var(--u))/1 var(--f-label); letter-spacing: .03em; text-transform: uppercase;
  transform: rotate(-6deg);
  color: var(--secondary);
  box-shadow: inset 0 0 0 calc(3 * var(--u)) currentColor;
}
.stamp--holds { color: var(--holds); }
.stamp--mint { color: var(--primary); }
.read-at { font: 400 var(--t-small)/1.3 var(--f-body); opacity: .8; }

/* ---------- 9. BORDER CLASSES — one class per framed component of DESIGN §4b ---------- */
.rule-nav-bottom      { border-bottom: var(--rule-nav-bottom); }
.rule-nav-cell        { border-left: var(--rule-nav-cell); }
.rule-nav-pill        { border: var(--rule-nav-pill); border-radius: var(--r-chip); }
.rule-footer-top      { border-top: var(--rule-footer-top); }
.rule-paper-panel     { border: var(--rule-paper-panel); border-radius: var(--r-panel); }
.rule-paper-panel-strong { border: var(--rule-paper-panel-strong); border-radius: var(--r-panel); }
.rule-callsheet       { border: var(--rule-callsheet); border-radius: calc(10 * var(--u)); }
.rule-playcard        { border: var(--rule-playcard); border-radius: var(--r-panel); }
.rule-token-ticket    { border: var(--rule-ticket); border-radius: var(--r-panel); }
.rule-token-ticket--curtain { border: var(--rule-ticket-curtain); border-radius: var(--r-panel); }
.rule-row             { border-bottom: var(--rule-row); }
.rule-row-strong      { border-bottom: var(--rule-row-strong); }
.rule-row-top         { border-top: var(--rule-row); }
.rule-row-dark        { border-bottom: var(--rule-row-dark); }
.rule-cork-row        { border-bottom: var(--rule-cork-row); }
.rule-chip-radio      { border: var(--rule-chip-radio); border-radius: var(--r-ctl); }
.rule-segmented       { border: var(--rule-segmented); border-radius: var(--r-ctl); }
.rule-summary-chip    { border: var(--rule-summary-chip); border-radius: var(--r-ctl); }
.rule-slate-strip     { border: var(--rule-slate-strip); border-radius: var(--r-panel); }
.rule-slate-strip-soft{ border: var(--rule-slate-strip-soft); border-radius: var(--r-panel); }
.rule-input           { border: var(--rule-input); border-radius: var(--r-ctl); }
.rule-input-dark      { border: var(--rule-input-dark); border-radius: var(--r-field); }
.rule-code-slate      { border: var(--rule-code-slate); border-radius: var(--r-panel); }
.rule-slate-panel     { border: var(--rule-slate-panel); border-radius: var(--r-panel); }
.rule-coming-soon     { border: var(--rule-coming-soon); border-radius: var(--r-ctl); }
.rule-play-row        { border: var(--rule-play-row); border-radius: var(--r-ctl); }
.rule-panel-head      { border: var(--rule-panel-head); border-radius: var(--r-ctl); }
.rule-wallet-panel    { border: var(--rule-wallet-panel); border-radius: var(--r-panel-lg); }
.rule-btn-outline-dark{ border: var(--rule-btn-outline-dark); border-radius: var(--r-ctl); }
.rule-divider-v       { border-left: var(--rule-nav-cell); }
.rule-join-top        { border-top-width: 0; border-top-left-radius: 0; border-top-right-radius: 0; } /* adjacent strip: the box above draws the shared edge once */
.slate[class*="rule-"] { box-shadow: var(--sh-dark); } /* framed slates: no inset top glow stacked on the frame */
/* adjacent frames share ONE edge: in a stack, every frame after the first drops its top edge and squares the joint */
.rule-stack > [class*="rule-"] + [class*="rule-"] { border-top: 0; border-top-left-radius: 0; border-top-right-radius: 0; }
.rule-stack > [class*="rule-"]:not(:last-child) { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.rule-row-last-none > :last-child { border-bottom: 0; }
/* an input frame wraps the whole control: put the rule class on the wrapper, the control inside fills it */
.field { display: flex; align-items: center; gap: calc(10 * var(--u)); padding: 0 calc(14 * var(--u)); min-height: calc(53 * var(--u)); }
.field > input, .field > select, .field > textarea { flex: 1; min-width: 0; height: 100%; padding: calc(10 * var(--u)) 0; background: transparent; }
.field:focus-within { box-shadow: 0 0 0 2px var(--primary); }

/* ---------- 10. MOTION — DESIGN §10 (backstage: work-light cue + rubber stamp; fly-rail ease) ---------- */
/* route change = the house curtain drops and flies out again */
.curtain-wipe { position: fixed; inset: 0; z-index: 50; pointer-events: none; display: flex; }
.curtain-wipe i {
  flex: 1;
  background: repeating-linear-gradient(90deg, #6B0A35 0, #97134A calc(26 * var(--u)), #A41E54 calc(36 * var(--u)), #6B0A35 calc(64 * var(--u)));
  transform: scaleX(0);
  transition: transform var(--d-cue) var(--ease-rail);
}
.curtain-wipe i:first-child { transform-origin: left center; }
.curtain-wipe i:last-child { transform-origin: right center; }
html.is-swapping .curtain-wipe i { transform: scaleX(1); transition-duration: 220ms; }
main.is-leaving { opacity: .6; transition: opacity var(--d-quick) linear; }

/* reveal-on-scroll = a work light comes up on the piece: dim → lit, a warm beam sweeps across once */
[data-cue] { position: relative; }
.motion-on [data-cue]:not(.is-lit) { opacity: .28; }
[data-cue].is-lit { opacity: 1; transition: opacity var(--d-scene) var(--ease-rail); }
[data-cue].is-lit::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: linear-gradient(100deg, rgba(255, 198, 107, 0) 30%, rgba(255, 230, 168, .28) 50%, rgba(255, 198, 107, 0) 70%);
  transform: translateX(-100%); opacity: 0;
  animation: und-beam 900ms var(--ease-rail) 1;
}
@keyframes und-beam { 0% { transform: translateX(-100%); opacity: 1; } 100% { transform: translateX(100%); opacity: 0; } }

/* stamp lands: 1.2 → 1 with a thud */
.is-stamped { animation: und-stamp var(--d-cue) var(--ease-drop) 1 both; }
@keyframes und-stamp { 0% { transform: scale(1.25) rotate(-10deg); opacity: 0; } 60% { opacity: 1; } 100% { transform: scale(1) rotate(-6deg); opacity: 1; } }

/* live tick = a cue light blinks beside the number and it settles in from above */
.is-ticked { animation: und-tick var(--d-cue) var(--ease-rail) 1; }
@keyframes und-tick { 0% { transform: translateY(-.35em); opacity: .2; } 100% { transform: none; opacity: 1; } }
[data-cell].is-live::before {
  content: ""; display: inline-block; width: .42em; height: .42em; margin-right: .32em; vertical-align: .12em;
  border-radius: 50%; background: var(--primary); box-shadow: 0 0 .5em var(--primary);
  animation: und-cue-light 1.6s ease-in-out 2;
}
@keyframes und-cue-light { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

/* grow-in = the fly rail lowers a bar into place (scaleX from the left / scaleY from the bottom) */
[data-grow] { transform-origin: left center; }
[data-grow="y"] { transform-origin: center bottom; }
.motion-on [data-grow]:not(.is-grown) { transform: scaleX(0); }
.motion-on [data-grow="y"]:not(.is-grown) { transform: scaleY(0); }
[data-grow].is-grown { transform: none; transition: transform var(--d-scene) var(--ease-rail); }

/* hover = paper lifts off the board like a pinned sheet */
.lift { transition: transform var(--d-quick) var(--ease-rail); }
.lift:hover { transform: translateY(calc(-4 * var(--u))) rotate(-.3deg); }

/* spotlight breathe (hero halo) */
.spot-breathe { animation: und-breathe 4s ease-in-out infinite; transform-origin: 50% 0; }
@keyframes und-breathe { 0%, 100% { opacity: .82; transform: scale(1); } 50% { opacity: 1; transform: scale(1.03); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .motion-on [data-cue]:not(.is-lit), .motion-on [data-grow]:not(.is-grown) { opacity: 1; transform: none; }
  .curtain-wipe { display: none; }
}
