:root {
  --heart: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 90'%3E%3Cpath d='M50 17C55 8 64 2 74 2C87 2 98 12 98 26C98 46 80 64 50 88C20 64 2 46 2 26C2 12 13 2 26 2C36 2 45 8 50 17Z'/%3E%3C/svg%3E");
  --red: #d3122f;
  --paper-card: #fffaf1;
  --paper-ink: #241512;
  --display: 'Fraunces', Georgia, serif;
  --hand: 'Reenie Beanie', 'Segoe Print', cursive;
  --mono: 'DM Mono', ui-monospace, monospace;
  --gutter: clamp(16px, 5vw, 64px);
}

/* Each scene recolors the whole page as she scrolls into it */
body[data-scene='paper'] { --bg: #f6eee3; --ink: #1d1210; --thread: #d3122f; --soft: #6d5a50; }
body[data-scene='blush'] { --bg: #f8cfc4; --ink: #3a0d12; --thread: #bb0d29; --soft: #7c3a39; }
body[data-scene='red'] { --bg: #c40d2e; --ink: #fff1e4; --thread: #fff1e4; --soft: #ffd1c6; }
body[data-scene='night'] { --bg: #0a0920; --ink: #f8ecdf; --thread: #ff5f76; --soft: #b6aec8; }
body[data-scene='dawn'] { --bg: #ffc69f; --ink: #3a1410; --thread: #bb0d29; --soft: #7d4532; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
[hidden] { display: none !important; }

body {
  position: relative;
  margin: 0;
  overflow-x: clip;
  font: 400 1.05rem/1.55 var(--display);
  color: var(--ink);
  background-color: var(--bg);
  transition: background-color 0.9s ease, color 0.9s ease;
  -webkit-tap-highlight-color: transparent;
}
body.locked { overflow: hidden; }
/* Until the question is answered, nothing behind it is shown. */
body.locked #site, body.locked #thread, body.locked #night { visibility: hidden; }

img, video, iframe { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
h2 { font: 400 clamp(3rem, 13.5vw, 8rem)/0.98 var(--display); letter-spacing: -0.03em; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.label { font: 500 0.7rem/1.4 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; }
.hand { font: 400 1.75rem/1.1 var(--hand); }
.lead { max-width: 30em; margin-inline: auto; }
.center { margin-top: 36px; text-align: center; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

.btn {
  position: relative;
  display: inline-block;
  min-height: 52px;
  padding: 15px 30px;
  overflow: hidden;
  border: 1.5px solid currentColor;
  border-radius: 999px;
  font: 500 0.74rem/1.5 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: inherit;
  background: none;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.btn:hover { transform: scale(1.05); }
.btn:active { transform: scale(0.95); }

/* Texture and background layers */
.grain {
  position: fixed;
  z-index: 40;
  inset: 0;
  pointer-events: none;
  opacity: 0.16;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E");
}
#night { position: fixed; inset: 0; z-index: 0; width: 100%; height: 100%; pointer-events: none; opacity: 0; transition: opacity 1.2s ease; }
body[data-scene='night'] #night { opacity: 1; }

/* The thread */
#thread { position: absolute; z-index: 1; top: 0; left: 0; overflow: visible; pointer-events: none; }
#thread-line { fill: none; stroke: var(--thread); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; transition: stroke 0.9s ease; }
.needle-dot { fill: var(--thread); transition: fill 0.9s ease; }
.needle-glow { fill: var(--thread); opacity: 0.3; transform-box: fill-box; transform-origin: center; animation: glint 1.2s ease-in-out infinite; }
@keyframes glint { 50% { opacity: 0.08; transform: scale(1.7); } }

/* Hearts in the thread: they fill as they are sewn, then come alive */
.bloom path { fill: none; transform-box: fill-box; transform-origin: 50% 55%; }
.bloom .hb-fill { fill: var(--thread); fill-opacity: calc(var(--p, 0) * 0.1); transition: fill 0.9s ease; }
.bloom .hb-ripple { stroke: var(--thread); stroke-width: 1.6; opacity: 0; transition: stroke 0.9s ease; }
.bloom .hb-run { stroke: #ffe6b0; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 6 94; opacity: 0; transition: opacity 0.8s ease; }
.bloom.on .hb-run { opacity: 0.95; }
.bloom.on.live .hb-fill { animation: hb-beat 1.7s ease-in-out infinite; }
.bloom.on.live .hb-ripple { animation: hb-ripple 2.8s ease-out infinite; }
.bloom.on.live .hb-ripple.two { animation-delay: 1.4s; }
.bloom.on.live .hb-run { animation: hb-run 3.4s linear infinite; }
@keyframes hb-beat { 0%, 48%, 100% { transform: scale(1); } 12% { transform: scale(1.09); } 36% { transform: scale(1.06); } }
@keyframes hb-ripple { from { opacity: 0.55; transform: scale(1); } to { opacity: 0; transform: scale(1.6); } }
@keyframes hb-run { to { stroke-dashoffset: -100; } }

/* The embedded player has to stay on the page for sound, so it is kept out of the way */
.yt-box { position: fixed; z-index: -1; left: 0; bottom: 0; width: 200px; height: 113px; overflow: hidden; opacity: 0.001; pointer-events: none; }
.now-playing {
  position: fixed;
  z-index: 46;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom));
  padding: 7px 14px;
  border-radius: 999px;
  font: 500 0.68rem/1.3 var(--mono);
  letter-spacing: 0.04em;
  white-space: nowrap;
  color: var(--bg);
  background: var(--ink);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.now-playing.on { opacity: 1; transform: translate(-50%, 0); }
.sound.ask { animation: ask 1.1s ease-in-out infinite; }
@keyframes ask { 50% { transform: scale(1.22); box-shadow: 0 0 0 9px rgba(211, 18, 47, 0.25); } }

.sound {
  position: fixed;
  z-index: 45;
  right: 14px;
  bottom: calc(14px + env(safe-area-inset-bottom));
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  width: 44px;
  height: 44px;
  padding: 14px 0;
  border: 0;
  border-radius: 50%;
  color: var(--bg);
  background: var(--ink);
  cursor: pointer;
  transition: background 0.9s ease;
}
.sound span { width: 3px; height: 100%; background: currentColor; transform-origin: bottom; animation: eq 1s ease-in-out infinite; }
.sound span:nth-child(2) { animation-delay: 0.25s; }
.sound span:nth-child(3) { animation-delay: 0.5s; }
.sound[aria-pressed='false'] span { animation: none; transform: scaleY(0.2); }
@keyframes eq { 0%, 100% { transform: scaleY(0.35); } 50% { transform: scaleY(1); } }

/* The question */
.gate {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 24px var(--gutter);
  text-align: center;
  /* Fixed colours, so the page behind can never wash the question out. */
  color: #1d1210;
  background: #f6eee3;
}
.gate-box { width: min(100%, 560px); transition: opacity 0.4s ease-in, transform 0.4s ease-in; }
.gate.leaving .gate-box { opacity: 0; transform: translateY(-20px); }
.gate-question { display: block; margin: 18px 0 44px; font: 500 clamp(1.55rem, 6.6vw, 2.8rem)/1.35 'Noto Serif Georgian', Sylfaen, serif; }
.gate-line { position: relative; display: flex; border-bottom: 2.5px solid var(--red); }
.gate-line.pluck { animation: pluck 0.5s linear; }
@keyframes pluck {
  0%, 100% { transform: none; }
  15% { transform: translateY(5px) skewX(5deg); }
  35% { transform: translateY(-4px) skewX(-4deg); }
  55% { transform: translateY(3px) skewX(2deg); }
  75% { transform: translateY(-2px) skewX(-1deg); }
}
#gate-input { flex: 1; min-width: 0; min-height: 60px; padding: 8px 44px; border: 0; outline: 0; font: 400 1.7rem var(--display); text-align: center; color: inherit; background: none; }
.gate-go { position: absolute; right: 0; bottom: 6px; width: 46px; height: 46px; border: 0; font: 400 1.6rem var(--display); color: var(--red); background: none; cursor: pointer; }
.gate-message { min-height: 2em; margin-top: 18px; font: 400 1.7rem var(--hand); color: var(--red); }

.wipe {
  position: fixed;
  z-index: 60;
  top: 50%;
  left: 50%;
  width: 120px;
  height: 108px;
  margin: -54px 0 0 -60px;
  pointer-events: none;
  background: var(--red);
  -webkit-mask: var(--heart) center / contain no-repeat;
  mask: var(--heart) center / contain no-repeat;
  transform: scale(0);
}
.wipe.grow { transform: scale(var(--cover, 40)); transition: transform 1s cubic-bezier(0.55, 0, 0.85, 0.35) 0.15s; }
.wipe.fade { opacity: 0; transition: opacity 0.6s ease; }

/* Hero */
.hero { position: relative; z-index: 3; height: 340vh; }
.stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }

.name {
  position: absolute;
  font: 400 clamp(5.4rem, 31vw, 24rem)/0.85 var(--display);
  font-style: italic;
  letter-spacing: -0.05em;
  color: var(--red);
  white-space: nowrap;
}
.name-him { top: 3.5svh; left: -0.03em; }
.name-her { right: 0.04em; bottom: 5svh; }
.name span { display: inline-block; }

.window {
  --m: 66vmin;
  position: absolute;
  inset: 0;
  background: #050505;
  -webkit-mask: var(--heart) center / var(--m) no-repeat;
  mask: var(--heart) center / var(--m) no-repeat;
}
.window img { width: 100%; height: 100%; object-fit: cover; object-position: center 62%; transform-origin: 44% 58%; }
.shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0.1) 40%, rgba(0, 0, 0, 0.7)); opacity: 0; }

.hero-title {
  position: absolute;
  right: var(--gutter);
  bottom: 9svh;
  left: var(--gutter);
  font: 400 clamp(2.7rem, 12vw, 7.4rem)/1 var(--display);
  letter-spacing: -0.03em;
  color: #fff6ec;
}
.word { display: inline-block; overflow: hidden; padding-bottom: 0.12em; margin-bottom: -0.12em; vertical-align: top; }
.word > span { display: inline-block; }

.scroll-cue { position: absolute; left: 50%; bottom: 14px; display: flex; flex-direction: column; align-items: center; gap: 6px; white-space: nowrap; transform: translateX(-50%); }
.scroll-cue i { width: 2px; height: 26px; background: var(--red); transform-origin: top; animation: drip 1.8s ease-in-out infinite; }
@keyframes drip { 0% { transform: scaleY(0); } 55% { transform: scaleY(1); } 100% { transform: scaleY(1) translateY(26px); opacity: 0; } }

/* Open space where the line draws its heart */
.gap { position: relative; z-index: 2; height: clamp(230px, 34vw, 400px); }
.gap.in-scene { z-index: auto; margin-bottom: 20px; }
.gap .t { left: 50%; top: 50%; }

/* Scenes */
.scene { position: relative; z-index: 2; padding: clamp(96px, 16vh, 180px) var(--gutter); }
.t { position: absolute; width: 0; height: 0; }
.section-head { position: relative; max-width: 1100px; margin: 0 auto 56px; text-align: center; }
.section-head .label { margin-bottom: 16px; }
.section-head .hand { margin-top: 16px; }

.quote { min-height: 120vh; display: grid; align-items: center; }
.big-quote { max-width: 1050px; margin: 0 auto; font: 400 clamp(2.5rem, 10.6vw, 6rem)/1.06 var(--display); letter-spacing: -0.025em; }
.big-quote span { opacity: 0.13; }

/* Days */
.days { min-height: 100vh; text-align: center; }
.odometer { display: flex; justify-content: center; height: 1em; margin: 18px 0 8px; overflow: hidden; font: 400 clamp(9rem, 46vw, 26rem)/1 var(--display); letter-spacing: -0.04em; font-variant-numeric: lining-nums tabular-nums; }
.digit { display: block; transition: transform 2.4s cubic-bezier(0.16, 1, 0.3, 1); }
.digit b { display: block; height: 1em; font-weight: 400; }
.days-word { margin-bottom: 26px; font-style: italic; }
.ticker { margin-top: 30px; font: 500 0.82rem/1.7 var(--mono); letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.forever { margin-top: 10px; font: 400 1.7rem var(--hand); }

/* Photos on the line */
.line { position: relative; display: flex; flex-direction: column; max-width: 1040px; margin: 0 auto; }
.hang { position: relative; width: min(72vw, 340px); padding-top: 4px; margin-bottom: 44px; perspective: 1100px; }
.hang:nth-child(odd) { align-self: flex-start; }
.hang:nth-child(even) { align-self: flex-end; }
.hang .t { left: 50%; top: 8px; }
.swing { position: relative; transform-origin: 50% 0; will-change: transform; }
.pin { position: absolute; z-index: 2; top: -13px; left: 50%; width: 15px; height: 40px; margin-left: -7px; border-radius: 3px 3px 5px 5px; background: linear-gradient(90deg, #b98d5a, #e0bd8a 45%, #a97c4c); box-shadow: 1px 2px 3px rgba(0, 0, 0, 0.35); }
.pin::after { content: ''; position: absolute; top: 15px; left: -2px; width: 19px; height: 3px; background: #6f7378; }
.print { position: relative; display: block; width: 100%; aspect-ratio: 5 / 6; padding: 0; border: 0; color: var(--paper-ink); background: none; cursor: pointer; transform-style: preserve-3d; transition: transform 0.85s cubic-bezier(0.3, 1.3, 0.5, 1); }
.print.flipped { transform: rotateY(180deg); }
.face { position: absolute; inset: 0; display: block; backface-visibility: hidden; -webkit-backface-visibility: hidden; background: var(--paper-card); box-shadow: 0 18px 34px rgba(50, 20, 10, 0.3); }
.front { padding: 12px 12px 0; }
.front img { width: 100%; height: 88%; object-fit: cover; object-position: center 25%; background: #2b2120; }
.back { display: grid; place-items: center; padding: 26px; font: 400 clamp(1.8rem, 7vw, 2.2rem)/1.08 var(--hand); text-align: center; transform: rotateY(180deg); background: repeating-linear-gradient(var(--paper-card) 0 31px, #f0dfd1 31px 32px); }

/* Heart video */
.heart-video {
  position: relative;
  display: block;
  width: min(88vw, 620px);
  aspect-ratio: 100 / 90;
  margin: 0 auto;
  padding: 0;
  border: 0;
  background: #000;
  cursor: pointer;
  -webkit-mask: var(--heart) center / contain no-repeat;
  mask: var(--heart) center / contain no-repeat;
}
.heart-video video { width: 100%; height: 100%; object-fit: cover; }
.video-hint { position: absolute; bottom: 30%; left: 0; right: 0; font: 400 1.7rem var(--hand); text-align: center; color: #fff; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7); }

/* Scratch ticket */
.ticket {
  position: relative;
  width: min(84vw, 440px);
  aspect-ratio: 3 / 4;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 14px;
  box-shadow: 0 26px 50px rgba(50, 20, 10, 0.32);
  background: #1b1213;
}
.ticket img { width: 100%; height: 100%; object-fit: cover; }
#scratch-foil { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: none; transition: opacity 0.9s ease; }
#scratch-foil.gone { opacity: 0; pointer-events: none; }
.after-note { min-height: 2.4em; max-width: 440px; margin: 26px auto 0; text-align: center; opacity: 0; transition: opacity 1s ease; }
.after-note.on { opacity: 1; }

/* The magic trick, as a short film */
.magic .section-head { margin-bottom: 34px; }
.film-reel {
  position: relative;
  width: min(100%, 820px);
  margin: 0 auto;
  padding: 22px 0;
  border-radius: 10px;
  background:
    radial-gradient(circle at center, #f6eee3 0 3.5px, transparent 4px) 0 7px / 22px 22px repeat-x,
    radial-gradient(circle at center, #f6eee3 0 3.5px, transparent 4px) 0 calc(100% - 7px) / 22px 22px repeat-x,
    #120c10;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6);
  transform: rotate(-0.8deg);
}
.film-screen { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #000; }
.film-screen video { width: 100%; height: 100%; object-fit: cover; }
.film-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  border: 0;
  color: #fff6ec;
  background: radial-gradient(ellipse at center, rgba(10, 5, 15, 0.15), rgba(10, 5, 15, 0.6));
  cursor: pointer;
  transition: opacity 0.4s ease;
}
.film-play[hidden] { display: none; }
.film-play-icon { position: relative; width: 74px; height: 74px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 0 rgba(211, 18, 47, 0.5); animation: film-pulse 1.8s ease-out infinite; }
.film-play-icon::after { content: ''; position: absolute; top: 50%; left: 54%; border-style: solid; border-width: 13px 0 13px 21px; border-color: transparent transparent transparent #fff6ec; transform: translate(-50%, -50%); }
@keyframes film-pulse { to { box-shadow: 0 0 0 18px rgba(211, 18, 47, 0); } }
.film-play-label { padding: 5px 14px; border-radius: 999px; font: 500 0.72rem var(--mono); letter-spacing: 0.1em; text-transform: uppercase; background: rgba(10, 5, 15, 0.55); }
.act-note { min-height: 2.4em; max-width: 520px; margin: 26px auto 0; text-align: center; opacity: 0; transition: opacity 1s ease; }
.act-note.on { opacity: 1; }

/* Heart of stars */
.sky { position: relative; width: min(88vw, 560px); aspect-ratio: 100 / 90; margin: 0 auto; }
.sky svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
#heart-ghost { fill: none; stroke: rgba(248, 236, 223, 0.14); stroke-width: 0.35; stroke-dasharray: 0.8 1.6; }
#heart-line { fill: none; stroke: var(--thread); stroke-width: 0.8; stroke-linecap: round; filter: drop-shadow(0 0 1.6px #ff5f76); transition: stroke-dashoffset 1.3s ease; }
#heart-fill { fill: #ff5f76; opacity: 0; transform-origin: 50% 50%; transition: opacity 1.6s ease; }
.sky.complete #heart-fill { opacity: 0.22; animation: throb 1.8s ease-in-out infinite; }
@keyframes throb { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.04); } 30% { transform: scale(1); } 45% { transform: scale(1.03); } }
.star { position: absolute; width: 56px; height: 56px; margin: -28px 0 0 -28px; padding: 0; border: 0; border-radius: 50%; font-size: 1.3rem; color: #6d6683; background: none; transition: color 0.5s ease; }
.star.done { color: #ffd9a8; cursor: pointer; }
.star.next { font-size: 1.9rem; color: #fff; cursor: pointer; text-shadow: 0 0 14px #ff5f76, 0 0 34px #ff5f76; animation: call 1.5s ease-in-out infinite; }
@keyframes call { 0%, 100% { transform: scale(0.85); } 50% { transform: scale(1.25); } }
.star-note { min-height: 11em; max-width: 520px; margin: 34px auto 0; text-align: center; }
.star-note h3 { margin-bottom: 8px; font: 400 2.4rem/1.1 var(--display); font-style: italic; }
.star-note p { font: 400 1.9rem/1.12 var(--hand); }

/* Envelope and letter */
.letter { padding-top: 40px; }
.envelope { position: relative; width: min(86vw, 460px); aspect-ratio: 8 / 5; margin: 0 auto; perspective: 1000px; }
/* Layers, back to front: inside of the envelope, opened flap, letter, front pocket, closed flap, seal */
.env-back { position: absolute; z-index: 1; inset: 0; border-radius: 6px; background: linear-gradient(180deg, #c3a88c, #d4bca2); box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5); }
.env-paper {
  position: absolute;
  z-index: 3;
  top: 6%;
  left: 6%;
  right: 6%;
  height: 88%;
  border-radius: 2px;
  background: repeating-linear-gradient(180deg, transparent 0 17px, rgba(58, 34, 48, 0.12) 17px 18px) 0 34px / 100% calc(100% - 46px) no-repeat, var(--paper-card);
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.12);
}
.env-front {
  position: absolute;
  z-index: 4;
  inset: 0;
  border-radius: 6px;
  background: linear-gradient(160deg, #efe1cf 0 49.8%, transparent 50%), linear-gradient(200deg, #ecdcc8 0 49.8%, #e4d1bb 50%);
  clip-path: polygon(0 0, 50% 56%, 100% 0, 100% 100%, 0 100%);
}
.env-flap { position: absolute; z-index: 6; inset: 0 0 42% 0; background: linear-gradient(180deg, #e8d6c1, #dcc6ad); clip-path: polygon(0 0, 100% 0, 50% 100%); transform-origin: top; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.12)); }
.env-name { position: absolute; z-index: 5; left: 0; right: 0; bottom: 8%; font: 400 1.9rem var(--hand); text-align: center; color: var(--paper-ink); }
.seal { position: absolute; z-index: 7; top: 60%; left: 50%; width: 76px; height: 76px; margin: -38px 0 0 -38px; border: 0; border-radius: 47% 53% 50% 50%; font-size: 1.8rem; color: #ffd8d0; background: radial-gradient(circle at 35% 30%, #e0243f, #7c0a1c); box-shadow: 0 5px 14px rgba(0, 0, 0, 0.45), inset 0 0 0 5px rgba(255, 255, 255, 0.08); cursor: pointer; animation: beat 1.8s ease-in-out infinite; }
@keyframes beat { 0%, 48%, 100% { transform: scale(1); } 12% { transform: scale(1.1); } 36% { transform: scale(1.06); } }

.paper { max-width: 620px; margin: 0 auto; padding: clamp(30px, 7vw, 56px); font: 400 clamp(1.95rem, 7.2vw, 2.5rem)/1.1 var(--hand); color: var(--paper-ink); background: var(--paper-card); box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5); transform: rotate(-0.8deg); }
.paper p { margin-bottom: 0.7em; }
.paper .signature { margin: 0; text-align: right; }
.paper audio { width: 100%; margin-top: 16px; }

/* Finale */
.finale { text-align: center; }
.finale h2 { margin-bottom: 20px; }
.finale-time { margin-top: 14px; font: 400 2.1rem var(--hand); }
/* The postcard: the Maps screenshot is cropped down to the street alone */
.postcard-hang { position: relative; width: min(100%, 680px); margin: 20px auto 64px; padding-top: 4px; perspective: 1400px; }
.postcard-hang .pin-mark { left: 50%; top: 8px; }
.postcard { position: relative; display: block; width: 100%; aspect-ratio: 3 / 2.3; padding: 0; border: 0; color: var(--paper-ink); background: none; cursor: pointer; transform-style: preserve-3d; transition: transform 0.9s cubic-bezier(0.3, 1.3, 0.5, 1); }
.postcard.flipped { transform: rotateY(180deg); }
.pc-face { position: absolute; inset: 0; display: block; overflow: hidden; border-radius: 8px; background: var(--paper-card); box-shadow: 0 22px 44px rgba(90, 30, 10, 0.34); backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.pc-front { padding: 10px; }
.spot { position: relative; display: block; width: 100%; aspect-ratio: 3 / 2; overflow: hidden; border-radius: 4px; }
.spot img { position: absolute; top: -16.7%; left: -60.6%; width: 193.3%; max-width: none; filter: sepia(0.3) saturate(1.2) brightness(1.05) contrast(0.98); }
.spot-glow { position: absolute; inset: 10px 10px auto; aspect-ratio: 3 / 2; border-radius: 4px; pointer-events: none; background: radial-gradient(ellipse at 33% 48%, rgba(255, 214, 170, 0.28), transparent 45%), radial-gradient(ellipse at center, transparent 55%, rgba(120, 40, 20, 0.34)); }
.sticker { position: absolute; top: 34%; left: 34%; width: 19%; aspect-ratio: 100 / 90; margin-left: -9.5%; filter: drop-shadow(0 3px 4px rgba(60, 10, 10, 0.45)); }
.sticker i { display: block; width: 100%; height: 100%; background: var(--red); -webkit-mask: var(--heart) center / contain no-repeat; mask: var(--heart) center / contain no-repeat; animation: beat 1.8s ease-in-out infinite; }
.spot-note { position: absolute; top: 9%; left: 50%; padding: 1px 12px 3px; font: 400 clamp(1.4rem, 5.6vw, 2.2rem)/1.15 var(--hand); color: var(--paper-ink); background: rgba(255, 244, 205, 0.92); box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); transform: rotate(-3deg); white-space: nowrap; }
.spot-place { position: absolute; left: 14px; bottom: 3px; font: 400 clamp(1.15rem, 4.4vw, 1.6rem)/1.5 var(--hand); }
.spot-credit { position: absolute; right: 14px; bottom: 5px; font: 400 0.5rem var(--mono); color: #8a7b70; }
.pc-back { display: grid; grid-template-columns: 1.15fr 1fr; gap: 12px; padding: clamp(12px, 3.6vw, 24px); text-align: left; transform: rotateY(180deg); background: var(--paper-card); }
.pc-message { display: block; padding-right: 10px; border-right: 1px solid #d9c7b6; font: 400 clamp(1.15rem, 4.6vw, 1.9rem)/1.08 var(--hand); }
.pc-signoff, .pc-sign { display: block; margin-top: 0.5em; }
.pc-sign { color: var(--red); }
.pc-side { position: relative; display: block; }
.stamp { position: absolute; top: 0; right: 0; width: 34%; aspect-ratio: 4 / 5; padding: 4px; background: #fff; }
.stamp img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 62%; }
.postmark { position: absolute; top: 4%; right: 22%; display: grid; place-items: center; align-content: center; width: 34%; aspect-ratio: 1; border: 1.5px solid rgba(190, 20, 45, 0.7); border-radius: 50%; font: 500 clamp(0.42rem, 1.7vw, 0.62rem)/1.1 var(--mono); letter-spacing: 0.08em; color: rgba(190, 20, 45, 0.8); transform: rotate(-14deg); }
.postmark b { display: block; font-size: 1.5em; }
.pc-to, .pc-where { position: absolute; right: 0; left: 0; padding-bottom: 1px; border-bottom: 1px solid #cdb9a7; font: 400 clamp(1.15rem, 4.4vw, 1.75rem)/1.1 var(--hand); }
.pc-to { bottom: 33%; }
.pc-where { bottom: 12%; }
.postcard-hint { margin-top: 18px; text-align: center; }

.map-frame { position: relative; max-width: 900px; margin: 0 auto; border: 10px solid var(--paper-card); box-shadow: 0 26px 50px rgba(80, 30, 10, 0.3); transform: rotate(0.8deg); }
.map-frame iframe { width: 100%; height: clamp(320px, 55vh, 520px); border: 0; filter: sepia(0.35) saturate(1.1); }

/* Open when */
.open-when { display: grid; gap: 12px; max-width: 720px; margin: 0 auto; }
.open-when details { padding: 0 20px; border-bottom: 1.5px solid currentColor; }
.open-when summary { display: flex; justify-content: space-between; align-items: center; gap: 14px; min-height: 66px; padding: 12px 0; font: 400 clamp(1.5rem, 6.4vw, 2.3rem)/1.1 var(--display); letter-spacing: -0.01em; list-style: none; cursor: pointer; }
.open-when summary::-webkit-details-marker { display: none; }
.open-when summary::after { content: '+'; color: var(--red); transition: transform 0.4s ease; }
.open-when details[open] summary::after { transform: rotate(45deg); }
.open-when p { padding-bottom: 20px; font: 400 1.9rem/1.12 var(--hand); color: var(--red); }

/* Coupons */
.coupons-head { margin-top: 110px; }
.coupons { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px; max-width: 900px; margin: 0 auto; }
.coupon { display: flex; min-height: 118px; filter: drop-shadow(0 8px 12px rgba(80, 30, 10, 0.2)); }
.coupon-main { flex: 1; min-width: 0; padding: 18px; color: #fff4e8; background: var(--red); -webkit-mask: radial-gradient(circle 9px at 100% 0, transparent 98%, #000) top right / 100% 51% no-repeat, radial-gradient(circle 9px at 100% 100%, transparent 98%, #000) bottom right / 100% 51% no-repeat; mask: radial-gradient(circle 9px at 100% 0, transparent 98%, #000) top right / 100% 51% no-repeat, radial-gradient(circle 9px at 100% 100%, transparent 98%, #000) bottom right / 100% 51% no-repeat; }
.coupon h3 { font: 400 1.5rem/1.1 var(--display); }
.coupon p { margin-top: 6px; font: 400 0.68rem/1.4 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; }
.coupon button { flex: none; width: 76px; border: 0; border-left: 2px dashed var(--red); font: 500 0.64rem var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--red); background: var(--paper-card); cursor: pointer; transform-origin: 0 100%; transition: transform 0.6s cubic-bezier(0.4, 1.6, 0.5, 1); }
.coupon.used button { transform: rotate(9deg) translateY(8px); }
.coupon.used .coupon-main { background: #9a7a70; }

.footer { padding-bottom: 110px; text-align: center; }
.footer h2 { margin-top: 14px; font-size: clamp(2.6rem, 11vw, 6.6rem); font-style: italic; color: var(--red); }

/* Tap hearts */
.pop { position: fixed; z-index: 55; pointer-events: none; color: var(--thread); animation: pop 1.1s cubic-bezier(0.2, 0.7, 0.3, 1) forwards; }
@keyframes pop { from { opacity: 1; transform: translate(-50%, -50%) scale(0.4); } to { opacity: 0; transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(1.2) rotate(var(--r)); } }

@media (min-width: 820px) {
  /* The photo's own black meets the black behind it, so wide screens keep it sharp. */
  .window img { object-fit: contain; }
  .hero-title { right: 52vw; }
  .line { display: grid; grid-template-columns: repeat(3, 1fr); gap: 34px 4vw; align-items: start; }
  .hang { width: 100%; margin: 0; }
  .hang:nth-child(3n + 2) { margin-top: 90px; }
  .hang:nth-child(3n) { margin-top: 26px; }
  .hang:nth-child(n) { align-self: start; }
  .back { font-size: 2rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
  .hero { height: 100vh; }
  .window { -webkit-mask: none; mask: none; }
  .shade { opacity: 1; }
  .name { display: none; }
  .big-quote span { opacity: 1; }
}

/* ---------- Extra effects ---------- */
.fx-canvas { position: fixed; z-index: 58; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* The moving banner */
.marquee { position: relative; z-index: 2; padding: 9vh 0; overflow: hidden; transform: rotate(-4deg); }
.marquee-row { display: flex; overflow: hidden; white-space: nowrap; }
.marquee-track { display: flex; flex: none; will-change: transform; }
.marquee-half { display: flex; flex: none; align-items: center; }
.marquee-row span { padding: 0 0.28em; font: italic 400 clamp(3.4rem, 15vw, 9rem)/1.05 var(--display); letter-spacing: -0.03em; }
.marquee-row.outline span { font: 500 clamp(1.4rem, 5.6vw, 3rem)/1.6 var(--mono); font-style: normal; letter-spacing: 0.04em; text-transform: uppercase; color: transparent; -webkit-text-stroke: 1.2px var(--ink); }
.marquee-heart { font-style: normal; font-size: clamp(2.2rem, 9vw, 5.4rem); color: var(--red); animation: beat 1.8s ease-in-out infinite; }
.marquee-star { font-style: normal; font-size: clamp(1.1rem, 4vw, 2rem); color: var(--red); }

/* Tilt glint */
.glare { position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0; mix-blend-mode: soft-light; transition: opacity 0.35s ease; }

/* Desktop heart cursor */
.fx-cursor { position: fixed; z-index: 70; top: -14px; left: -14px; width: 28px; height: 28px; pointer-events: none; border: 1.5px solid var(--thread); border-radius: 50%; transition: width 0.25s ease, height 0.25s ease, top 0.25s ease, left 0.25s ease, background 0.25s ease, border-color 0.9s ease; }
.fx-cursor::after { content: '♥'; position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; color: var(--thread); }
.fx-cursor.big { top: -26px; left: -26px; width: 52px; height: 52px; background: rgba(211, 18, 47, 0.12); }
.fx-trail { position: fixed; z-index: 69; pointer-events: none; font-size: 10px; color: var(--thread); transform: translate(-50%, -50%); animation: trail 0.9s ease-out forwards; }
@keyframes trail { to { opacity: 0; transform: translate(-50%, calc(-50% + 18px)) scale(0.3) rotate(25deg); } }
.btn, .sound { transition: transform 0.3s cubic-bezier(0.3, 1.6, 0.5, 1), translate 0.25s ease-out; }

@media (prefers-reduced-motion: reduce) {
  .marquee-heart { animation: none; }
}

/* The music button as a spinning record (the plain button stays for its logic) */
.has-vinyl .sound { visibility: hidden; }
.vinyl { position: fixed; z-index: 46; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); width: 54px; height: 54px; padding: 0; border: 0; background: none; cursor: pointer; }
.vinyl[hidden] { display: none; }
.vinyl-disc { position: absolute; inset: 0; border-radius: 50%; background: repeating-radial-gradient(circle, #141014 0 2px, #241c22 2px 3px); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.06); animation: spin 2.4s linear infinite; animation-play-state: paused; }
.vinyl-disc::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 30deg, transparent 0 20%, rgba(255, 255, 255, 0.16) 25%, transparent 30% 70%, rgba(255, 255, 255, 0.1) 75%, transparent 80%); }
.vinyl-label { position: absolute; inset: 31%; border-radius: 50%; border: 2px solid var(--red); background: var(--red) center 60% / cover; }
.vinyl-label::after { content: ''; position: absolute; top: 50%; left: 50%; width: 4px; height: 4px; margin: -2px; border-radius: 50%; background: #f6eee3; }
.vinyl-arm { position: absolute; top: -6px; right: -4px; width: 4px; height: 30px; border-radius: 2px; background: linear-gradient(#e6c27a, #b88b3c); transform-origin: 50% 3px; transform: rotate(-38deg); transition: transform 0.6s cubic-bezier(0.3, 1.4, 0.5, 1); }
.vinyl-arm::before { content: ''; position: absolute; top: -3px; left: -3px; width: 10px; height: 10px; border-radius: 50%; background: #b88b3c; }
.vinyl.playing .vinyl-disc { animation-play-state: running; }
.vinyl.playing .vinyl-arm { transform: rotate(-8deg); }
@keyframes spin { to { transform: rotate(360deg); } }

/* Press and hold anywhere */
.love-hold { position: fixed; z-index: 57; pointer-events: none; font-size: 26px; line-height: 1; color: var(--thread); text-shadow: 0 0 18px rgba(255, 95, 118, 0.7); transform: translate(-50%, -50%) scale(0.4); animation: love-grow 1.6s cubic-bezier(0.2, 0.8, 0.3, 1) forwards; }
@keyframes love-grow { to { transform: translate(-50%, -50%) scale(4); } }
#site { -webkit-touch-callout: none; }

/* Shooting stars to catch */
.wish-star { position: fixed; z-index: 57; width: 52px; height: 52px; padding: 0; border: 0; background: none; cursor: pointer; animation: wish-fly 2.6s cubic-bezier(0.3, 0, 0.7, 1) forwards; }
.wish-star::before { content: '✦'; position: absolute; inset: 0; display: grid; place-items: center; font-size: 22px; color: #fff3cf; text-shadow: 0 0 10px #ffd792, 0 0 22px #ffd792; }
.wish-star::after { content: ''; position: absolute; top: 50%; left: 50%; width: 120px; height: 2px; background: linear-gradient(90deg, rgba(255, 243, 207, 0.9), transparent); transform-origin: 0 50%; transform: rotate(-24deg); }
@keyframes wish-fly { from { opacity: 0; transform: translate(0, 0); } 12% { opacity: 1; } 85% { opacity: 1; } to { opacity: 0; transform: translate(-46vw, 22vh); } }
.wish-toast { position: fixed; z-index: 59; left: 50%; top: 20%; max-width: 86vw; padding: 10px 20px; border-radius: 999px; font: 400 1.6rem/1.1 var(--hand); text-align: center; color: #3a1410; background: #fff3cf; box-shadow: 0 10px 30px rgba(255, 215, 146, 0.45); transform: translateX(-50%); animation: toast 3.2s ease forwards; }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, 14px) scale(0.9); } 12%, 80% { opacity: 1; transform: translate(-50%, 0) scale(1); } 100% { opacity: 0; transform: translate(-50%, -10px); } }

/* Movie credits */
.credits { position: relative; z-index: 2; height: 300vh; }
.credits-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; -webkit-mask: linear-gradient(transparent, #000 16%, #000 84%, transparent); mask: linear-gradient(transparent, #000 16%, #000 84%, transparent); }
.credits-roll { position: absolute; left: 0; right: 0; top: 0; padding: 0 var(--gutter); text-align: center; will-change: transform; }
.credit { margin-bottom: 13vh; }
.credit-role { font: 500 0.7rem/1.4 var(--mono); letter-spacing: 0.22em; text-transform: uppercase; color: var(--soft); }
.credit-name { margin-top: 8px; font: italic 400 clamp(2rem, 9vw, 3.6rem)/1.05 var(--display); }
.credit-note { margin-top: 4px; font: 400 1.6rem var(--hand); color: var(--thread); }
.credit-end { padding: 10vh 0 30vh; }
.credit-big { margin-top: 10px; font: italic 400 clamp(3rem, 14vw, 6.6rem)/1 var(--display); }
.credit-heart { margin-top: 18px; font-size: 2.4rem; color: var(--thread); animation: beat 1.8s ease-in-out infinite; }
.credits.static { height: auto; }
.credits.static .credits-stage { position: static; height: auto; -webkit-mask: none; mask: none; }
.credits.static .credits-roll { position: static; padding: 15vh var(--gutter); }

/* Letter ink */
.ink { display: inline-block; }
