/* ───────────────────────────────────────────────────────────
   SPARKLES, SPADES & SAKE
   Layout: one full-bleed stage, edge to edge; art bleeds past the
   screen edges; only the controls respect the safe areas.
   Palette drawn from the moodboard, lifted onto an ivory ground.
   ─────────────────────────────────────────────────────────── */
:root {
  --ivory: #FBF6EC;
  --cream: #F4EAD8;
  --champagne: #D6B58A;
  --bronze: #A66A3D;
  --rust: #8E321E;
  --vermilion: #A8432A;
  --oxblood: #5A1715;
  --walnut: #3B1F18;
  --ink: #171514;
  --blush: #EBCFC0;
  --ruby: #A11E33;
  --ruby-grad: linear-gradient(180deg, #C8303F 0%, #A31F34 52%, #7E132A 100%);
  --vermilion-lux: #BF4A2C;

  --display: 'Bodoni Moda', 'Bodoni 72', Didot, 'Didot LT STD', 'Playfair Display', Georgia, serif;
  --lyric: 'Cormorant Garamond', Cormorant, 'Hoefler Text', Georgia, serif;
  --flourish: 'Playfair Display', 'Bodoni Moda', Didot, Georgia, serif;
  --script: 'Pinyon Script', 'Snell Roundhand', 'Apple Chancery', 'Brush Script MT', cursive;
  --label: 'Jost', 'Avenir Next', Avenir, 'Helvetica Neue', Arial, sans-serif;

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --vh: 1vh;
  color-scheme: light;
}
@supports (height: 1dvh) { :root { --vh: 1dvh; } }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: var(--ivory); color: var(--walnut);
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
body { font-family: var(--label); position: fixed; inset: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 1.5px solid var(--bronze); outline-offset: 4px; border-radius: 4px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nowrap { white-space: nowrap; }

#app { position: fixed; inset: 0; overflow: hidden; }

/* ── Background: ivory, a golden-hour dusk for the sky, drifting light ── */
#bg { position: absolute; inset: 0; overflow: hidden; }
.bg-layer { position: absolute; inset: 0; transition: opacity 1.4s ease; }
.bg-ivory {
  background:
    radial-gradient(120% 70% at 50% 108%, #F1DEC4 0%, rgba(241,222,196,0) 60%),
    radial-gradient(90% 60% at 50% -10%, #FFFDF8 0%, rgba(255,253,248,0) 70%),
    linear-gradient(180deg, #FCF8F0 0%, #F8F0E2 55%, #F3E6D2 100%);
}
.bg-dusk {
  opacity: 0;
  background:
    radial-gradient(80% 50% at 50% 115%, rgba(255,238,214,.9) 0%, rgba(255,238,214,0) 70%),
    linear-gradient(180deg, #B83A22 0%, #CB4529 18%, #DE7552 34%, #EFB596 48%, #F8E2CE 62%, #FBEEE0 100%);
}

/* ── Screen colours (approved: Option B, Japanese Vermilion) ──
   Screen 1 vermilion · Screen 2 ivory · Screen 3 rust · Screen 4 vermilion
   dusk into ivory. Colours come from the moodboard. Layers cross-fade. */
.bg-vermilion { opacity: 0; background: radial-gradient(62% 40% at 50% 47%, #DD5C34 0%, #CB4529 100%); }
.bg-rust { opacity: 0; background: radial-gradient(62% 42% at 50% 46%, #AD4A2B 0%, #93361F 100%); }
#app[data-scene="fan"] .bg-vermilion, #app[data-scene="cards"] .bg-rust { opacity: 1; }
#app[data-scene="fan"] .glow.g1, #app[data-scene="cards"] .glow.g1 { background: radial-gradient(closest-side, rgba(255,214,170,.28), transparent); }
#app[data-scene="fan"] .glow.g2 { background: radial-gradient(closest-side, #B03A22, transparent); opacity: .5; }
#app[data-scene="fan"] .grain, #app[data-scene="cards"] .grain { mix-blend-mode: soft-light; opacity: .12; }
/* Warm-ivory text and controls on the coloured screens */
#app[data-scene="fan"] .opening { color: #FFF4E2; text-shadow: 0 2px 14px rgba(60,14,8,.28); }
#app[data-scene="fan"] .cue-text, #app[data-scene="cards"] .cue-text { color: #FFF4E2; text-shadow: 0 1px 10px rgba(60,14,8,.3); }
#app[data-scene="fan"] .fan-wrap svg { filter: drop-shadow(0 14px 26px rgba(50,12,6,.32)); }
#app[data-scene="cards"] .pips i { border-color: rgba(255,236,206,.8); }
#app[data-scene="cards"] .pips i.on { background: #FFF0DA; }
#app[data-scene="fan"] .hud-btn, #app[data-scene="cards"] .hud-btn { background: rgba(255,244,226,.14); border-color: rgba(255,236,206,.5); color: #FFF0DA; }
#app[data-scene="fan"] #mute.needs-tap::after, #app[data-scene="cards"] #mute.needs-tap::after { color: #FFF0DA; }
#app[data-scene="fan"] #progress li, #app[data-scene="cards"] #progress li { background: rgba(255,236,206,.35); }
#app[data-scene="fan"] #progress li.on, #app[data-scene="cards"] #progress li.on { background: #FFF0DA; }
/* Screen 4 sky: ivory cue and counter on the vermilion upper sky */
#app[data-scene="finale"] .hud-btn { background: rgba(255,244,226,.18); border-color: rgba(255,236,206,.55); color: #FFF0DA; }
.glow { position: absolute; border-radius: 50%; filter: blur(40px); opacity: .55; pointer-events: none; }
.glow.g1 { width: 70vmax; height: 70vmax; left: -30vmax; top: -25vmax; background: radial-gradient(closest-side, #FFF6E2, transparent); animation: drift 22s ease-in-out infinite alternate; }
.glow.g2 { width: 60vmax; height: 60vmax; right: -28vmax; bottom: -22vmax; background: radial-gradient(closest-side, rgba(214,181,138,.55), transparent); animation: drift 26s ease-in-out infinite alternate-reverse; }
@keyframes drift { to { transform: translate(8vmax, 6vmax) scale(1.1); } }
.grain {
  position: absolute; inset: -50%; opacity: .07; pointer-events: none; mix-blend-mode: multiply;
  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 .35 0 0 0 0 .22 0 0 0 0 .12 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
.petal { position: absolute; top: -6vh; left: var(--x); width: calc(22px * var(--s)); height: calc(22px * var(--s)); opacity: .85; animation: fall var(--dur) linear var(--delay) infinite; will-change: transform; }
.petal svg { width: 100%; height: 100%; display: block; animation: flutter 3.2s ease-in-out infinite alternate; }
@keyframes fall { to { transform: translate(var(--drift), 115vh) rotate(var(--spin)); } }
@keyframes flutter { from { transform: rotateY(0deg) rotateX(20deg); } to { transform: rotateY(160deg) rotateX(-20deg); } }
.dust { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: #D6B58A; box-shadow: 0 0 6px 1px rgba(214,181,138,.8); transform: scale(var(--s)); animation: twinkle 4.6s ease-in-out var(--d) infinite; }
@keyframes twinkle { 0%, 100% { opacity: 0; } 50% { opacity: .9; } }

#fx-back, #fx-front { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#fx-front { z-index: 5; }
#stage { position: absolute; inset: 0; z-index: 2; }
#sweep { position: absolute; inset: 0; z-index: 6; pointer-events: none; opacity: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255,246,226,.0) 40%, rgba(255,240,210,.85) 50%, rgba(255,246,226,0) 60%, transparent 65%);
  background-size: 300% 100%; }
#sweep.run { animation: sweep 1.1s cubic-bezier(.6,0,.3,1); }
@keyframes sweep { 0% { opacity: 1; background-position: 100% 0; } 100% { opacity: 1; background-position: 0 0; } }

/* ── Scenes: every scene is a full-bleed sheet ── */
.scene {
  position: absolute; inset: 0; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: calc(var(--safe-t) + 64px) max(18px, var(--safe-r)) calc(var(--safe-b) + 28px) max(18px, var(--safe-l));
  touch-action: none; will-change: opacity, transform, filter;
}

/* ── Type ── */
.eyebrow { margin: 0; text-align: center; }
.lyric { font-family: var(--lyric); font-style: italic; font-weight: 400; color: var(--walnut); letter-spacing: .01em; text-wrap: balance; }
.eyebrow.lyric { font-size: clamp(20px, 5.6vw, 28px); line-height: 1.25; }
.title {
  margin: 0; font-family: var(--display); font-weight: 400; color: var(--oxblood);
  font-size: clamp(38px, 11.4vw, 74px); line-height: .98; letter-spacing: .02em; text-align: center;
  font-variation-settings: 'opsz' 96;
}
.title .t-line { display: block; white-space: nowrap; }
.title .amp { font-family: var(--lyric); font-style: italic; font-weight: 400; color: var(--vermilion); font-size: 1.08em; padding: 0 .02em; }
.tagline { margin: .55em 0 0; font-size: clamp(18px, 5vw, 26px); text-align: center; color: var(--rust); }
.hint { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.hint .label, .label-caps {
  font-family: var(--label); font-weight: 400; font-size: 11.5px; letter-spacing: .32em; text-transform: uppercase; color: var(--bronze); padding-left: .32em;
}
.divider { display: block; width: min(220px, 60vw); height: 14px; margin: 0 auto; }

.cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 48px; padding: 0 22px; border-radius: 999px; cursor: pointer; text-decoration: none;
  font-family: var(--label); font-size: 11.5px; font-weight: 500; letter-spacing: .24em; text-transform: uppercase;
  color: var(--oxblood); background: rgba(255,251,243,.72);
  border: 1px solid rgba(166,106,61,.55);
  box-shadow: 0 1px 0 rgba(255,255,255,.9) inset, 0 10px 24px -14px rgba(90,23,21,.45);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: transform .25s ease, background .25s ease;
}
.cta:active { transform: scale(.97); background: rgba(246,234,212,.9); }
.text-btn { background: none; border: 0; cursor: pointer; padding: 10px 12px; min-height: 44px; display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--label); font-size: 11px; letter-spacing: .26em; text-transform: uppercase; color: var(--bronze); }

/* ── HUD ── */
#hud { position: absolute; inset: 0 0 auto 0; z-index: 8; pointer-events: none;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(var(--safe-t) + 12px) max(14px, var(--safe-r)) 0 max(14px, var(--safe-l)); }
.hud-btn { pointer-events: auto; border: 1px solid rgba(166,106,61,.35); background: rgba(251,246,236,.55);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: var(--bronze); height: 38px; min-width: 38px; border-radius: 999px; display: grid; place-items: center; cursor: pointer; }
.hud-text { padding: 0 14px; font-size: 10.5px; letter-spacing: .24em; text-transform: uppercase; }
#mute { position: relative; visibility: hidden; pointer-events: none; }  /* no sound button: kept only as a spacer so the progress marks stay centred */
#mute.needs-tap { animation: needTap 1.6s ease-in-out infinite; }
#mute.needs-tap::after { content: 'Tap for sound'; position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%); white-space: nowrap; font-size: 10px; letter-spacing: .22em; text-transform: uppercase; color: var(--bronze); }
@keyframes needTap { 50% { box-shadow: 0 0 0 6px rgba(214,181,138,.35); } }
#mute .slash { opacity: 0; } #mute.is-muted .slash { opacity: 1; } #mute.is-muted .waves { opacity: 0; }
#progress { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; }
#progress li { width: 16px; height: 1.5px; background: rgba(166,106,61,.25); transition: background .6s; }
#progress li.on { background: var(--bronze); }

/* ════ SCREEN 1 · THE FAN ════ */
.scene-fan { padding: 0; }
.fan-stage { position: absolute; inset: 0; }
.fan-wrap { position: absolute; left: 50%; top: 50%; width: min(100vw, 128vh, 640px); aspect-ratio: 410 / 236; transform: translate(-50%, -66%); cursor: grab; outline-offset: 12px; }
.fan-move, .fan-tilt { position: absolute; inset: 0; }
.fan-move { transform-origin: 50% 91%; }
.fan-tilt { transform-origin: 50% 91%; }
.fan-svg { width: 100%; height: 100%; display: block; overflow: visible; filter: drop-shadow(0 18px 18px rgba(90,23,21,.16)); }
.lite .fan-svg { filter: none; }
.fan-halo { position: absolute; left: 50%; top: 62%; width: 110%; aspect-ratio: 1; transform: translate(-50%, -50%) scale(.6); border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255,244,220,.95), rgba(255,244,220,0)); opacity: 0; transition: opacity 1.2s, transform 1.6s cubic-bezier(.2,.8,.2,1); }
.scene-fan.opened .fan-halo { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.scene-fan.leaving .fan-halo { opacity: 0; transition-duration: .5s; }
.tassel { transform-origin: 0 4px; animation: sway 3.4s ease-in-out infinite alternate; transition: opacity .8s; }
.scene-fan.opened .tassel { opacity: 0; }
.tassels .tsl { transform-box: fill-box; transform-origin: 50% 0; animation: tslSway 3.6s ease-in-out infinite alternate; animation-delay: var(--d, 0s); }
@keyframes tslSway { from { transform: rotate(-4deg); } to { transform: rotate(4deg); } }
@keyframes sway { from { transform: rotate(-7deg); } to { transform: rotate(7deg); } }
/* Opening line, the cord knot and the golden spark */
.opening { position: absolute; left: 0; right: 0; top: calc(var(--safe-t) + clamp(104px, 19.5vh, 200px)); margin: 0; text-align: center; padding: 0 20px;
  font-family: var(--display); font-style: italic; font-weight: 500; font-variation-settings: 'opsz' 28; font-size: clamp(31px, 9vw, 48px); line-height: 1.1;
  color: var(--ruby); letter-spacing: .005em; opacity: 0; transform: translateY(10px); animation: fadeUp 1.4s cubic-bezier(.2,.8,.2,1) forwards .35s; transition: opacity .7s, transform .7s; }
.scene-fan.opened .opening { opacity: 0 !important; transform: translateY(-12px); animation: none; }
.mizuhiki { position: absolute; left: 50%; top: 63%; width: 17%; transform: translate(-50%, -50%); pointer-events: none; }
.mizuhiki svg { display: block; width: 100%; height: auto; filter: drop-shadow(0 3px 3px rgba(90,23,21,.2)); }
.rivet-spark { position: absolute; left: 50%; top: 89.8%; width: 7%; transform: translate(-50%, -50%); pointer-events: none; }
.rivet-spark svg { display: block; width: 100%; height: auto; animation: rivetGlint 2.8s ease-in-out infinite; transform-origin: center; }
@keyframes rivetGlint { 0%, 100% { transform: scale(.75) rotate(0deg); opacity: .75; } 50% { transform: scale(1.1) rotate(45deg); opacity: 1; } }
.scene-fan.opened .rivet-spark svg { animation-duration: 1.4s; }
/* The cue: large, high-contrast, unmistakable */
.fan-cue { position: absolute; left: 0; right: 0; bottom: calc(var(--safe-b) + clamp(44px, 11vh, 120px)); display: grid; justify-items: center; transition: opacity .6s; }
.fan-cue > * { grid-area: 1 / 1; }
.cue-text { font-family: var(--lyric); font-style: italic; font-weight: 600; font-size: clamp(28px, 8.2vw, 38px); line-height: 1.1; color: var(--oxblood); letter-spacing: .01em; text-shadow: 0 1px 0 rgba(255,255,255,.8); }
.begin { display: flex; flex-direction: column; align-items: center; gap: 12px; background: none; border: 0; padding: 8px 16px; cursor: pointer; transition: opacity .5s, transform .6s; }
.begin .seal { display: block; border-radius: 50%; animation: sealBreathe 2.8s ease-in-out infinite; filter: drop-shadow(0 8px 14px rgba(90,23,21,.25)); }
.begin .seal svg { display: block; }
@keyframes sealBreathe { 50% { transform: scale(1.06); } }
.scene-fan.begun .begin { opacity: 0; transform: scale(.85); pointer-events: none; }
.swipe-cue { display: flex; flex-direction: column; align-items: center; gap: 6px; opacity: 0; transition: opacity .8s .4s; pointer-events: none; }
.scene-fan.begun .swipe-cue { opacity: 1; }
.swipe-arc { width: min(64vw, 250px); height: auto; overflow: visible; }
.arc-dot { filter: drop-shadow(0 0 5px rgba(214,181,138,.95)); }
.scene-fan.touched .fan-cue { opacity: .25; }
.scene-fan.opened .fan-cue { opacity: 0; }

/* ════ SCREEN 2 · THE TITLE ════
   Three rows: accents top, the name in the middle, accents bottom.
   Decoration is confined to its row, so it can never touch the name. */
.scene-title { padding: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto minmax(0, 1fr); align-items: stretch; justify-items: stretch; cursor: pointer; }
.band { position: relative; overflow: hidden; min-height: 0; }
.band-art { position: absolute; height: 100%; max-height: 340px; aspect-ratio: 320 / 260; }
.band-art svg { display: block; width: 100%; height: 100%; }
.top-art { left: -12%; bottom: 0; }
.bottom-art { right: -14%; top: 0; }
.band-lanterns { position: absolute; top: 0; right: max(32%, 136px); height: min(76%, 240px); display: flex; align-items: flex-start; gap: 16px; }
.band-lanterns .lantern, .cp-lanterns .lantern { position: relative; left: auto; top: auto; width: auto; height: 100%; animation: sway2 5s ease-in-out infinite alternate; animation-delay: var(--d, 0s); transform-origin: 50% 0; }
.band-lanterns .lantern:first-child, .cp-lanterns .lantern:first-child { height: 62%; }
.band-lanterns .lantern svg, .cp-lanterns .lantern svg { height: 100%; width: auto; display: block; filter: drop-shadow(0 8px 14px rgba(142,50,30,.25)); }
@keyframes sway2 { from { transform: rotate(-3deg); } to { transform: rotate(3deg); } }
.tile-pair { position: absolute; left: 8%; bottom: 16%; height: min(52%, 112px); display: flex; align-items: flex-end; }
.mt { display: block; height: 100%; aspect-ratio: 60 / 82; filter: drop-shadow(0 10px 12px rgba(59,31,24,.2)); }
.mt svg { display: block; width: 100%; height: 100%; }
.tile-pair .mt1 { transform: rotate(-9deg); }
.tile-pair .mt2 { margin-left: -14%; transform: rotate(7deg) translateY(5%); }
/* bands glide in as the fan sweeps away */
.scene-title .band > * { opacity: 0; }
.scene-title.reveal .top-art { animation: inTL 1.5s cubic-bezier(.2,.8,.2,1) forwards; }
.scene-title.reveal .band-lanterns { animation: inTop 1.6s cubic-bezier(.2,.8,.2,1) forwards .2s; }
.scene-title.reveal .bottom-art { animation: inBR 1.5s cubic-bezier(.2,.8,.2,1) forwards .15s; }
.scene-title.reveal .tile-pair { animation: inUp 1.3s cubic-bezier(.2,.8,.2,1) forwards .5s; }
@keyframes inTL { from { opacity: 0; translate: -28px -18px; } to { opacity: 1; translate: 0 0; } }
@keyframes inBR { from { opacity: 0; translate: 28px 18px; } to { opacity: 1; translate: 0 0; } }
@keyframes inTop { from { opacity: 0; translate: 0 -30px; } to { opacity: 1; translate: 0 0; } }
@keyframes inUp { from { opacity: 0; translate: 0 22px; } to { opacity: 1; translate: 0 0; } }

.title-core { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: clamp(8px, 1.6vh, 16px); padding: clamp(10px, 2vh, 24px) max(18px, var(--safe-r)) clamp(10px, 2vh, 24px) max(18px, var(--safe-l)); }
/* The name: high-contrast Didone caps in luminous ruby, a script ampersand */
.hero-title { margin: 0; font-family: var(--display); font-weight: 600; font-variation-settings: 'opsz' 14; letter-spacing: .06em; line-height: 1.04; color: var(--ruby); }
.hero-title .t-line { display: block; white-space: nowrap; padding: .12em .4em .18em; margin: -.12em -.4em -.18em; clip-path: inset(-1em -2em 0 -2em); }
.hero-title .t-in { display: inline-block; transform: translateY(118%);
  background: linear-gradient(100deg, rgba(255,236,214,0) 42%, rgba(255,236,214,.8) 50%, rgba(255,236,214,0) 58%), var(--ruby-grad);
  background-size: 280% 100%, 100% 100%; background-position: 135% 0, 0 0; background-repeat: no-repeat;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  -webkit-text-stroke: .022em #A31F34; paint-order: stroke fill; }  /* firms up the hairlines, so every A reads clearly */
.hero-title .amp { font-family: var(--script); font-style: normal; font-weight: 400; font-size: 1.34em; line-height: 0; letter-spacing: 0; vertical-align: -.1em; margin-right: .14em;
  -webkit-text-fill-color: var(--vermilion-lux); color: var(--vermilion-lux); -webkit-text-stroke: 0; }
.scene-title.reveal .t-in { animation: lineUp 1.2s cubic-bezier(.16,.9,.12,1) forwards, glint 2.4s ease-in-out forwards; }
.scene-title.reveal .t-line:nth-child(1) .t-in { animation-delay: .22s, 1.9s; }
.scene-title.reveal .t-line:nth-child(2) .t-in { animation-delay: .38s, 2.05s; }
.scene-title.reveal .t-line:nth-child(3) .t-in { animation-delay: .54s, 2.2s; }
@keyframes lineUp { to { transform: none; } }
@keyframes glint { from { background-position: 135% 0, 0 0; } to { background-position: -35% 0, 0 0; } }
.core-emblem, .title-core .tagline, .hold-line { opacity: 0; transform: translateY(10px); }
.scene-title.reveal .core-emblem { animation: fadeUp .9s ease forwards .05s; }
.scene-title.reveal .tagline { animation: fadeUp 1.2s ease forwards 1.3s; }
.scene-title.reveal .hold-line { animation: fadeUp .8s ease forwards 1.9s; }
.core-flourish .flourish { display: block; width: min(66vw, 290px); height: auto; overflow: visible; }
.fl-stroke { stroke-dasharray: 1; stroke-dashoffset: 1; }
.fl-dot { opacity: 0; }
.scene-title.reveal .fl-stroke { animation: draw 1.5s cubic-bezier(.45,0,.2,1) forwards 1s; }
.scene-title.reveal .fl-dot { animation: fadeIn .6s ease forwards 2.2s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fadeIn { to { opacity: 1; } }
.title-core .tagline { margin: 0; font-family: var(--lyric); font-style: italic; font-weight: 500; font-size: clamp(19px, 5.4vw, 30px); color: var(--rust); max-width: 22em; letter-spacing: .01em; }
.hold-line { display: block; width: 72px; height: 1px; background: rgba(166,106,61,.25); position: relative; overflow: hidden; }
.hold-line i { position: absolute; inset: 0; background: var(--bronze); transform-origin: left; transform: scaleX(0); }
.scene-title.reveal .hold-line i { animation: hold 4.5s linear forwards 1.9s; }
@keyframes hold { to { transform: scaleX(1); } }
@keyframes chIn { to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes fadeUp { to { opacity: 1; transform: none; } }
@keyframes breathe { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

/* ════ SCREEN 3 · THE CARDS ════ */
.scene-cards { justify-content: space-between; perspective: 1200px; padding: calc(var(--safe-t) + 62px) 0 calc(var(--safe-b) + 14px); }
.tiles { position: absolute; inset: 0; pointer-events: none; transition: transform .6s ease-out; }
.tile { position: absolute; width: clamp(50px, 14vw, 88px); opacity: .55; filter: drop-shadow(0 10px 12px rgba(59,31,24,.14)); animation: float 7s ease-in-out infinite alternate; }
.tile svg { display: block; width: 100%; height: auto; }
.tile.t1 { left: -4vw; top: 6%; transform: rotate(-18deg); }
.tile.t2 { right: -5vw; bottom: 7%; transform: rotate(16deg); animation-delay: -2s; }
@keyframes float { to { translate: 0 -12px; } }
.deck { position: relative; width: 100%; flex: 1; min-height: 0; transform-style: preserve-3d; transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .5s ease-out; }
.card { position: absolute; width: var(--cw, 40vw); aspect-ratio: 140 / 200; padding: 0; border: 0; background: none; cursor: pointer; perspective: 1100px;
  transform: rotate(var(--rot, 0deg)); container-type: inline-size; }
.card-enter, .card-bob, .card-inner { position: absolute; inset: 0; display: block; transform-style: preserve-3d; }
.card-bob { animation: bob 4.6s ease-in-out infinite alternate; animation-delay: calc(var(--bob) * -1); }
@keyframes bob { from { transform: translateY(-4px); } to { transform: translateY(5px); } }
.face { position: absolute; inset: 0; display: block; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 9%/6.3%; overflow: hidden;
  box-shadow: 0 1px 0 rgba(255,255,255,.8) inset, 0 24px 32px -18px rgba(59,31,24,.45), 0 2px 6px rgba(59,31,24,.12); background: #FCF8F0; }
.face svg { width: 100%; height: 100%; display: block; }
.face.front { transform: rotateY(180deg); }
.card:not(.flipped) .card-inner::after { content: ''; position: absolute; inset: 0; border-radius: 9%/6.3%; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255,250,236,.65) 45%, transparent 60%); background-size: 260% 100%; animation: cardGleam 4s ease-in-out infinite; }
.card.c1:not(.flipped) .card-inner::after { animation-delay: .5s; } .card.c2:not(.flipped) .card-inner::after { animation-delay: 1s; }
@keyframes cardGleam { 0%, 55% { background-position: 120% 0; } 100% { background-position: -40% 0; } }
.card-info { position: absolute; left: 10%; right: 10%; top: 53%; bottom: 10%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3.5cqw; text-align: center; color: var(--oxblood); }
.ci-lyric { font-family: var(--lyric); font-style: italic; font-weight: 600; font-size: 12.5cqw; line-height: 1; color: var(--rust); }
.ci-big { font-family: var(--display); font-weight: 600; font-variation-settings: 'opsz' 28; font-size: 11.5cqw; line-height: 1.12; text-wrap: balance; letter-spacing: .01em; }
.ci-cap { font-family: var(--label); font-size: 7.6cqw; letter-spacing: .32em; padding-left: .32em; color: var(--bronze); }
.ci-hero { font-family: var(--display); font-weight: 600; font-variation-settings: 'opsz' 28; font-size: 28cqw; line-height: .95; letter-spacing: .02em; }
.ci-venue .ci-big { font-size: 11cqw; }
.ci-addr { font-family: var(--label); font-size: 6.8cqw; letter-spacing: .06em; line-height: 1.5; color: var(--walnut); text-wrap: balance; }
.cards-hint { position: relative; z-index: 2; }
.cards-hint .cue-text { font-size: clamp(24px, 6.8vw, 32px); }
.cards-hint { gap: 10px; }
.face { transition: box-shadow .5s ease; }
.card.lifting .face { box-shadow: 0 1px 0 rgba(255,255,255,.8) inset, 0 40px 46px -20px rgba(59,31,24,.5), 0 4px 10px rgba(59,31,24,.14); }
.pips { display: flex; gap: 10px; }
.pips i { width: 6px; height: 6px; transform: rotate(45deg); border: 1px solid var(--bronze); transition: background .4s; }
.pips i.on { background: var(--bronze); }
.scene-cards.converge .cards-hint { transition: opacity .5s; opacity: 0; }
.cards-hint .cue-text { transition: opacity .5s ease; }
.scene-cards.revealing .cards-hint .cue-text { opacity: 0; }
/* The grand card cascade */
.scene-cards.pre .card-enter { visibility: hidden; }
.cascade { position: absolute; inset: 0; pointer-events: none; perspective: 1000px; overflow: hidden; }
.cascade-back { z-index: 0; } .deck { z-index: 1; } .cascade-front { z-index: 3; }
.fcard { position: absolute; left: 0; top: 0; aspect-ratio: 140 / 200; transform-style: preserve-3d; will-change: transform; }
.fc-in { position: absolute; inset: 0; transform-style: preserve-3d; }
.fcard .face { box-shadow: 0 1px 0 rgba(255,255,255,.8) inset, 0 18px 26px -14px rgba(40,10,6,.45); }
.cards-hint { transition: opacity .45s ease; }
.cards-hint.waiting { opacity: 0; }
/* a warm-gold glint along the edges as each hero card settles */
.card .glint { position: absolute; inset: 0; border-radius: 9%/6.3%; pointer-events: none; backface-visibility: hidden; -webkit-backface-visibility: hidden; transform: translateZ(.5px);
  opacity: 0; box-shadow: inset 0 0 0 1.5px rgba(236,204,148,.95), 0 0 16px 1px rgba(255,214,150,.55);
  background: linear-gradient(115deg, transparent 38%, rgba(255,240,206,.55) 48%, transparent 58%) no-repeat; background-size: 260% 100%; background-position: 120% 0; }
.card.glinting .glint { animation: edgeGlint 1.2s cubic-bezier(.3,.6,.3,1) forwards; }
@keyframes edgeGlint { 0% { opacity: 0; background-position: 120% 0; } 25% { opacity: 1; } 100% { opacity: 0; background-position: -40% 0; } }
.card.flipped .glint { display: none; }
/* motif animations, started once a card is turned */
.card .ray { stroke-dasharray: 30; stroke-dashoffset: 30; }
.card.flipped .ray { animation: ray 2.6s cubic-bezier(.2,.7,.2,1) infinite; animation-delay: var(--d); }
@keyframes ray { 0% { stroke-dashoffset: 30; opacity: 1; } 55% { stroke-dashoffset: 0; opacity: 1; } 100% { stroke-dashoffset: -30; opacity: 0; } }
.card .twinkle { opacity: 0; }
.card.flipped .twinkle { animation: twinkle 1.8s ease-in-out infinite; animation-delay: var(--d); }
.card.flipped .burst { animation: spin 18s linear infinite; transform-origin: 0 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.card.flipped .ace { animation: ace 3.4s ease-in-out infinite; transform-origin: 70px 86px; }
@keyframes ace { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.card .sheen { transform: translateX(0) skewX(-18deg); }
.card.flipped .sheen { animation: spadeSheen 3.2s ease-in-out infinite 1s; }
@keyframes spadeSheen { 0% { transform: translateX(0) skewX(-18deg); } 60%, 100% { transform: translateX(150px) skewX(-18deg); } }
.card .ripple { opacity: 0; transform-box: fill-box; transform-origin: center; }
.card.flipped .ripple { animation: ripple 2.4s ease-out infinite; } .card.flipped .ripple.r2 { animation-delay: 1.2s; }
@keyframes ripple { 0% { transform: scale(.3); opacity: .9; } 100% { transform: scale(4.2); opacity: 0; } }

/* ════ SCREEN 4 · FIREWORKS FINALE ════ */
.scene-finale { padding: 0; }
.lanterns { position: absolute; inset: 0 0 auto 0; height: 50%; pointer-events: none; }
.lanterns .lantern { position: absolute; top: 0; width: calc(62px * var(--s, 1)); transform-origin: 50% 0; animation: lanternSway 5s ease-in-out infinite alternate; animation-delay: var(--d, 0s); }
.lantern svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 8px 14px rgba(142,50,30,.3)); }
@keyframes lanternSway { from { transform: translateX(-50%) rotate(-3deg); } to { transform: translateX(-50%) rotate(3deg); } }
.sky-cue { position: absolute; left: 0; right: 0; bottom: calc(var(--safe-b) + 66px); display: flex; flex-direction: column; align-items: center; gap: 16px; transition: opacity .8s; pointer-events: none; }
.sky-cue .cue-text { color: var(--oxblood); }
.swipe-up { position: relative; width: 1px; height: 84px; background: linear-gradient(to top, rgba(90,23,21,0), rgba(90,23,21,.35)); }
.swipe-up i { position: absolute; left: -4px; bottom: 0; width: 9px; height: 9px; border-radius: 50%; background: #FFF4DE; box-shadow: 0 0 14px 4px rgba(255,236,200,.95); animation: riseDot 1.8s cubic-bezier(.5,0,.3,1) infinite; }
@keyframes riseDot { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(-84px); opacity: 0; } }
.scene-finale.launched .sky-cue { opacity: 0; }
.sky-count { position: absolute; bottom: calc(var(--safe-b) + 26px); left: 0; right: 0; display: flex; gap: 14px; justify-content: center; transition: opacity .8s; }
.sky-count i { width: 10px; height: 10px; border-radius: 50%; border: 1px solid var(--oxblood); opacity: .55; transition: all .5s; }
.sky-count i.on { background: var(--oxblood); opacity: 1; box-shadow: 0 0 0 4px rgba(90,23,21,.12); }
.scene-finale.closed .sky-count { opacity: 0; }
.sky-a11y { position: absolute; bottom: calc(var(--safe-b) + 50px); left: 50%; transform: translateX(-50%); font-size: 9.5px; color: var(--oxblood); opacity: 0; pointer-events: none; }
.sky-a11y:focus-visible { opacity: 1; pointer-events: auto; }
.scene-finale.closed .sky-a11y { display: none; }
.closing { position: absolute; left: 0; right: 0; bottom: calc(var(--safe-b) + clamp(118px, 19vh, 170px)); display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: clamp(8px, 1.6vh, 14px); padding: 0 max(18px, var(--safe-r)) 0 max(18px, var(--safe-l)); pointer-events: none; }
.closing > * { opacity: 0; transform: translateY(14px); filter: blur(5px); margin: 0; }
.scene-finale.closed .closing > * { animation: finIn 1.3s cubic-bezier(.2,.8,.2,1) forwards; }
.scene-finale.closed .closing > :nth-child(2) { animation-delay: .4s; }
.scene-finale.closed .closing > :nth-child(3) { animation-delay: .75s; }
.closing-title { font-family: var(--display); font-weight: 650; color: #7E1426; line-height: 1.12; letter-spacing: .11em; text-transform: uppercase; font-variation-settings: 'opsz' 16; margin: 0 0 clamp(4px, 1.1vh, 10px); }
.closing-title .t-line:first-child { padding-left: .11em; }
.closing-title .glow-word { font-family: var(--display); font-style: italic; font-weight: 600; font-variation-settings: 'opsz' 36; text-transform: none; font-size: 2.05em; line-height: 1; letter-spacing: .005em; color: var(--ruby); padding: 0 .14em .04em; margin-top: .04em; }
.closing-title .t-line { display: block; white-space: nowrap; }
.closing-sub { font-family: var(--lyric); font-style: italic; font-weight: 600; font-size: clamp(21px, 5.9vw, 28px); line-height: 1.2; color: #7A2A1A; letter-spacing: .015em; }
.closing-hosts { display: flex; align-items: center; justify-content: center; gap: 14px; font-family: var(--display); font-weight: 650; font-variation-settings: 'opsz' 20; font-size: clamp(16px, 4.8vw, 22px); letter-spacing: 0; color: var(--oxblood); padding-left: 0; }
.hosts-rule { display: block; width: 28px; height: 1px; background: var(--bronze); }
.hosts-rule:last-child { margin-left: 0; }
@keyframes finIn { to { opacity: 1; transform: none; filter: blur(0); } }
.closing-actions { position: absolute; left: 0; right: 0; bottom: calc(var(--safe-b) + 8px); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px;
  padding: 0 max(8px, var(--safe-r)) 0 max(8px, var(--safe-l)); opacity: 0; pointer-events: none; transition: opacity .9s ease 1.2s; }
.scene-finale.closed .closing-actions { opacity: 1; pointer-events: auto; }
.act { display: flex; flex-direction: column; align-items: center; gap: 7px; background: none; border: 0; padding: 8px 2px; cursor: pointer; text-decoration: none;
  color: var(--oxblood); font-family: var(--label); font-size: 9px; letter-spacing: .14em; line-height: 1.35; text-transform: uppercase; text-align: center; }
.act svg { width: 18px; height: 18px; padding: 10px; box-sizing: content-box; border: 1px solid rgba(90,23,21,.3); border-radius: 50%; background: rgba(255,250,240,.6); transition: background .25s, transform .25s; }
.act:active svg { transform: scale(.94); background: rgba(246,234,212,.95); }
.cal-pop { grid-column: 1 / -1; order: -1; display: flex; justify-content: center; align-items: center; gap: 10px; padding: 6px 0 8px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--bronze); }
.cal-pop a { color: var(--oxblood); text-decoration: none; border-bottom: 1px solid rgba(166,106,61,.5); padding: 8px 2px 3px; }

/* ════ COMPLETE INVITATION (overlay) ════
   One composed card that fits the screen: an ikebana spray and lanterns at
   the top, the details centred, an open fan and two mahjong tiles as a base. */
.complete { position: absolute; inset: 0; z-index: 20;
  background: radial-gradient(120% 70% at 50% 108%, #F1DEC4 0%, rgba(241,222,196,0) 60%), linear-gradient(180deg, #FCF8F0 0%, #F8F0E2 60%, #F3E6D2 100%); }
.cp-page { --k: 1; position: absolute; inset: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y;
  display: grid; grid-template-rows: auto 1fr auto;
  padding: calc(var(--safe-t) + 16px) max(16px, calc(var(--safe-r) + 12px)) calc(var(--safe-b) + 16px) max(16px, calc(var(--safe-l) + 12px)); }
.cp-page::before { content: ''; position: absolute; inset: 0; opacity: .4; pointer-events: none;
  background: radial-gradient(70% 45% at 50% 50%, var(--ivory) 0%, rgba(251,246,236,.92) 60%, rgba(251,246,236,0) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='20'%3E%3Cg fill='none' stroke='%23B98C5E' stroke-width='.5'%3E%3Ccircle cx='0' cy='0' r='20'/%3E%3Ccircle cx='0' cy='0' r='14'/%3E%3Ccircle cx='0' cy='0' r='8'/%3E%3Ccircle cx='40' cy='0' r='20'/%3E%3Ccircle cx='40' cy='0' r='14'/%3E%3Ccircle cx='40' cy='0' r='8'/%3E%3Ccircle cx='20' cy='10' r='20'/%3E%3Ccircle cx='20' cy='10' r='14'/%3E%3Ccircle cx='20' cy='10' r='8'/%3E%3C/g%3E%3C/svg%3E"); }
.cp-frame { position: absolute; inset: calc(var(--safe-t) + 8px) max(8px, var(--safe-r)) calc(var(--safe-b) + 8px) max(8px, var(--safe-l)); border: 1px solid rgba(166,106,61,.5); pointer-events: none; z-index: 1; }
.cp-frame::after { content: ''; position: absolute; inset: 5px; border: .5px solid rgba(166,106,61,.32); }
.cp-top { position: relative; z-index: 2; height: clamp(90px, 18vh, 180px); }
.cp-spray { position: absolute; left: 0; top: 0; height: 100%; aspect-ratio: 320 / 260; }
.cp-spray svg { display: block; width: 100%; height: 100%; }
.cp-core { position: relative; z-index: 2; align-self: center; display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: calc(var(--k) * clamp(6px, 1.25vh, 12px)); padding: calc(var(--k) * 10px) 14px; }
.cp-core > *, .cp-details > * { margin: 0; }
.cp-title { margin: 0; font-family: var(--display); font-weight: 600; font-variation-settings: 'opsz' 14; color: var(--ruby); line-height: 1.06; letter-spacing: .05em; -webkit-text-stroke: .018em var(--ruby); }  /* same sturdy cut as Screen 2, so every A reads */
.cp-title .t-line { display: block; white-space: nowrap; }
.cp-title .amp { font-family: var(--script); font-style: normal; font-size: 1.3em; line-height: 0; vertical-align: -.1em; color: var(--vermilion-lux); letter-spacing: 0; -webkit-text-stroke: 0; }
.cp-tagline { font-family: var(--lyric); font-style: italic; font-weight: 500; font-size: calc(var(--k) * clamp(16px, 4.6vw, 23px)); color: var(--rust); }
.cp-rule .divider { width: min(180px, 48vw); }
.cp-details { display: flex; flex-direction: column; align-items: center; gap: calc(var(--k) * 3px); }
.cp-date { font-family: var(--display); font-weight: 600; font-variation-settings: 'opsz' 28; font-size: calc(var(--k) * clamp(18px, 5.2vw, 25px)); color: var(--walnut); }
.cp-time { font-family: var(--label); font-weight: 500; font-size: calc(var(--k) * 11.5px); letter-spacing: .34em; text-transform: uppercase; color: var(--vermilion); padding-left: .34em; }
.cp-venue { font-family: var(--display); font-weight: 600; font-variation-settings: 'opsz' 28; font-size: calc(var(--k) * clamp(19px, 5.6vw, 27px)); color: var(--oxblood); letter-spacing: .03em; }
.cp-addr { font-family: var(--label); font-size: calc(var(--k) * clamp(11px, 3.2vw, 13px)); letter-spacing: .1em; color: var(--walnut); }
.cp-glow { font-family: var(--display); font-weight: 700; font-variation-settings: 'opsz' 28; font-size: calc(var(--k) * clamp(17px, 4.9vw, 24px)); color: var(--ruby); line-height: 1.2; }
.cp-glow .glow-word { font-family: var(--display); font-style: italic; font-weight: 600; font-variation-settings: 'opsz' 36; font-size: 1.3em; color: var(--ruby); line-height: .9; padding-left: .06em; }  /* matches the closing screen */
.cp-closing { font-family: var(--lyric); font-style: italic; font-weight: 500; font-size: calc(var(--k) * clamp(17px, 4.9vw, 23px)); color: var(--rust); }
.cp-hosts { font-family: var(--display); font-weight: 650; font-variation-settings: 'opsz' 20; font-size: calc(var(--k) * clamp(15px, 4.4vw, 20px)); letter-spacing: 0; padding-left: 0; color: var(--oxblood); }
.cp-bottom { position: relative; z-index: 2; height: clamp(70px, 13vh, 140px); display: flex; align-items: flex-end; justify-content: flex-end; padding-right: 2%; }
.cp-fan { height: 100%; aspect-ratio: 410 / 236; transform: rotate(-8deg); transform-origin: 50% 90%; }
.cp-fan .fan-svg { filter: drop-shadow(0 8px 10px rgba(90,23,21,.12)); }
.cp-bottom .mt { height: 58%; }
.cp-bottom .mt1 { transform: rotate(-10deg); margin-right: 4px; }
.cp-bottom .mt2 { transform: rotate(9deg); margin-left: 4px; }
.cp-close { position: absolute; top: calc(var(--safe-t) + 18px); right: max(18px, calc(var(--safe-r) + 14px)); z-index: 4; width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; border: 1px solid rgba(166,106,61,.4); background: rgba(251,246,236,.85); color: var(--oxblood); cursor: pointer; }

/* Short screens (older iPhones, in-app browsers with toolbars) */
@media (max-height: 700px) {
  .fan-wrap { width: min(100vw, 120vh, 640px); }
  .closing { bottom: calc(var(--safe-b) + 108px); gap: 6px; }
  .act { font-size: 8.5px; }
  .act svg { padding: 8px; }
  .tile-pair { height: min(50%, 86px); bottom: 12%; }
  .cp-top { height: clamp(70px, 13vh, 120px); }
  .cp-bottom { height: clamp(58px, 10.5vh, 100px); }
}
@media (min-width: 700px) {
  .band-art { max-height: 300px; }
  .cp-core { max-width: 640px; margin: 0 auto; }
}

/* ── Reduced motion: keep every reveal, drop the drifting ── */
@media (prefers-reduced-motion: reduce) {
  .glow, .petal, .dust, .tile, .card-bob, .tassel, .tsl, .lantern, .card .burst, .card-inner::after, .begin .seal, .rivet-spark svg { animation: none !important; }
}

.noscript { position: fixed; inset: 0; display: grid; place-content: center; text-align: center; padding: 24px; font-family: Georgia, serif; color: #5A1715; background: #FBF6EC; }

/* Screen 4: the golden ember that becomes the first firework */
.ember { position: absolute; left: 50%; bottom: calc(var(--safe-b) + 176px); width: 40px; pointer-events: none; opacity: 0;
  transform: translate(-50%, 55vh); transition: transform 1.8s cubic-bezier(.2,.8,.2,1), opacity .6s; }
.ember.risen { transform: translate(-50%, 0); opacity: 1; }
.ember svg { display: block; width: 100%; height: auto; transition: opacity .25s, transform .25s; filter: drop-shadow(0 0 8px rgba(255,214,150,.9)); }
.ember:not(.ready) svg { opacity: 0; transform: scale(.3); }
.ember.ready svg { animation: emberBob 2.4s ease-in-out infinite; }
@keyframes emberBob { 0%, 100% { transform: translateY(0) rotate(0deg) scale(1); } 50% { transform: translateY(-8px) rotate(45deg) scale(1.12); } }
.scene-finale.closed .ember { display: none; }
@media (prefers-reduced-motion: reduce) { .ember.ready svg { animation: none; } }
