@property --r { syntax: '<percentage>'; inherits: false; initial-value: 0%; }
@property --m { syntax: '<percentage>'; inherits: false; initial-value: -20%; }

:root {
  --abyss: #030c09;
  --lake: #062019;
  --lake-2: #0b3427;
  --emerald: #1d6b48;
  --emerald-hi: #4fd18f;
  --emerald-ink: #174a32;
  --silver: #d3dcde;
  --silver-dim: #a3b8b1;
  --parchment: #e7d4aa;
  --parchment-hi: #f1e3c0;
  --parchment-lo: #c9a970;
  --ink: #2a190b;
  --ink-soft: #5b3e22;

  --serif: 'IM Fell English', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --sc: 'IM Fell English SC', 'IM Fell English', Georgia, serif;
  --black: 'UnifrakturCook', 'IM Fell English SC', serif;
  --hand: 'Mrs Saint Delafield', 'Snell Roundhand', cursive;

  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-fold: cubic-bezier(.65, .02, .2, 1);
  --ease-land: cubic-bezier(.22, 1, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--abyss);
  color: var(--silver);
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--emerald) var(--abyss);
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(18px, 4.7vw, 21px);
  line-height: 1.55;
  overflow-x: clip;
  -webkit-tap-highlight-color: transparent;
  caret-color: var(--emerald-hi);
}
body.locked { overflow: hidden; height: 100svh; }

::selection { background: #2f8a5e; color: #f3f8f4; }
:focus-visible { outline: 2px solid var(--silver); outline-offset: 4px; border-radius: 3px; }
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--abyss); }
::-webkit-scrollbar-thumb { background: var(--emerald); border-radius: 8px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
button { font: inherit; color: inherit; }

/* ── The lake ─────────────────────────────────────────── */
.lake {
  position: fixed; inset: 0; z-index: -1; overflow: hidden;
  background:
    radial-gradient(120% 70% at 50% -8%, #11452f 0%, transparent 60%),
    radial-gradient(90% 60% at 85% 110%, #0a2c20 0%, transparent 70%),
    linear-gradient(180deg, #072219 0%, #04140f 55%, #020906 100%);
}
.lake::before, .lake::after {
  content: ''; position: absolute; inset: -640px;
  background-image: var(--caustics-a);
  background-size: 640px 640px;
  mix-blend-mode: screen; opacity: .14;
  animation: drift-a 90s linear infinite;
  will-change: transform;
}
.lake::after {
  inset: -520px;
  background-image: var(--caustics-b); background-size: 520px 520px; opacity: .12;
  animation: drift-b 120s linear infinite;
}
@keyframes drift-a { to { transform: translate3d(640px, 640px, 0); } }
@keyframes drift-b { to { transform: translate3d(-520px, 520px, 0); } }
.lake-glow {
  position: absolute; left: 50%; top: -20vh; width: 140vw; height: 80vh; translate: -50% 0;
  background: radial-gradient(closest-side, rgba(79, 209, 143, .22), transparent);
  filter: blur(20px);
  animation: breathe 9s ease-in-out infinite alternate;
}
@keyframes breathe { from { opacity: .55; scale: 1; } to { opacity: 1; scale: 1.12; } }

#wand { position: fixed; inset: 0; z-index: 60; pointer-events: none; }

/* ── Map stage ────────────────────────────────────────── */
.map-stage {
  min-height: 100svh; display: grid; place-items: center;
  padding: max(3svh, env(safe-area-inset-top)) 0 7svh; position: relative;
}
.map {
  --w: min(90vw, 400px, 44svh);
  width: var(--w); height: calc(var(--w) * 2);
  position: relative;
}
.map-intro {
  position: absolute; left: 0; right: 0; height: 33.333%;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  transition: opacity .8s var(--ease-out), translate .8s var(--ease-out);
}
.map-intro--top { top: 0; justify-content: flex-end; padding-bottom: 6%; }
.map-intro--bottom { bottom: 0; justify-content: flex-start; padding-top: 7%; }
.map.unlocking .map-intro { opacity: 0; }
.map.unlocking .map-intro--top { translate: 0 -12px; }
.map.unlocking .map-intro--bottom { translate: 0 12px; }

.emblem { width: 34px; height: 46px; color: var(--silver); filter: drop-shadow(0 2px 6px rgba(79, 209, 143, .45)); animation: hover 4s ease-in-out infinite alternate; }
@keyframes hover { to { translate: 0 -5px; } }
.dedication { margin: .35em 0 0; font-family: var(--hand); font-size: clamp(30px, 9vw, 42px); line-height: 1; color: #eaf1f1; text-shadow: 0 0 18px rgba(79, 209, 143, .35); }
.promise { margin: 0; max-width: 24ch; font-style: italic; font-size: .82em; color: var(--silver-dim); }

/* Folding panels */
.panel {
  position: absolute; left: 0; width: 100%; height: 33.3334%;
  transform-style: preserve-3d;
  transition: transform 1.25s var(--ease-fold);
}
.panel.p0 { top: 0; transform-origin: 50% 100%; transform: perspective(1500px) rotateX(-180deg); z-index: 3; }
.panel.p1 { top: 33.3333%; z-index: 1; }
.panel.p2 { top: 66.6666%; transform-origin: 50% 0; transform: perspective(1500px) rotateX(180deg); z-index: 2; }
.map.open-top .p0 { transform: perspective(1500px) rotateX(0deg); }
.map.open-bottom .p2 { transform: perspective(1500px) rotateX(0deg); }

.face {
  position: absolute; inset: 0; overflow: hidden;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
.face-back {
  transform: rotateX(180deg);
  background: var(--paper), radial-gradient(120% 90% at 30% 20%, var(--parchment-hi), var(--parchment) 55%, var(--parchment-lo));
  background-size: 360px 360px, cover;
  box-shadow: inset 0 0 40px rgba(90, 55, 20, .45), 0 18px 40px -12px rgba(0, 0, 0, .8);
  border-radius: 2px;
}
.p0 .face-back::after {
  content: ''; position: absolute; inset: 7px; border: 1px solid rgba(60, 35, 12, .35); outline: 1px solid rgba(60, 35, 12, .18); outline-offset: 3px;
}
.face-front { box-shadow: 0 22px 50px -18px rgba(0, 0, 0, .85); }
.face-front::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  transition: opacity 1.6s ease .6s;
}
.p0 .face-front::after { background: linear-gradient(0deg, rgba(60, 35, 10, .35), transparent 22%); }
.p2 .face-front::after { background: linear-gradient(180deg, rgba(60, 35, 10, .35), transparent 22%); }
.map.inked .face-front::after { opacity: .5; }

.slice {
  position: absolute; left: 0; width: 100%; height: 300%;
  background:
    var(--paper),
    radial-gradient(60% 30% at 20% 12%, rgba(255, 245, 215, .7), transparent 70%),
    radial-gradient(50% 25% at 80% 78%, rgba(150, 105, 45, .28), transparent 70%),
    radial-gradient(40% 18% at 70% 30%, rgba(140, 95, 40, .18), transparent 70%),
    linear-gradient(180deg, var(--parchment-hi), var(--parchment) 45%, #dcc28c 80%, var(--parchment-lo));
  background-size: 360px 360px, cover, cover, cover, cover;
  box-shadow: inset 0 0 50px rgba(90, 55, 20, .45);
}
.p0 .slice { top: 0; }
.p1 .slice { top: -100%; }
.p2 .slice { top: -200%; }
.slice svg { display: block; width: 100%; height: 100%; }

/* Ink */
.ink { fill: none; stroke: var(--ink); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.ink-thin { stroke-width: .7; }
.ink-fade { opacity: 0; transition: opacity 1.4s ease; }
.map-text { fill: var(--ink); font-family: var(--sc); }
.map-label { font-size: 11px; letter-spacing: .04em; }
.map-title { font-size: 22px; letter-spacing: .03em; }
.map-sub { font-family: var(--serif); font-style: italic; font-size: 10.5px; fill: var(--ink-soft); }
.map.inked .ink { transition: stroke-dashoffset 2.2s var(--ease-out) var(--d, 0s); stroke-dashoffset: 0; }
.map.inked .ink-fade { opacity: 1; transition-delay: var(--d, .6s); }
.map.inked .slice svg {
  animation: bleed 2.6s var(--ease-out) both;
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 calc(var(--r) - 12%), transparent var(--r));
  mask-image: radial-gradient(circle at 50% 50%, #000 calc(var(--r) - 12%), transparent var(--r));
}
.map.revealed .slice svg { animation: none; -webkit-mask-image: none; mask-image: none; }
@keyframes bleed {
  from { --r: 0%; }
  to { --r: 160%; }
}

/* Overlay: footprints, tags, heart */
.map-overlay { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 5; pointer-events: none; overflow: visible; }
.step { fill: var(--ink); opacity: 0; animation: step 3.4s ease-out forwards; }
@keyframes step { 0% { opacity: 0; } 8% { opacity: .95; } 55% { opacity: .85; } 100% { opacity: .2; } }
.tag { opacity: 0; transition: opacity .6s ease, transform .32s linear; }
.tag.on { opacity: 1; }
.tag rect { fill: var(--parchment-hi); stroke: var(--ink); stroke-width: .8; }
.tag text { font-family: var(--sc); font-size: 9.5px; fill: var(--ink); }
.heart { fill: none; stroke: #6b1a1a; stroke-width: 1.6; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.4s var(--ease-out), fill 1.2s ease .9s; }
.met .heart { stroke-dashoffset: 0; fill: rgba(120, 25, 25, .18); }
.met-text { font-family: var(--sc); fill: var(--ink); opacity: 0; transition: opacity 1.2s ease 1.1s; }
.met .met-text { opacity: 1; }

/* Lock form */
.lock {
  position: absolute; left: 0; right: 0; top: 33.3333%; height: 33.3334%; z-index: 4;
  display: flex; flex-direction: column; justify-content: center; align-items: stretch;
  padding: 0 9%; color: var(--ink); text-align: center; gap: .55em;
  transition: opacity .6s ease, filter .6s ease;
}
.lock.shake { animation: shake .5s ease; }
@keyframes shake { 20%, 60% { translate: -7px 0; } 40%, 80% { translate: 7px 0; } }
.map.unlocking .lock { opacity: 0; filter: blur(6px); pointer-events: none; }
.lock-title { margin: 0; font-family: var(--sc); font-weight: 400; font-size: clamp(16px, 4.6vw, 21px); line-height: 1.15; text-wrap: balance; }
.lock-input {
  width: 100%; border: 0; border-bottom: 1px solid rgba(42, 25, 11, .55); background: transparent;
  font: italic 17px/1.4 var(--serif); color: var(--ink); padding: .35em .1em; text-align: center; border-radius: 0;
  caret-color: var(--ink);
}
.lock-input::placeholder { color: rgba(91, 62, 34, .8); }
.lock-input:focus { outline: none; border-bottom-color: var(--ink); box-shadow: 0 6px 10px -8px rgba(42, 25, 11, .6); }
.lock-row { display: flex; align-items: center; justify-content: center; gap: .9em; }
.lock-btn {
  display: inline-flex; align-items: center; gap: .4em;
  border: 0; border-radius: 999px; padding: .5em 1.15em .45em;
  background: var(--ink); color: var(--parchment-hi);
  font-family: var(--sc); font-size: 16px; letter-spacing: .06em; cursor: pointer;
  box-shadow: 0 4px 10px -4px rgba(42, 25, 11, .7);
  transition: transform .2s var(--ease-out), background .2s;
}
.lock-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.lock-btn:hover { background: #3f2611; }
.lock-btn:active { transform: scale(.96); }
.lock-btn:focus-visible { outline-color: var(--ink); }
.lock-hint { border: 0; background: none; padding: .3em 0; font-style: italic; font-size: 14px; color: var(--ink-soft); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(91, 62, 34, .45); cursor: pointer; }
.lock-msg { margin: 0; min-height: 1.3em; font-style: italic; font-size: 13.5px; line-height: 1.3; color: #5a1f12; }

.scroll-cue {
  position: absolute; bottom: max(2svh, env(safe-area-inset-bottom)); left: 50%; translate: -50% 0;
  display: flex; flex-direction: column; align-items: center; gap: .2em;
  color: var(--silver-dim); text-decoration: none; font-style: italic; font-size: 15px;
  opacity: 0; pointer-events: none; transition: opacity 1s ease;
}
.scroll-cue svg { width: 26px; height: 40px; fill: var(--silver); }
.scroll-cue.on { opacity: 1; pointer-events: auto; }
.cue-steps path { animation: cue 2.4s ease-in-out infinite; opacity: .15; }
.cue-steps path:nth-child(2) { animation-delay: .4s; }
.cue-steps path:nth-child(3) { animation-delay: .8s; }
@keyframes cue { 0%, 100% { opacity: .12; } 30% { opacity: 1; } }

/* ── Sections ─────────────────────────────────────────── */
.sect { padding: 16svh 5vw 6svh; position: relative; }
.sect-title {
  margin: 0 0 .25em; text-align: center;
  font-family: var(--sc); font-weight: 400; font-size: clamp(38px, 11vw, 64px); line-height: 1;
  color: var(--silver); letter-spacing: .01em; text-wrap: balance;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .7), 0 0 28px rgba(79, 209, 143, .22);
}
.sect-title::after {
  content: ''; display: block; width: 120px; height: 14px; margin: .35em auto 0;
  background:
    radial-gradient(circle at 50% 50%, var(--emerald-hi) 0 3px, transparent 4px),
    linear-gradient(90deg, transparent, var(--silver-dim) 30% 42%, transparent 42% 58%, var(--silver-dim) 58% 70%, transparent) center / 100% 1px no-repeat;
}
.lede { margin: 0 auto; max-width: 30ch; text-align: center; font-style: italic; color: var(--silver-dim); text-wrap: balance; }

/* ── Time-turner ──────────────────────────────────────── */
.turner {
  width: min(84vw, 380px); aspect-ratio: 1; margin: 1.2rem auto 0; position: relative;
  cursor: grab; touch-action: pan-y; outline-offset: 8px; border-radius: 50%;
}
.turner canvas { position: absolute; inset: -8%; width: 116% !important; height: 116% !important; display: block; }
.turner.has-3d .turner-2d { display: none; }
.turner-2d { position: absolute; inset: 0; perspective: 900px; }
.turner .layer { position: absolute; display: grid; place-items: center; transform-style: preserve-3d; transition: opacity 1s var(--ease-out), transform 1.4s var(--ease-out); }
.turner .layer svg { width: 100%; height: 100%; overflow: visible; }
.l-ouro { inset: 0; } .l-a { inset: 9%; } .l-b { inset: 19%; } .l-glass { inset: 29% 33%; }
.spin { width: 100%; height: 100%; }
.l-ouro .spin { animation: spinZ 70s linear infinite; }
.l-a .spin { animation: spinY 16s linear infinite; }
.l-b .spin { animation: spinX 22s linear infinite; }
.l-glass svg { filter: drop-shadow(0 0 12px rgba(79, 209, 143, .45)); }
@keyframes spinZ { to { transform: rotate(360deg); } }
@keyframes spinY { to { transform: rotateY(360deg); } }
@keyframes spinX { to { transform: rotateX(360deg); } }
html.js .turner:not(.in) .layer { opacity: 0; transform: scale(.5) rotate(-120deg); }
.turner .l-a { transition-delay: .12s; } .turner .l-b { transition-delay: .24s; } .turner .l-glass { transition-delay: .4s; }
.turner.whirl .l-a { animation: whirl 1.6s var(--ease-out); }
.turner.whirl .l-b { animation: whirl 1.6s var(--ease-out) reverse; }
@keyframes whirl { to { transform: rotate(720deg); } }
#sandTopRect, #sandBotRect { transition: y 1s linear, height 1s linear; }
.sand-stream { animation: stream .5s linear infinite; }
@keyframes stream { to { stroke-dashoffset: -5; } }

.turner-whisper { margin: .4em auto 0; min-height: 2.8em; max-width: 30ch; text-align: center; font-style: italic; font-size: .9em; color: #b6cdc3; text-wrap: balance; transition: opacity .4s; }

.counter {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 1.1rem .4rem;
  max-width: 460px; margin: 1.4rem auto 0; text-align: center;
}
.unit { grid-column: span 2; display: flex; flex-direction: column; align-items: center; }
.unit--big { grid-column: span 3; }
.num {
  font-family: var(--sc); font-size: clamp(34px, 10vw, 46px); line-height: 1; color: #eef4f4;
  font-variant-numeric: tabular-nums lining-nums; min-width: 2ch;
  text-shadow: 0 0 22px rgba(79, 209, 143, .35);
}
.unit--big .num { font-size: clamp(64px, 20vw, 96px); }
.num.tick { animation: tick .6s var(--ease-out); }
@keyframes tick { from { opacity: .2; translate: 0 -.25em; filter: blur(3px); } }
.lbl { margin-top: .25em; font-family: var(--sc); font-size: 13px; letter-spacing: .14em; color: var(--silver-dim); }
.total { margin: 1.6rem auto 0; max-width: 28ch; text-align: center; font-style: italic; color: var(--silver-dim); text-wrap: balance; }
.total b { font-style: normal; font-weight: 400; color: var(--silver); font-variant-numeric: tabular-nums; }

/* ── Newspaper ────────────────────────────────────────── */
.prophet-sect { padding-left: 3vw; padding-right: 3vw; }
.paper {
  width: min(100%, 720px); margin: 0 auto; padding: 20px 18px 26px; color: var(--ink);
  background:
    var(--paper),
    radial-gradient(70% 40% at 15% 5%, rgba(255, 250, 230, .6), transparent 70%),
    radial-gradient(60% 30% at 90% 95%, rgba(140, 100, 45, .25), transparent 70%),
    linear-gradient(180deg, #efe3c6, #e5d4ad 70%, #d8c08c);
  background-size: 360px 360px, cover, cover, cover;
  box-shadow: 0 40px 70px -30px rgba(0, 0, 0, .9), inset 0 0 60px rgba(110, 75, 30, .35);
  rotate: -.6deg;
}
.masthead { text-align: center; padding-bottom: .5rem; border-bottom: 3px double var(--ink); }
.mast-rule { height: 0; border-top: 1px solid var(--ink); margin-bottom: .5rem; }
.mast-title { margin: .05em 0 .12em; font-family: var(--black); font-weight: 700; font-size: clamp(38px, 12.5vw, 80px); line-height: 1; letter-spacing: -.01em; }
.mast-meta {
  display: flex; justify-content: space-between; gap: .6em; flex-wrap: wrap;
  border-top: 1px solid var(--ink); padding-top: .35rem;
  font-family: var(--sc); font-size: 12px; letter-spacing: .06em;
}
.stories { display: flex; flex-direction: column; }
.story { padding: 1.4rem 0 1.5rem; border-bottom: 1px solid rgba(42, 25, 11, .55); }
.story:last-child { border-bottom: 0; }
html.js .story {
  opacity: 0; translate: 0 -14px; scale: 1.14; rotate: var(--rot, -3deg); filter: blur(5px);
  transition: opacity .45s ease, translate .85s var(--ease-land), scale .85s var(--ease-land), rotate .85s var(--ease-land), filter .5s ease;
}
html.js .story.in { opacity: 1; translate: 0 0; scale: 1; rotate: 0deg; filter: none; }
.story-head { margin: 0; font-family: var(--sc); font-weight: 400; font-size: clamp(27px, 7.6vw, 42px); line-height: 1.02; text-align: center; text-wrap: balance; }
.story--lead .story-head { font-size: clamp(32px, 9.6vw, 56px); }
.byline { margin: .45em 0 .9em; text-align: center; font-style: italic; font-size: 14px; color: var(--ink-soft); }
.frame { position: relative; overflow: hidden; margin: 0 auto; background: #b9a57b; aspect-ratio: 4 / 3; box-shadow: inset 0 0 0 1px rgba(42, 25, 11, .6), 0 6px 14px -8px rgba(42, 25, 11, .8); }
.frame img, .frame video {
  width: 100%; height: 100%; object-fit: cover; display: block;
  filter: sepia(.62) contrast(1.12) brightness(.93) saturate(.85);
  animation: living 11s ease-in-out infinite alternate;
}
.frame::before { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none; box-shadow: inset 0 0 40px rgba(40, 22, 6, .7); }
.frame::after {
  content: ''; position: absolute; inset: -50%; z-index: 2; pointer-events: none;
  background-image: var(--grain); background-size: 200px 200px; opacity: .35; mix-blend-mode: multiply;
  animation: grain .9s steps(4) infinite;
}
@keyframes living {
  0% { transform: scale(1.05) translate(0, 0); }
  50% { transform: scale(1.12) translate(-1.6%, 1.1%); }
  100% { transform: scale(1.07) translate(1.4%, -1.2%); }
}
@keyframes grain { 0% { transform: translate(0, 0); } 25% { transform: translate(-6%, 4%); } 50% { transform: translate(5%, -3%); } 75% { transform: translate(-3%, -6%); } 100% { transform: translate(4%, 5%); } }
.story--oval .frame { width: 80%; aspect-ratio: 4 / 5; border-radius: 50%; isolation: isolate; -webkit-mask-image: -webkit-radial-gradient(white, black); box-shadow: 0 0 0 4px #e7d6ae, 0 0 0 5px var(--ink), 0 8px 18px -8px rgba(42, 25, 11, .8); }
.story--tilt .frame { width: 92%; rotate: 2.2deg; overflow: visible; }
.story--tilt .frame > * { overflow: hidden; }
.story--tilt .tape { position: absolute; z-index: 3; top: -12px; left: 50%; width: 92px; height: 24px; translate: -50% 0; rotate: -4deg; background: rgba(225, 210, 160, .75); box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
figure { margin: 0; }
.frame--empty { aspect-ratio: 16 / 9; display: grid; place-items: center; background: rgba(255, 248, 225, .35); box-shadow: inset 0 0 0 1px var(--ink), inset 0 0 0 5px rgba(231, 214, 174, .9), inset 0 0 0 6px rgba(42, 25, 11, .5); }
.frame--empty::after { opacity: .18; }
.no-photo { padding: 1rem 1.4rem; text-align: center; font-style: italic; font-size: 15px; color: var(--ink-soft); }
.no-photo p { margin: 0; }
.no-photo-title { margin-bottom: .3em !important; font-family: var(--sc); font-style: normal; font-size: 17px; letter-spacing: .06em; color: var(--ink); }
figcaption { margin: .55em auto 0; max-width: 34ch; text-align: center; font-style: italic; font-size: 13.5px; color: var(--ink-soft); }
.story-text { margin: 1em 0 0; font-size: 17.5px; line-height: 1.5; text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.story-text::first-letter { float: left; font-family: var(--black); font-size: 3.6em; line-height: .8; padding: .06em .08em 0 0; color: var(--emerald-ink); }
.paper-foot { margin: 1rem 0 0; padding-top: .7rem; border-top: 3px double var(--ink); text-align: center; font-family: var(--sc); font-size: 12px; letter-spacing: .05em; }
@media (min-width: 640px) {
  .paper { padding: 34px 40px 40px; }
  .story-text { columns: 2 240px; column-gap: 28px; column-rule: 1px solid rgba(42, 25, 11, .35); }
}

/* ── Cards ────────────────────────────────────────────── */
.cards-sect { padding-left: 0; padding-right: 0; }
.cards-sect .sect-title, .cards-sect .lede { padding: 0 5vw; }
.deck {
  --cw: min(70vw, 290px);
  display: flex; gap: 18px; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scrollbar-width: none;
  padding: 34px calc(50vw - var(--cw) / 2) 28px;
}
.deck::-webkit-scrollbar { display: none; }
.cromo {
  --tx: 0; --ty: 0; --hx: 50%; --hy: 50%;
  flex: 0 0 var(--cw); aspect-ratio: 5 / 7; position: relative;
  border: 0; padding: 0; background: none; cursor: pointer; scroll-snap-align: center;
  perspective: 1100px;
  transition: opacity .7s var(--ease-out), translate .9s var(--ease-land), rotate .9s var(--ease-land);
  transition-delay: calc(var(--i, 0) * 70ms);
}
html.js .deck:not(.in) .cromo { opacity: 0; translate: 0 70px; rotate: calc((var(--i, 0) - 1) * 6deg); }
.cromo-inner {
  position: absolute; inset: 0; transform-style: preserve-3d;
  transform: rotateX(calc(var(--ty) * -9deg)) rotateY(calc(var(--tx) * 12deg));
  transition: transform 1s var(--ease-land);
}
.cromo.flipped .cromo-inner { transform: rotateX(calc(var(--ty) * -9deg)) rotateY(calc(180deg + var(--tx) * 12deg)); }
.cromo-face {
  position: absolute; inset: 0; border-radius: 14px; overflow: hidden;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; text-align: center;
  box-shadow: 0 24px 40px -18px rgba(0, 0, 0, .9);
}
.cromo-face::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: linear-gradient(115deg, transparent 22%, rgba(150, 255, 205, .45) 40%, rgba(255, 255, 255, .7) 50%, rgba(170, 205, 255, .4) 60%, transparent 78%);
  background-size: 260% 260%; background-position: var(--hx) var(--hy);
  mix-blend-mode: color-dodge; opacity: .5;
}
.deck.auto .cromo-face::after { animation: holo 5s ease-in-out infinite alternate; }
@keyframes holo { from { background-position: 0% 0%; } to { background-position: 100% 100%; } }
.cromo-cover {
  padding: 18px 16px 20px; color: var(--silver);
  background:
    repeating-linear-gradient(45deg, rgba(211, 220, 222, .07) 0 1px, transparent 1px 14px),
    repeating-linear-gradient(-45deg, rgba(211, 220, 222, .07) 0 1px, transparent 1px 14px),
    radial-gradient(90% 70% at 50% 40%, #1f7a52, #0c3f2a 60%, #062016);
  box-shadow: inset 0 0 0 2px #0a2c1e, inset 0 0 0 4px rgba(211, 220, 222, .75), inset 0 0 0 5px #0a2c1e, 0 24px 40px -18px rgba(0, 0, 0, .9);
}
.cromo-no { font-family: var(--sc); font-size: 14px; letter-spacing: .14em; }
.cromo-cover svg { width: 38%; height: auto; color: #e3ebeb; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .5)) drop-shadow(0 0 14px rgba(79, 209, 143, .4)); }
.cromo-tap { font-style: italic; font-size: 15px; color: #bcd3c9; }
.cromo-reveal {
  transform: rotateY(180deg); padding: 18px 18px 16px; color: var(--ink);
  background: radial-gradient(100% 80% at 50% 20%, #f6f1e2, #e4dcc4 70%, #cfc3a2);
  box-shadow: inset 0 0 0 3px #e9e2cc, inset 0 0 0 5px var(--emerald), inset 0 0 0 6px #e9e2cc, inset 0 0 0 7px rgba(29, 107, 72, .5), 0 24px 40px -18px rgba(0, 0, 0, .9);
}
.cromo-reveal .cromo-no { color: var(--emerald-ink); }
.glyph { width: 30%; aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #2d8a5f, #0d3f2a); box-shadow: 0 0 0 2px #e9e2cc, 0 0 0 3px var(--emerald-ink); }
.glyph svg { width: 58%; height: 58%; fill: none; stroke: #e9f3ee; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.reason { margin: 0; font-style: italic; font-size: clamp(18px, 5.4vw, 22px); line-height: 1.3; text-wrap: balance; }
.rarity { font-family: var(--sc); font-size: 11.5px; letter-spacing: .1em; color: var(--ink-soft); }
.collected { margin: .4rem auto 0; text-align: center; font-family: var(--sc); letter-spacing: .08em; font-size: 15px; color: var(--silver-dim); padding: 0 5vw; }
.collected.done { color: var(--emerald-hi); }

/* ── Letter ───────────────────────────────────────────── */
.letter-sect { padding-bottom: 12svh; }
.envelope-wrap { margin: 2.2rem auto 0; display: flex; flex-direction: column; align-items: center; transition: opacity .8s ease, translate .9s var(--ease-out); }
html.js .envelope-wrap:not(.in) { opacity: 0; translate: 0 50px; }
.envelope-wrap.gone { opacity: 0; translate: 0 40px; pointer-events: none; }
.envelope { --ew: min(86vw, 380px); width: var(--ew); aspect-ratio: 1.42; position: relative; perspective: 1000px; animation: float 5s ease-in-out infinite alternate; }
@keyframes float { to { translate: 0 -8px; rotate: .6deg; } }
.env-back, .env-front, .env-flap, .env-peek { position: absolute; inset: 0; }
.env-back { background: linear-gradient(160deg, #d9c08a, #b99a5f); border-radius: 4px; box-shadow: 0 30px 50px -20px rgba(0, 0, 0, .9); }
.env-peek {
  inset: 6% 7% 10%; background: linear-gradient(180deg, #f4e9cc, #e6d3a8); border-radius: 2px;
  transition: translate 1.1s var(--ease-out); box-shadow: 0 -2px 8px rgba(0, 0, 0, .15);
}
.env-peek::before { content: ''; position: absolute; left: 12%; right: 12%; top: 18%; height: 40%; background: repeating-linear-gradient(180deg, rgba(42, 25, 11, .35) 0 1px, transparent 1px 12px); }
.env-front {
  background: linear-gradient(170deg, #e5cf9c, #c9ab70);
  clip-path: polygon(0 0, 50% 54%, 100% 0, 100% 100%, 0 100%);
  border-radius: 4px; box-shadow: inset 0 -12px 30px rgba(90, 60, 20, .3);
}
.env-flap {
  background: linear-gradient(180deg, #d4b97f, #c2a264);
  clip-path: polygon(0 0, 100% 0, 50% 58%);
  transform-origin: 50% 0; transition: transform 1s var(--ease-fold), z-index 0s .5s; z-index: 3;
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .25));
}
.envelope.open .env-flap { transform: rotateX(180deg); z-index: 0; }
.envelope.rise .env-peek { translate: 0 -52%; }
.seal {
  position: absolute; z-index: 4; left: 50%; top: 58%; width: 26%; aspect-ratio: 1; translate: -50% -50%;
  border: 0; padding: 0; background: none; cursor: pointer; border-radius: 50%;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .45));
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 50% { filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .45)) drop-shadow(0 0 14px rgba(79, 209, 143, .7)); } }
.seal-half { position: absolute; inset: 0; width: 100%; height: 100%; transition: transform 1s var(--ease-out), opacity .9s ease .2s; }
.seal-l { clip-path: polygon(0 0, 52% 0, 46% 22%, 55% 40%, 44% 58%, 53% 78%, 47% 100%, 0 100%); }
.seal-r { clip-path: polygon(52% 0, 100% 0, 100% 100%, 47% 100%, 53% 78%, 44% 58%, 55% 40%, 46% 22%); }
.seal.broken { animation: none; pointer-events: none; }
.seal.broken .seal-l { transform: translate(-40px, 90px) rotate(-40deg); opacity: 0; }
.seal.broken .seal-r { transform: translate(44px, 100px) rotate(36deg); opacity: 0; }
.env-hint { margin: 1rem 0 0; font-style: italic; color: var(--silver-dim); }

.sheet {
  width: min(100%, 640px); margin: 1.5rem auto 0; padding: 34px 26px 38px; color: var(--ink);
  background:
    var(--paper),
    radial-gradient(70% 40% at 20% 8%, rgba(255, 250, 230, .7), transparent 70%),
    linear-gradient(180deg, #f2e6c8, #e6d3a8 70%, #d5bb84);
  background-size: 360px 360px, cover, cover;
  box-shadow: 0 40px 70px -30px rgba(0, 0, 0, .9), inset 0 0 50px rgba(110, 75, 30, .3);
  clip-path: inset(0 0 100% 0);
}
.sheet.unfold { animation: unfoldSheet 1.5s var(--ease-out) forwards; }
@keyframes unfoldSheet { to { clip-path: inset(0 0 0 0); } }
.sheet .greet { margin: 0 0 .8em; font-family: var(--hand); font-size: clamp(40px, 11vw, 56px); line-height: 1; }
.sheet p { margin: 0 0 1em; font-size: 19px; line-height: 1.6; max-width: 62ch; }
.sheet .write {
  -webkit-mask-image: linear-gradient(100deg, #000 var(--m), transparent calc(var(--m) + 18%));
  mask-image: linear-gradient(100deg, #000 var(--m), transparent calc(var(--m) + 18%));
  transition: --m 2.6s cubic-bezier(.4, .1, .3, 1);
}
.sheet .write.shown { --m: 120%; }
.sheet .closing { margin: 1.4em 0 0; font-style: italic; }
.sheet .sign { margin: 0; font-family: var(--hand); font-size: clamp(46px, 13vw, 64px); line-height: 1.05; color: var(--emerald-ink); }
.mischief {
  display: block; margin: 2.4rem auto 0; padding: .7em 1.5em .62em; cursor: pointer;
  border: 1px solid var(--silver); border-radius: 999px; background: rgba(3, 12, 9, .5); color: var(--silver);
  font-family: var(--sc); font-size: 18px; letter-spacing: .08em;
  box-shadow: 0 0 0 4px rgba(211, 220, 222, .08), 0 10px 30px -10px rgba(79, 209, 143, .5);
  transition: background .3s, color .3s, transform .2s var(--ease-out), opacity .8s ease;
}
.mischief:hover { background: var(--silver); color: var(--abyss); }
.mischief:active { transform: scale(.97); }
.mischief[data-ready] { animation: appear 1s var(--ease-out); }
@keyframes appear { from { opacity: 0; translate: 0 14px; } }

.foot { padding: 4rem 5vw calc(3rem + env(safe-area-inset-bottom)); text-align: center; font-style: italic; font-size: 14px; color: #7f978d; }

/* ── Finale ───────────────────────────────────────────── */
.finale {
  --ox: 50%; --oy: 80%;
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 8vw; text-align: center; color: var(--ink);
  background:
    var(--paper),
    radial-gradient(80% 60% at 50% 40%, #f3e7c9, #e3cf9f 70%, #c9a970);
  background-size: 360px 360px, cover;
  clip-path: circle(0% at var(--ox) var(--oy));
  transition: clip-path 1.6s var(--ease-out);
}
.finale.on { clip-path: circle(150% at var(--ox) var(--oy)); }
.finale p { margin: 0; opacity: 0; filter: blur(6px); transition: opacity 1.4s ease, filter 1.4s ease; }
.finale.on .fin-1 { opacity: 1; filter: none; transition-delay: .9s; }
.finale.on .fin-2 { opacity: 1; filter: none; transition-delay: 2.3s; }
.finale.on .fin-3 { opacity: 1; filter: none; transition-delay: 3.4s; }
.fin-1 { font-family: var(--sc); font-size: clamp(30px, 9vw, 52px); line-height: 1.1; }
.fin-2 { margin-top: .6em !important; font-family: var(--hand); font-size: clamp(54px, 16vw, 96px); line-height: 1; color: var(--emerald-ink); }
.fin-3 { margin-top: .4em !important; font-style: italic; color: var(--ink-soft); }
.fin-btn {
  margin-top: 2.4rem; padding: .55em 1.2em .5em; border: 1px solid var(--ink); border-radius: 999px; background: none; color: var(--ink);
  font-family: var(--sc); font-size: 15px; letter-spacing: .06em; cursor: pointer; opacity: 0; transition: opacity 1s ease 4.4s, background .3s;
}
.finale.on .fin-btn { opacity: 1; }
.fin-btn:hover { background: rgba(42, 25, 11, .08); }
.fin-btn:focus-visible { outline-color: var(--ink); }

/* ── Music ────────────────────────────────────────────── */
.music {
  position: fixed; right: max(14px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom)); z-index: 40;
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  border: 1px solid rgba(211, 220, 222, .6); background: rgba(3, 12, 9, .7); color: var(--silver);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.music svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.music[aria-pressed="true"] { color: var(--emerald-hi); border-color: var(--emerald-hi); box-shadow: 0 0 16px rgba(79, 209, 143, .45); }

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

.music[hidden] { display: none; }
