/* Kitchen Table: a dusk realm you scroll into, then a lamp-lit table. */

:root {
  --night: #0b0c1c;
  --ink: #efe7d6;
  --ink-dim: #b9b0c6;
  --ink-faint: #8a8199;
  --gold: #d9a846;
  --gold-hi: #f3cf7a;
  --gold-deep: #a8742a;
  --line: rgba(243, 207, 122, .22);
  --seat-0: #d9a846;
  --seat-1: #4ea8de;
  --seat-2: #e5704d;
  --seat-3: #5fb86a;
  --display: "Cinzel", "Trajan Pro", Georgia, serif;
  --story: "EB Garamond", Georgia, "Times New Roman", serif;
  --ui: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--night); color: var(--ink); font: 17px/1.6 var(--ui); -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }
body { margin: 0; overflow-x: clip; }
img { max-width: 100%; }
a { color: var(--gold-hi); }
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: .02em; line-height: 1.15; margin: 0; }
.kicker { font: 600 13px/1 var(--display); letter-spacing: .28em; text-transform: uppercase; color: var(--gold); margin: 0 0 16px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; border-radius: 999px; padding: 12px 22px;
  font: 600 15px/1 var(--ui); text-decoration: none; color: var(--ink); border: 1px solid var(--line);
  transition: transform .2s, box-shadow .2s, filter .2s; }
.btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 3px; }
.btn.sm { padding: 9px 16px; font-size: 14px; }
.btn.lg { padding: 17px 32px; font-size: 17px; }
.btn.gold { color: #1f1606; background: linear-gradient(180deg, #ffe39c, var(--gold) 58%, var(--gold-deep)); border-color: #f5d690;
  box-shadow: 0 6px 24px rgba(217, 168, 70, .35), inset 0 1px 0 rgba(255, 255, 255, .55); }
.btn.gold:hover { box-shadow: 0 10px 36px rgba(217, 168, 70, .55), inset 0 1px 0 rgba(255, 255, 255, .55); }
.btn.coffee { color: #0b1733; background: linear-gradient(180deg, #a9c8ff, #72a4f2 60%, #5582d4); border-color: #c3d8ff;
  box-shadow: 0 6px 24px rgba(114, 164, 242, .35), inset 0 1px 0 rgba(255, 255, 255, .5); }
.btn.coffee:hover { box-shadow: 0 10px 36px rgba(114, 164, 242, .55), inset 0 1px 0 rgba(255, 255, 255, .5); }

/* ---------- top bar ---------- */
.topbar { position: fixed; inset: 0 0 auto; z-index: 50; display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(16px, 4vw, 40px); transition: transform .4s ease, background .4s, box-shadow .4s; }
/* no backdrop blur: it re-blurs the moving scenes behind the bar on every frame */
.topbar.solid { background: rgba(11, 12, 28, .9); box-shadow: 0 1px 0 rgba(243, 207, 122, .14); }
.topbar.away { transform: translateY(-110%); }
.mark { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 700 17px/1 var(--display); letter-spacing: .06em; }
.topbar nav { display: flex; align-items: center; gap: clamp(14px, 2.6vw, 28px); }
.topbar nav a:not(.btn) { color: var(--ink-dim); text-decoration: none; font-size: 15px; }
.topbar nav a:not(.btn):hover { color: var(--ink); }
@media (max-width: 560px) { .topbar nav a:not(.btn) { display: none; } }

/* ---------- pinned scenes ---------- */
.scene { position: relative; height: calc(var(--len) * 100vh); }
/* clip, not hidden: a hidden overflow is still a scroll container, and the zoomed-in realm gives it
   a huge scroll area that swallows swipes. The artwork ignores touches for the same reason. */
.stage { position: sticky; top: 0; height: 100vh; overflow: hidden; overflow: clip; }
.world, .board { pointer-events: none; }
/* a stop for scrolling, at progress --at through the scene (see "stops" below) */
.snap { position: absolute; left: 0; width: 1px; height: 100vh; pointer-events: none;
  top: calc(var(--at) * (var(--len) - 1) * 100vh); }

/* I. the realm */
.realm { --len: 5; }
.world, .layer { position: absolute; inset: 0; transform-origin: var(--ox, 50%) var(--oy, 78%); }
.world { transform: translate(var(--tx, 0px), var(--ty, 0px)) scale(var(--zoom, 1)); will-change: transform; }
.layer { transform: scale(calc(1 + var(--dz, 0) * var(--depth, 0))); will-change: transform; }
/* (main.js keeps these cached layers from ever being drawn deep in the zoom) */
.realm.zooming .world *, .realm.zooming .mist::before, .realm.zooming .mist::after { animation-play-state: paused; }
svg.layer, .layer > svg[data-paint] { display: block; width: 100%; height: 100%; }
.sky { position: absolute; inset: 0; overflow: hidden; overflow: clip;
  background: linear-gradient(180deg, #04050d 0%, #0a0c24 24%, #181944 46%, #33285c 62%, #633c5e 76%, #9a5549 88%, #c9773f 100%); }
/* three star layers that fade as whole layers, so twinkling never redraws the sky */
.stars { fill: #fff; }
.stars svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.stars svg:nth-child(2) { animation: twinkle 3.8s ease-in-out infinite; }
.stars svg:nth-child(3) { animation: twinkle 5.4s ease-in-out 1.3s infinite; }
@keyframes twinkle { 50% { opacity: .3; } }
.shooting { position: absolute; top: 14%; left: 8%; width: 160px; height: 2px; border-radius: 2px; opacity: 0;
  background: linear-gradient(90deg, transparent, #fff); transform: rotate(12deg); animation: shoot 11s linear 3s infinite; }
@keyframes shoot {
  0%, 90% { opacity: 0; translate: 0 0; }
  91% { opacity: 1; }
  97%, 100% { opacity: 0; translate: 46vw 10vw; }
}
.moon { position: absolute; left: 79%; top: 9vh; width: clamp(60px, 10vmin, 140px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 62% 38%, rgba(0, 0, 0, .06) 0 9%, transparent 10%),
    radial-gradient(circle at 34% 64%, rgba(0, 0, 0, .07) 0 12%, transparent 13%),
    radial-gradient(circle at 40% 36%, #fffaf0, #f3e7c6 55%, #d9c89c);
  box-shadow: 0 0 40px 10px rgba(255, 236, 190, .28), 0 0 140px 60px rgba(160, 140, 220, .16); }
.castle { position: absolute; overflow: visible; }
.castle .lit rect { animation: flicker 6s steps(1) infinite; }
.castle .lit rect:nth-child(2n) { animation-delay: -2.5s; }
@keyframes flicker { 0%, 100% { opacity: 1; } 42% { opacity: .55; } 44% { opacity: 1; } 71% { opacity: .75; } }
.mist::before, .mist::after { content: ""; position: absolute; left: -25%; width: 150%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(205, 195, 235, .17), transparent); animation: drift 40s ease-in-out infinite alternate; }
.mist-a::before { bottom: 28vh; height: 16vh; }
.mist-a::after { bottom: 22vh; height: 12vh; left: -45%; opacity: .7; animation-duration: 55s; }
.mist-b::before { bottom: 11vh; height: 12vh; opacity: .8; }
.mist-b::after { bottom: 4vh; height: 10vh; left: -40%; animation-duration: 47s; }
@keyframes drift { to { translate: 14% 0; } }
.cottage { position: absolute; overflow: visible; }
.cottage .window { animation: hearth 2.6s ease-in-out infinite alternate; }
@keyframes hearth { to { opacity: .86; } }
.cottage .smoke { filter: blur(2.5px); }
.cottage .smoke circle { transform-box: fill-box; transform-origin: center; opacity: 0; animation: smoke 7.5s ease-out infinite; }
.cottage .smoke circle:nth-child(2) { animation-delay: -2.5s; }
.cottage .smoke circle:nth-child(3) { animation-delay: -5s; }
@keyframes smoke { 0% { opacity: 0; transform: translate(0, 0) scale(.5); } 12% { opacity: .45; } 100% { opacity: 0; transform: translate(18px, -70px) scale(2.6); } }

.realm .stage::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: calc(1 - var(--glow, 0));
  background: radial-gradient(ellipse 80% 75% at 50% 58%, transparent 55%, rgba(2, 2, 10, .5)); }
.embers { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: calc(1 - var(--p, 0) * 1.8); }
/* pieces that fade and move with the scroll get their own layers, so they're drawn once */
.hero, .caption, .beat { will-change: transform, opacity; }
.glow, .flash, .realm .stage::after { will-change: opacity; }
/* ends exactly like the table scene's .flash starts, so the hand-off is seamless */
.glow { position: absolute; inset: 0; pointer-events: none; opacity: var(--glow, 0);
  background: radial-gradient(circle at 50% 50%, #fff7de, #ffd58a 40%, #f0a54a); }

.hero { position: absolute; left: 50%; top: 15vh; width: min(94vw, 1400px); text-align: center; z-index: 5;
  transform: translate(-50%, calc(var(--p, 0) * -70vh)); opacity: calc(1 - var(--p, 0) * 7.5); }
/* the sparkles sit beside the title, not inside it, so they don't redraw its glow */
.title { position: relative; display: inline-block; font-size: clamp(46px, 9.4vw, 132px); }
.hero h1 { font-size: 1em; font-weight: 700; letter-spacing: .04em;
  background: linear-gradient(180deg, #fff6d8 0%, #f3cf7a 40%, #d9a846 64%, #97641f 100%); -webkit-background-clip: text; background-clip: text;
  color: transparent; filter: drop-shadow(0 4px 30px rgba(243, 207, 122, .32)); padding: 0 .15em; }
.sparkle { position: absolute; width: .2em; height: .2em; fill: #fff3cf; animation: glint 3.2s ease-in-out infinite; }
.sparkle.s1 { left: -.05em; top: .02em; }
.sparkle.s2 { right: .08em; top: -.12em; width: .14em; height: .14em; animation-delay: -1.1s; }
.sparkle.s3 { right: -.08em; bottom: .12em; width: .12em; height: .12em; animation-delay: -2.2s; }
@keyframes glint { 0%, 100% { opacity: 0; transform: scale(.3) rotate(0); } 45% { opacity: 1; transform: scale(1) rotate(45deg); } 70% { opacity: 0; transform: scale(.4) rotate(90deg); } }
.tagline { font: italic 500 clamp(21px, 2.7vw, 32px)/1.3 var(--story); margin: 6px 0 0; text-shadow: 0 2px 18px rgba(0, 0, 0, .7); }
.scroll-hint { margin: 10vh 0 0; font: 600 12px/1 var(--display); letter-spacing: .32em; text-transform: uppercase; color: var(--ink-dim); }
.scroll-hint span { display: block; width: 1px; height: 52px; margin: 16px auto 0; background: linear-gradient(var(--gold-hi), transparent);
  transform-origin: top; animation: drip 2.4s ease-in-out infinite; }
@keyframes drip { 0% { transform: scaleY(0); opacity: 1; } 60% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }

.caption { position: absolute; left: 50%; top: 20vh; width: min(88vw, 780px); margin: 0; text-align: center; z-index: 5; pointer-events: none;
  font: italic 400 clamp(26px, 3.5vw, 46px)/1.3 var(--story); text-shadow: 0 2px 20px rgba(0, 0, 0, .8), 0 0 70px rgba(11, 12, 28, .9);
  opacity: var(--v, 0); transform: translate(-50%, calc(28px - var(--t, 0) * 56px)); }
.caption.warm { top: 46vh; font-weight: 500; color: #3b2208; text-shadow: 0 0 40px rgba(255, 244, 214, .9); transform: translate(-50%, calc(16px - var(--t, 0) * 16px)); }

/* II. the table */
.table-scene { --len: 6.4; --bx: 63%; --by: 52%; --S: min(66vh, 44vw, 760px); --pw: 33%; }
.room { position: absolute; inset: 0;
  background: radial-gradient(ellipse 58% 70% at var(--bx) 45%, #4c2f17 0%, #2b190c 36%, #150c07 66%, #070403 100%); }
.board { position: absolute; left: calc(var(--bx) - var(--S) / 2); top: calc(var(--by) - var(--S) / 2); width: var(--S); height: var(--S); }
.board::after { content: ""; position: absolute; inset: -12%; pointer-events: none; z-index: 5; border-radius: 50%;
  background: radial-gradient(circle at 46% 40%, rgba(255, 220, 160, .16), transparent 58%); }
.table { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; }
/* the table's shadow as a plain gradient (a blur filter would be redrawn with every change on the table) */
.board::before { content: ""; position: absolute; left: 2%; right: 2%; top: 12%; bottom: -9%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, .72), rgba(0, 0, 0, .35) 70%, transparent); }
.flash { position: absolute; inset: 0; z-index: 20; pointer-events: none; opacity: calc(1 - var(--p, 0) * 14);
  background: radial-gradient(circle at 50% 50%, #fff7de, #ffd58a 40%, #f0a54a); }

.tcard, .deck { position: absolute; left: var(--x); top: var(--y); width: 15%; aspect-ratio: 63 / 88; z-index: 3;
  transform: translate(-50%, -50%) rotate(var(--r)); transition: transform .9s cubic-bezier(.2, .8, .2, 1), box-shadow .5s; }
.tcard { border-radius: 7% / 5%; background: #f7efdf; box-shadow: 0 8px 16px rgba(30, 12, 2, .45); }
.tcard b { position: absolute; left: 8%; right: 8%; top: 7%; height: 52%; border-radius: 5px; background: var(--art); }
.tcard::after { content: ""; position: absolute; left: 9%; right: 9%; top: 66%; height: 24%; opacity: .9;
  background: repeating-linear-gradient(180deg, #dccfb4 0 16%, transparent 16% 32%); }
.c-land { --x: 49%; --y: 34%; --r: -3deg; --art: linear-gradient(160deg, #78b36a, #1f4d2c); }
.c-red { --x: 60%; --y: 62%; --r: 6deg; --art: linear-gradient(160deg, #f39a62, #a3322b); }
.c-elf { --x: 40%; --y: 60%; --r: -8deg; --art: linear-gradient(160deg, #b9d27a, #4b6a2b); }
.deck { --x: 25%; --y: 42%; --r: 9deg; }
.deck i { position: absolute; inset: 0; border-radius: 7% / 5%; background: #f7efdf; box-shadow: 0 4px 10px rgba(30, 12, 2, .4); }
.deck i:nth-child(1) { translate: 4px 5px; }
.deck i:nth-child(2) { translate: 2px 2.5px; }
.deck i::after { content: ""; position: absolute; inset: 7%; border-radius: 5px; box-shadow: inset 0 0 0 2px var(--gold);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-100 -100 200 200'%3E%3Cpath fill='%23d9a846' d='M0,-80 C10,-10 10,-10 80,0 C10,10 10,10 0,80 C-10,10 -10,10 -80,0 C-10,-10 -10,-10 0,-80 Z'/%3E%3C/svg%3E") center / 58% no-repeat,
    linear-gradient(180deg, #2a3752, #18202f); }
.mug { position: absolute; left: 77%; top: 27%; width: 11%; aspect-ratio: 1; z-index: 3; border-radius: 50%;
  background: radial-gradient(circle, #6b4226 0 57%, #f7efdf 59%); box-shadow: 0 8px 14px rgba(30, 12, 2, .45); }
.mug::after { content: ""; position: absolute; left: 88%; top: 34%; width: 38%; height: 32%; border: 5px solid #f7efdf; border-left: 0; border-radius: 0 40% 40% 0; }
.mug span { position: absolute; left: 30%; top: 30%; width: 40%; height: 40%; border-radius: 50%; background: rgba(255, 250, 240, .5);
  filter: blur(6px); opacity: 0; animation: steam 5s ease-out infinite; }
.mug span:nth-child(2) { animation-delay: -1.7s; }
.mug span:nth-child(3) { animation-delay: -3.4s; }
@keyframes steam { 0% { opacity: 0; transform: translate(0, 0) scale(.6); } 20% { opacity: .5; } 100% { opacity: 0; transform: translate(10px, -90px) scale(2.2); } }

/* III: the card gets read */
.chip { position: absolute; left: 50%; bottom: 104%; white-space: nowrap; padding: 6px 11px; border-radius: 999px; pointer-events: none;
  font: 600 clamp(10px, 1.6vmin, 13px)/1 var(--ui); font-style: normal; color: var(--gold-hi); background: rgba(12, 10, 24, .9);
  border: 1px solid rgba(243, 207, 122, .5); box-shadow: 0 6px 18px rgba(0, 0, 0, .45);
  opacity: 0; transform: translateX(-50%) translateY(6px) scale(.85); transition: opacity .45s, transform .45s; }
.b3 .chip { opacity: 1; transform: translateX(-50%); }
.b3 .c-elf { box-shadow: 0 0 0 3px var(--gold-hi), 0 0 34px 8px rgba(243, 207, 122, .55), 0 8px 16px rgba(30, 12, 2, .45); }
.c-elf::before { content: ""; position: absolute; inset: -9%; border-radius: 10%; pointer-events: none; opacity: 0;
  border: 2px solid var(--gold-hi); }
.b3:not(.b4) .c-elf::before { animation: ping 1.6s ease-out infinite; }
@keyframes ping { 0% { opacity: .9; transform: scale(.9); } 100% { opacity: 0; transform: scale(1.25); } }

/* IV: a land gets tapped */
.b4 .c-land { --r: 84deg; }

/* V: dice */
.die { position: absolute; left: 67%; top: 44%; width: 15%; aspect-ratio: 1; z-index: 4; opacity: 0; transform: translate(-50%, -50%) scale(.4); }
.die svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 8px 10px rgba(20, 8, 2, .55)); }
.die .faces { fill: #2a3160; stroke: var(--gold-hi); stroke-width: 3; stroke-linejoin: round; }
.die .edges { fill: none; stroke: rgba(243, 207, 122, .55); stroke-width: 2; stroke-linejoin: round; }
.die text { font: 700 22px var(--display); fill: #fff3cf; text-anchor: middle; dominant-baseline: middle; }
.b5 .die { animation: roll 1.15s cubic-bezier(.2, .7, .3, 1) forwards; }
.die.crit svg { filter: drop-shadow(0 8px 10px rgba(20, 8, 2, .55)) drop-shadow(0 0 16px rgba(243, 207, 122, .95)); }
@keyframes roll {
  0% { opacity: 0; transform: translate(-340%, -220%) rotate(-720deg) scale(.5); }
  15% { opacity: 1; }
  70% { transform: translate(-44%, -56%) rotate(18deg) scale(1.08); }
  100% { opacity: 1; transform: translate(-50%, -50%) rotate(0) scale(1); }
}

/* players */
.threads { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; z-index: 2; pointer-events: none; }
.thread { fill: none; stroke: #f3cf7a; stroke-opacity: .8; stroke-width: 2.2; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1;
  transition: stroke-dashoffset 1.4s cubic-bezier(.3, .6, .2, 1); }
.thread.halo { stroke-width: 9; stroke-opacity: .14; } /* the glow, without a blur filter */
.threads .pulse { fill: #fff3cf; opacity: 0; transition: opacity .5s .9s; }
.b2 .thread { stroke-dashoffset: 0; }
.b2 .threads .pulse { opacity: 1; }
.portal { position: absolute; margin: 0; z-index: 6; width: var(--pw); left: var(--px); top: var(--py);
  opacity: 0; transform: translate(-50%, -50%) scale(.6);
  transition: transform 1s cubic-bezier(.2, .8, .2, 1) var(--d), opacity .8s var(--d); }
.b1 .portal { opacity: 1; transform: translate(-50%, -50%); }
.portal > svg { display: block; width: 100%; aspect-ratio: 16 / 10; border-radius: 12px; border: 2px solid var(--seat); background: #000;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .6), 0 0 30px color-mix(in srgb, var(--seat) 55%, transparent), 0 16px 34px rgba(0, 0, 0, .6); }
.portal figcaption, .seat-you { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 5px 12px; border-radius: 999px;
  background: rgba(12, 10, 24, .86); border: 1px solid rgba(255, 255, 255, .08); font: 600 clamp(11px, 1.6vmin, 14px)/1.3 var(--ui); }
.portal figcaption { margin-top: 7px; }
.portal figcaption b { color: var(--seat); }
.portal[data-seat="1"] { --seat: var(--seat-1); --px: 50%; --py: -5%; --d: .05s; }
.portal[data-seat="2"] { --seat: var(--seat-2); --px: 108%; --py: 46%; --d: .22s; }
.portal[data-seat="3"] { --seat: var(--seat-3); --px: -8%; --py: 46%; --d: .39s; }
.life, .pips i { display: inline-grid; font-variant-numeric: tabular-nums; }
.life > *, .pips i > * { grid-area: 1 / 1; text-decoration: none; transition: opacity .4s, transform .4s; }
.life ins, .pips ins { opacity: 0; transform: translateY(-8px); }
.b5 .life s, .b4 .pips s { opacity: 0; transform: translateY(8px); }
.b5 .life ins, .b4 .pips ins { opacity: 1; transform: none; }
.b5 .portal[data-seat="2"] > svg { animation: hurt .9s ease-out .3s; }
@keyframes hurt { 30% { box-shadow: 0 0 0 1px rgba(0, 0, 0, .6), 0 0 50px 10px rgba(229, 72, 77, .85), 0 16px 34px rgba(0, 0, 0, .6); } }
.seat-you { position: absolute; left: 50%; top: 100%; z-index: 6; transform: translate(-50%, -50%); }
.seat-you b { color: var(--seat-0); }
.pips { display: inline-flex; gap: 5px; }
.pips i { place-items: center; width: 1.7em; height: 1.7em; border-radius: 50%; font-style: normal; font-size: .85em; color: #10240f; background: #86c46f;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .2); }
.pips i.w { background: #f2ead0; color: #3a3320; }

.log { position: absolute; right: clamp(16px, 3vw, 48px); bottom: 7vh; width: min(300px, 25vw); padding: 12px 16px; z-index: 8;
  border-radius: 14px; background: rgba(14, 11, 22, .85); border: 1px solid rgba(243, 207, 122, .18); box-shadow: 0 20px 40px rgba(0, 0, 0, .5);
  font: 13.5px/1.45 var(--ui); color: var(--ink-dim); opacity: 0; transform: translateY(20px); transition: opacity .6s, transform .6s; }
.log p { margin: 0; max-height: 0; overflow: hidden; border-top: 1px solid transparent; opacity: 0; transform: translateX(10px);
  transition: opacity .5s, transform .5s, max-height .5s, padding .5s, border-color .5s; }
.log p:first-child { border-top: 0; }
.b4 .log .l1, .b4 .log .l2, .b5 .log .l3, .b5 .log .l4 { max-height: 3em; padding: 6px 0; border-top-color: rgba(255, 255, 255, .06); }
.log b { font-weight: 600; }
.log .s0 { color: var(--seat-0); }
.log .s2 { color: var(--seat-2); }
.log .s3 { color: var(--seat-3); }
.log em { color: #ff8f7a; font-style: normal; font-weight: 600; }
.log strong { color: var(--gold-hi); }
.b4 .log { opacity: 1; transform: none; }
.b4 .log .l1 { opacity: 1; transform: none; transition-delay: .25s; }
.b4 .log .l2 { opacity: 1; transform: none; transition-delay: .7s; }
.b5 .log .l3 { opacity: 1; transform: none; transition-delay: .4s; }
.b5 .log .l4 { opacity: 1; transform: none; transition-delay: 1.3s; }

.beats { position: absolute; left: clamp(20px, 6vw, 110px); top: 50%; width: min(29vw, 440px); height: 64vh; transform: translateY(-50%); z-index: 8; }
.beat { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; pointer-events: none;
  opacity: var(--v, 0); transform: translateY(calc(34px - var(--t, 0) * 52px)); }
.beat .num { font: 600 15px/1 var(--display); letter-spacing: .32em; color: var(--gold); margin-bottom: 16px; }
.beat h2 { font-size: clamp(27px, 2.6vw, 40px); margin-bottom: 16px; }
.beat p { font: 400 clamp(19px, 1.5vw, 22px)/1.5 var(--story); color: var(--ink-dim); margin: 0; }

@media (max-aspect-ratio: 4/3), (max-width: 820px) {
  .table-scene { --bx: 50%; --by: 35%; --S: min(78vw, 44vh); --pw: 38%; }
  .portal[data-seat="1"] { --px: 50%; --py: -6%; }
  .portal[data-seat="2"] { --px: 92%; --py: 72%; }
  .portal[data-seat="3"] { --px: 8%; --py: 72%; }
  .beats { left: 50%; top: auto; bottom: 3vh; width: min(90vw, 560px); height: 32vh; transform: translateX(-50%); text-align: center; }
  .beat { justify-content: flex-start; }
  .beat .num { margin-bottom: 10px; }
  .beat h2 { margin-bottom: 10px; }
  .log { display: none; }
}

/* ---------- III/IV. support and download ---------- */
/* starts in the table scene's dark room colour, so the two blend */
.support { position: relative; display: grid; place-items: center; text-align: center; padding: 14vh clamp(16px, 5vw, 64px); min-height: 90vh;
  background: linear-gradient(180deg, #070403, transparent 28%),
    radial-gradient(ellipse 50% 50% at 50% 45%, rgba(114, 164, 242, .1), transparent 70%), #0a0a18; }
/* the last screen: the download in the middle, the fine print along the bottom */
.download { position: relative; display: flex; flex-direction: column; min-height: 100vh; text-align: center;
  background: radial-gradient(ellipse 60% 50% at 50% 38%, rgba(217, 168, 70, .13), transparent 70%), var(--night); }
.download .panel { margin: auto; padding: 12vh clamp(16px, 5vw, 64px) 8vh; width: min(100%, 888px); }
.panel { width: min(100%, 760px); }
.panel h2 { font-size: clamp(38px, 5.2vw, 66px); margin-bottom: 16px; }
.big-icon { display: block; margin: 0 auto 28px; filter: drop-shadow(0 18px 40px rgba(0, 0, 0, .55)) drop-shadow(0 0 44px rgba(217, 168, 70, .25));
  animation: float 6s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-9px) rotate(3deg); } }
.lead { font: 400 clamp(20px, 1.9vw, 25px)/1.5 var(--story); color: var(--ink-dim); margin: 0 auto 32px; max-width: 600px; }
.fine { margin: 16px 0 0; font-size: 14px; color: var(--ink-faint); }
.note { margin: 30px auto 0; max-width: 580px; font-size: 14px; color: var(--ink-faint); }
.note b { color: var(--ink-dim); }
.big-mug { display: block; width: 150px; margin: 0 auto 22px; overflow: visible; }
.big-mug .steam path { stroke-opacity: 0; stroke-dasharray: 60; animation: waft 3.6s ease-in-out infinite; }
.big-mug .steam path:nth-child(2) { animation-delay: -1.2s; }
.big-mug .steam path:nth-child(3) { animation-delay: -2.4s; }
@keyframes waft { 0% { stroke-opacity: 0; stroke-dashoffset: 60; transform: translateY(8px); } 40% { stroke-opacity: .55; }
  100% { stroke-opacity: 0; stroke-dashoffset: -60; transform: translateY(-10px); } }

/* ---------- footer ---------- */
.foot { padding: 40px clamp(16px, 5vw, 64px) 48px; text-align: center; font-size: 13px; color: var(--ink-faint);
  background: #07070f; border-top: 1px solid rgba(243, 207, 122, .1); }
.foot p { max-width: 780px; margin: 10px auto; }
.foot .mark { justify-content: center; font-size: 15px; color: var(--ink-dim); }

/* ---------- stops: a swipe, flick or wheel turn of any size glides to the next one ---------- */
html { scroll-snap-type: y mandatory; }
.snap, .support, .download { scroll-snap-align: start; scroll-snap-stop: always; }
.support { scroll-margin-top: 64px; } /* clear the top bar */
/* Stops sit about a screen apart (the scene lengths and the support section's min-height):
   a long swipe drags the page past a closer stop before the glide even starts. The last
   screen holds the footer, so the bottom of the page needs no stop of its own; where it's
   taller than the screen, you can scroll freely within it. */

/* ---------- less motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .shooting, .embers { display: none; }
}
