/* Navrang — phone-first festive scroll story.
   Layout: one centred column of full-screen scenes; the backdrop takes each night's colour.
   Materials (paper, kraft, velvet, film grain) come from js/tex.js as CSS variables. */
:root {
  color-scheme: dark;
  --night: #14070C;
  --ivory: #FBEFDC;
  --gold: #E2B04A;
  --gold-hi: #F6D67A;
  --gold-lo: #9A6A1C;
  --kumkum: #B3122F;
  --rani: #D91F82;
  --ink: var(--ivory);
  --accent: var(--gold);
  --muted: rgba(251, 239, 220, 0.68);
  --foil: linear-gradient(100deg, #9A6A1C 0%, #E2B04A 20%, #FFF1C4 32%, #E2B04A 44%, #B5832A 58%, #F6D67A 76%, #9A6A1C 100%);

  --f-display: "Bodoni Moda", Didot, "Bodoni 72", Georgia, serif;
  --f-serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --f-hand: "Kalam", "Segoe Print", "Bradley Hand", cursive;
  --f-deva: "Tiro Devanagari Sanskrit", "Noto Serif Devanagari", serif;
  --f-type: "Courier Prime", "Courier New", ui-monospace, monospace;
  --f-story: "Fraunces", "Iowan Old Style", Georgia, serif;

  --shadow-print: 0 1px 1px rgba(0, 0, 0, 0.18), 0 6px 12px -4px rgba(0, 0, 0, 0.35), 0 24px 44px -16px rgba(0, 0, 0, 0.5);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tx: 0;
  --ty: 0;
}
body[data-ink="dark"] {
  --ink: #3A0E18;
  --accent: #8C1631;
  --muted: rgba(58, 14, 24, 0.7);
  --foil: linear-gradient(100deg, #5E0918 0%, #A3122D 26%, #D9566C 36%, #8C1631 50%, #A3122D 74%, #5E0918 100%);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--night);
  color: var(--ink);
  font-family: var(--f-serif);
  overflow-x: clip;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.8s ease;
}
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.backdrop { position: fixed; inset: 0; z-index: 0; background-color: var(--night); transition: background-color 1.1s ease; }
.backdrop::after {
  content: ""; position: absolute; inset: 0; transition: opacity 1s;
  background:
    radial-gradient(ellipse 90% 50% at 50% 0%, rgba(255, 236, 200, 0.14), transparent 70%),
    radial-gradient(ellipse 120% 60% at 50% 110%, rgba(0, 0, 0, 0.4), transparent 70%);
}
body[data-ink="dark"] .backdrop::after { opacity: 0.3; }
.petals { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
main { position: relative; z-index: 2; overflow-x: clip; }

/* film grain over everything, the way a printed photograph has it.
   Static and unblended on purpose: a blended, moving full-screen layer makes phones re-composite
   the whole page every frame, which uses a lot of memory and makes iPhones reload the page. */
@media (pointer: coarse) { .grain { display: none; } }
.grain {
  position: fixed; inset: 0; z-index: 65; pointer-events: none;
  background-image: var(--tex-grain);
  opacity: 0.05;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-4%, 3%); } 40% { transform: translate(3%, -2%); }
  60% { transform: translate(-2%, -4%); } 80% { transform: translate(4%, 2%); } 100% { transform: translate(0, 0); }
}

/* ---------- scene scaffold ---------- */
.scene {
  position: relative;
  min-height: 100svh;
  padding: calc(78px + var(--safe-top)) 16px calc(100px + var(--safe-bottom));
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 24px;
  text-align: center;
  overflow-x: clip;
}
/* Scenes far off screen are not rendered at all (big memory and battery saving on phones).
   The clothesline is excluded because its pinned scroll needs real layout. */
.scene:not(.hero):not(.night-clothesline) { content-visibility: auto; contain-intrinsic-size: auto 100svh; }
.intro-build { position: absolute; left: 0; right: 0; bottom: calc(14px + var(--safe-bottom)); margin: 0; text-align: center; font: 500 0.62rem/1 ui-monospace, Menlo, monospace; letter-spacing: 0.12em; color: rgba(251, 239, 220, 0.28); }
.scene > * { max-width: 460px; }
/* full-width decorations stay full width on laptops */
.scene > .toran-wrap, .scene > .scroll-hint { max-width: none; }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.9s ease, transform 0.9s cubic-bezier(.2, .8, .2, 1); }
.reveal.in { opacity: 1; transform: none; }

.setup {
  margin: 0;
  font-style: italic; font-weight: 500;
  font-size: clamp(1.35rem, 5.8vw, 1.75rem);
  line-height: 1.32;
  max-width: 21ch;
  text-wrap: balance;
}
.hint {
  margin: 0;
  display: flex; align-items: center; justify-content: center; gap: 0.7em;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--muted);
}
.hint-ico { width: 13px; height: 13px; flex: none; color: var(--accent); }
.hint.in { animation: hintPulse 2.8s ease-in-out 1.2s infinite; }
@keyframes hintPulse { 50% { opacity: 0.5; } }
.scene.done .hint { visibility: hidden; }

/* hand-drawn doodles draw themselves when their group comes in */
.doodle { display: block; overflow: visible; }
.doodle path { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 0.9s cubic-bezier(.5, 0, .3, 1); }
.in .doodle path, .doodle.in path { stroke-dashoffset: 0; }

/* handwriting: one pen, letters appear in writing order */
.hw { margin: 0; font-family: var(--f-hand); font-weight: 400; line-height: 1.22; }
.hw .w { display: inline-block; white-space: nowrap; }
.hw .c {
  display: inline-block;
  opacity: 0;
  transform: rotate(var(--r, 0deg)) translateY(calc(var(--y, 0em) + 0.14em)) scale(var(--s, 1));
  transition: opacity 0.24s ease, transform 0.36s ease;
}
.hw.in .c { opacity: 1; transform: rotate(var(--r, 0deg)) translateY(var(--y, 0em)) scale(var(--s, 1)); }
.punch-wrap { width: 100%; }
.punch { font-size: clamp(1.6rem, 7vw, 2.15rem); max-width: 19ch; margin-inline: auto; color: var(--ink); }
.punch.big { font-size: clamp(1.9rem, 8.6vw, 2.7rem); color: var(--accent); }

/* ---------- night headers ---------- */
.night-head { position: relative; isolation: isolate; display: grid; justify-items: center; gap: 12px; padding-top: 14px; width: 100%; container-type: inline-size; }
.ghost {
  position: absolute; left: 50%; top: 52%; z-index: -1;
  translate: -50% -50%;
  font-family: var(--f-deva); font-size: clamp(6.5rem, 36vw, 11rem); line-height: 1;
  white-space: nowrap; pointer-events: none;
  color: var(--accent); opacity: 0.11;
}
.night-tag {
  margin: 0; display: flex; align-items: center; gap: 0.75em;
  font-size: 0.74rem; font-weight: 600; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--muted);
}
.night-tag .sw {
  width: 12px; height: 12px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.6), transparent 45%), var(--c);
  box-shadow: inset 0 -2px 3px rgba(0, 0, 0, 0.28), 0 0 0 1.5px rgba(255, 255, 255, 0.55), 0 2px 6px rgba(0, 0, 0, 0.35);
}
.night-title { margin: 0; display: grid; justify-items: center; font-family: var(--f-display); line-height: 0.95; font-optical-sizing: auto; }
.t-small { font-style: italic; font-weight: 400; font-size: clamp(1.15rem, 5vw, 1.45rem); color: var(--muted); margin-bottom: 0.12em; }
.t-big {
  font-style: italic; font-weight: 500;
  /* long names (Brahmacharini, Chandraghanta) shrink so they never overflow the column */
  font-size: min(clamp(3.1rem, 14.5vw, 4.9rem), calc(168cqi / var(--len, 1)));
  letter-spacing: -0.01em; white-space: nowrap;
  padding: 0 0.08em 0.08em;
  background: var(--foil); background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: foil 8s ease-in-out infinite alternate;
}
@keyframes foil { from { background-position: 0% 0; } to { background-position: 100% 0; } }

/* ---------- the diya and its flame ---------- */
.diya-wrap { position: relative; display: block; }
.diya-wrap > img { width: 100%; height: auto; display: block; }
.flame-host { position: absolute; left: 92.7%; top: 38%; width: 9%; aspect-ratio: 1 / 2; translate: -50% -94%; pointer-events: none; }
.flm-glow {
  position: absolute; left: 50%; top: 66%; width: 1100%; aspect-ratio: 1;
  translate: -50% -50%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 196, 110, 0.3), rgba(255, 140, 50, 0.09) 32%, rgba(255, 120, 40, 0) 62%);
  transform: scale(0);
}
.flm-body { position: absolute; inset: 0; transform-origin: 50% 100%; transform: scale(0); }
.flm-body svg { position: absolute; bottom: 0; overflow: visible; transform-origin: 50% 100%; }
.flm-o { left: 0; width: 100%; height: 100%; }
.flm-m { left: 17%; width: 66%; height: 72%; }
.flm-c { left: 31%; width: 38%; height: 40%; }
.flm-blue { position: absolute; left: 28%; bottom: 0; width: 44%; height: 14%; border-radius: 50%; background: radial-gradient(ellipse, rgba(90, 130, 255, 0.6), rgba(90, 130, 255, 0) 70%); }

/* ---------- intro ---------- */
.intro {
  position: fixed; inset: 0; z-index: 60;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  padding: 16px;
  background: radial-gradient(ellipse at 50% 56%, #2E0F0A 0%, #0B0406 62%);
  transition: opacity 1.4s ease, visibility 1.4s;
}
.intro::before {
  content: ""; position: absolute; left: 50%; top: 58%; width: 120vmin; height: 26vmin; translate: -50% 0; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(120, 50, 20, 0.35), transparent 70%);
}
.intro.gone { opacity: 0; visibility: hidden; }
.intro-diya {
  position: relative; width: min(62vw, 260px);
  padding: 0; border: 0; background: none; cursor: pointer;
  opacity: 0; transform: translateY(10px); transition: opacity 1.2s ease, transform 1.2s ease;
}
.intro.ready .intro-diya { opacity: 1; transform: none; }
.intro-diya::after {
  content: ""; position: absolute; left: 92.7%; top: 34%; width: 16%; aspect-ratio: 1;
  translate: -50% -50%; border-radius: 50%;
  border: 1.5px solid rgba(255, 210, 140, 0.75);
  animation: ping 2.2s ease-out infinite;
}
.intro.lit .intro-diya::after { display: none; }
@keyframes ping { from { transform: scale(0.5); opacity: 1; } to { transform: scale(3.4); opacity: 0; } }
.intro-text, .intro-sub { opacity: 0; transition: opacity 1s ease 0.4s; }
.intro.ready .intro-text, .intro.ready .intro-sub { opacity: 1; }
.intro-text { margin: 0; font-family: var(--f-display); font-style: italic; font-weight: 400; font-size: clamp(1.7rem, 7.4vw, 2.3rem); color: var(--ivory); }
.intro-sub { margin: 0; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.34em; text-transform: uppercase; color: rgba(251, 239, 220, 0.5); }
.intro.lit .intro-text, .intro.lit .intro-sub { opacity: 0; transition-delay: 0s; }

/* ---------- fixed chrome ---------- */
.mute {
  position: fixed; z-index: 40;
  top: calc(12px + var(--safe-top)); right: 12px;
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  background: color-mix(in srgb, var(--night) 35%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: var(--ink); cursor: pointer;
}
.mute svg { width: 19px; height: 19px; }
.mute .slash { display: none; }
.mute.muted .slash { display: inline; }
.mute.muted .waves { display: none; }

.beads { position: fixed; z-index: 40; top: calc(30px + var(--safe-top)); left: 50%; translate: -50% 0; display: flex; gap: 8px; opacity: 0; transition: opacity 0.6s; pointer-events: none; }
.beads.show { opacity: 1; }
.beads i { width: 8px; height: 8px; border-radius: 50%; border: 1px solid var(--ink); opacity: 0.4; transition: all 0.5s ease; }
.beads i.on { background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.6), transparent 50%), var(--c); opacity: 1; box-shadow: 0 0 8px var(--c); border-color: rgba(255, 255, 255, 0.6); }
.beads i.now { transform: scale(1.5); }

.peek {
  position: fixed; z-index: 40; left: 6px; bottom: calc(-4px + var(--safe-bottom));
  width: 70px; padding: 0; border: 0; background: none; cursor: pointer;
  transform: translateY(110%); transition: transform 0.7s cubic-bezier(.3, 1.4, .5, 1);
}
.peek.show { transform: translateY(34%); }
.peek-head { position: relative; display: block; }
.peek-head img { width: 100%; display: block; }
.peek-head .lids, .ch-boy .lids { position: absolute; inset: 0; opacity: 0; }
.peek.blink .lids, .ch-boy.blink .lids { animation: lid 0.34s steps(1) forwards; }
@keyframes lid { 0% { opacity: 0; } 12% { opacity: 1; } 88% { opacity: 1; } 100% { opacity: 0; } }
.peek-bubble {
  position: absolute; left: 62px; bottom: 56px;
  padding: 4px 12px 6px;
  border-radius: 14px 14px 14px 3px;
  background: var(--tex-paper) #FBF7EE; color: #3A1E12;
  font-family: var(--f-hand); font-size: 1.05rem; white-space: nowrap;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
  opacity: 0; transform: scale(0.5); transform-origin: 0 100%;
}
.peek-bubble.pop { animation: bubble 3.8s ease forwards; }
@keyframes bubble { 0% { opacity: 0; transform: scale(0.5) rotate(-6deg); } 10%, 80% { opacity: 1; transform: scale(1) rotate(-2deg); } 100% { opacity: 0; transform: scale(0.9); } }

/* ---------- hero ---------- */
.hero { padding-top: calc(170px + var(--safe-top)); }
.toran-wrap { position: absolute; top: 0; left: 0; right: 0; pointer-events: none; }
.toran {
  position: absolute; left: 0; right: 0; top: 0;
  background-repeat: repeat-x; background-position: top center; background-size: auto 100%;
  transform: translateY(-120%);
  transition: transform 1.8s cubic-bezier(.2, .9, .25, 1.12);
}
.toran.front { height: min(calc(100vw * 160 / 420), 170px); transform-origin: 50% 0; }
.toran.back { top: 4px; height: min(calc(100vw * 60 / 420 * 0.8), 52px); opacity: 0.7; filter: brightness(0.7) saturate(0.85); }
body.lit .toran { transform: none; }
body.lit .toran.back { transition-delay: 0.25s; }
body.lit .toran.front { animation: toranSway 7s ease-in-out 2s infinite; }
@keyframes toranSway { 50% { transform: rotate(0.5deg) translateY(1px); } }
.hero-lines { display: grid; justify-items: center; gap: 18px; }
.hero-lines > .hero-hi { order: 0; }
.hero-lines > .hero-ul { order: 1; }
.hero-lines > .hero-line { order: 2; }
.hero-hi { font-weight: 700; font-size: clamp(3.3rem, 15.5vw, 5.2rem); line-height: 1; color: var(--gold-hi); text-shadow: 0 0 24px rgba(246, 214, 122, 0.25); }
.hero-ul { width: 62%; height: 16px; margin-top: -14px; color: var(--gold); }
.hero-ul path { stroke-width: 3; transition-delay: 1.2s; transition-duration: 1.1s; }
.hero-line { font-size: clamp(1.5rem, 6.8vw, 2.15rem); line-height: 1.2; }
.scroll-hint {
  position: absolute; bottom: calc(20px + var(--safe-bottom)); left: 0; right: 0;
  display: grid; justify-items: center; gap: 0;
  color: var(--muted); opacity: 0; transition: opacity 1s;
}
.scroll-hint.in { opacity: 1; }
.hint-hw { font-size: 1.1rem; }
.scroll-arrow { width: 26px; height: 34px; }

/* ---------- characters, on a sheet of hand-made paper ---------- */
.chars { padding-inline: 18px; }
.sketch {
  position: relative; width: min(100%, 440px);
  padding: 26px 16px 30px;
  background: var(--tex-cream) #F3E9D6; background-size: 240px;
  color: #3B2418;
  clip-path: polygon(0% 1.2%, 6% 0.4%, 12% 1%, 19% 0.2%, 26% 0.9%, 33% 0.3%, 41% 1.1%, 48% 0.2%, 56% 0.8%, 63% 0.1%, 71% 1%, 78% 0.4%, 86% 1.2%, 93% 0.3%, 100% 0.9%, 99.4% 8%, 100% 16%, 99.2% 25%, 99.8% 34%, 99.1% 43%, 100% 52%, 99.3% 61%, 99.9% 70%, 99.2% 79%, 100% 88%, 99.4% 96%, 100% 99.2%, 93% 100%, 86% 99.1%, 78% 99.8%, 70% 99%, 62% 100%, 54% 99.2%, 46% 99.9%, 38% 99%, 30% 99.8%, 22% 99.1%, 14% 100%, 7% 99.2%, 0% 99.8%, 0.6% 92%, 0% 83%, 0.8% 74%, 0.2% 65%, 0.9% 56%, 0% 47%, 0.7% 38%, 0.1% 29%, 0.9% 20%, 0.3% 11%);
  display: grid; gap: 6px;
  box-shadow: inset 0 0 60px rgba(120, 80, 30, 0.18);
}
.chars::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: min(calc(100% - 50px), 400px); height: 62%;
  translate: -50% -42%; background: rgba(0, 0, 0, 0.55); filter: blur(26px); border-radius: 20px; z-index: -1;
}
.sk-row { display: flex; align-items: center; gap: 4px; min-height: 2.2em; }
.sk-top { justify-content: flex-start; padding-left: 4px; }
.sk-bottom { justify-content: flex-end; padding-right: 4px; }
.sk-hw { font-size: clamp(1.15rem, 5vw, 1.35rem); color: #3B2418; text-align: left; max-width: 15em; }
.sk-arrow { width: 52px; height: 34px; flex: none; color: #3B2418; }
.sk-arrow path { stroke-width: 1.8; }
.sk-top .sk-arrow { margin-top: 26px; }
.sk-bottom .sk-arrow { margin-top: -20px; }
.chars-row { display: grid; grid-template-columns: 1fr 1fr; align-items: end; }
.ch { position: relative; }
.ch img { width: 100%; }
.ch-boy { padding: 0; border: 0; background: none; cursor: pointer; animation: bob 3.4s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes bob { 50% { transform: translateY(-3px) rotate(-0.8deg); } }
.steam { position: absolute; left: 25%; top: 19%; width: 16%; overflow: visible; }
.steam path { fill: none; stroke: rgba(90, 70, 60, 0.4); stroke-width: 1.4; stroke-linecap: round; stroke-dasharray: 10 60; animation: steam 3.2s linear infinite; }
.steam path:nth-child(2) { animation-delay: -1.1s; }
.steam path:nth-child(3) { animation-delay: -2.2s; }
@keyframes steam { from { stroke-dashoffset: 60; opacity: 0; } 30% { opacity: 1; } to { stroke-dashoffset: -10; opacity: 0; } }
.tapme { position: relative; padding: 2px 10px; cursor: pointer; }
.tap-hw { color: #9C1730; }
.tap-circle { position: absolute; left: -8px; top: -10px; width: calc(100% + 16px); height: calc(100% + 18px); color: #9C1730; }
.tap-circle path { stroke-width: 1.6; transition-delay: 0.9s; }
.hearts { position: absolute; inset: 0; pointer-events: none; }
.heart { position: absolute; top: 4%; width: 22px; animation: heartUp 1.7s ease-out forwards; }
.heart .doodle path { fill: #D91F82; stroke: #8E1446; stroke-width: 1.4; stroke-dashoffset: 0; }
@keyframes heartUp { from { opacity: 0; transform: translateY(10px) scale(0.6); } 20% { opacity: 1; } to { opacity: 0; transform: translateY(-80px) scale(1.15) rotate(-12deg); } }
.punch.ink { color: #3B2418; font-size: clamp(1.35rem, 6vw, 1.75rem); }

/* ---------- bridge ---------- */
.bridge { gap: 0; }
.bridge-lines { display: grid; gap: 16vh; padding-block: 8vh; }
.scrub { margin: 0; font-family: var(--f-story); font-weight: 350; font-variation-settings: "SOFT" 100; font-size: clamp(1.6rem, 7.1vw, 2.35rem); line-height: 1.22; letter-spacing: -0.01em; text-wrap: balance; }
.scrub-last { font-style: italic; font-weight: 400; }
.scrub span { opacity: 0.13; transition: opacity 0.35s ease; }
.scrub span.on { opacity: 1; }
.scrub-last span.on { background: var(--foil); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; }
.swatches { display: flex; gap: 8px; justify-content: center; margin-top: 4vh; }
.swatches i {
  width: 20px; height: 30px; border-radius: 2px;
  background: linear-gradient(110deg, rgba(255, 255, 255, 0.28), transparent 38%, rgba(0, 0, 0, 0.22)), var(--c);
  border-bottom: 4px solid var(--gold);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 5px 10px rgba(0, 0, 0, 0.35);
}
.swatches i:nth-child(odd) { rotate: -3deg; }
.swatches i:nth-child(even) { rotate: 2deg; translate: 0 3px; }

/* ---------- night 1: marble jharokha over misty hills ---------- */
.focus-stage { position: relative; width: 100%; padding: 6px 0 26px; }
.mist-wrap { position: absolute; left: -16px; right: -16px; bottom: 0; height: 60%; -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
.mist { width: 100%; height: 100%; display: block; }
.jharokha { position: relative; z-index: 1; width: min(76vw, 320px); aspect-ratio: 3 / 4; margin: 0 auto; }
.jharokha::before { content: ""; position: absolute; inset: 8% 6% -3%; z-index: -1; background: rgba(40, 8, 0, 0.6); filter: blur(22px); }
.jh-photo { position: absolute; overflow: hidden; background: #1A0A06; -webkit-mask-size: 100% 100%; mask-size: 100% 100%; }
.jh-photo img { width: 100%; height: 100%; object-fit: cover; }
.jh-photo::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 14px 28px rgba(0, 0, 0, 0.45), inset 0 -6px 14px rgba(0, 0, 0, 0.25); pointer-events: none; }
.jh-frame { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* ---------- night 1: the case file ---------- */
.dossier {
  --P: min(80vw, 330px); --H: calc(var(--P) * 1.3);
  position: relative; width: 100%; height: calc(var(--H) + 44px);
  display: flex; align-items: center; justify-content: center;
  font-size: calc(var(--P) / 20);
  user-select: none; -webkit-user-select: none; touch-action: pan-y;
}
.ds-spread { position: relative; width: calc(var(--P) * 2); height: var(--H); transform: translateX(calc(var(--P) * -0.5)); transition: transform 0.9s cubic-bezier(.3, .1, .2, 1); }
.dossier[data-view="left"] .ds-spread { transform: translateX(calc(var(--P) * 0.5)); }
.ds-spread::before { content: ""; position: absolute; left: 2%; top: 5%; width: 48%; height: 95%; background: rgba(0, 0, 0, 0.55); filter: blur(22px); opacity: 0; transition: opacity 0.6s 0.4s; }
.dossier:not([data-view="closed"]) .ds-spread::before { opacity: 1; }
.ds-back {
  position: absolute; left: 50%; top: 0; width: var(--P); height: 100%;
  border-radius: 3px 12px 12px 3px;
  background: var(--tex-manila) #D9C8A4; background-size: 220px;
  box-shadow: 0 28px 50px -18px rgba(0, 0, 0, 0.65), 0 8px 18px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}
.ds-back::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5%; background: repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.12) 0 1px, rgba(255, 255, 255, 0.25) 1px 2px, transparent 2px 5px); }
.ds-sheet {
  position: absolute; left: 3%; top: -3.5%; width: 95%; height: 102%;
  padding: 10% 10% 8% 10%;
  background: var(--tex-blue) #6F95D4; background-size: 220px;
  color: #17202E; text-align: left;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  rotate: 1deg;
}
.ds-sheet::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, transparent 49.5%, rgba(255, 255, 255, 0.2) 50%, rgba(0, 0, 0, 0.09) 50.5%, transparent 51%),
    linear-gradient(0deg, transparent 32.7%, rgba(255, 255, 255, 0.16) 33.2%, rgba(0, 0, 0, 0.08) 33.7%, transparent 34.2%),
    linear-gradient(0deg, transparent 65.7%, rgba(255, 255, 255, 0.16) 66.2%, rgba(0, 0, 0, 0.08) 66.7%, transparent 67.2%);
}
.ds-stars { position: absolute; right: 4%; top: 4%; writing-mode: vertical-rl; font-size: 0.7em; letter-spacing: 0.55em; opacity: 0.7; }
.ds-sheet-title { margin: 0; font-family: var(--f-display); font-weight: 400; font-size: 2em; line-height: 1; }
.ds-sheet-sub { margin: 0.3em 0 0; max-width: 78%; font-size: 1.05em; line-height: 1.15; }
.ds-index { position: absolute; left: 9%; top: 27%; width: 64%; height: 54%; padding: 8% 9%; background: var(--tex-paper) #FBF7EE; background-size: 160px; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.22); rotate: -0.6deg; }
.ds-index > b { position: absolute; right: 5%; top: 6%; writing-mode: vertical-rl; font-family: var(--f-display); font-weight: 400; font-size: 1.25em; letter-spacing: 0.1em; text-transform: uppercase; }
.ds-index ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5em; font-family: var(--f-type); font-size: 0.68em; letter-spacing: 0.02em; color: #1B1B1F; }
.ds-index li { position: relative; }
.ds-index li span { margin-right: 0.45em; }
.ds-index li.now { color: #B3122F; font-weight: 700; }
.ds-index li .ds-name { position: relative; margin: 0; }
.ds-circle { position: absolute; left: -14%; top: -62%; width: 128%; height: 224%; color: #C8102E; overflow: visible; }
.ds-circle path { stroke-width: 1.5; vector-effect: non-scaling-stroke; transition-delay: 0.3s; }
.dossier[data-view="right"] .ds-circle path { stroke-dashoffset: 0; }
.ds-fileno { position: absolute; left: 3.5%; bottom: 7%; writing-mode: vertical-rl; rotate: 180deg; font-family: var(--f-type); font-size: 0.62em; letter-spacing: 0.38em; text-transform: uppercase; }
.ds-tab { position: absolute; right: -11%; top: 36%; width: 12%; height: 32%; display: grid; place-items: center; border-radius: 0 14px 14px 0; background: var(--tex-blue) #6F95D4; background-size: 220px; writing-mode: vertical-rl; font-family: var(--f-type); font-size: 0.66em; letter-spacing: 0.42em; text-transform: uppercase; color: #17202E; box-shadow: 3px 3px 6px rgba(0, 0, 0, 0.22); }
.ds-photo { position: absolute; z-index: 2; margin: 0; }
.ds-pic { display: block; padding: 6% 6% 16%; background: #FBF9F4; box-shadow: var(--shadow-print); }
.ds-pic img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.ds-clip { position: absolute; top: -15%; left: 50%; width: 28%; translate: -50% 0; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.4)); }
.ds-photo.p2 { right: -16%; bottom: 6%; width: 52%; rotate: 4deg; }
.ds-photo.p2 .ds-pic img { aspect-ratio: 4 / 5; }
.ds-photo.p2 .ds-clip { top: 52%; left: auto; right: -21%; width: 30%; translate: 0 0; rotate: 90deg; }
.ds-cover {
  position: absolute; left: 50%; top: 0; z-index: 3;
  width: var(--P); height: 100%;
  transform-origin: 0 50%; transform-style: preserve-3d;
  transform: perspective(2000px) rotateY(0deg);
  transition: transform 1s cubic-bezier(.3, .1, .2, 1);
  cursor: pointer;
}
.dossier:not([data-view="closed"]) .ds-cover { transform: perspective(2000px) rotateY(-180deg); }
@media (hover: hover) { .dossier[data-view="closed"] .ds-cover:hover { transform: perspective(2000px) rotateY(-22deg); } }
.ds-face {
  position: absolute; inset: 0;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: 3px 12px 12px 3px;
  background: var(--tex-manila) #D9C8A4; background-size: 220px;
  color: #241A12; text-align: left;
  -webkit-mask-image: radial-gradient(circle at 100% 50%, transparent calc(var(--P) * 0.1), #000 calc(var(--P) * 0.1 + 1px));
  mask-image: radial-gradient(circle at 100% 50%, transparent calc(var(--P) * 0.1), #000 calc(var(--P) * 0.1 + 1px));
}
.ds-front::before, .ds-inside::after { content: ""; position: absolute; top: 0; bottom: 0; width: 7%; background: repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.1) 0 1px, rgba(255, 255, 255, 0.24) 1px 2px, transparent 2px 5px); }
.ds-front::before { left: 0; }
.ds-photo.p1 { left: 11%; top: 7%; width: 42%; rotate: -3deg; }
.ds-photo.p1 .ds-pic img { filter: blur(3px) saturate(0.75); }
.ds-seal { position: absolute; left: 40%; top: 34%; width: 50%; rotate: -12deg; color: rgba(28, 28, 38, 0.82); }
.ds-seal svg, .ds-stamp svg { display: block; width: 100%; overflow: visible; }
.ds-title { position: absolute; left: 16%; top: 58%; margin: 0; font-family: var(--f-display); font-weight: 400; font-size: 2.2em; letter-spacing: 0.03em; text-transform: uppercase; }
.ds-sub { position: absolute; left: 16%; right: 14%; top: 70%; margin: 0; font-family: var(--f-type); font-size: 0.8em; line-height: 1.35; }
.ds-stamp { position: absolute; right: 8%; bottom: 8%; width: 48%; rotate: -9deg; color: #D62B2B; opacity: 0.88; }
.ds-inside {
  transform: rotateY(180deg); border-radius: 12px 3px 3px 12px;
  -webkit-mask-image: radial-gradient(circle at 0% 50%, transparent calc(var(--P) * 0.1), #000 calc(var(--P) * 0.1 + 1px));
  mask-image: radial-gradient(circle at 0% 50%, transparent calc(var(--P) * 0.1), #000 calc(var(--P) * 0.1 + 1px));
}
.ds-inside::after { right: 0; }
.ds-close { position: absolute; left: 3%; top: 6%; padding: 4px; border: 0; background: none; writing-mode: vertical-rl; rotate: 180deg; font-family: var(--f-type); font-size: 0.66em; letter-spacing: 0.45em; text-transform: uppercase; color: #3A2A1C; cursor: pointer; }
.ds-photo.p3 { right: 11%; top: 4%; width: 40%; rotate: 3deg; }
.ds-photo.p3 .ds-pic img { filter: blur(7px) saturate(0.6); transition: filter 1.8s ease; }
.dossier.focused .ds-photo.p3 .ds-pic img { filter: none; }
.ds-report { position: absolute; left: 12%; top: 29%; width: 54%; margin: 0; padding: 6% 7%; background: var(--tex-paper) #FBF7EE; background-size: 160px; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.22); font-family: var(--f-type); font-size: 0.6em; line-height: 1.42; color: #26222A; rotate: -1.2deg; }
.ds-notes {
  position: absolute; left: 33%; right: 5%; bottom: 3%;
  padding: 0.5em 0.5em 1.3em 2.1em;
  background:
    linear-gradient(90deg, transparent 1.55em, rgba(220, 60, 60, 0.5) 1.55em, rgba(220, 60, 60, 0.5) calc(1.55em + 1px), transparent calc(1.55em + 1px)),
    repeating-linear-gradient(transparent 0, transparent 1.45em, rgba(70, 110, 200, 0.35) 1.45em, rgba(70, 110, 200, 0.35) calc(1.45em + 1px)),
    #FFFDF6;
  background-position: 0 0.55em;
  rotate: 3deg;
  clip-path: polygon(0 0, 100% 0, 100% 92%, 94% 97%, 88% 93%, 80% 99%, 72% 94%, 64% 98%, 55% 93%, 47% 99%, 38% 94%, 30% 98%, 21% 93%, 13% 99%, 6% 94%, 0 98%);
}
.ds-notes::before { content: ""; position: absolute; left: 0.45em; top: 0.4em; bottom: 1em; width: 0.6em; background: radial-gradient(circle, rgba(60, 40, 30, 0.45) 0.18em, transparent 0.24em) 0 0 / 0.6em 1.45em repeat-y; }
.ds-note { font-size: 0.8em; line-height: 1.81em; color: #1E2A5A; }

/* ---------- night 2: Polaroid 600 ---------- */
.polaroid {
  position: relative; width: min(70vw, 290px); aspect-ratio: 88 / 107;
  padding: 0; border: 0; background: none; cursor: pointer;
  perspective: 1400px; rotate: -3deg;
}
.tape {
  position: absolute; z-index: 3; top: -14px; left: 50%; width: 100px; height: 30px;
  translate: -50% 0; rotate: 4deg;
  background:
    radial-gradient(circle at 25% 50%, rgba(179, 18, 47, 0.35) 0 2px, transparent 2.5px) 0 0 / 12px 10px,
    linear-gradient(rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.05)),
    rgba(242, 196, 120, 0.7);
  clip-path: polygon(0 12%, 3% 0, 7% 9%, 11% 1%, 15% 8%, 100% 0, 97% 14%, 100% 28%, 96% 42%, 100% 57%, 97% 71%, 100% 86%, 97% 100%, 0 100%, 3% 86%, 0 71%, 4% 57%, 0 42%, 3% 28%);
}
.pol-inner { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform 1s cubic-bezier(.3, 1.25, .4, 1); }
.polaroid.flipped .pol-inner { transform: rotateY(180deg); }
.pol-tilt { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform 0.25s ease-out; }
.pol-face { position: absolute; inset: 0; display: flex; flex-direction: column; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 2px; overflow: hidden; }
.pol-front { padding: 5.2% 5.2% 0; background: var(--tex-paper) #F8F5EE; background-size: 200px; box-shadow: var(--shadow-print), inset 0 0 0 1px rgba(0, 0, 0, 0.05); }
.pol-img { position: relative; display: block; width: 100%; aspect-ratio: 1; background: #111; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.4); }
.pol-img img { width: 100%; height: 100%; object-fit: cover; filter: contrast(0.92) saturate(0.86) sepia(0.14) brightness(1.04); }
.pol-img::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 22px rgba(40, 20, 0, 0.4); background: linear-gradient(160deg, rgba(255, 240, 210, 0.14), transparent 45%); }
.pol-cap { flex: 1; display: grid; place-items: center; color: #1C1C22; }
.pol-hw { font-weight: 700; font-size: clamp(1.15rem, 5.4vw, 1.45rem); rotate: -2deg; }
.pol-gloss { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, 0.28) 48%, transparent 58%); background-size: 260% 100%; background-position: var(--gx, calc(50% + var(--tx) * 45%)) 0; }
.pol-back { transform: rotateY(180deg); justify-content: center; padding: 12% 11%; background: var(--tex-black) #26221F; background-size: 200px; color: #F1EEE6; text-align: left; box-shadow: var(--shadow-print); }
.pol-note { font-weight: 300; font-size: clamp(1.1rem, 5vw, 1.3rem); line-height: 1.36; }
.pol-print { position: absolute; bottom: 5%; right: 8%; font-size: 0.5rem; font-weight: 600; letter-spacing: 0.24em; text-transform: uppercase; opacity: 0.3; }

/* ---------- night 3: the laugh wall (stickers) ---------- */
.wall {
  position: relative; width: 100%; aspect-ratio: 4 / 5; max-height: 62svh;
  border-radius: 16px; overflow: hidden; cursor: pointer;
  background: var(--tex-cream) #EDE4D3; background-size: 220px;
  box-shadow: inset 0 0 70px rgba(90, 60, 30, 0.28), 0 24px 50px rgba(0, 0, 0, 0.45);
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.wall-print { position: absolute; left: 50%; top: 45%; width: 50%; margin: 0; translate: -50% -50%; rotate: -3deg; padding: 4% 4% 15%; background: var(--tex-paper) #FBF7EE; background-size: 160px; box-shadow: var(--shadow-print); pointer-events: none; }
.wall-print img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.wall-tape { position: absolute; top: -10px; left: 50%; width: 46%; height: 20px; translate: -50% 0; rotate: -4deg; background: linear-gradient(rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.05)), rgba(242, 196, 120, 0.7); clip-path: polygon(0 10%, 4% 0, 9% 12%, 100% 0, 97% 30%, 100% 60%, 96% 100%, 0 100%, 3% 70%, 0 40%); }
.wall-hint { position: absolute; left: 7%; bottom: 7%; width: 34%; aspect-ratio: 1; border-radius: 50%; border: 2px dashed rgba(59, 36, 24, 0.35); display: grid; place-items: center; text-align: center; font-family: var(--f-hand); font-size: 0.95rem; line-height: 1.15; color: rgba(59, 36, 24, 0.6); transition: opacity 0.4s; pointer-events: none; }
.wall.used .wall-hint { opacity: 0; }
.wall-stickers { position: absolute; inset: 0; pointer-events: none; }
.stk { position: absolute; width: 30%; translate: -50% -50%; rotate: var(--rot); scale: var(--sz); filter: drop-shadow(0 2px 1.5px rgba(0, 0, 0, 0.25)) drop-shadow(0 10px 12px rgba(0, 0, 0, 0.16)); animation: slap 0.45s cubic-bezier(.2, 1.6, .4, 1) both; }
.stk svg { width: 100%; display: block; overflow: visible; }
@media (pointer: coarse) { .stk { filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.22)); } }
@keyframes slap { from { transform: scale(1.5) rotate(12deg); opacity: 0; } 50% { opacity: 1; } to { transform: none; opacity: 1; } }
.stk.peel { animation: peelOff 0.7s ease-in var(--delay, 0ms) forwards; }
@keyframes peelOff { 0% { transform: none; } 30% { transform: rotate(-8deg) scale(1.06); } 100% { transform: translateY(170%) rotate(40deg); opacity: 0; } }
.wall-reset { position: absolute; right: 10px; top: 10px; z-index: 3; padding: 8px 14px; border: 0; border-radius: 999px; background: #241612; color: #F3E9D6; font-size: 0.66rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3); cursor: pointer; }

/* ---------- night 4: the instant camera ---------- */
.ask-hw { font-size: clamp(1.5rem, 6.6vw, 2rem); color: var(--gold-hi); }
.cam-wrap { width: 100%; display: grid; justify-items: center; gap: 14px; }
.cam-stage { position: relative; width: min(88vw, 340px); }
.camera {
  position: relative; width: 100%; aspect-ratio: 340 / 420;
  border-radius: 34px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 9%), var(--tex-cream) #EFE4CE;
  background-size: auto, 200px;
  box-shadow: inset 0 -7px 14px rgba(80, 50, 20, 0.25), inset 0 2px 0 rgba(255, 255, 255, 0.75), 0 32px 60px -20px rgba(0, 0, 0, 0.65), 0 10px 22px rgba(0, 0, 0, 0.25);
}
.camera::before { content: ""; position: absolute; left: 0; right: 0; top: 31%; height: 46%; background: var(--tex-floor) #3B2A24; background-size: 110px; box-shadow: inset 0 3px 3px rgba(0, 0, 0, 0.45), inset 0 -2px 0 rgba(255, 255, 255, 0.08); }
.camera::after { content: ""; position: absolute; left: 4%; right: 4%; top: 32.6%; height: 42.8%; border-block: 1.5px dashed rgba(233, 180, 76, 0.45); pointer-events: none; }
.cam-plate { position: absolute; left: 7%; top: 7%; display: grid; padding: 7px 12px 8px; border-radius: 8px; text-align: left; background: linear-gradient(110deg, #9A6A1C, #F3D37E 40%, #C99A45 60%, #8A5E18); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 2px 4px rgba(0, 0, 0, 0.3); color: #3A1E12; }
.cam-plate b { font-family: var(--f-display); font-weight: 700; font-size: 0.72rem; letter-spacing: 0.2em; }
.cam-plate i { font-family: var(--f-display); font-size: 0.82rem; color: #6E0B1F; }
.cam-finder { position: absolute; right: 7%; top: 6%; width: 30%; aspect-ratio: 1.15; padding: 5px; border-radius: 12px; background: #121212; box-shadow: inset 0 0 0 2px #2b2b2b, 0 2px 0 rgba(255, 255, 255, 0.7); }
.cam-finder video { width: 100%; height: 100%; display: block; border-radius: 8px; object-fit: cover; transform: scaleX(-1); background: radial-gradient(#2a2f36, #0d0f12); opacity: 0; transition: opacity 0.6s; }
.finder-glass { display: block; width: 100%; height: 100%; border-radius: 8px; background: radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.18), transparent 40%), linear-gradient(160deg, #2a2d33, #0c0d10); }
.camera.on .finder-glass { background: radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.2), transparent 40%), linear-gradient(160deg, #3b3f48, #15171b); }
.finder-led { position: absolute; top: 8px; right: 8px; width: 6px; height: 6px; border-radius: 50%; background: #4a4a4a; }
.camera.on .finder-led { background: #3BE37A; box-shadow: 0 0 6px #3BE37A; }
.cam-counter { position: absolute; left: 7%; top: 35%; z-index: 2; display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 999px; background: #141110; box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.8), 0 1px 0 rgba(255, 255, 255, 0.15); }
.cam-ticks { display: flex; gap: 2px; }
.cam-ticks i { width: 3px; height: 13px; border-radius: 1px; background: #3A3633; transition: background 0.3s; }
.cam-ticks i.used { background: #F5A623; box-shadow: 0 0 5px rgba(245, 166, 35, 0.8); }
.cam-left { font: 700 0.85rem/1 ui-monospace, Menlo, monospace; color: #F3E9D6; }
.cam-lens {
  position: absolute; left: 50%; top: 54%; z-index: 1;
  width: 60%; aspect-ratio: 1; translate: -50% -50%;
  padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  background: conic-gradient(from 30deg, #2a2a2a, #9a9a9a, #2a2a2a, #c4c4c4, #2a2a2a, #858585, #2a2a2a);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.55), inset 0 0 0 2px rgba(255, 255, 255, 0.25);
}
.lens-barrel { position: absolute; inset: 8%; border-radius: 50%; overflow: hidden; background: radial-gradient(circle, #0b0b0c 54%, #262626 68%, #0b0b0c 71%); box-shadow: inset 0 5px 14px rgba(0, 0, 0, 0.9); }
.lens-video { position: absolute; inset: 17%; width: 66%; height: 66%; border-radius: 50%; object-fit: cover; transform: scaleX(-1) scale(1.15); opacity: 0; filter: saturate(1.2) contrast(1.1); transition: opacity 0.8s; }
.camera.on .lens-video { opacity: 0.5; }
.lens-glass { position: absolute; inset: 15%; border-radius: 50%; background: radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 17%), radial-gradient(circle at 62% 66%, rgba(120, 90, 255, 0.38), transparent 42%), radial-gradient(circle at 38% 72%, rgba(40, 200, 180, 0.26), transparent 46%), radial-gradient(circle, rgba(20, 20, 40, 0.15), rgba(0, 0, 0, 0.65) 82%); box-shadow: inset 0 0 0 3px rgba(0, 0, 0, 0.6), inset 0 0 18px rgba(0, 0, 0, 0.8); }
.lens-label { position: absolute; left: 0; right: 0; bottom: 26%; font-family: var(--f-hand); font-size: 0.85rem; line-height: 1.1; color: rgba(255, 255, 255, 0.8); pointer-events: none; transition: opacity 0.4s; }
.camera.on .lens-label { opacity: 0; }
.camera.waking .lens-glass { animation: hintPulse 0.8s ease-in-out infinite; }
.cam-row { position: absolute; left: 6%; right: 6%; bottom: 12%; z-index: 2; display: grid; grid-template-columns: 1fr; justify-items: center; }
.cam-reload { padding: 9px 11px; border: 0; border-radius: 12px; background: #E1D3B8; color: #6B5A44; font-size: 0.64rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.15), 0 1px 0 rgba(255, 255, 255, 0.7); cursor: pointer; }
.cam-reload.nudge { background: var(--gold); color: #2A0610; animation: hintPulse 1.2s ease-in-out infinite; }
.cam-shutter {
  justify-self: center; min-width: 118px; padding: 14px 18px;
  border: 0; border-radius: 18px; cursor: pointer;
  background: linear-gradient(#D7263D, #9E0C26); color: #FFF3E0;
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.24em; text-transform: uppercase;
  box-shadow: 0 6px 0 #6E0819, 0 10px 18px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.08s, box-shadow 0.08s;
}
.cam-shutter:active { transform: translateY(4px); box-shadow: 0 2px 0 #6E0819, 0 4px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.35); }
.cam-shutter:disabled { filter: grayscale(0.7) brightness(0.8); cursor: default; }
.cam-shots { display: grid; justify-items: center; padding: 6px 10px; border-radius: 12px; background: #141110; color: #F3E9D6; }
.cam-shots small { font-size: 0.52rem; letter-spacing: 0.2em; text-transform: uppercase; opacity: 0.6; }
.cam-shots b { font: 600 0.85rem/1.1 ui-monospace, Menlo, monospace; }
.cam-slot { position: absolute; left: 10%; right: 10%; bottom: 4.5%; height: 9px; border-radius: 99px; background: #120E0C; box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.9), 0 1px 0 rgba(255, 255, 255, 0.7); }
.camera.reloading .cam-counter { animation: hintPulse 0.5s ease 2; }
body.cam-flash::before { content: ""; position: fixed; inset: 0; z-index: 80; background: #fff; pointer-events: none; animation: camflash 0.55s ease-out forwards; }
@keyframes camflash { from { opacity: 0.95; } to { opacity: 0; } }
.cam-out { position: absolute; left: 50%; top: 44%; z-index: 5; width: 82%; translate: -50% 0; display: grid; justify-items: center; gap: 14px; }
.cam-print { width: 100%; rotate: -2deg; box-shadow: var(--shadow-print); }
.cam-print img { width: 100%; height: auto; display: block; }
.cam-out.in .cam-print { animation: eject 1.2s cubic-bezier(.2, .8, .2, 1) both; }
.cam-out.in .cam-print img { animation: develop 3.8s ease 0.5s both; }
@keyframes eject { from { transform: translateY(-38%) scale(0.8); opacity: 0; } 25% { opacity: 1; } to { transform: none; opacity: 1; } }
@keyframes develop { from { filter: brightness(0.22) sepia(0.85) contrast(0.5) blur(1.5px); } 60% { filter: brightness(0.85) sepia(0.3) contrast(0.85) blur(0.3px); } to { filter: none; } }
.cam-ask { margin: 2px 0 -4px; font-family: var(--f-hand); font-size: 1.15rem; line-height: 1.2; color: var(--ink); opacity: 0; }
.cam-actions { display: flex; gap: 10px; opacity: 0; }
.cam-out.in .cam-ask { animation: fadeUp 0.5s ease 1.2s forwards; }
.cam-out.in .cam-actions { animation: fadeUp 0.5s ease 1.35s forwards; }
.cam-out.leaving .cam-ask { opacity: 0; transition: opacity 0.2s; animation: none; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.cam-actions button { padding: 12px 26px; border-radius: 14px; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; cursor: pointer; }
.cam-keep { border: 0; background: var(--gold); color: #2A0610; box-shadow: 0 8px 18px rgba(0, 0, 0, 0.3); }
.cam-del { border: 1.5px solid rgba(251, 239, 220, 0.6); background: rgba(20, 10, 10, 0.4); color: var(--ivory); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.cam-out.leaving .cam-actions { opacity: 0; transition: opacity 0.2s; animation: none; }
.cam-out.leaving.keep .cam-print { animation: toPile 0.6s ease-in forwards; }
.cam-out.leaving.del .cam-print { animation: toss 0.5s ease-in forwards; }
@keyframes toPile { to { transform: translate(-30%, 110%) scale(0.22) rotate(10deg); opacity: 0; } }
@keyframes toss { to { transform: translate(40%, 140%) rotate(-28deg); opacity: 0; } }
.cam-pile { display: flex; align-items: center; gap: 18px; }
.pile { position: relative; width: 68px; aspect-ratio: 1080 / 1320; padding: 0; border: 0; background: none; cursor: pointer; }
.pile img { position: absolute; inset: 0; width: 100%; box-shadow: 0 6px 12px rgba(0, 0, 0, 0.35); transform: rotate(calc(var(--i) * 8deg - 4deg)) translate(calc(var(--i) * 3px), calc(var(--i) * -2px)); }
.pile-count { position: absolute; right: -9px; top: -9px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 99px; display: grid; place-items: center; background: var(--gold); color: #2A0610; font: 700 0.72rem/1 ui-monospace, Menlo, monospace; }
.view-all { padding: 6px 2px; border: 0; border-bottom: 1px solid currentColor; background: none; color: var(--ink); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; cursor: pointer; }
.night-camera:has(.camera.on) .hint, .night-camera:has(.camera.files) .hint { visibility: hidden; }
.cam-note { margin: 0; font-size: 0.8rem; font-style: italic; color: var(--muted); }
html.no-scroll, html.no-scroll body { overflow: hidden; }
.collection { position: fixed; inset: 0; z-index: 75; overflow-y: auto; padding: calc(18px + var(--safe-top)) 16px calc(40px + var(--safe-bottom)); background: var(--tex-paper) #FBF7EE; background-size: 200px; color: #241612; }
.col-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.col-head h3 { margin: 0; font-family: var(--f-display); font-style: italic; font-weight: 500; font-size: 1.9rem; }
.col-close, .col-grid button { padding: 10px 16px; border: 0; border-radius: 10px; background: #241612; color: #FBF7EE; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; cursor: pointer; }
.col-note { margin: 6px 0 18px; font-style: italic; color: rgba(36, 22, 18, 0.65); }
.col-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.col-grid figure { margin: 0; display: grid; gap: 10px; }
.col-grid img { width: 100%; box-shadow: var(--shadow-print); }

/* ---------- night 5: film negative ---------- */
.film {
  position: relative;
  width: min(84vw, 340px);
  padding: 44px 14px 30px;
  border-radius: 4px;
  background: #1A1310;
  box-shadow: 0 22px 50px rgba(70, 40, 0, 0.4);
  rotate: -2deg;
  cursor: pointer;
  touch-action: none;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  transition: rotate 0.8s ease, scale 0.3s ease;
}
.film::before, .film::after {
  content: ""; position: absolute; left: 8px; right: 8px; height: 10px;
  background: repeating-linear-gradient(90deg, rgba(243, 233, 208, 0.85) 0 9px, transparent 9px 20px);
  border-radius: 2px;
}
.film::before { top: 8px; }
.film::after { bottom: 9px; }
.film.holding { scale: 0.98; }
.film.developed { rotate: 0deg; }
.film-frame { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: #000; }
.film-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.neg { filter: invert(1) contrast(0.92); }
.neg-mask { position: absolute; inset: 0; background: #D9762E; mix-blend-mode: multiply; opacity: 0.55; }
.pos { opacity: 0; }
.film-meta {
  position: absolute; top: 23px; left: 16px; right: 16px;
  display: flex; justify-content: space-between;
  font: 600 0.62rem/1 ui-monospace, Menlo, monospace; letter-spacing: 0.16em;
  color: #E9A23B;
}
.hold-ring { position: absolute; right: -14px; bottom: -14px; width: 50px; height: 50px; rotate: -90deg; transition: opacity 0.5s; }
.hold-ring circle { fill: rgba(26, 19, 16, 0.85); stroke: rgba(255, 255, 255, 0.2); stroke-width: 3; }
.hold-ring .prog { fill: none; stroke: var(--gold-hi); stroke-linecap: round; stroke-width: 3.5; }
.film.developed .hold-ring { opacity: 0; }

/* ---------- night 6: magazine ---------- */
.mag {
  --pw: min(43vw, 200px);
  position: relative; width: 100%;
  height: calc(var(--pw) * 1.38 * 1.3 + 30px);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; user-select: none; -webkit-user-select: none;
}
.mag-book { position: relative; width: calc(var(--pw) * 2); height: calc(var(--pw) * 1.38); transform: translateX(calc(var(--pw) * -0.65)) scale(1.3); transition: transform 1s cubic-bezier(.3, .1, .2, 1); }
.mag-book::before { content: ""; position: absolute; left: 6%; right: 6%; bottom: -6%; height: 14%; background: rgba(0, 0, 0, 0.5); filter: blur(14px); border-radius: 50%; }
.mag[data-open] .mag-book { transform: none; }
.leaf { position: absolute; left: 50%; top: 0; width: var(--pw); height: 100%; transform-origin: 0 50%; transform-style: preserve-3d; transform: perspective(1800px) rotateY(0deg); transition: transform 1s cubic-bezier(.3, .1, .2, 1); font-size: calc(var(--pw) / 13); }
.leaf.flipped { transform: perspective(1800px) rotateY(-180deg); }
.leaf .face { position: absolute; inset: 0; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 0 3px 3px 0; }
.leaf .back { transform: rotateY(180deg); border-radius: 3px 0 0 3px; }
.leaf .front::after, .mag-last::after { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 12%; background: linear-gradient(90deg, rgba(0, 0, 0, 0.3), transparent); pointer-events: none; z-index: 4; }
.leaf .back::after { content: ""; position: absolute; top: 0; bottom: 0; right: 0; width: 12%; background: linear-gradient(-90deg, rgba(0, 0, 0, 0.24), transparent); pointer-events: none; z-index: 4; }
.leaf.turning .face::before { content: ""; position: absolute; inset: 0; z-index: 5; pointer-events: none; background: linear-gradient(90deg, rgba(0, 0, 0, 0.32), transparent 35%, rgba(255, 255, 255, 0.18) 62%, transparent); animation: curl 1s ease; }
@keyframes curl { 0%, 100% { opacity: 0; } 50% { opacity: 1; } }
.paper { background: var(--tex-paper) #FBF6EC; background-size: 160px; color: #241612; }
.gloss { position: absolute; inset: 0; z-index: 3; pointer-events: none; background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.2) 44%, transparent 56%); background-size: 260% 100%; background-position: calc(50% + var(--tx) * 50%) 0; }
.cover { background: #111; color: #fff; }
.cover > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover-shade { position: absolute; inset: 0; background: linear-gradient(rgba(0, 0, 0, 0.5), transparent 30%, transparent 48%, rgba(0, 0, 0, 0.78)); }
.cover-top { position: absolute; top: 0.55em; left: 0.7em; right: 0.7em; display: flex; justify-content: space-between; font-size: 0.42em; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; }
.cover-mast { position: absolute; top: 0.62em; left: 0; right: 0; margin: 0; font-family: var(--f-display); font-weight: 900; font-size: 1.82em; line-height: 1; letter-spacing: -0.01em; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3); }
.cover-badge { position: absolute; top: 34%; right: 6%; width: 3.9em; aspect-ratio: 1; display: grid; place-items: center; padding: 0.4em; border-radius: 50%; background: #B3122F; font-family: var(--f-display); font-style: italic; font-size: 0.48em; line-height: 1.05; rotate: -12deg; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35); }
.cover-name { position: absolute; left: 0.55em; bottom: 4.3em; margin: 0; font-family: var(--f-display); font-style: italic; font-weight: 500; font-size: 2em; line-height: 1; color: var(--gold-hi); }
.cover-lines { position: absolute; left: 0.75em; right: 4.6em; bottom: 0.7em; margin: 0; padding: 0; list-style: none; text-align: left; display: grid; gap: 0.4em; font-size: 0.56em; font-weight: 600; line-height: 1.12; }
.cover-lines b { display: block; font-family: var(--f-display); font-style: italic; font-size: 1.1em; color: var(--gold-hi); }
.cover-code { position: absolute; right: 0.6em; bottom: 0.6em; width: 3.4em; }
.cover-code svg { width: 100%; display: block; }
.letter { padding: 0.95em 1em; display: flex; flex-direction: column; text-align: left; gap: 0.4em; }
.kicker { margin: 0; font-size: 0.42em; font-weight: 600; letter-spacing: 0.24em; text-transform: uppercase; color: #8C1631; }
.letter h3 { margin: 0; font-family: var(--f-display); font-style: italic; font-weight: 500; font-size: 1.3em; line-height: 1; }
.letter .body { margin: 0; font-size: 0.62em; line-height: 1.4; text-align: justify; hyphens: auto; }
.drop { float: left; font-family: var(--f-display); font-size: 3em; line-height: 0.78; margin: 0.06em 0.08em 0 0; color: #8C1631; }
.mag-sign { font-size: 0.95em; color: #23307A; align-self: flex-end; }
.folio { position: absolute; bottom: 0.5em; font-size: 0.42em; letter-spacing: 0.12em; opacity: 0.6; }
.front .folio { right: 0.9em; }
.back .folio { left: 0.9em; }
.exhibit { display: flex; flex-direction: column; gap: 0.5em; padding: 0.8em; }
.exhibit img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.exhibit p { margin: 0; text-align: left; font-family: var(--f-display); font-style: italic; font-size: 0.82em; line-height: 1.15; }
.exhibit p b { display: block; font-family: var(--f-serif); font-style: normal; font-size: 0.5em; font-weight: 600; letter-spacing: 0.24em; text-transform: uppercase; color: #8C1631; margin-bottom: 0.3em; }
.quote { display: flex; flex-direction: column; justify-content: center; gap: 0.6em; padding: 1.2em; text-align: center; }
.quote blockquote { margin: 0; font-family: var(--f-display); font-style: italic; font-size: 1.25em; line-height: 1.12; }
.quote blockquote::before { content: "“"; display: block; font-size: 2.2em; line-height: 0.6; color: #8C1631; }
.quote .small, .coupon .small { margin: 0; font-size: 0.48em; letter-spacing: 0.08em; opacity: 0.7; }
.mag-last { position: absolute; left: 50%; top: 0; width: var(--pw); height: 100%; padding: 0.9em; font-size: calc(var(--pw) / 13); border-radius: 0 3px 3px 0; display: grid; }
.coupon .cut { display: flex; flex-direction: column; justify-content: center; gap: 0.6em; padding: 0.8em; border: 1.5px dashed rgba(36, 22, 18, 0.45); text-align: center; }
.coupon .mag-sign { align-self: center; font-size: 1em; }

/* ---------- night 7: diya in the dark ---------- */
.dark-stage {
  --x: 50%; --y: 60%;
  position: relative; width: 100%; height: min(60svh, 520px);
  border-radius: 18px; overflow: hidden;
  touch-action: none; user-select: none; -webkit-user-select: none;
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.45);
}
.dk-photo { width: 100%; height: 100%; object-fit: cover; }
/* The dark is a stage-sized canvas repainted around the diya (see app.js); the warm glow is a small
   soft circle that follows it. Both are cheap for phones. */
.dark-warm { position: absolute; left: 0; top: 0; width: 340px; height: 340px; margin: -170px 0 0 -170px; pointer-events: none; background: radial-gradient(circle, rgba(255, 170, 80, 0.26), rgba(255, 140, 60, 0.08) 55%, transparent 72%); transition: opacity 1.4s; }
.dark-veil { position: absolute; inset: 0; width: 100%; height: 100%; transition: opacity 1.8s ease; }
.dark-veil.gone { opacity: 0; }
.cleared .dark-warm { opacity: 0; }
.dark-word { position: absolute; z-index: 2; translate: -50% -50%; font-family: var(--f-hand); font-size: 1.45rem; white-space: nowrap; color: rgba(255, 255, 255, 0.08); pointer-events: none; transition: color 0.6s ease, text-shadow 0.6s ease, opacity 1.2s ease 1.2s; }
.dark-word.lit { color: #FFD98A; text-shadow: 0 0 14px rgba(255, 170, 60, 0.9); }
.cleared .dark-word { opacity: 0; }
.fairy { position: absolute; left: 0; top: 0; z-index: 3; width: 100%; height: 64px; opacity: 0; transition: opacity 0.6s; overflow: visible; }
.cleared .fairy { opacity: 1; }
.fairy .glass { opacity: 0.35; transition: opacity 0.2s; }
.fairy .halo { opacity: 0; transition: opacity 0.3s; }
.fairy .bulb.on .glass { opacity: 1; }
.fairy .bulb.on .halo { opacity: 1; animation: twinkle 2.4s ease-in-out infinite; animation-delay: calc(var(--i) * -0.37s); }
@keyframes twinkle { 50% { opacity: 0.65; } }
.torch { position: absolute; left: 0; top: 0; z-index: 4; width: 76px; pointer-events: none; transition: opacity 0.8s; }
.torch img { filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.6)); }
.cleared .torch { opacity: 0; }

/* ---------- night 8: rangoli on a stone floor ---------- */
.rangoli-wrap {
  position: relative; width: min(100%, 400px); aspect-ratio: 1; border-radius: 50%;
  background: var(--tex-floor) #3B2A24; background-size: 220px;
  box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.6), 0 0 0 6px rgba(0, 0, 0, 0.18), 0 18px 40px rgba(0, 0, 0, 0.35);
}
.rangoli-wrap::before {
  content: ""; position: absolute; inset: 5%; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.4) 1.2px, transparent 1.9px) 50% 50% / 22px 22px;
  -webkit-mask-image: radial-gradient(circle, #000 58%, transparent 71%); mask-image: radial-gradient(circle, #000 58%, transparent 71%);
}
.rangoli { position: relative; display: block; width: 100%; height: 100%; border-radius: 50%; touch-action: none; }
.rangoli-tools { display: grid; justify-items: center; gap: 10px; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.chip { width: 44px; height: 32px; padding: 0; border: 0; background: none; cursor: pointer; transition: transform 0.25s ease; }
.chip svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.35)); }
.chip.on { transform: translateY(-5px) scale(1.1); }
.txt-btn { padding: 4px 6px; border: 0; background: none; cursor: pointer; color: var(--muted); }
.clear-hw { font-size: 1.05rem; border-bottom: 1px dashed currentColor; padding-bottom: 1px; }

/* ---------- night 9: clothesline ---------- */
.night-clothesline { display: block; padding: 0; }
.night-clothesline > * { max-width: none; }
.cl-sticky { position: sticky; top: 0; height: 100svh; overflow: hidden; display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: calc(64px + var(--safe-top)) 0 calc(30px + var(--safe-bottom)); }
.cl-top { display: grid; justify-items: center; gap: 12px; padding: 0 16px; }
.cl-track { position: relative; display: flex; gap: 12vw; padding: 14px 14vw 46px; width: max-content; }
.cl-string { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.cl-string path { fill: none; stroke-width: 2.4; }
.cl-string .tw-a { stroke: #D8C7A2; }
.cl-string .tw-b { stroke: #8A7148; stroke-dasharray: 2 3; }
.hang { position: relative; margin: 0; width: min(52vw, 220px); transform-origin: 50% 0; transform: rotate(var(--r)); }
.peg { position: relative; z-index: 2; display: block; width: 16px; margin: 0 auto -27px; }
.print { position: relative; display: block; padding: 4.5% 4.5% 13%; background: var(--tex-paper) #FBF7EE; background-size: 180px; box-shadow: var(--shadow-print); }
.print img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.print::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0.05), transparent 20%, transparent 75%, rgba(0, 0, 0, 0.08)); pointer-events: none; }
.tag {
  position: absolute; right: 6%; bottom: -30px; width: 62%; padding: 7px 10px 6px 20px;
  background: var(--tex-kraft) #C7A274; background-size: 160px; color: #2B1D10;
  clip-path: polygon(11% 0, 100% 0, 100% 100%, 11% 100%, 0 50%);
  rotate: -4deg; text-align: left;
}
.tag-hole { position: absolute; left: 7%; top: 50%; width: 6px; height: 6px; translate: 0 -50%; border-radius: 50%; background: rgba(0, 0, 0, 0.45); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.5); }
.tag-hw { font-size: 1.02rem; line-height: 1.1; }
.cl-punch { padding: 0 16px; }

/* ---------- interlude: fanned photo cards ---------- */
.deck { position: relative; width: 100%; height: min(64svh, 540px); touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.dcard {
  --w: min(66vw, 290px);
  position: absolute; left: 50%; top: 3%;
  width: var(--w); aspect-ratio: 3 / 4; margin: 0 0 0 calc(var(--w) / -2);
  border-radius: 28px; overflow: hidden; background: #111;
  box-shadow: 0 30px 50px -18px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.06);
  transform-origin: 50% 130%;
  transform: translateX(calc(var(--d, 0) * 30%)) translateY(calc(var(--ad, 0) * 7%)) rotate(calc(var(--d, 0) * 9deg)) scale(calc(1 - var(--ad, 0) * 0.1));
  filter: brightness(calc(1 - var(--ad, 0) * 0.14));
  transition: transform 0.75s cubic-bezier(.2, .9, .2, 1), filter 0.5s, opacity 0.4s;
  cursor: pointer;
}
.dcard img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.dshade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0.58), transparent 40%, transparent 72%, rgba(0, 0, 0, 0.25)); }
.dcard figcaption { position: absolute; left: 7%; right: 34%; top: 7%; display: grid; gap: 5px; text-align: left; color: #fff; }
.dcard figcaption b { font-family: var(--f-display); font-style: italic; font-weight: 500; font-size: clamp(1.3rem, 5.6vw, 1.7rem); line-height: 1.04; }
.dcard figcaption span { font-size: 0.98rem; line-height: 1.2; opacity: 0.85; }
.dtag { position: absolute; right: 6%; top: 7%; padding: 6px 12px; border-radius: 999px; font-style: normal; font-size: 0.64rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: #fff; background: rgba(255, 255, 255, 0.16); border: 1px solid rgba(255, 255, 255, 0.45); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.dots { display: flex; justify-content: center; gap: 7px; margin-top: -6px; }
.dots i { width: 8px; height: 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.3); transition: width 0.4s, background 0.4s; }
.dots i.on { width: 26px; background: #fff; }

/* ---------- day 10: Ravan dahan ---------- */
.ravan-stage { position: relative; width: 100%; max-width: 420px; padding-top: 42%; }
.ravan-stage .sky { position: absolute; left: -16px; right: -16px; top: 0; bottom: 30%; width: calc(100% + 32px); height: 70%; z-index: 0; pointer-events: none; }
.effigy { position: relative; z-index: 1; width: 100%; }
.rv-body { width: 100%; transition: filter 3s ease 1s, translate 3s ease 1s; }
.rv-head { position: absolute; aspect-ratio: 52 / 74; padding: 0; border: 0; background: none; cursor: pointer; }
.rv-head img { width: 100%; transition: filter 1.4s ease, translate 1.4s ease, rotate 1.4s ease, opacity 1.4s ease; }
.rv-head.burnt { pointer-events: none; }
.rv-head.burnt img { filter: brightness(0.28) sepia(0.7) saturate(0.4) contrast(1.2); translate: 0 6%; rotate: 9deg; opacity: 0.75; }
.effigy.burnt .rv-body { filter: brightness(0.2) sepia(0.6) saturate(0.3); translate: 0 3%; }
.ravan-stage .fire { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; pointer-events: none; }
.ravan-stage::after { content: ""; position: absolute; inset: -10% -16px 0; z-index: 3; pointer-events: none; background: radial-gradient(ellipse at 50% 62%, rgba(255, 140, 40, calc(var(--heat, 0) * 0.5)), transparent 66%); }
.ravan { justify-content: flex-start; }
.promises { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; gap: 12px; }
.slip {
  display: flex; gap: 12px; align-items: baseline;
  padding: 12px 18px 12px 16px;
  background: radial-gradient(ellipse at 50% 50%, transparent 52%, rgba(70, 30, 8, 0.5) 100%), var(--tex-cream) #F3E9D6;
  background-size: auto, 220px;
  color: #2B1810; text-align: left;
  clip-path: polygon(0 6%, 4% 0, 12% 4%, 22% 0, 35% 5%, 48% 1%, 60% 6%, 73% 0, 86% 5%, 96% 0, 100% 8%, 98% 30%, 100% 52%, 98% 74%, 100% 94%, 92% 100%, 78% 95%, 64% 100%, 50% 96%, 36% 100%, 22% 95%, 10% 100%, 0 93%, 2% 70%, 0 48%, 2% 26%);
  opacity: 0; transform: translateY(10px);
  transition: opacity 0.6s, transform 0.6s;
}
.slip:nth-child(odd) { rotate: -0.8deg; }
.slip:nth-child(even) { rotate: 0.9deg; }
.slip.in { opacity: 1; transform: none; }
.slip .num { flex: none; font-family: var(--f-display); font-style: italic; font-size: 1rem; color: #8C1631; }
.promise { font-size: 1.15rem; line-height: 1.25; }

/* ---------- gate ---------- */
.gate { gap: 22px; }
.gate-line { font-size: clamp(1.9rem, 8.6vw, 2.6rem); color: var(--gold-hi); }
.gate-diya {
  --p: 0;
  position: relative; width: min(72vw, 300px); aspect-ratio: 1;
  display: grid; place-items: center;
  padding: 0; border: 0; background: none; cursor: pointer;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.gd-wrap { width: 78%; translate: 0 16%; }
.gate-ring { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.gate-ring path { fill: none; stroke: var(--gold-hi); stroke-width: 1.6; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; filter: drop-shadow(0 0 4px rgba(246, 214, 122, 0.6)); }
.gate-diya.done .gate-ring { opacity: 0; transition: opacity 0.6s; }
.gate-diya.done + .hint { visibility: hidden; }
.invite {
  display: grid; justify-items: center; gap: 12px;
  width: min(100%, 360px); padding: 26px 22px 24px;
  background: var(--tex-cream) #F3E9D6; background-size: 220px; color: #3A0E18;
  border: 1px solid #C9A24A; outline: 1px solid rgba(201, 162, 74, 0.7); outline-offset: -8px;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.5);
}
.invite .punch { color: #8C1631; }
.invite .setup { font-size: 1.2rem; }
.countdown { display: flex; gap: 16px; }
.countdown span { display: grid; gap: 2px; font-size: 0.62rem; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: rgba(58, 14, 24, 0.65); }
.countdown b { font-family: var(--f-display); font-weight: 500; font-size: 2rem; letter-spacing: 0; color: #8C1631; font-variant-numeric: tabular-nums lining-nums; }
body.flash::after { content: ""; position: fixed; inset: 0; z-index: 70; background: radial-gradient(circle, #FFF6D8, #F6D67A 40%, #E9B44C); animation: flash 1.1s ease forwards; }
@keyframes flash { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.2s !important; }
  .grain { animation: none; }
}
