/* app.css — HAMPER shell (DESIGN.md §0–§5, §10). Build width 1920 = mockup 1:1 (×1.148 from the 1672 px PNG).
   SCALE: every size is calc(N * var(--u)); --u = 100vw/1920 from 1280 up (no max-width cap); one phone layout 360–1279.
   BORDERS: only the .rule-* classes below draw borders/outlines. Route files never write border/outline. */

/* ============ 0. TOKENS ============ */
:root {
  /* colour (DESIGN.md §3) */
  --paper: #073B24;          /* page ground — LOCKED */
  --chrome-hi: #2A523A;
  --chrome: #173826;
  --surface: #0E4B2C;
  --surface-lo: #0B3F25;
  --cream: #F5EEDF;
  --ink: #0E3827;
  --muted: #B7C8BA;
  --hairline: #3A6C52;
  --frame: #3B7A58;
  --frame-hi: #5FA47E;
  --frame-soft: rgb(59 122 88 / .6);
  --rule-cream-c: #B4B8A5;
  --mint: #2AC888;
  --mint-hi: #36F4A7;
  --amber: #F2B865;
  --amber-lo: #C2A152;
  --amber-hi: #E7CD6B;
  --down: #E0796B;
  --berry: #C9506A;
  --snow: #F5EEDF;

  /* type (DESIGN.md §2) */
  --f-display: "Source Serif 4", "Source Serif Pro", Georgia, serif;
  --f-ui: "Figtree", "Segoe UI", system-ui, sans-serif;
  --f-mono: "Roboto Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* scale unit — 1 design px at 1920 */
  --u: calc(100vw / 1920);

  /* frame (frame.json + USER_FIXES: gutters 57 / 52 @1920) */
  --gut-l: calc(57 * var(--u));
  --gut-r: calc(52 * var(--u));
  --chrome-pad: calc(56 * var(--u));

  /* rules (BORDER TABLE, DESIGN.md §4b) */
  --rule-hair: max(1px, calc(1 * var(--u)));
  --rule-frame: max(1px, calc(2 * var(--u)));
  --rule-strong: max(2px, calc(3 * var(--u)));
  --rule-c-hair: var(--hairline);
  --rule-c-frame: var(--frame);
  --rule-c-hi: var(--frame-hi);
  --rule-c-row: var(--frame-soft);
  --rule-c-cream: var(--rule-cream-c);
  --rule-c-sel: var(--mint);
  --rule-c-ghost: rgb(245 238 223 / .6);

  /* radii (DESIGN.md §4) */
  --r-panel: calc(16 * var(--u));
  --r-tile: calc(12 * var(--u));
  --r-card: calc(24 * var(--u));
  --r-btn: calc(12 * var(--u));
  --r-input: calc(10 * var(--u));
  --r-swatch: calc(14 * var(--u));
  --shadow-panel: 0 calc(12 * var(--u)) calc(40 * var(--u)) rgb(5 20 12 / .45);

  /* motion (DESIGN.md §10) — "the gift counter at night" */
  --ease-wrap: cubic-bezier(.22, .8, .24, 1);
  --ease-drop: cubic-bezier(.34, 1.36, .5, 1);
  --t-fast: 180ms;
  --t-base: 260ms;
  --t-slow: 600ms;
  --t-path: 900ms;
  --rt-dur: 220ms;
  --rt-nudge: 16px;

  /* native controls (vendor/native.css §6) */
  --native-accent: var(--mint);
  --native-scroll-thumb: #3B7A58;
  --native-scroll-track: #062F1D;
  color-scheme: dark;
}
html[data-rt-dir=back] { --rt-nudge: -16px; }

/* ============ 1. BASE ============ */
*, *::before, *::after { box-sizing: border-box; }
:where(button, input, select, textarea) { border: 0; font: inherit; color: inherit; background: none; }
:where(button) { cursor: pointer; padding: 0; }
:where(a) { color: inherit; text-decoration: none; }
:where(h1, h2, h3, h4, p, ul, ol, figure, dl, dd) { margin: 0; }
:where(ul, ol) { padding: 0; list-style: none; }
img, svg, video { display: block; max-width: 100%; }
html { background: var(--paper); accent-color: var(--mint); scrollbar-color: var(--native-scroll-thumb) var(--native-scroll-track); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; position: relative; min-height: 100vh; overflow-x: clip;
  background: transparent; color: var(--cream);   /* ground = html (paper) + .atm layers; body must not cover .atm */
  font: 400 max(12px, calc(16 * var(--u)))/1.45 var(--f-ui);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--mint); color: var(--ink); }
:focus-visible { outline: max(2px, calc(2 * var(--u))) solid var(--mint-hi); outline-offset: 3px; }
[hidden] { display: none !important; }

/* type roles — routes use these classes, never their own font sizes for these roles */
.t-hero { font: 500 calc(66 * var(--u))/1.05 var(--f-display); letter-spacing: -.011em; font-optical-sizing: auto; }
.t-title { font: 500 calc(54 * var(--u))/1.08 var(--f-display); letter-spacing: -.01em; }
.t-section { font: 500 calc(50 * var(--u))/1.1 var(--f-display); letter-spacing: -.01em; }
.t-big { font: 600 calc(56 * var(--u))/1 var(--f-display); font-variant-numeric: lining-nums tabular-nums; }
.t-eyebrow { font: 400 max(12px, calc(20 * var(--u)))/1.2 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; }
.t-label { font: 400 max(12px, calc(15 * var(--u)))/1.2 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.t-body { font: 400 max(12px, calc(17 * var(--u)))/1.45 var(--f-ui); }
.t-data { font: 400 max(12px, calc(16 * var(--u)))/1.3 var(--f-mono); font-variant-numeric: tabular-nums; }
.is-up { color: var(--mint); }
.is-down { color: var(--down); }
.muted { color: var(--muted); }
.mono-label { font: 500 max(12px, calc(13 * var(--u)))/1.2 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* buttons (DESIGN.md §5) */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: calc(8 * var(--u));
  min-height: calc(46 * var(--u)); padding: 0 calc(22 * var(--u)); border-radius: var(--r-btn);
  font: 600 max(13px, calc(16 * var(--u)))/1 var(--f-ui); white-space: nowrap;
  transition: background-color var(--t-fast) var(--ease-wrap), color var(--t-fast) var(--ease-wrap), transform var(--t-fast) var(--ease-wrap), box-shadow var(--t-base) var(--ease-wrap);
}
.btn--mint { background: var(--mint); color: var(--chrome); }
.btn--mint:hover { background: var(--mint-hi); box-shadow: 0 0 calc(24 * var(--u)) rgb(242 184 101 / .25); }
.btn--ghost { color: var(--cream); background: transparent; }
.btn--ghost:hover { background: rgb(245 238 223 / .08); }
.btn:active { transform: translateY(1px); }
.btn[aria-disabled="true"], .btn:disabled { cursor: default; }
.btn--mint.is-soon[aria-disabled="true"] { background: rgb(42 200 136 / .32); color: rgb(245 238 223 / .78); box-shadow: none; }
.btn--mint[data-launch-done] { background: var(--mint); color: var(--chrome); cursor: pointer; }
a.is-soon[aria-disabled="true"] { cursor: default; opacity: .72; }

/* ============ 2. PAGE GROUND + ATMOSPHERE (DESIGN.md §3b — shared by every route) ============ */
/* lamp positions per route (§3b atm-lamp table, @1920 px from page top) */
body { --lamp1-x: calc(960 * var(--u)); --lamp1-y: calc(430 * var(--u)); --lamp2-x: calc(960 * var(--u)); --lamp2-y: calc(1180 * var(--u)); }
body[data-route="home"]    { --lamp1-x: calc(960 * var(--u));  --lamp1-y: calc(420 * var(--u));  --lamp2-x: calc(1300 * var(--u)); --lamp2-y: calc(1620 * var(--u)); }
body[data-route="counter"] { --lamp1-x: calc(1150 * var(--u)); --lamp1-y: calc(280 * var(--u));  --lamp2-x: calc(1400 * var(--u)); --lamp2-y: calc(1000 * var(--u)); }
body[data-route="card"]    { --lamp1-x: calc(1000 * var(--u)); --lamp1-y: calc(290 * var(--u));  --lamp2-x: calc(1500 * var(--u)); --lamp2-y: calc(1050 * var(--u)); }
body[data-route="send"]    { --lamp1-x: calc(850 * var(--u));  --lamp1-y: calc(300 * var(--u));  --lamp2-x: calc(1300 * var(--u)); --lamp2-y: calc(1000 * var(--u)); }
body[data-route="open"]    { --lamp1-x: calc(900 * var(--u));  --lamp1-y: calc(230 * var(--u));  --lamp2-x: calc(1500 * var(--u)); --lamp2-y: calc(1000 * var(--u)); }

.atm {                                   /* scrolls with the page, behind everything, never over text (z -1) */
  position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden;
  background:
    /* atm-vignette: page edges + bottom */
    linear-gradient(90deg, rgb(3 58 33 / .6) 0, transparent 7%, transparent 93%, rgb(3 58 33 / .6) 100%),
    linear-gradient(180deg, transparent 70%, rgb(3 58 33 / .6) 100%),
    /* atm-pool: evergreen lamp pool, one per 1080 screen height */
    radial-gradient(calc(1600 * var(--u)) calc(1100 * var(--u)) at 50% calc(450 * var(--u)), rgb(43 90 62 / .45), rgb(14 75 44 / .20) 40%, transparent 70%),
    radial-gradient(calc(1600 * var(--u)) calc(1100 * var(--u)) at 50% calc(1530 * var(--u)), rgb(43 90 62 / .38), rgb(14 75 44 / .18) 40%, transparent 70%),
    radial-gradient(calc(1600 * var(--u)) calc(1100 * var(--u)) at 50% calc(2610 * var(--u)), rgb(43 90 62 / .32), rgb(14 75 44 / .15) 40%, transparent 70%),
    var(--paper);
}
.atm::after {                            /* atm-grain: gouache grain ≈ 3 % */
  content: ""; position: absolute; inset: 0; opacity: .035; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0'/></filter><rect width='220' height='220' filter='url(%23n)'/></svg>");
}
.atm-lamp {                              /* atm-lamp: warm amber pools behind each route's art */
  position: absolute; display: block; width: calc(700 * var(--u)); height: calc(650 * var(--u));
  translate: -50% -50%; border-radius: 50%;
  background: radial-gradient(closest-side, rgb(242 184 101 / .55), rgb(182 131 48 / .25) 35%, rgb(182 131 48 / .08) 55%, transparent 75%);
  filter: blur(calc(36 * var(--u)));
  transition: left var(--t-slow) var(--ease-wrap), top var(--t-slow) var(--ease-wrap);
}
.atm-lamp--1 { left: var(--lamp1-x); top: var(--lamp1-y); }
.atm-lamp--2 { left: var(--lamp2-x); top: var(--lamp2-y); width: calc(520 * var(--u)); height: calc(480 * var(--u)); opacity: .7; }
@media (prefers-reduced-motion: no-preference) {
  .atm-lamp--1 { animation: lamp-breathe 6s ease-in-out infinite; }
  .atm-lamp--2 { animation: lamp-breathe 6s ease-in-out -3s infinite; }
  @keyframes lamp-breathe { 0%, 100% { opacity: .78; scale: 1; } 50% { opacity: 1; scale: 1.05; } }
}

/* ============ 3. PAGE FRAME (one container for every route — LUAT 53) ============ */
.page {
  display: block; position: relative; min-height: 60vh;
  padding: 0 var(--gut-r) calc(80 * var(--u)) var(--gut-l);
}
.page:focus { outline: none; }
.page.is-leaving { opacity: .55; transition: opacity 120ms linear; }
/* full-bleed helper (the homepage runs edge-to-edge only where the mockup does) */
.bleed { margin-left: calc(-1 * var(--gut-l)); margin-right: calc(-1 * var(--gut-r)); }

/* ============ 4. BORDER CLASSES (BORDER_TABLE.md → DESIGN.md §4b; the ONLY border declarations of the site) ============ */
/* chrome */
.rule-masthead { border-bottom: var(--rule-hair) solid var(--rule-c-hair); }
.rule-footer { border-top: var(--rule-hair) solid var(--rule-c-hair); }
.rule-footer-col { border-left: var(--rule-hair) solid var(--rule-c-hair); }
/* framed boxes — 2 px frame, panel radius 16 */
.rule-panel, .rule-ca-panel, .rule-table-panel, .rule-card-form-panel, .rule-explain-panel, .rule-send-step-panel,
.rule-lands-panel, .rule-connected-panel, .rule-before-panel, .rule-receipt-panel, .rule-lookup-bar, .rule-holdings-panel,
.rule-wallet-table-panel, .rule-chart-panel, .rule-state-panel, .rule-tray-panel {
  border: var(--rule-frame) solid var(--rule-c-frame); border-radius: var(--r-panel);
}
/* #/open chart panel: 2 px @1920 (DESIGN §4); never thinner than 2 px so its right edge survives at 1440 (pre_send 30/11) */
.rule-chart-panel { border-width: max(2px, calc(2 * var(--u))); }
/* tiles / rows / boxes — 2 px frame, radius 12 */
.rule-tile, .rule-shelf-tile, .rule-slice-row, .rule-total-box, .rule-btn, .rule-disconnect-btn {
  border: var(--rule-frame) solid var(--rule-c-frame); border-radius: var(--r-tile);
}
.rule-swatch, .rule-ribbon-swatch { border: var(--rule-frame) solid var(--rule-c-frame); border-radius: var(--r-swatch); }
.rule-swatch.is-selected, .rule-ribbon-swatch.is-selected, .rule-swatch[aria-pressed="true"], .rule-ribbon-swatch[aria-pressed="true"] { border: var(--rule-strong) solid var(--rule-c-sel); }
/* inputs — the frame wraps the whole control (put the class on the wrapper or on the input itself; padding sits inside) */
.rule-input, .rule-ca-input, .rule-card-message-input, .rule-lookup-input {
  border: var(--rule-frame) solid var(--rule-c-hi); border-radius: var(--r-input);
}
.rule-input-thin, .rule-recipient-input { border: var(--rule-hair) solid var(--rule-c-hi); border-radius: var(--r-input); }
.rule-input:focus-within, .rule-ca-input:focus-within, .rule-card-message-input:focus-within, .rule-lookup-input:focus-within,
.rule-input-thin:focus-within, .rule-recipient-input:focus-within { border-color: var(--mint); }
/* selected / expanded */
.rule-selected, .rule-expanded-row { border: var(--rule-frame) solid var(--rule-c-sel); border-radius: var(--r-tile); }
.rule-expanded-inner { border: var(--rule-hair) solid #74DEA6; border-radius: var(--r-input); }
.rule-tile.is-added, .rule-shelf-tile.is-added, .rule-slice-row.is-added { border-color: var(--rule-c-sel); }
/* caution / info strip */
.rule-caution, .rule-caution-strip { border: var(--rule-hair) solid var(--amber-lo); border-radius: var(--r-tile); }
.rule-caution-strong { border: var(--rule-frame) solid var(--amber-hi); border-radius: var(--r-tile); }
/* ghost buttons, chips (1 px cream @ 60 %) */
.rule-ghost, .rule-chip { border: var(--rule-hair) solid var(--rule-c-ghost); }
.rule-chip { border-radius: 999px; }
/* row rules (horizontal) */
.rule-row, .rule-tray-row, .rule-holdings-row, .rule-review-row, .rule-tile-foot { border-bottom: var(--rule-hair) solid var(--rule-c-row); }
.rule-row-head, .rule-table-head { border-bottom: var(--rule-frame) solid var(--rule-c-frame); }
.rule-section, .rule-read { border-bottom: var(--rule-hair) solid var(--rule-c-hi); }
.rule-section-top, .rule-notes { border-top: var(--rule-frame) solid var(--rule-c-frame); }
.rule-howto-row { border-bottom: var(--rule-frame) solid var(--rule-c-hi); }
.rule-note-row, .rule-ca-note { border-bottom: var(--rule-hair) solid var(--rule-c-frame); }
/* rules on the cream card */
.rule-cream-row, .rule-card-cream, .rule-index-card { border-bottom: var(--rule-hair) solid var(--rule-c-cream); }
.rule-cream-head { border-bottom: var(--rule-frame) solid var(--rule-c-cream); }
.rule-hash { border-top: var(--rule-hair) solid #E3EED9; border-bottom: var(--rule-hair) solid #E3EED9; }
/* vertical divider */
.rule-col { border-left: var(--rule-hair) solid var(--rule-c-hair); }
/* no doubled lines: the last row inside a framed box never draws its rule against the frame */
:is(.rule-panel, [class*="rule-"][class*="-panel"], .rule-total-box) > :is(.rule-row, .rule-tray-row, .rule-holdings-row, .rule-review-row, .rule-cream-row, .rule-howto-row, .rule-note-row):last-child { border-bottom-width: 0; }
/* panel fill (DESIGN.md §4 panel gradient + shadow) — opt in with .surface */
.surface { background: linear-gradient(180deg, #0F4B2C, var(--surface-lo)); box-shadow: var(--shadow-panel); }
.cream-card { background: var(--cream); color: var(--ink); border-radius: var(--r-card); box-shadow: var(--shadow-panel), calc(-30 * var(--u)) calc(-20 * var(--u)) calc(80 * var(--u)) rgb(242 184 101 / .16); }

/* ============ 5. MASTHEAD (N2 — mockup/v1/chrome/nav.html, scaled) ============ */
.hamper-masthead {
  position: relative; z-index: 20; height: calc(161 * var(--u));
  padding: calc(18 * var(--u)) var(--chrome-pad) 0;
  background: radial-gradient(ellipse at 24% 0%, #2B5A3E 0%, var(--chrome) 66%), linear-gradient(180deg, var(--chrome-hi), var(--chrome));
  font-family: var(--f-ui); color: var(--cream);
}
.hamper-top { height: calc(56 * var(--u)); display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; }
.hamper-social { display: flex; gap: calc(18 * var(--u)); padding-top: calc(2 * var(--u)); font: 600 max(12px, calc(15 * var(--u)))/1.6 var(--f-ui); }
.hamper-social a { padding: calc(2 * var(--u)) 0; }
.hamper-social a[data-launch-done]:hover, .hamper-footer a:hover, .hamper-routes a:hover { color: var(--mint-hi); }
.hamper-brand { display: flex; align-items: center; gap: calc(14 * var(--u)); margin-top: calc(-4 * var(--u)); }
.hamper-mark { width: auto; height: calc(50 * var(--u)); min-height: 36px; }
.hamper-word { font: 600 calc(52 * var(--u))/1 var(--f-display); letter-spacing: .01em; font-optical-sizing: auto; }
.hamper-actions { justify-self: end; display: flex; align-items: center; gap: calc(14 * var(--u)); }
.hamper-actions .btn { min-height: calc(38 * var(--u)); padding: 0 calc(19 * var(--u)); font-size: max(12px, calc(15 * var(--u))); }
.wallet-chip { display: inline-flex; gap: calc(10 * var(--u)); align-items: baseline; font: 400 max(12px, calc(14 * var(--u)))/1 var(--f-mono); color: var(--muted); }
.wallet-chip__addr { color: var(--cream); }
.hamper-routes { height: calc(87 * var(--u)); display: flex; align-items: flex-end; justify-content: center; gap: calc(56 * var(--u)); padding-bottom: calc(14 * var(--u)); }
.hamper-routes a {
  position: relative; padding: calc(7 * var(--u)) calc(7 * var(--u)) calc(9 * var(--u));
  font: 500 max(12px, calc(16 * var(--u)))/1 var(--f-ui); color: var(--muted);
  transition: color var(--t-fast) var(--ease-wrap);
}
.hamper-routes a::after {                /* active route underline — 3 px mint ribbon that ties itself in */
  content: ""; position: absolute; left: 0; right: 0; bottom: calc(-14 * var(--u)); height: calc(3 * var(--u)); min-height: 2px;
  background: var(--mint); border-radius: 2px; transform: scaleX(0); transform-origin: 50% 50%;
  transition: transform var(--t-base) var(--ease-drop);
}
.hamper-routes a.is-active { color: var(--cream); font-weight: 600; }
.hamper-routes a.is-active::after { transform: scaleX(1); }
.hamper-routes a:hover::after { transform: scaleX(.4); }
.hamper-routes a.is-active:hover::after { transform: scaleX(1); }
.nav-toggle, .nav-drawer { display: none; }

/* ============ 6. FOOTER (F2 — mockup/v1/chrome/footer.html, scaled) ============ */
.hamper-footer {
  position: relative; z-index: 1;
  background: radial-gradient(ellipse at 18% 120%, #2B5A3E 0%, var(--chrome) 62%);
  color: var(--cream); font: 400 max(12px, calc(14 * var(--u)))/1.5 var(--f-ui);
}
.hamper-footer__grid { min-height: calc(164 * var(--u)); display: grid; grid-template-columns: 729fr 496fr 583fr; padding: calc(28 * var(--u)) var(--chrome-pad) calc(24 * var(--u)); }
.hamper-footer__col { padding: 0 calc(40 * var(--u)); }
.hamper-footer__col:first-child { padding-left: 0; }
.hamper-footer h2 { margin: 0 0 calc(14 * var(--u)); font: 600 max(12px, calc(13 * var(--u)))/1.2 var(--f-ui); letter-spacing: .18em; }
.hamper-footer p { margin: calc(4 * var(--u)) 0; }
.hamper-footer nav { display: flex; flex-wrap: wrap; gap: calc(9 * var(--u)) calc(24 * var(--u)); }
.hamper-footer nav a.is-active { color: var(--mint); }
.hamper-footer__season { display: flex; justify-content: space-between; align-items: flex-start; gap: calc(24 * var(--u)); }
.hamper-footer__brand { display: inline-flex; align-items: center; gap: calc(10 * var(--u)); font: 600 calc(26 * var(--u))/1 var(--f-display); }
.hamper-footer__mark { width: auto; height: calc(44 * var(--u)); min-height: 32px; }

/* ============ 7. WALLET MODAL ============ */
.wallet-modal {
  width: min(92vw, calc(520 * var(--u))); min-width: min(92vw, 340px); padding: calc(28 * var(--u)); color: var(--cream);
  background: linear-gradient(180deg, #0F4B2C, var(--surface-lo)); box-shadow: var(--shadow-panel);
}
.wallet-modal::backdrop { background: rgb(3 30 18 / .6); }
.wallet-modal__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: calc(8 * var(--u)); }
.wallet-modal__head h2 { font: 500 max(20px, calc(30 * var(--u)))/1.1 var(--f-display); }
.wallet-modal__close { font-size: max(20px, calc(28 * var(--u))); line-height: 1; padding: 4px 8px; color: var(--muted); }
.wallet-modal__note { font: 400 max(12px, calc(14 * var(--u)))/1.3 var(--f-mono); color: var(--muted); margin-bottom: calc(18 * var(--u)); }
.wallet-modal__list { display: grid; gap: calc(10 * var(--u)); }
.wallet-modal__list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(12 * var(--u)) calc(14 * var(--u)); background: rgb(245 238 223 / .04); border-radius: var(--r-tile); }
.wallet-modal__list img { width: 28px; height: 28px; border-radius: 6px; }
.wallet-modal__list .w-name { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.wallet-modal__state { display: grid; gap: calc(12 * var(--u)); margin-top: calc(6 * var(--u)); }
.wallet-modal__addr { font: 400 max(13px, calc(16 * var(--u)))/1.3 var(--f-mono); }
.wallet-modal__row { display: flex; flex-wrap: wrap; gap: calc(12 * var(--u)); }
.wallet-modal__msg { margin-top: calc(12 * var(--u)); color: var(--muted); font-size: max(12px, calc(14 * var(--u))); min-height: 1.4em; }

/* ============ 8. MOTION HELPERS (DESIGN.md §10 — "wrapped at the counter, under the lamp") ============ */
/* reveal = "set on the shelf": rises 10 units and settles with the drop ease; the 2 s timer in app.js forces .is-in */
@media (prefers-reduced-motion: no-preference) {
  [data-reveal] { opacity: 0; translate: 0 calc(14 * var(--u)); transition: opacity var(--t-slow) var(--ease-wrap), translate var(--t-slow) var(--ease-drop); transition-delay: calc(var(--i, 0) * 70ms); }
  [data-reveal].is-in { opacity: 1; translate: 0 0; }
  /* ribbon tie: an element marked data-ribbon-line draws a mint line left → right once it is in view */
  [data-ribbon-line] { background-image: linear-gradient(var(--mint), var(--mint)); background-repeat: no-repeat; background-position: 0 100%; background-size: 0% max(2px, calc(3 * var(--u))); transition: background-size var(--t-path) var(--ease-wrap); }
  [data-ribbon-line].is-in { background-size: 100% max(2px, calc(3 * var(--u))); }
  /* grow-in = slices dropping into the tray: rise from the base with a soft spring */
  [data-grow] { transform-origin: 50% 100%; scale: 1 0; transition: scale var(--t-slow) var(--ease-drop); transition-delay: calc(var(--i, 0) * 60ms); }
  [data-grow].is-in { scale: 1 1; }
  /* hover lift — tiles lift and catch the lamp */
  [data-lift] { transition: translate var(--t-base) var(--ease-wrap), box-shadow var(--t-base) var(--ease-wrap); }
  [data-lift]:hover { translate: 0 calc(-3 * var(--u)); box-shadow: var(--shadow-panel), 0 calc(-6 * var(--u)) calc(30 * var(--u)) rgb(242 184 101 / .14); }
}
/* live tick = an amber glint across the number (opacity only, no layout) */
[data-cell] { position: relative; }
.is-ticked::after {
  content: ""; position: absolute; inset: -2px -4px; border-radius: 4px; pointer-events: none;
  background: linear-gradient(100deg, transparent 20%, rgb(242 184 101 / .45) 50%, transparent 80%);
  opacity: 0; animation: tick-glint 900ms var(--ease-wrap) 1;
}
@keyframes tick-glint { 0% { opacity: 0; translate: -30% 0; } 30% { opacity: 1; } 100% { opacity: 0; translate: 30% 0; } }
/* art: scroll-driven drift only on art/decoration (LUAT 67 rule a) */
@media (prefers-reduced-motion: no-preference) {
  @supports ((animation-timeline: view()) and (animation-range: entry)) {
    .art-drift { animation: art-drift linear both; animation-timeline: view(); animation-range: cover; }
    @keyframes art-drift { from { translate: 0 calc(24 * var(--u)); } to { translate: 0 calc(-24 * var(--u)); } }
  }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
/* route change (kit router v3 View Transition): masthead stays, page fades + nudges 16 px */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: var(--rt-dur); }

/* ============ 9. PHONE LAYOUT 360–1279 (LUAT 71) ============ */
@media (max-width: 1279.98px) {
  :root {
    --u: 0.8px;                                      /* phone design unit: routes keep their calc(N*var(--u)) and add phone rules */
    --gut-l: max(16px, calc((100vw - 760px) / 2));   /* content column capped at 760 px, centred; ground + bleed art fill the screen */
    --gut-r: var(--gut-l);
    --chrome-pad: 16px;
  }
  body { font-size: 15px; }
  .t-hero { font-size: clamp(34px, 8.6vw, 52px); }
  .t-title { font-size: clamp(30px, 7.4vw, 44px); }
  .t-section { font-size: clamp(26px, 6.6vw, 38px); }
  .t-big { font-size: clamp(32px, 8vw, 46px); }
  .t-eyebrow { font-size: 13px; }
  .t-label, .t-data { font-size: 13px; }
  .t-body { font-size: 15px; }
  .btn { min-height: 44px; font-size: 15px; padding: 0 18px; }

  .hamper-masthead { height: auto; padding: 12px var(--chrome-pad) 12px; }
  .hamper-top { height: auto; grid-template-columns: 1fr auto 1fr; align-items: center; }
  .hamper-social { gap: 14px; font-size: 14px; padding-top: 0; }
  .hamper-brand { margin-top: 0; gap: 8px; }
  .hamper-mark { height: 38px; min-height: 0; }
  .hamper-word { font-size: 28px; }
  .hamper-actions, .hamper-routes { display: none; }
  .nav-toggle {
    justify-self: end; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px;
    border-radius: 10px; font: 600 14px/1 var(--f-ui); color: var(--cream);
  }
  .nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after { display: block; width: 16px; height: 2px; background: currentColor; border-radius: 1px; position: relative; content: ""; }
  .nav-toggle__bars::before { position: absolute; top: -5px; }
  .nav-toggle__bars::after { position: absolute; top: 5px; }
  .nav-drawer { display: block; padding: 14px 0 6px; }
  .nav-drawer[hidden] { display: none !important; }
  .nav-mobile { display: grid; gap: 2px; }
  .nav-mobile a { display: block; padding: 12px 4px; font: 500 17px/1.2 var(--f-ui); color: var(--muted); }
  .nav-mobile a.is-active { color: var(--cream); font-weight: 600; box-shadow: inset 3px 0 0 var(--mint); padding-left: 12px; }
  .nav-drawer__actions { display: flex; flex-wrap: wrap; gap: 10px; padding: 12px 0 4px; }
  .wallet-chip { font-size: 12px; }

  .page { padding-bottom: 56px; }
  .hamper-footer { font-size: 14px; }
  .hamper-footer__grid { grid-template-columns: 1fr; gap: 20px; min-height: 0; padding: 24px max(16px, calc((100vw - 760px) / 2)) 28px; }
  .hamper-footer__col, .hamper-footer__col:first-child { padding: 0; }
  .hamper-footer__col.rule-footer-col { border-left-width: 0; border-top: var(--rule-hair) solid var(--rule-c-hair); padding-top: 18px; }
  .hamper-footer h2 { font-size: 12px; margin-bottom: 10px; }
  .hamper-footer__brand { font-size: 22px; }
  .hamper-footer__mark { height: 36px; min-height: 0; }
  .atm-lamp { width: 90vw; height: 80vw; }
  body, body[data-route] { --lamp1-x: 60vw; --lamp1-y: 360px; --lamp2-x: 40vw; --lamp2-y: 1300px; }
}
@media (max-width: 420px) {
  .nav-toggle__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .hamper-social { gap: 10px; font-size: 13px; }
  .hamper-word { font-size: 24px; }
  .hamper-mark { height: 36px; }
}
