/* ===================================================================
   OUR STORY — anniversary scroll site
   Palette: warm candlelight. Cocoa dark with soft amber and coral glows,
   honey gold, coral-peach; purple petals.
   Display face: Fraunces. Body face: Work Sans.
   =================================================================== */

:root {
  --ink: #2a1913;        /* warm cocoa, a little lighter and redder than before */
  --ink-2: #352019;
  --ink-3: #42291f;
  --paper: #fff1e2;
  --gold: #f1b866;       /* sunny honey gold */
  --gold-soft: rgba(241, 184, 102, 0.3);
  --rose: #f29a82;       /* warm coral-peach */
  --plum: #a86ad6;       /* flower petals */
  --lilac: #d2aef2;
  --text-main: #fbeee0;
  --text-muted: #d2b29c;
  --line: rgba(241, 184, 102, 0.26);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--ink);
  color: var(--text-main);
  font-family: "Work Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  /* clip (not hidden): hidden turns body into a scroll container, which
     silently breaks the sticky pinned keychain section */
  overflow-x: clip;
}

/* html carries the base colour so the glow layer below can sit behind body */
body { background: transparent; }

/* soft amber and coral glows fixed behind the page, like candlelight */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(70vmax 55vmax at 12% 0%, rgba(242, 154, 130, 0.22), transparent 70%),
    radial-gradient(65vmax 55vmax at 95% 45%, rgba(241, 184, 102, 0.16), transparent 70%),
    radial-gradient(70vmax 60vmax at 20% 100%, rgba(214, 120, 90, 0.18), transparent 70%);
}

img { max-width: 100%; display: block; }

h1, h2, h3 {
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  color: var(--paper);
  text-wrap: balance;
  margin: 0;
}

.section {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  padding-inline: max(20px, 5vw);
  padding-block: clamp(64px, 12vh, 120px);
}

/* thin gold chain-link thread running down the page behind the story */
.thread {
  position: absolute;
  top: 640px;
  bottom: 320px;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: repeating-linear-gradient(
    to bottom,
    var(--gold) 0px, var(--gold) 7px,
    transparent 7px, transparent 16px
  );
  opacity: 0.45;
  z-index: 0;
}

.marker {
  position: absolute;
  left: 50%;
  top: clamp(56px, 10vh, 96px);
  width: 10px;
  height: 10px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 5px var(--ink), 0 0 16px 2px var(--gold-soft);
  z-index: 1;
}

.eyebrow {
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 0.72rem;
  color: var(--rose);
  margin: 0 0 18px;
}

.kicker {
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin: 0 0 14px;
  position: relative;
  z-index: 1;
}

/* ---------- PIN gate ---------- */
.gate { display: none; }
html.gated { overflow: hidden; }
html.gated .gate {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background:
    radial-gradient(70vmax 55vmax at 15% 5%, rgba(242, 154, 130, 0.22), transparent 70%),
    radial-gradient(65vmax 55vmax at 95% 60%, rgba(241, 184, 102, 0.14), transparent 70%),
    var(--ink);
  transition: opacity 0.6s ease;
}
html.gated .gate.is-leaving { opacity: 0; pointer-events: none; }
.gate-inner { text-align: center; width: 100%; max-width: 320px; }
.gate-title {
  font-size: clamp(2.6rem, 11vw, 3.6rem);
  font-weight: 340;
}
.gate-prompt {
  margin: 12px 0 26px;
  color: var(--text-muted);
  font-size: 0.95rem;
  transition: color 0.2s ease;
}
.gate-prompt.is-wrong { color: var(--rose); }
.pin-dots {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-bottom: 34px;
}
.pin-dots span {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
  transition: background 0.15s ease, transform 0.15s ease;
}
.pin-dots span.is-filled { background: var(--gold); transform: scale(1.1); }
.pin-dots.is-right span { background: var(--rose); border-color: var(--rose); }
.pin-dots.is-wrong { animation: pinShake 0.45s ease; }
@keyframes pinShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-10px); }
  40% { transform: translateX(9px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(4px); }
}
.keypad {
  display: grid;
  grid-template-columns: repeat(3, 72px);
  justify-content: center;
  gap: 16px 22px;
}
.keypad button {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 241, 226, 0.06);
  color: var(--paper);
  font: 400 1.7rem/1 "Fraunces", Georgia, serif;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s ease, transform 0.12s ease;
}
.keypad button:active,
.keypad button.is-pressed { background: var(--gold-soft); transform: scale(0.94); }
.keypad button:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.keypad .key-back { border-color: transparent; background: transparent; }
.keypad .key-back svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 1.6;
  stroke-linejoin: round;
  stroke-linecap: round;
}
@media (max-height: 640px) {
  .keypad { gap: 10px 18px; grid-template-columns: repeat(3, 62px); }
  .keypad button { width: 62px; height: 62px; }
  .gate-prompt { margin-bottom: 18px; }
  .pin-dots { margin-bottom: 22px; }
}

/* berry shower that carries you from the gate onto the story */
.berry-rain {
  position: fixed;
  inset: 0;
  z-index: 101;
  pointer-events: none;
  width: 100%;
  height: 100%;
}

/* ---------- Hero ---------- */
.hero {
  min-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-block: clamp(48px, 10vh, 96px);
}

.hero-title {
  font-size: clamp(3rem, 9vw, 5.5rem);
  font-weight: 340;
  letter-spacing: -0.01em;
}

.hero-date {
  margin-top: 20px;
  font-family: "Fraunces", serif;
  font-style: italic;
  font-size: clamp(1.1rem, 2.4vw, 1.4rem);
  color: var(--gold);
}

.hero-sub {
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 40ch;
}

.scroll-hint {
  margin-top: 56px;
  width: 22px;
  height: 36px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  display: flex;
  justify-content: center;
  padding-top: 6px;
}
.scroll-hint span {
  width: 4px;
  height: 8px;
  border-radius: 2px;
  background: var(--gold);
  animation: scrollDown 1.8s ease-in-out infinite;
}
@keyframes scrollDown {
  0%   { transform: translateY(0);   opacity: 1; }
  60%  { transform: translateY(10px); opacity: 0.2; }
  100% { transform: translateY(0);   opacity: 0; }
}

/* ---------- Story blocks ---------- */
.h2 {
  text-align: center;
  font-size: clamp(1.7rem, 4.2vw, 2.4rem);
  font-weight: 340;
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}

.h3 {
  text-align: center;
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  font-weight: 340;
  margin-bottom: 12px;
}

.body-text {
  text-align: center;
  max-width: 52ch;
  margin: 0 auto 40px;
  color: var(--text-main);
  position: relative;
  z-index: 1;
}

/* ---------- Photo frames ---------- */
.photo-frame {
  margin: 0;
  aspect-ratio: 4 / 5;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(150deg, var(--ink-3), var(--ink-2));
  border: 1px solid var(--line);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.photo-frame img { width: 100%; height: 100%; object-fit: cover; }
.photo-frame.wide { aspect-ratio: 16 / 9; }

.photo-frame::before {
  content: attr(data-label);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  opacity: 1;
  transition: opacity 0.2s ease;
}
.photo-frame:has(img[src]:not([src=""])) {
  /* once a real image loads, hide the label text behind it */
}
.photo-frame img[src] { position: relative; z-index: 1; }
.photo-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px var(--line);
  pointer-events: none;
}

.frame-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}
.frame-row .photo-frame { flex: 1 1 240px; }

.frame-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  position: relative;
  z-index: 1;
}
@media (max-width: 560px) {
  .frame-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- First messages: chat that types itself, one tap at a time ---------- */
.chat {
  position: relative;
  z-index: 1;
  max-width: 460px;
  margin: 0 auto;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}
.chat.is-live { cursor: pointer; -webkit-tap-highlight-color: transparent; }

.chat-log {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px 14px 20px;
  min-height: 120px;
}

.chat-time {
  align-self: center;
  margin: 12px 0 4px;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.chat-time:first-child { margin-top: 0; }

.msg {
  position: relative;
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 0.95rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.msg p { margin: 0; }
.msg.me {
  align-self: flex-end;
  background: linear-gradient(160deg, #f29a82, #d9705d);
  color: #fffaf4;
  border-bottom-right-radius: 6px;
}
.msg.them {
  align-self: flex-start;
  background: var(--ink-3);
  color: var(--text-main);
  border: 1px solid var(--line);
  border-bottom-left-radius: 6px;
}
.msg.has-reaction { margin-bottom: 18px; }
.reaction {
  position: absolute;
  left: 10px;
  bottom: -18px;
  padding: 1px 8px;
  font-size: 0.85rem;
  border-radius: 999px;
  background: var(--ink-2);
  border: 1px solid var(--gold-soft);
}
.msg.me .reaction { left: auto; right: 10px; }
.quote {
  margin: 0 0 8px;
  padding: 8px 10px;
  border-left: 3px solid var(--gold-soft);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
  font-size: 0.85rem;
  opacity: 0.9;
}
.quote-name { display: block; font-size: 0.75rem; opacity: 0.75; margin-bottom: 2px; }

/* script.js hides every step, then reveals them one per tap */
.chat.is-live .chat-log > .is-hidden { display: none; }
.chat-log > .is-in { animation: msgIn 0.38s cubic-bezier(0.2, 0.8, 0.3, 1.2) both; }
.chat-log > .is-in .reaction { animation: msgIn 0.3s 0.5s ease-out both; }
@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px) scale(0.96); }
  to   { opacity: 1; transform: none; }
}

.typing {
  display: inline-flex;
  gap: 4px;
  padding: 13px 14px;
}
.typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.35;
  animation: typingDot 1.1s ease-in-out infinite;
}
.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typingDot {
  0%, 60%, 100% { opacity: 0.35; transform: translateY(0); }
  30%           { opacity: 1;    transform: translateY(-3px); }
}

.chat-next {
  display: block;
  width: 100%;
  padding: 14px;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--gold);
  font: inherit;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
}
.chat-next[hidden] { display: none; }
.chat-next:disabled { cursor: default; color: var(--text-muted); }
.chat-next:focus-visible { outline: 2px solid var(--gold); outline-offset: -4px; }
.chat.is-live:not(.is-done) .chat-next { animation: nudge 2.4s ease-in-out infinite; }
@keyframes nudge {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.55; }
}

/* the photo under the chat */
.first-photo-title {
  margin-top: clamp(48px, 8vh, 72px);
  font-style: italic;
  position: relative;
  z-index: 1;
}
.first-photo {
  max-width: 380px;
  margin: 0 auto;
  z-index: 1;
}
/* call log: a tall phone screenshot, shown whole rather than cropped */


/* ---------- Interlude: a single line between chapters ---------- */
.interlude {
  text-align: center;
  padding-block: clamp(80px, 16vh, 150px);
}
.interlude-title {
  position: relative;
  z-index: 1;
  font-style: italic;
  font-weight: 340;
  font-size: clamp(1.8rem, 5.5vw, 2.8rem);
  color: var(--paper);
}

/* ---------- Struck by lightning ---------- */
.lightning-block { text-align: center; }
.bolt {
  display: block;
  width: 26px;
  height: 44px;
  margin: 0 auto 16px;
  fill: var(--gold);
  filter: drop-shadow(0 0 10px rgba(241, 184, 102, 0.55));
  position: relative;
  z-index: 1;
}
.lightning-sub {
  margin: 0 auto 22px;
  font-family: "Fraunces", serif;
  font-style: italic;
  font-size: clamp(1.05rem, 2.6vw, 1.25rem);
  color: var(--rose);
  position: relative;
  z-index: 1;
}
.when-where {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 0 auto 30px;
  position: relative;
  z-index: 1;
}
.when-where span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--ink-2);
  font-size: 0.85rem;
  color: var(--text-main);
}
.when-where svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.lightning-story {
  max-width: 54ch;
  margin: 0 auto;
  padding: clamp(22px, 5vw, 32px);
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, var(--ink-3), var(--ink-2));
  text-align: left;
  position: relative;
  z-index: 1;
}
.lightning-story p { margin: 0 0 14px; }
.lightning-story p:last-child { margin-bottom: 0; }

/* ---------- Scrapbook: taped-in call log snippets, overlapping ---------- */
.scrapbook-title {
  font-style: italic;
  margin: clamp(56px, 10vh, 90px) 0 34px;
  position: relative;
  z-index: 1;
}
.scrapbook {
  position: relative;
  z-index: 1;
  max-width: 520px;
  margin: 0 auto;
  padding: 10px 0 20px;
}
.scrap {
  position: relative;
  width: 86%;
  margin: 0;
  padding: 8px 8px 10px;
  background: #fbf1e3;
  border-radius: 3px;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.45), 0 2px 4px rgba(0, 0, 0, 0.3);
  transform: rotate(var(--tilt, -3deg));
  transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.3, 1.1), opacity 0.5s ease;
}
.scrap + .scrap { margin-top: -4px; }
.scrap img { width: 100%; border-radius: 2px; }
/* a strip of washi tape across the top of each */
.scrap::before {
  content: "";
  position: absolute;
  top: -11px;
  left: 50%;
  width: 84px;
  height: 22px;
  margin-left: -42px;
  background: rgba(241, 184, 102, 0.55);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  transform: rotate(var(--tape, -4deg));
  z-index: 1;
}
.scrap:nth-child(odd)  { margin-right: auto; }
.scrap:nth-child(even) { margin-left: auto; }
.scrap:nth-child(1) { --tilt: -4deg; --tape: 5deg;  z-index: 1; }
.scrap:nth-child(2) { --tilt: 3deg;  --tape: -6deg; z-index: 2; }
.scrap:nth-child(2)::before { background: rgba(210, 174, 242, 0.6); left: 78%; }
.scrap:nth-child(3) { --tilt: -2deg; --tape: 3deg;  z-index: 3; }
.scrap:nth-child(3)::before { left: 74%; }
.scrap:nth-child(4) { --tilt: 4deg;  --tape: -3deg; z-index: 4; }
.scrap:nth-child(4)::before { background: rgba(242, 154, 130, 0.6); left: 80%; }
.scrap:nth-child(5) { --tilt: -3deg; --tape: 6deg;  z-index: 5; width: 80%; margin-left: 9%; }
.scrap:nth-child(5)::before { background: rgba(210, 174, 242, 0.6); left: 72%; }
/* the single taped-in screenshot of a day full of dropped calls */
.disconnects-title { margin: clamp(56px, 10vh, 90px) 0 6px; }
.disconnects-sub {
  margin: 0 auto 30px;
  text-align: center;
  font-family: "Fraunces", serif;
  font-style: italic;
  color: var(--rose);
  position: relative;
  z-index: 1;
}
.scrap-single {
  --tilt: 2.5deg;
  --tape: -5deg;
  width: min(80%, 360px);
  margin: 0 auto;
  z-index: 1;
}
.scrap-single::after {
  /* a second strip of tape on the bottom corner */
  content: "";
  position: absolute;
  bottom: -10px;
  right: -14px;
  width: 70px;
  height: 20px;
  background: rgba(210, 174, 242, 0.6);
  transform: rotate(-38deg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}
.scrap-first { --tilt: -2.5deg; --tape: 4deg; }
.scrap-first::after { right: auto; left: -14px; transform: rotate(38deg); background: rgba(242, 154, 130, 0.6); }
.scrap-single.is-waiting:not(.is-in) {
  opacity: 0;
  transform: rotate(calc(var(--tilt) * 2.5)) translateY(40px) scale(1.04);
}

/* script.js adds .is-live, then drops each one in as it scrolls into view */
.scrapbook.is-live .scrap:not(.is-in) {
  opacity: 0;
  transform: rotate(calc(var(--tilt, -3deg) * 2.5)) translateY(40px) scale(1.04);
}

/* ---------- Keychain / ring spin stage ---------- */
.spin-block { text-align: center; }
.spin-stage {
  position: relative;
  height: clamp(280px, 40vh, 380px);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 20px auto 12px;
  z-index: 1;
  perspective: 900px;
}
.spin-hook {
  position: absolute;
  top: 18px;
  left: 50%;
  width: 26px;
  height: 26px;
  transform: translateX(-50%);
  border: 3px solid var(--gold);
  border-bottom-color: transparent;
  border-right-color: transparent;
  border-radius: 50%;
  opacity: 0.7;
}
.spin-object {
  max-height: clamp(180px, 30vh, 260px);
  width: auto;
  will-change: transform;
  transform-origin: top center;
  filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.45));
}
.spin-object.ring {
  transform-origin: center;
  max-height: clamp(140px, 22vh, 200px);
}

/* ---------- Photoreal turntables (Blender frame sequences) ---------- */
.gem-stage {
  will-change: transform, opacity;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* ring: square frames */
.gem-stage[data-spin="hover"] {
  width: min(100%, 520px);
  height: clamp(320px, 62vw, 520px);
}
#ring .spin-stage { height: auto; }
/* keychain: tall portrait frames, swinging from the top of the clasp */
.key-seq {
  height: min(78vh, 640px);
  aspect-ratio: 400 / 760;
  max-width: 90vw;
  transform-origin: 50% 4%;
}
.seq-frame {
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}
.spin-glow {
  position: absolute;
  bottom: 8%;
  left: 50%;
  width: 60%;
  height: 34px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, var(--gold-soft) 0%, transparent 70%);
  filter: blur(4px);
  z-index: -1;
}
.spin-caption {
  font-size: 0.78rem;
  color: var(--text-muted);
  max-width: 40ch;
  margin: 0 auto;
}

/* placeholder state before a real cutout PNG is dropped in */
.spin-stage.is-placeholder {
  border: 1px dashed var(--line);
  border-radius: 20px;
}
.spin-stage.is-placeholder::before {
  content: "Drop in a transparent PNG cutout here";
  color: var(--text-muted);
  font-size: 0.85rem;
}

.pin-caption-below {
  margin-top: -8px;
  padding-bottom: 8px;
  position: relative;
  z-index: 2;
}

/* ---------- Pinned fall-away transition (keychain) ---------- */
.pin-wrap {
  position: relative;
  height: 220vh;
}
.pin-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pin-stage .spin-hook,
.pin-stage .spin-glow {
  position: absolute;
}
.pin-stage .spin-hook { top: 32%; }
.pin-stage .spin-glow { top: 86%; }
.pin-stage .spin-object[data-spin="fall"] {
  position: relative;
  transform-origin: top center;
}

/* ---------- Reel ---------- */
.reel-block { max-width: none; }
.reel {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 6px max(20px, calc((100vw - 760px) / 2 + 5vw)) 20px;
  margin-inline: calc(-1 * max(20px, 5vw));
  position: relative;
  z-index: 1;
}
.reel-card {
  flex: 0 0 auto;
  width: min(70vw, 300px);
  scroll-snap-align: center;
  margin: 0;
}
.reel-card img,
.reel-card .photo-frame { border-radius: 14px; }
.reel-card {
  aspect-ratio: 4 / 5;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(150deg, var(--ink-3), var(--ink-2));
  border: 1px solid var(--line);
  position: relative;
}
.reel-card::before {
  content: attr(data-label);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.78rem;
}
.reel-card img { width: 100%; height: 100%; object-fit: cover; position: relative; z-index: 1; }
.reel-card figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 2;
  padding: 10px 12px;
  font-size: 0.78rem;
  color: var(--paper);
  background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
}
.reel-hint {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ---------- Love letter ---------- */
.letter-block { text-align: center; }
.letter-card {
  position: relative;
  z-index: 1;
  background: var(--paper);
  color: #2c2015;
  border-radius: 4px;
  padding: clamp(32px, 6vw, 64px) clamp(24px, 7vw, 56px);
  text-align: left;
  box-shadow: 0 30px 60px rgba(0,0,0,0.4);
  max-width: 620px;
  margin: 0 auto;
}
.letter-line {
  font-family: "Fraunces", serif;
  font-style: italic;
  font-size: 1.3rem;
  margin: 0 0 20px;
  color: #c4604a; /* deeper coral: readable on the paper card */
}
.letter-body {
  font-family: "Fraunces", serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.05rem, 2.4vw, 1.2rem);
  line-height: 1.8;
  margin: 0 0 28px;
}
.letter-sign {
  font-family: "Fraunces", serif;
  font-style: italic;
  font-size: 1.15rem;
  color: #c4604a;
  margin: 0;
}

/* sealed envelope: script.js adds .is-sealed, tapping the heart opens it */
.letter-block { overflow: hidden; padding-bottom: clamp(80px, 14vh, 140px); }
.letter-stage { position: relative; z-index: 1; }
.envelope, .seal-hint { display: none; }
.letter-stage.is-sealed .envelope,
.letter-stage.is-sealed .seal-hint { display: block; }
.letter-stage.is-sealed .letter-card { display: none; }

.envelope {
  position: relative;
  width: min(100%, 460px);
  aspect-ratio: 3 / 2;
  margin: 12px auto 0;
  perspective: 1200px;
  filter: drop-shadow(0 26px 40px rgba(0, 0, 0, 0.45));
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.env-back {
  position: absolute;
  inset: 0;
  border-radius: 6px;
  background: linear-gradient(160deg, #f8ead6, #eed7b9);
}
/* the folded front: side and bottom flaps meeting under the seal */
.env-pocket {
  position: absolute;
  inset: 0;
  border-radius: 6px;
  background:
    linear-gradient(to top right, #ecd3b2 49.6%, transparent 50%) left bottom / 50.2% 100% no-repeat,
    linear-gradient(to top left, #ecd3b2 49.6%, transparent 50%) right bottom / 50.2% 100% no-repeat;
  clip-path: polygon(0 100%, 0 12%, 50% 62%, 100% 12%, 100% 100%);
}
.env-flap {
  position: absolute;
  inset: 0 0 auto 0;
  height: 62%;
  background: linear-gradient(180deg, #f3dfc3, #e6c9a3);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: 50% 0;
  transition: transform 0.7s cubic-bezier(0.5, 0, 0.3, 1);
  z-index: 2;
}
.seal {
  position: absolute;
  left: 50%;
  top: 62%;
  width: 72px;
  height: 72px;
  margin: -36px 0 0 -36px;
  border: 0;
  padding: 0;
  cursor: pointer;
  z-index: 3;
  /* wax: slightly uneven edge and a soft sheen */
  background: radial-gradient(circle at 36% 30%, #ee7d71, #c2413f 55%, #93272d 100%);
  box-shadow:
    0 0 0 4px rgba(179, 50, 52, 0.55),
    0 6px 14px rgba(70, 10, 10, 0.45),
    inset 0 -4px 8px rgba(80, 10, 14, 0.4),
    inset 0 3px 6px rgba(255, 190, 170, 0.35);
  border-radius: 48% 52% 50% 50% / 52% 48% 52% 48%;
  animation: sealPulse 2.4s ease-in-out infinite;
  transition: transform 0.35s ease, opacity 0.35s ease;
}
.seal svg {
  width: 38px;
  height: 38px;
  margin-top: 3px;
  fill: #f6a393;
  filter: drop-shadow(0 1px 0 rgba(255, 220, 210, 0.5)) drop-shadow(0 -1px 0 rgba(90, 10, 14, 0.45));
}
.seal:focus-visible { outline: 2px solid var(--gold); outline-offset: 6px; }
@keyframes sealPulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.07); }
}
.seal-hint {
  margin: 22px 0 0;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

/* opening: the seal pops, the flap folds back, the envelope sinks away */
.letter-stage.is-opening .seal { animation: none; transform: scale(1.25); opacity: 0; }
.letter-stage.is-opening .env-flap { transform: rotateX(180deg); z-index: 0; }
.letter-stage.is-opening .seal-hint { opacity: 0; transition: opacity 0.3s ease; }
.letter-stage.is-leaving .envelope { opacity: 0; transform: translateY(40px) scale(0.96); }
.letter-stage.is-open .letter-card { animation: letterIn 0.8s cubic-bezier(0.2, 0.8, 0.3, 1) both; }
@keyframes letterIn {
  from { opacity: 0; transform: translateY(60px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

/* petals that drift down and settle on the letter */
.petal-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}
.petal {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 0 100% 0 100%;
  opacity: 0;
  will-change: transform, opacity;
  box-shadow: inset 2px 2px 4px rgba(255, 255, 255, 0.25);
}

.footer {
  text-align: center;
  padding-block: 48px 80px;
  color: var(--text-muted);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

/* respect reduced motion: freeze the swing/spin, keep a resting pose */
@media (prefers-reduced-motion: reduce) {
  .scroll-hint span { animation: none; }
  .chat-log > .is-in, .chat-log > .is-in .reaction, .chat-next { animation: none !important; }
  .seal, .letter-stage.is-open .letter-card { animation: none !important; }
  .pin-dots.is-wrong { animation: none; }
  .scrap { transition: none; }
}
