/* CHARON app.css — tokens, page scale, ONE page frame + atmosphere, nav N3, footer F10, border rules, motion.
   Source of truth: mockup/v1/DESIGN.md (§0 frame, §2 fonts, §3 colours, §3b atmosphere, §4b BORDER TABLE, §10 motion).
   SCALE (LUAT 50): the design width is 1920. Every measured size is written calc(N * var(--u)); --u = 100vw/1920 from 1024 up,
   so 1280–2560 keep the mockup proportions. Below 1024 the mobile layout uses its own --u.
   BORDERS (LUAT 56): route files contain ZERO border/outline declarations — use the .rule-* classes below. */

:root {
  --u: calc(100vw / 1920);
  /* colours (DESIGN §3) */
  --paper: #0B343B;
  --ground: #0F344A;
  --surface: #F0E6CF;
  --surface-2: #E8DCC0;
  --surface-container: #173E50;
  --primary: #04B147;
  --primary-container: #A7E411;
  --grad-primary: linear-gradient(90deg, #04B147, #A7E411);
  --secondary: #F2A93B;
  --tertiary: #97FCE4;
  --outline-dark: #4F7A8C;
  --outline-paper: #D6C9A8;
  --ink: #17352F;
  --ink-2: rgba(23, 53, 47, .75);
  --ivory: #F0E6CF;
  --ivory-2: rgba(240, 230, 207, .78);
  --moss: #1D4D4A;
  --nav-active: #CDE6A5;
  /* type (DESIGN §2) */
  --f-display: "Fraunces", "Playfair Display", Georgia, serif;
  --f-body: "Signika Negative", "Segoe UI", system-ui, sans-serif;
  --f-label: "DM Sans", "Segoe UI", system-ui, sans-serif;
  --fs-hero: calc(72 * var(--u));
  --fs-route: calc(52 * var(--u));
  --fs-card-caps: calc(30 * var(--u));
  --fs-value: calc(23 * var(--u));
  --fs-body: max(13px, calc(16 * var(--u)));
  --fs-small: max(12px, calc(14 * var(--u)));
  --fs-label: max(12px, calc(13 * var(--u)));
  /* page frame (DESIGN §0, USER FIX U1) */
  --gutter-l: calc(9 * var(--u));
  --gutter-r: calc(11 * var(--u));
  --rail-w: calc(575 * var(--u));
  --container-w: calc(1323 * var(--u));
  --nav-h: calc(104 * var(--u));
  --section-gap: calc(72 * var(--u));
  /* radii + elevation (DESIGN §4) */
  --r-ticket: calc(6 * var(--u));
  --r-panel: calc(20 * var(--u));
  --shadow-1: 0 calc(6 * var(--u)) calc(18 * var(--u)) rgba(4, 23, 34, .28);
  --shadow-2: 0 calc(14 * var(--u)) calc(34 * var(--u)) rgba(4, 23, 34, .36);
  /* border rule tokens — widths/colours from BORDER_TABLE.md (CSS px @1920), hairlines never below 1px */
  --rule-hair: max(1px, calc(1 * var(--u)));
  --rule-row: max(1px, calc(1.5 * var(--u)));
  --rule-2: max(1px, calc(2 * var(--u)));
  --rule-3: max(1px, calc(3 * var(--u)));
  --rule-4: max(1px, calc(4 * var(--u)));
  --rule-c-input: #F3F7EF;
  --rule-c-ticket-row: #C7BDA7;
  --rule-c-ledger-row: #C3B498;
  --rule-c-honest: #4F8182;
  --rule-c-honest-inner: #93AAA4;
  --rule-c-dock: #4C7479;
  --rule-c-plate: #55736D;
  --rule-c-step: #406565;
  --rule-c-step-icon: #3A735F;
  --rule-c-water: #378789;
  --rule-c-tier: #D4C1A2;
  --rule-c-control: #466767;
  --rule-c-buy-step: #CFBC9C;
  --rule-c-ok: #55A15C;
  --rule-c-picker: #FFFBE8;
  --rule-c-picker-list: #9C9A87;
  /* motion (DESIGN §10) */
  --ease-ferry: cubic-bezier(.33, 0, .15, 1);
  --ease-oar: cubic-bezier(.45, .05, .2, 1);
  --dur-quick: 200ms;
  --dur-tear: 320ms;
  --dur-drift: 640ms;
  --dur-glow: 520ms;
  --rt-dur: 240ms;
  --rt-nudge: calc(18 * var(--u));
  color-scheme: dark;
  accent-color: var(--primary);
  scrollbar-color: var(--outline-dark) var(--ground);
}
html[data-rt-dir=back] { --rt-nudge: calc(-18 * var(--u)); }

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body { margin: 0; min-height: 100vh; overflow-x: clip; font: 400 var(--fs-body)/1.4 var(--f-body); color: var(--ivory); font-variant-numeric: tabular-nums; }
h1, h2, h3, h4, p, figure, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; }
:where(button, input, select, textarea, fieldset) { border: 0; font: inherit; color: inherit; background: none; }
:where(button) { cursor: pointer; padding: 0; }
:where(button:disabled, [aria-disabled="true"]) { cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--secondary); outline-offset: 2px; }
::selection { background: rgba(242, 169, 59, .38); color: inherit; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 50; padding: 10px 16px; border-radius: 10px; background: var(--surface); color: var(--ink); text-decoration: none; }
.skip-link:focus { top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- PAGE ATMOSPHERE (DESIGN §3b) — one ground for every route ---------- */
body {
  background-color: var(--paper);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.06'/%3E%3C/svg%3E"),
    repeating-linear-gradient(180deg, transparent 0 calc(38 * var(--u)), rgba(151, 252, 228, .025) calc(38 * var(--u)) calc(39 * var(--u)), transparent calc(39 * var(--u)) calc(71 * var(--u)), rgba(240, 230, 207, .02) calc(71 * var(--u)) calc(72 * var(--u))),
    radial-gradient(ellipse calc(520 * var(--u)) calc(380 * var(--u)) at 26% calc(330 * var(--u)), rgba(167, 228, 17, .10), transparent 70%),
    radial-gradient(ellipse calc(900 * var(--u)) calc(600 * var(--u)) at 70% calc(520 * var(--u)), rgba(41, 75, 83, .55), transparent 72%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(45, 100, 93, .30), transparent 70%),
    linear-gradient(135deg, #0F344A 0%, #0C363E 34%, #11343F 62%, #1D4D4A 100%);
  background-size: 160px 160px, auto, auto, auto, auto, auto;
}
/* mist veil: drifts slowly over the whole page (signature motion #1) */
body::before {
  content: ""; position: fixed; inset: -10% -20%; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 38% 16% at 22% 30%, rgba(240, 230, 207, .07), transparent 70%),
    radial-gradient(ellipse 44% 14% at 70% 62%, rgba(151, 252, 228, .05), transparent 70%),
    radial-gradient(ellipse 30% 12% at 40% 86%, rgba(240, 230, 207, .05), transparent 70%);
  animation: mist-drift 46s var(--ease-oar) infinite alternate;
}
@keyframes mist-drift { from { transform: translate3d(-4%, 0, 0); } to { transform: translate3d(5%, -1.5%, 0); } }

/* ---------- ONE PAGE FRAME (USER FIX U1) ---------- */
.page { position: relative; z-index: 1; padding: 0 var(--gutter-r) 0 var(--gutter-l); min-height: calc(100vh - var(--nav-h)); }
.frame { position: relative; z-index: 1; display: block; min-height: calc(976 * var(--u)); }
/* Route layout helpers — the ONLY width system routes use (never their own max-width / side padding / background) */
.frame-grid { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); column-gap: 0; }
.frame-main { grid-column: 2; min-width: 0; }            /* the 1323 px interface container right of the rail */
.frame-full { grid-column: 1 / -1; min-width: 0; }        /* spans rail + container (second screens, honest panel) */
.frame-section + .frame-section { margin-top: var(--section-gap); }
/* Route-owned left art rail: full first screen, fades right + down into the ground. */
.art-rail { position: absolute; left: 0; top: 0; width: calc(var(--rail-w) + var(--gutter-l)); height: calc(1010 * var(--u)); z-index: 0; overflow: hidden; pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, #000 72%, transparent 100%), linear-gradient(180deg, #000 76%, transparent 100%);
  -webkit-mask-composite: source-in; mask-image: linear-gradient(90deg, #000 72%, transparent 100%), linear-gradient(180deg, #000 76%, transparent 100%); mask-composite: intersect; }
.art-rail-motion { position: absolute; inset: -6%; display: block; will-change: transform; }
.art-rail img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; will-change: transform; }
.art-rail-mist { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11, 52, 59, 0) 40%, rgba(11, 52, 59, .5) 100%), radial-gradient(ellipse 80% 22% at 40% 64%, rgba(240, 230, 207, .10), transparent 70%); animation: mist-drift 30s var(--ease-oar) infinite alternate; }
.art-rail--home .art-rail-motion { animation: rail-home-float 12s var(--ease-oar) infinite alternate; }
.art-rail--ferry .art-rail-motion { animation: rail-queue-drift 13s var(--ease-oar) infinite alternate; }
.art-rail--manifest .art-rail-motion { animation: rail-snapshot-breathe 10s var(--ease-oar) infinite alternate; }
.art-rail--fare .art-rail-motion { animation: rail-share-sway 12.5s var(--ease-oar) infinite alternate; }
.art-rail--far-shore .art-rail-motion { animation: rail-arrival-lift 11s var(--ease-oar) infinite alternate; }
@keyframes rail-home-float { from { transform: translate3d(-2.2%, -1.6%, 0) scale(1.03); } to { transform: translate3d(2.4%, 2%, 0) scale(1.08); } }
@keyframes rail-queue-drift { from { transform: translate3d(-3%, 1%, 0) scale(1.04); } to { transform: translate3d(3%, -1.6%, 0) scale(1.07); } }
@keyframes rail-snapshot-breathe { from { transform: translate3d(0, -2%, 0) scale(1.02); } to { transform: translate3d(0, 2.2%, 0) scale(1.09); } }
@keyframes rail-share-sway { from { transform: translate3d(-2.6%, -1%, 0) scale(1.04); } to { transform: translate3d(2.8%, 1.6%, 0) scale(1.07); } }
@keyframes rail-arrival-lift { from { transform: translate3d(-1%, 2.6%, 0) scale(1.04); } to { transform: translate3d(1.6%, -2.6%, 0) scale(1.08); } }
.art-rail::after { content: ""; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen;
  background: linear-gradient(105deg, transparent 38%, rgba(214, 255, 170, .16) 48%, rgba(255, 245, 200, .22) 50%, rgba(214, 255, 170, .16) 52%, transparent 62%);
  background-size: 260% 100%; animation: rail-sweep 7.5s cubic-bezier(.45,0,.25,1) infinite; }
@keyframes rail-sweep { 0% { background-position: 130% 0; } 55%, 100% { background-position: -30% 0; } }
@media (prefers-reduced-motion: reduce) { .art-rail::after { animation: none; opacity: 0; } .art-rail-motion { animation: none !important; transform: none !important; } }
@supports ((animation-timeline: scroll()) and (animation-range: 0 100%)) {
  .art-rail img { animation: rail-parallax linear both; animation-timeline: scroll(root); animation-range: 0 calc(1400 * var(--u)); }
  @keyframes rail-parallax { to { transform: translate3d(0, calc(168 * var(--u)), 0); } }
}

/* ---------- NAV N3 (mockup/v1/chrome/nav.html, measured: band 104, pill top 24, h 64) ---------- */
.site-nav { position: relative; z-index: 20; height: var(--nav-h); display: flex; justify-content: center; align-items: flex-start; padding-top: calc(24 * var(--u)); font-family: var(--f-body); background: linear-gradient(90deg, #0F344A, #174653 48%, #0F344A); }
.nav-group { display: flex; align-items: center; gap: calc(10 * var(--u)); }
.nav-shell { height: calc(64 * var(--u)); display: flex; align-items: center; gap: calc(22 * var(--u)); padding: 0 calc(18 * var(--u)) 0 calc(14 * var(--u)); border-radius: calc(34 * var(--u)); background: var(--surface); color: var(--ground); box-shadow: var(--shadow-2); white-space: nowrap; font-size: max(13px, calc(15 * var(--u))); font-weight: 500; }
.brand { display: flex; align-items: center; gap: calc(10 * var(--u)); color: var(--ground); }
.brand-mark { height: calc(42 * var(--u)); min-height: 34px; width: auto; aspect-ratio: 2048 / 1306; object-fit: contain; }
.brand-word { font-family: var(--f-display); font-weight: 600; font-size: calc(27 * var(--u)); letter-spacing: .04em; line-height: 1; font-variation-settings: "opsz" 48; }
.nav-links { display: flex; align-items: center; gap: calc(14 * var(--u)); }
.nav-links a, .nav-drawer a { color: var(--ground); text-decoration: none; padding: calc(10 * var(--u)) calc(14 * var(--u)); border-radius: calc(18 * var(--u)); transition: background-color var(--dur-quick) var(--ease-ferry), color var(--dur-quick) var(--ease-ferry); }
.nav-links a:hover { background: rgba(205, 230, 165, .45); }
.nav-links a.is-active, .nav-drawer a.is-active { background: var(--nav-active); }
.socials { display: flex; gap: calc(10 * var(--u)); }
.social { display: grid; place-items: center; width: calc(42 * var(--u)); height: calc(42 * var(--u)); min-width: 34px; min-height: 34px; border-radius: 50%; color: var(--ivory); background: #123D4E; text-decoration: none; font-size: max(13px, calc(16 * var(--u))); font-weight: 600; transition: transform var(--dur-quick) var(--ease-ferry), background-color var(--dur-quick); }
.social svg { width: calc(18 * var(--u)); height: calc(18 * var(--u)); min-width: 15px; min-height: 15px; }
a.social[href]:hover { transform: translateY(calc(-2 * var(--u))); background: #174C5E; }
[data-launch][aria-disabled="true"] { opacity: .82; }
.nav-toggle { display: none; }
.nav-drawer[hidden] { display: none; }

/* ---------- FOOTER F10 end credits (mockup/v1/chrome/footer.html; band 252 @1920) ---------- */
.site-footer { position: relative; z-index: 1; min-height: calc(252 * var(--u)); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(16 * var(--u)); padding: calc(30 * var(--u)) calc(48 * var(--u)); color: var(--ivory); background: linear-gradient(180deg, #2A4B5E 0%, #14384E 100%); font-family: var(--f-body); text-align: center; }
.foot-brand { display: flex; align-items: center; gap: calc(10 * var(--u)); font-family: var(--f-display); font-weight: 600; font-size: calc(22 * var(--u)); letter-spacing: .06em; }
.foot-mark { height: calc(42 * var(--u)); min-height: 34px; width: auto; aspect-ratio: 2048 / 1306; }
.credits { display: flex; flex-wrap: wrap; justify-content: center; gap: calc(48 * var(--u)); font-family: var(--f-display); font-size: max(15px, calc(21 * var(--u))); font-weight: 400; }
.credits span { display: flex; flex-direction: column; gap: calc(5 * var(--u)); }
.credits b { font-family: var(--f-label); color: var(--primary-container); font-size: max(12px, calc(12 * var(--u))); font-weight: 500; letter-spacing: .18em; text-transform: uppercase; }
.boundary { font-size: var(--fs-small); color: var(--ivory-2); }
.meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: calc(22 * var(--u)); font-size: var(--fs-small); }
.foot-link { color: var(--ivory); text-decoration: none; }
a.foot-link[href]:hover { color: var(--primary-container); }
.ca-chip { display: inline-flex; align-items: center; gap: .35em; padding: calc(8 * var(--u)) calc(14 * var(--u)); border-radius: calc(16 * var(--u)); }
.ca-value { font-variant-numeric: tabular-nums; }
.ca-copy { color: var(--ivory); text-decoration: underline; text-underline-offset: 2px; }
.ca-copy:disabled { text-decoration: none; opacity: .75; }
.buy { display: inline-flex; align-items: center; padding: calc(8 * var(--u)) calc(18 * var(--u)); border-radius: calc(20 * var(--u)); background: var(--grad-primary); color: #072B1D; font-weight: 600; }
.buy:disabled, .buy[aria-disabled="true"] { background: #D7D5CF; color: #5E6264; }

/* ---------- BORDER RULES (BORDER_TABLE.md → DESIGN §4b) — ONE class per framed component ---------- */
.rule-ca-input      { border: var(--rule-2) solid var(--rule-c-input); border-radius: calc(12 * var(--u)); }
.rule-ticket-row    { border-bottom: var(--rule-row) solid var(--rule-c-ticket-row); }
.rule-ticket-row-top { border-top: var(--rule-row) solid var(--rule-c-ticket-row); }
.rule-ticket-perf   { border-left: var(--rule-2) dashed var(--outline-paper); }
.rule-ledger-row    { border-bottom: var(--rule-row) solid var(--rule-c-ledger-row); }
.rule-honest-panel  { border: var(--rule-2) solid var(--rule-c-honest); border-radius: calc(24 * var(--u)); }
.rule-honest-inner  { border-bottom: var(--rule-hair) solid var(--rule-c-honest-inner); }
.rule-dock-head     { border: var(--rule-2) solid var(--rule-c-dock); border-radius: calc(8 * var(--u)); }
.rule-dock-headrow { border-bottom: var(--rule-2) solid var(--rule-c-dock); }
.rule-art-plate     { border: var(--rule-4) solid var(--rule-c-plate); border-radius: calc(18 * var(--u)); }
.rule-plan-step     { border: var(--rule-2) solid var(--rule-c-step); border-radius: calc(14 * var(--u)); }
.rule-step-icon     { border: var(--rule-2) solid var(--rule-c-step-icon); border-radius: calc(10 * var(--u)); }
.rule-timeline      { border: var(--rule-3) solid var(--rule-c-water); border-radius: calc(14 * var(--u)); }
.rule-tier-chip     { border: var(--rule-2) solid var(--rule-c-tier); border-radius: calc(10 * var(--u)); }
.rule-control-panel { border: var(--rule-2) solid var(--rule-c-control); border-radius: calc(16 * var(--u)); }
.rule-buy-step      { border: var(--rule-2) solid var(--rule-c-buy-step); border-radius: calc(12 * var(--u)); }
.rule-wallet-card   { border: var(--rule-2) solid var(--rule-c-ok); border-radius: calc(14 * var(--u)); }
.rule-picker        { border: var(--rule-3) solid var(--rule-c-picker); border-radius: calc(16 * var(--u)); }
.rule-picker-list   { border: var(--rule-3) solid var(--rule-c-picker-list); border-radius: calc(10 * var(--u)); }
/* shell chrome frames (nav.html / footer.html) */
.rule-social        { border: var(--rule-hair) solid var(--outline-dark); }
.rule-ca-chip       { border: var(--rule-hair) solid var(--outline-dark); }
.rule-buy           { border: 0; }
/* rows: the last row of a list keeps its rule (mockup draws it); stacked frames never both draw the shared edge */
.rule-stack > [class*="rule-"] + [class*="rule-"] { border-top-width: 0; }

/* ---------- shared type + materials for routes ---------- */
.t-hero { font-family: var(--f-display); font-weight: 500; font-size: var(--fs-hero); line-height: .98; letter-spacing: -.01em; color: var(--ivory); font-variation-settings: "opsz" 36; }
.t-route { font-family: var(--f-display); font-weight: 500; font-size: var(--fs-route); line-height: 1; color: var(--ivory); text-wrap: balance; }
.t-caps { font-family: var(--f-display); font-weight: 500; font-size: var(--fs-card-caps); line-height: 1.1; letter-spacing: .18em; text-transform: uppercase; }
.t-label { font-family: var(--f-label); font-weight: 500; font-size: var(--fs-label); line-height: 1.25; letter-spacing: .10em; text-transform: uppercase; }
.t-value { font-family: var(--f-body); font-weight: 500; font-size: var(--fs-value); line-height: 1.2; font-variant-numeric: tabular-nums; }
.t-body { font-size: var(--fs-body); line-height: 1.4; text-wrap: pretty; }
.t-small { font-size: var(--fs-small); }
.paper { background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.012 .9' numOctaves='3'/%3E%3CfeColorMatrix values='0 0 0 0 .55 0 0 0 0 .45 0 0 0 0 .3 0 0 0 .5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)' opacity='.14'/%3E%3C/svg%3E"); color: var(--ink); box-shadow: var(--shadow-1); }
.glass { background: linear-gradient(180deg, rgba(23, 62, 80, .62), rgba(15, 52, 74, .48)); backdrop-filter: blur(6px); }
/* paper edge (fix-charon-presend, mockup-measured): every ivory surface carries a 1 px dark shadow line with a light inner rim — §4b "dark #0A2C35/#071D25 edges are shadow, not frames"; drawn as inset shadow so ticket masks keep it */
:root { --paper-edge: inset 0 0 0 max(1px, calc(1 * var(--u))) rgba(6, 30, 38, .92), inset 0 0 0 max(2px, calc(2 * var(--u))) rgba(255, 250, 235, .9); }
.page .paper { box-shadow: var(--paper-edge), var(--shadow-1); }
.page .fr-ticket.paper { box-shadow: var(--paper-edge), var(--shadow-2); }
.page .fs-picker.paper[data-state="picking"] { box-shadow: var(--paper-edge), var(--shadow-1), 0 0 calc(26 * var(--u)) rgba(242, 169, 59, .6); }
.ticket { position: relative; border-radius: var(--r-ticket); }
.source-meta { font-size: var(--fs-label); color: inherit; opacity: .72; }

/* ---------- MOTION (DESIGN §10) ---------- */
/* drift alongside: content glides in horizontally like a boat coming to the dock */
.drift-ready [data-drift]:not(.is-in) { opacity: 0; transform: translate3d(calc(-22 * var(--u)), 0, 0); }
[data-drift] { transition: opacity var(--dur-drift) var(--ease-ferry), transform var(--dur-drift) var(--ease-ferry); transition-delay: calc(var(--drift-i, 0) * 30ms); }
/* lantern glow: amber pool that travels to the selection (signature motion #2) */
[data-lantern-scope] { position: relative; isolation: isolate; }
.lantern { position: absolute; left: 0; top: 0; z-index: -1; width: calc(var(--lw, 200px) + 80px); height: calc(var(--lh, 60px) + 60px); pointer-events: none; opacity: 0;
  background: radial-gradient(closest-side, rgba(242, 169, 59, .55), rgba(242, 169, 59, .18) 60%, transparent);
  transform: translate3d(calc(var(--lx, 0px) - 50%), calc(var(--ly, 0px) - 50%), 0); transform-origin: 0 0;
  transition: transform var(--dur-glow) var(--ease-ferry), opacity var(--dur-glow) var(--ease-ferry); }
.lantern.is-lit { opacity: 1; animation: lantern-flicker 3.6s ease-in-out infinite alternate; }
@keyframes lantern-flicker { 0%, 100% { opacity: 1; } 45% { opacity: .86; } 70% { opacity: .95; } }
/* live tick: one amber breath on a refreshed value */
.is-ticked { animation: tick-breath 900ms var(--ease-ferry) 1; }
@keyframes tick-breath { 0% { text-shadow: 0 0 0 transparent; } 30% { text-shadow: 0 0 14px rgba(242, 169, 59, .75); } 100% { text-shadow: 0 0 0 transparent; } }
.is-inking { color: inherit; }
/* ticket punch + stub tear (320 ms) */
.ticket-stub { transition: transform var(--dur-tear) var(--ease-ferry); transform-origin: 0 50%; }
.is-punched .ticket-stub { animation: stub-tear var(--dur-tear) var(--ease-ferry) 1; }
@keyframes stub-tear { 0% { transform: none; } 45% { transform: translate3d(calc(8 * var(--u)), calc(-3 * var(--u)), 0) rotate(2.5deg); } 100% { transform: none; } }
.punch-hole { transform: scale(1); transition: transform var(--dur-quick) var(--ease-spring, var(--ease-ferry)); }
.is-punched .punch-hole { animation: punch 320ms var(--ease-ferry) 1; }
@keyframes punch { 0% { transform: scale(.2); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }
/* hover: lift toward the lantern */
.hover-lift { transition: transform var(--dur-quick) var(--ease-ferry), box-shadow var(--dur-quick) var(--ease-ferry); }
.hover-lift:hover { transform: translate3d(0, calc(-3 * var(--u)), 0); box-shadow: var(--shadow-2), 0 0 calc(30 * var(--u)) rgba(242, 169, 59, .18); }
/* grow-in for bars/fills: grows from the dock side (left) */
.grow-x { transform-origin: 0 50%; animation: grow-x 900ms var(--ease-ferry) both; }
@keyframes grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
/* route change: 240 ms fade through mist with a small horizontal nudge (kit router v3) */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: var(--rt-dur); animation-timing-function: var(--ease-ferry); }

/* ---------- 1024–1279: same proportions, minimum sizes keep nav readable ---------- */
@media (max-width: 1279px) and (min-width: 1024px) {
  .nav-shell { gap: calc(16 * var(--u)); }
}

/* ---------- MOBILE < 1024 ---------- */
@media (max-width: 1023px) {
  :root { --u: calc(100vw / 820); --gutter-l: 16px; --gutter-r: 16px; --rail-w: 0px; --nav-h: 72px; --section-gap: 40px; --fs-hero: clamp(34px, 9vw, 56px); --fs-route: clamp(30px, 7.6vw, 44px); }
  .site-nav { height: auto; min-height: var(--nav-h); padding: 12px 12px 10px; flex-direction: column; align-items: stretch; }
  .nav-group { justify-content: space-between; gap: 8px; }
  .nav-shell { flex: 1; height: 52px; padding: 0 10px 0 12px; border-radius: 26px; justify-content: space-between; }
  .brand-mark { height: 40px; }
  .brand-word { font-size: 21px; }
  .nav-links { display: none; }
  .nav-toggle { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 19px; background: var(--ground); color: var(--ivory); font-weight: 500; font-size: 14px; }
  .nav-toggle-bars { width: 16px; height: 2px; background: currentColor; box-shadow: 0 -5px 0 currentColor, 0 5px 0 currentColor; }
  .social { width: 40px; height: 40px; }
  .nav-drawer { display: grid; gap: 4px; margin-top: 10px; padding: 10px; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-2); font-size: 16px; font-weight: 500; }
  .nav-drawer a { padding: 12px 14px; border-radius: 14px; }
  .frame-grid { grid-template-columns: minmax(0, 1fr); }
  .frame-main, .frame-full { grid-column: 1; }
  .art-rail { position: relative; width: auto; height: 220px; margin: 0 calc(-1 * var(--gutter-r)) 0 calc(-1 * var(--gutter-l));
    -webkit-mask-image: linear-gradient(180deg, #000 60%, transparent 100%); mask-image: linear-gradient(180deg, #000 60%, transparent 100%); }
  .art-rail img { object-position: 50% 40%; }
  .frame { min-height: 50vh; }
  .site-footer { padding: 32px 20px; gap: 16px; }
  .credits { gap: 18px 26px; }
}

/* ---------- reduced motion: everything still, final states instantly ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
  body::before, .art-rail-mist, .art-rail-motion { animation: none !important; }
  .art-rail img { animation: none !important; transform: none !important; }
  .drift-ready [data-drift]:not(.is-in) { opacity: 1; transform: none; }
}
