:root {
  --bg: #fff7f8;
  --paper: #fffdfc;
  --card: rgba(255, 255, 255, 0.65);
  --ink: #34242b;
  --muted: #8d727b;
  --rose: #dc8298;
  --deep: #b84f6a;
  --blush: #f6dbe1;
  --red: #762b3c;
  --gold: #c8925a;
  --line: rgba(76, 40, 51, 0.12);
  --nav-bg: rgba(255, 247, 248, 0.82);
  --photo-filter: sepia(0.12) contrast(0.99);
}

html[data-theme="midnight"] {
  --bg: #0f0a10;
  --paper: #1b121d;
  --card: rgba(32, 21, 35, 0.72);
  --ink: #f5e9ec;
  --muted: #a88d97;
  --rose: #e58ca3;
  --deep: #f095ad;
  --blush: #2b1a25;
  --red: #ff85a1;
  --gold: #e8c391;
  --line: rgba(245, 215, 225, 0.12);
  --nav-bg: rgba(15, 10, 16, 0.84);
  --photo-filter: sepia(0.2) brightness(0.9) contrast(1.03);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: radial-gradient(circle at 15% 5%, rgba(220, 130, 152, 0.12) 0, transparent 35%),
              radial-gradient(circle at 85% 20%, rgba(212, 163, 115, 0.08) 0, transparent 30%),
              var(--bg);
  color: var(--ink);
  font-family: 'DM Sans', sans-serif;
  line-height: 1.65;
  overflow-x: hidden;
  transition: background 0.5s ease, color 0.5s ease;
}

button, a { font: inherit; }
a { color: inherit; text-decoration: none; }

.film-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  opacity: 0.03;
  background-image: radial-gradient(rgba(255,255,255,0.4) 1px, transparent 0);
  background-size: 24px 24px;
}

/* Entry Curtain Gate */
.entry-gate {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: radial-gradient(circle at 50% 35%, #221426 0%, #09060a 100%);
  color: #f5e9ec;
  display: grid;
  place-items: center;
  padding: 28px;
  text-align: center;
  transition: opacity 0.7s ease, visibility 0.7s ease;
}
.entry-gate.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.gate-inner { max-width: 560px; }
.gate-inner h2 {
  font: 600 clamp(2rem, 5vw, 3.2rem)/1.18 'Playfair Display', serif;
  margin: 12px 0 18px;
}
.gate-sub { color: #b79da7; font-size: 1.02rem; margin-bottom: 34px; }
.gate-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.gate-btn {
  padding: 13px 24px;
  border-radius: 99px;
  cursor: pointer;
  transition: 0.25s ease;
  font-size: 0.9rem;
}
.gate-btn.primary {
  background: #e58ca3;
  color: #160d14;
  border: none;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(229, 140, 163, 0.3);
}
.gate-btn.primary:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(229, 140, 163, 0.45); }
.gate-btn.secondary {
  background: transparent;
  color: #d6bec7;
  border: 1px solid rgba(245, 233, 236, 0.22);
}
.gate-btn.secondary:hover { border-color: #e58ca3; color: #fff; }

.section { max-width: 1050px; margin: auto; padding: 100px 28px; }
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: none; }
.small-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .18em; color: var(--muted); margin: 0 0 10px; }
.script, .signature { font-family: Caveat, cursive; color: var(--deep); }

/* Hero */
.hero {
  min-height: 100svh;
  display: grid;
  place-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  padding: 70px 22px;
}
.hero-inner { position: relative; max-width: 780px; z-index: 3; }
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 15px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 0.74rem;
  color: var(--muted);
  margin-bottom: 14px;
}
.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--deep);
  box-shadow: 0 0 10px var(--deep);
  animation: pulse 2s infinite;
}
.live-clock-note {
  font-size: 0.85rem;
  color: var(--gold);
  font-style: italic;
  margin: 0 auto 14px;
  max-width: 480px;
}
.eyebrow { font: 600 1.45rem Caveat, cursive; color: var(--deep); margin: 0 0 16px; }
.hero h1 { font: 600 clamp(2.5rem, 7vw, 5.5rem)/1.06 'Playfair Display', serif; margin: 0; }
.hero-lines { font: italic 1.1rem/1.9 'Playfair Display', serif; color: var(--muted); margin: 28px auto 0; }
.hero-lines p { margin: 0; }
.scroll { display: inline-block; margin-top: 48px; font-size: .75rem; letter-spacing: .14em; color: var(--muted); animation: bob 2s ease-in-out infinite; }
.hero-flower { position: absolute; color: var(--rose); font-size: 8rem; opacity: .08; pointer-events: none; }
.flower-a { left: -20px; top: 15%; }
.flower-b { right: -25px; bottom: 12%; }
@keyframes bob { 50% { transform: translateY(5px); } }

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px max(22px, calc((100vw - 1050px)/2));
  background: var(--nav-bg);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}
.logo { font: 600 1.35rem Caveat, cursive; color: var(--deep); cursor: pointer; }
.nav-links { display: flex; align-items: center; gap: 18px; font-size: .75rem; color: var(--muted); }
.icon-toggle {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  padding: 5px 12px;
  border-radius: 99px;
  font-size: 0.72rem;
  cursor: pointer;
}

/* LIVE TYPING UNSENT SECTION */
.unsent { max-width: 820px; }
.unsent-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 26px;
}
.unsent-tab {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  padding: 10px 18px;
  border-radius: 99px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: 0.25s;
}
.unsent-tab.active, .unsent-tab:hover {
  border-color: var(--deep);
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 8px 24px rgba(184, 79, 106, 0.16);
}
.letter-paper {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 36px 34px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.16);
}
.letter-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
  margin-bottom: 22px;
}
.typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
}
.typing-dot.active {
  animation: pulse 0.9s infinite;
  box-shadow: 0 0 8px var(--gold);
}
.typewriter-wrap {
  font: 1.14rem/1.85 'Playfair Display', serif;
  min-height: 165px;
  color: var(--ink);
  white-space: pre-line;
}
.typewriter-cursor {
  display: inline-block;
  color: var(--deep);
  font-weight: 600;
  margin-left: 2px;
  animation: blinkCursor 0.75s step-end infinite;
}
@keyframes blinkCursor { 50% { opacity: 0; } }

.letter-footer-actions {
  margin-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.replay-type-btn {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 0.75rem;
  padding: 5px 12px;
  border-radius: 99px;
  cursor: pointer;
}
.replay-type-btn:hover { color: var(--deep); border-color: var(--rose); }
.letter-sign { font-size: 0.9rem; color: var(--muted); }
.letter-sign .script { font-size: 1.55rem; margin-left: 6px; }

/* Headings */
.intro { max-width: 760px; text-align: center; }
.intro h2, .section-head h2, .promises h2, .story h2, .candle-section h2 {
  font: 600 clamp(2rem, 4vw, 3.2rem)/1.15 'Playfair Display', serif;
  margin: 0 0 20px;
}
.intro p { font-size: 1.05rem; color: var(--muted); max-width: 65ch; margin: 12px auto; }
.section-head { text-align: center; margin-bottom: 50px; }
.section-head > p:last-child { color: var(--muted); }

/* 1. Phone Drafts Simulator */
.drafts-section { max-width: 680px; text-align: center; }
.phone-frame {
  max-width: 400px;
  margin: 0 auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 32px;
  padding: 20px 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
  text-align: left;
}
.phone-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  font-size: 0.82rem;
}
.phone-contact { font-weight: 600; color: var(--ink); }
.phone-time { color: var(--muted); font-size: 0.74rem; }
.chat-stream {
  min-height: 155px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
  padding: 18px 4px;
}
.chat-timestamp {
  text-align: center;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: auto;
}
.chat-bubble {
  align-self: flex-end;
  max-width: 85%;
  background: linear-gradient(135deg, var(--deep), var(--rose));
  color: #160d14;
  font-weight: 500;
  padding: 12px 16px;
  border-radius: 20px 20px 4px 20px;
  font-size: 0.92rem;
  line-height: 1.45;
  box-shadow: 0 8px 20px rgba(184, 79, 106, 0.22);
}
.typing-dots-bubble {
  align-self: flex-end;
  display: none;
  gap: 5px;
  background: var(--card);
  border: 1px solid var(--line);
  padding: 10px 14px;
  border-radius: 18px;
}
.typing-dots-bubble.show { display: inline-flex; }
.typing-dots-bubble span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  animation: dotBounce 1s infinite ease-in-out;
}
.typing-dots-bubble span:nth-child(2) { animation-delay: 0.18s; }
.typing-dots-bubble span:nth-child(3) { animation-delay: 0.36s; }
@keyframes dotBounce {
  0%, 100% { transform: translateY(0); opacity: 0.4; }
  50% { transform: translateY(-4px); opacity: 1; }
}
.phone-input-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px 8px 16px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--card);
}
.fake-input {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.draft-next-btn {
  border: none;
  background: var(--gold);
  color: #160d14;
  font-weight: 600;
  font-size: 0.74rem;
  padding: 6px 13px;
  border-radius: 99px;
  cursor: pointer;
  flex-shrink: 0;
}

/* 2. Real Voice Note / Cassette Player */
.voicenote-section { max-width: 660px; text-align: center; }
.cassette-card {
  max-width: 460px;
  margin: 0 auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 26px 24px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.2);
}
.cassette-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: var(--muted);
  margin-bottom: 18px;
}
.cassette-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.vn-rec-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--deep);
  box-shadow: 0 0 8px var(--deep);
}
.vn-player-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.vn-play-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  background: var(--deep);
  color: #160d14;
  font-size: 1rem;
  cursor: pointer;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  transition: transform 0.2s ease;
}
.vn-play-btn:hover { transform: scale(1.06); }
.vn-waveform {
  flex: 1;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 3px;
  cursor: pointer;
}
.vn-bar {
  flex: 1;
  background: var(--line);
  border-radius: 3px;
  transition: background 0.15s, height 0.2s;
}
.vn-bar.active { background: var(--gold); }
.vn-subtitle {
  margin: 18px 0 0;
  font: italic 1.02rem/1.6 'Playfair Display', serif;
  color: var(--ink);
  min-height: 2.2em;
}

/* 3. Interactive Breathing Orb */
.breathe-section { max-width: 680px; text-align: center; }
.breathe-stage {
  height: 240px;
  display: grid;
  place-items: center;
}
.breathe-orb {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  background: radial-gradient(circle, rgba(229, 140, 163, 0.28) 0%, rgba(212, 163, 115, 0.08) 70%, transparent 100%);
  color: var(--ink);
  font: italic 1.05rem 'Playfair Display', serif;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 18px;
  box-shadow: 0 0 40px rgba(229, 140, 163, 0.15);
  transition: transform 4s ease-in-out, box-shadow 4s ease-in-out, border-color 1s ease;
}
.breathe-orb.inhale {
  transform: scale(1.42);
  box-shadow: 0 0 70px rgba(229, 140, 163, 0.45), 0 0 110px rgba(232, 195, 145, 0.25);
  border-color: var(--deep);
}
.breathe-orb.exhale {
  transform: scale(0.92);
  box-shadow: 0 0 25px rgba(229, 140, 163, 0.12);
}
.breathe-note { max-width: 34ch; margin: 0 auto; color: var(--muted); font-size: .88rem; }
.breathe-orb span { max-width: 11ch; line-height: 1.25; text-wrap: balance; }
.draft-next-btn:focus-visible, .breathe-orb:focus-visible { outline: 3px solid var(--deep); outline-offset: 4px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
@media (max-width: 520px) {
  .phone-frame { padding: 17px 14px; border-radius: 26px; }
  .chat-stream { min-height: 145px; }
  .breathe-stage { height: 224px; }
  .breathe-orb { width: 138px; height: 138px; padding: 14px; }
  .breathe-orb.inhale { transform: scale(1.34); }
}
@media (prefers-reduced-motion: reduce) {
  .breathe-orb, .typing-dots-bubble span { transition: none; animation: none; }
  .breathe-orb.inhale, .breathe-orb.exhale { transform: none; }
}

/* 4. Archive Gallery & 3D Flip Polaroids */
.year-block { margin: 70px 0; }
.year-title { display: flex; align-items: baseline; gap: 14px; margin-bottom: 24px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.year-title span { font: 600 2rem 'Playfair Display', serif; }
.year-title i { font: 1.2rem Caveat, cursive; color: var(--deep); }
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 26px 18px; }
.photo {
  perspective: 900px;
  cursor: pointer;
  transition: .32s ease;
  position: relative;
  margin: 0;
}
.photo:nth-child(4n+1) { transform: rotate(-1.8deg); }
.photo:nth-child(4n+2) { transform: rotate(1.4deg); }
.photo:nth-child(4n+3) { transform: rotate(-1deg); }
.photo:nth-child(4n) { transform: rotate(1.8deg); }
.photo:hover {
  transform: translateY(-7px) rotate(0) scale(1.025);
  z-index: 3;
}
.photo-inner {
  position: relative;
  width: 100%;
  transform-style: preserve-3d;
  transition: transform 0.65s cubic-bezier(0.4, 0.2, 0.2, 1);
  background: var(--paper);
  padding: 9px 9px 36px;
  border: 1px solid var(--line);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .18);
}
.photo.flipped .photo-inner {
  transform: rotateY(180deg);
}
.photo-front, .photo-back {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.photo-front img {
  display: block;
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  filter: var(--photo-filter);
  transition: filter 0.35s ease;
}
.photo:hover .photo-front img { filter: none; }
.photo figcaption { position: absolute; bottom: 6px; left: 8px; right: 8px; text-align: center; font: 1.15rem Caveat, cursive; color: var(--deep); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photo-back {
  position: absolute;
  inset: 0;
  background: var(--paper);
  border: 1px solid var(--gold);
  padding: 24px 16px;
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}
.photo-back-year {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin-bottom: 8px;
}
.photo-back-note {
  font: 1.25rem/1.35 Caveat, cursive;
  color: var(--ink);
  margin: 0;
}
.photo-flip-btn, .photo-like-btn {
  position: absolute;
  top: 14px;
  z-index: 5;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(15, 10, 16, 0.55);
  backdrop-filter: blur(6px);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  transition: 0.25s ease;
}
.photo-flip-btn { left: 14px; font-size: 0.85rem; }
.photo-like-btn { right: 14px; font-size: 0.95rem; }
.photo-flip-btn:hover { border-color: var(--gold); color: var(--gold); }
.photo-like-btn.liked {
  background: var(--deep);
  color: #160d14;
  border-color: var(--deep);
  box-shadow: 0 0 14px var(--deep);
  transform: scale(1.1);
}

/* 5. Darkroom Hold-to-Develop Polaroid */
.darkroom-section { text-align: center; max-width: 680px; }
.darkroom-frame {
  width: min(100%, 340px);
  margin: 0 auto;
  background: var(--paper);
  border: 1px solid var(--gold);
  padding: 12px 12px 42px;
  box-shadow: 0 24px 55px rgba(0,0,0,0.35);
  cursor: pointer;
  user-select: none;
  position: relative;
}
.darkroom-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: #050306;
}
#darkroomImg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0) contrast(1.4) sepia(0.8);
  transition: filter 0.15s linear;
}
.darkroom-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 20px;
  background: rgba(8, 5, 10, 0.45);
  transition: opacity 0.5s ease;
}
.darkroom-frame.developed .darkroom-overlay {
  opacity: 0;
  pointer-events: none;
}
.darkroom-prompt { font: 1.3rem Caveat, cursive; color: var(--gold); }
.darkroom-bar { width: 140px; height: 5px; border-radius: 99px; background: rgba(255,255,255,0.15); overflow: hidden; }
.darkroom-fill { width: 0%; height: 100%; background: var(--gold); }
.darkroom-caption { font: 1.3rem Caveat, cursive; color: var(--deep); margin: 14px 0 0; }

/* Envelopes & Promises */
.open-when { max-width: 900px; }
.envelopes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.envelope {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 18px;
  padding: 22px;
  text-align: left;
  cursor: pointer;
  position: relative;
  transition: .25s;
}
.envelope.featured { border-color: var(--gold); box-shadow: 0 0 25px rgba(212, 163, 115, 0.12); }
.envelope:after { content: "♡"; position: absolute; right: 18px; top: 14px; color: var(--rose); font-size: 1.5rem; }
.envelope.featured:after { content: "✦"; color: var(--gold); }
.envelope:hover { transform: translateY(-3px); }
.envelope span { font: 1.35rem Caveat, cursive; color: var(--deep); }
.envelope.featured span { color: var(--gold); }

.promises { max-width: 850px; text-align: center; }
.promise-list { display: grid; margin-top: 30px; }
.promise-list p { margin: 0; padding: 18px 0; border-bottom: 1px solid var(--line); font-family: 'Playfair Display', serif; font-style: italic; font-size: 1.15rem; }

/* 6. FIXED: Two Orbits Distance Slider */
.orbit-slider-section { max-width: 680px; text-align: center; }
.orbit-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 32px 24px;
  box-shadow: 0 18px 45px rgba(0,0,0,0.18);
}
.orbit-stage {
  position: relative;
  height: 76px;
  max-width: 420px;
  margin: 0 auto 22px;
}
.orbit-thread {
  position: absolute;
  top: 50%;
  left: 28px;
  right: 28px;
  height: 2px;
  transform: translateY(-50%);
  background: var(--line);
  z-index: 1;
}
.orbit-thread-glow {
  height: 100%;
  width: 15%;
  margin: 0 auto;
  background: linear-gradient(90deg, var(--deep), var(--gold), var(--deep));
  box-shadow: 0 0 14px var(--gold);
  transition: width 0.1s ease;
}
.orbit-node {
  position: absolute;
  top: 50%;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  background: var(--paper);
  display: grid;
  place-items: center;
  font: 600 1.45rem Caveat, cursive;
  color: var(--deep);
  z-index: 2;
  box-shadow: 0 0 22px rgba(232, 195, 145, 0.28);
  transform: translate(-50%, -50%);
  transition: left 0.08s ease, box-shadow 0.3s ease;
}
.orbit-left { left: 12%; }
.orbit-right { left: 88%; }
.orbit-range {
  width: min(100%, 340px);
  accent-color: var(--deep);
  cursor: pointer;
  display: block;
  margin: 0 auto;
}
.orbit-status {
  font: italic 1.06rem/1.6 'Playfair Display', serif;
  color: var(--gold);
  margin: 18px auto 0;
  max-width: 46ch;
}

/* Dates, Parallel Clock & Moon */
.dates { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.date-card { padding: 34px; border: 1px solid var(--line); border-radius: 28px; background: var(--card); text-align: center; }
.date-icon { color: var(--deep); font-size: 2rem; }
.date-card h3 { font: 600 1.8rem 'Playfair Display', serif; margin: 5px 0 15px; }
.countdown { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.unit { min-width: 60px; padding: 10px 8px; border-radius: 15px; background: var(--paper); border: 1px solid var(--line); }
.unit b { display: block; font: 600 1.25rem 'Playfair Display', serif; }
.unit span { font-size: .62rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.days-together { font-size: .82rem; color: var(--muted); margin-top: 15px; }
.freeze-btn {
  margin-top: 12px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--muted);
  font-size: 0.74rem;
  padding: 6px 14px;
  border-radius: 99px;
  cursor: pointer;
}
.freeze-btn:hover { border-color: var(--gold); color: var(--gold); }

.moon-section { max-width: 680px; }
.moon-card {
  display: flex;
  align-items: center;
  gap: 24px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 28px 30px;
}
.moon-visual {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #ffd166;
  box-shadow: 0 0 30px rgba(255, 209, 102, 0.35);
}
.moon-info h3 { font: 600 1.5rem 'Playfair Display', serif; margin: 4px 0 6px; }
.moon-info p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* Story */
.story { text-align: center; max-width: 900px; }
.story-buttons { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 30px; }
.story-buttons button { border: 1px solid var(--line); background: var(--card); border-radius: 18px; padding: 18px; color: var(--ink); cursor: pointer; transition: .25s; }
.story-buttons button:hover { transform: translateY(-3px); border-color: var(--rose); }

/* Triggers, Constellation, Scratch, Check-in, Whisper, Candle */
.triggers-section { max-width: 850px; text-align: center; }
.trigger-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 26px; }
.trigger-pill { border: 1px solid var(--line); background: var(--card); color: var(--ink); padding: 10px 18px; border-radius: 99px; font-size: 0.88rem; cursor: pointer; transition: 0.25s; }
.trigger-pill:hover, .trigger-pill.active { border-color: var(--gold); color: var(--gold); transform: translateY(-2px); }
.trigger-display { max-width: 620px; margin: 0 auto; padding: 28px 26px; border-radius: 22px; background: var(--paper); border: 1px solid var(--line); min-height: 105px; display: grid; place-items: center; font: italic 1.15rem/1.75 'Playfair Display', serif; }

.constellation-section { max-width: 860px; text-align: center; }
.sky-box { position: relative; width: 100%; height: 360px; background: radial-gradient(circle at 50% 40%, #1d1427 0%, #09060d 100%); border: 1px solid rgba(232, 195, 145, 0.22); border-radius: 28px; overflow: hidden; }
#starCanvas { width: 100%; height: 100%; display: block; }
.star-nodes { position: absolute; inset: 0; }
.star-point { position: absolute; transform: translate(-50%, -50%); width: 28px; height: 28px; border: none; background: transparent; cursor: pointer; display: grid; place-items: center; padding: 0; }
.star-point::before { content: "✦"; color: rgba(255, 255, 255, 0.45); font-size: 1.1rem; transition: 0.3s; }
.star-point.unlocked::before { color: #ffd166; font-size: 1.45rem; text-shadow: 0 0 16px #ffd166; }
.star-point.next-star::before { color: #fff; animation: pulse 1.3s infinite; }
.star-caption { font: 1.45rem Caveat, cursive; color: var(--gold); margin-top: 18px; min-height: 1.8em; }

.scratch-section { text-align: center; }
.scratch-card { position: relative; width: min(100%, 420px); height: 230px; margin: 0 auto; border-radius: 24px; overflow: hidden; border: 1px solid var(--gold); background: var(--paper); user-select: none; }
.scratch-secret { position: absolute; inset: 0; padding: 28px 24px; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.scratch-secret h3 { font: 600 1.45rem/1.3 'Playfair Display', serif; margin: 8px 0 10px; }
#scratchCanvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: none; }

.checkin-section { max-width: 720px; text-align: center; }
.mood-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.mood-pill { border: 1px solid var(--line); background: var(--card); color: var(--ink); padding: 11px 20px; border-radius: 99px; font-size: 0.88rem; cursor: pointer; transition: 0.25s; }
.mood-pill:hover, .mood-pill.selected { border-color: var(--gold); background: var(--paper); color: var(--gold); box-shadow: 0 8px 24px rgba(232, 195, 145, 0.18); transform: translateY(-2px); }
.mood-Ack { font: 1.35rem Caveat, cursive; color: var(--deep); min-height: 1.5em; margin-top: 16px; }

.whisper-section { max-width: 680px; text-align: center; }
.whisper-box { background: var(--paper); border: 1px solid var(--line); border-radius: 24px; padding: 28px; }
#whisperInput { width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; color: var(--ink); font-family: 'Playfair Display', serif; font-size: 1rem; resize: none; outline: none; margin-bottom: 16px; }
.whisper-saved { font: 1.35rem Caveat, cursive; color: var(--gold); margin: 14px 0 0; min-height: 1.4em; }

.candle-section { text-align: center; max-width: 680px; }
.candle-desc { color: var(--muted); margin-bottom: 35px; }
.candle-wrap { background: none; border: none; cursor: pointer; display: inline-flex; flex-direction: column; align-items: center; padding: 20px; }
.flame { width: 18px; height: 32px; background: radial-gradient(circle at 50% 75%, #fff 10%, #ffd166 45%, #f48c06 85%, transparent 100%); border-radius: 50% 50% 35% 35%; opacity: 0.14; transform: scale(0.6); transition: 0.5s ease; }
.candle-wrap.lit .flame { opacity: 1; transform: scale(1); box-shadow: 0 0 28px #ffb703, 0 0 60px rgba(229, 140, 163, 0.5); animation: flicker 2.2s infinite ease-in-out; }
.wick { width: 2px; height: 8px; background: #6c555e; }
.wax { width: 54px; height: 82px; background: linear-gradient(180deg, #fffdfa, #e6ccb2); border-radius: 8px 8px 14px 14px; }
.candle-status { font: 1.35rem Caveat, cursive; color: var(--gold); margin-top: 10px; }
@keyframes flicker { 0%, 100% { transform: scale(1) rotate(-1deg); } 50% { transform: scale(1.06, 0.96) rotate(1.5deg); } }

/* Final Scene & Ending */
.final-scene { max-width: 680px; text-align: center; }
.final-letter { background: var(--paper); border: 1px solid var(--line); border-radius: 26px; padding: 42px 34px; text-align: left; }
.final-letter h2 { font: 600 2.2rem 'Playfair Display', serif; margin: 6px 0 20px; }
.final-letter-body p { color: var(--ink); font: 1.06rem/1.85 'Playfair Display', serif; margin: 14px 0; }
.final-signature { font: 1.8rem Caveat, cursive !important; color: var(--deep) !important; margin-top: 24px !important; }

.ending { text-align: center; min-height: 65vh; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.ending-heart { font-size: 3rem; color: var(--deep); animation: pulse 1.8s infinite; }
.ending h2 { font: 600 clamp(3.5rem, 10vw, 6.5rem)/1 'Playfair Display', serif; margin: 10px 0; }
.ending p { font: italic 1.15rem/1.9 'Playfair Display', serif; color: var(--muted); }
.ending strong { color: var(--deep); }
.signature { font-size: 2.2rem; margin: 25px 0 2px; }
@keyframes pulse { 50% { transform: scale(1.12); } }

/* Ambient & Modals */
.ambient { position: fixed; inset: 0; pointer-events: none; z-index: 2; overflow: hidden; }
.float { position: absolute; bottom: -30px; color: var(--rose); opacity: .2; animation: floatUp linear forwards; }
@keyframes floatUp { to { transform: translateY(-110vh) rotate(25deg); opacity: 0; } }

.lightbox { position: fixed; inset: 0; background: rgba(15, 8, 13, .95); z-index: 200; display: none; align-items: center; justify-content: center; padding: 45px 60px; }
.lightbox.open { display: flex; }
.lightbox img { max-width: min(88vw, 950px); max-height: 82vh; object-fit: contain; border-radius: 8px; }
.lightbox button { position: absolute; border: 0; background: rgba(255, 255, 255, .12); color: #fff; border-radius: 50%; width: 44px; height: 44px; font-size: 2rem; cursor: pointer; }
.lightbox #lbClose { right: 22px; top: 22px; }
.lightbox #lbPrev { left: 20px; }
.lightbox #lbNext { right: 20px; }
.lb-caption { position: absolute; bottom: 18px; color: #fff; font: 1.4rem Caveat, cursive; }

.story-overlay { position: fixed; inset: 0; z-index: 210; display: none; place-items: center; background: linear-gradient(#080b1d, #121632); color: #fff; padding: 30px; }
.story-overlay.open { display: grid; }
.story-close { position: absolute; right: 20px; top: 20px; background: none; border: 1px solid rgba(255, 255, 255, .35); color: #fff; border-radius: 20px; padding: 8px 14px; cursor: pointer; z-index: 5; }
.story-book { position: relative; max-width: 680px; text-align: center; padding: 50px 30px; }
.story-book h2 { font: 600 clamp(2.1rem, 5vw, 3.6rem)/1.1 'Playfair Display', serif; }
.story-book #storyText { font: 1.08rem/1.9 'Playfair Display', serif; color: #e9e7ef; }

.message-modal, .secret-modal { position: fixed; inset: 0; z-index: 220; display: none; place-items: center; background: rgba(15, 8, 13, .78); backdrop-filter: blur(12px); padding: 24px; }
.message-modal.open, .secret-modal.open { display: grid; }
.modal-card { position: relative; max-width: 550px; width: 100%; background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-radius: 28px; padding: 45px 35px; text-align: center; box-shadow: 0 30px 80px rgba(0, 0, 0, .4); }
.modal-card button { position: absolute; right: 18px; top: 18px; border: 0; background: var(--card); color: var(--deep); font-size: 1.6rem; border-radius: 50%; width: 40px; height: 40px; cursor: pointer; }
.modal-card h3 { font: 600 1.9rem 'Playfair Display', serif; margin: 0 0 15px; }

/* Vinyl HUD */
.vinyl-hud { position: fixed; left: 20px; bottom: 20px; z-index: 90; display: flex; align-items: center; gap: 12px; padding: 8px 16px 8px 8px; border-radius: 99px; background: var(--nav-bg); backdrop-filter: blur(16px); border: 1px solid var(--line); box-shadow: 0 14px 34px rgba(0,0,0,0.28); }
.vinyl-disc { width: 42px; height: 42px; border-radius: 50%; border: 2px solid var(--gold); background: repeating-radial-gradient(circle, #19131b 0 3px, #2b202e 3px 6px); display: grid; place-items: center; cursor: pointer; padding: 0; }
.vinyl-hud.playing .vinyl-disc { animation: spinVinyl 4s linear infinite; }
.vinyl-center { width: 15px; height: 15px; border-radius: 50%; background: var(--rose); color: #160d14; font-size: 0.6rem; display: grid; place-items: center; }
.vinyl-info { display: flex; flex-direction: column; text-align: left; line-height: 1.2; }
.vinyl-label { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }
.vinyl-info strong { font-size: 0.78rem; color: var(--ink); }
.eq-bars { display: flex; align-items: flex-end; gap: 2px; height: 14px; }
.eq-bars i { width: 3px; height: 4px; background: var(--gold); border-radius: 2px; }
.vinyl-hud.playing .eq-bars i:nth-child(1) { animation: eq 0.6s infinite alternate; }
.vinyl-hud.playing .eq-bars i:nth-child(2) { animation: eq 0.45s infinite alternate 0.15s; }
.vinyl-hud.playing .eq-bars i:nth-child(3) { animation: eq 0.7s infinite alternate 0.3s; }
.vinyl-hud.playing .eq-bars i:nth-child(4) { animation: eq 0.5s infinite alternate 0.1s; }
@keyframes spinVinyl { to { transform: rotate(360deg); } }
@keyframes eq { from { height: 3px; } to { height: 14px; } }

@media(max-width: 800px) {
  .gallery { grid-template-columns: repeat(2, 1fr); gap: 20px 14px; }
  .section { padding: 80px 18px; }
  .dates, .story-buttons { grid-template-columns: 1fr; }
  .nav { padding: 12px 16px; }
  .nav-links { gap: 10px; }
}
@media(max-width: 520px) {
  .envelopes { grid-template-columns: 1fr; }
  .nav-links a:nth-child(1), .nav-links a:nth-child(2) { display: none; }
  .letter-paper { padding: 26px 20px; }
  .moon-card { flex-direction: column; text-align: center; }
}
/* --- OUR LITTLE MOVIE (CINEMA SECTION) --- */
.movie-section {
  max-width: 900px;
  text-align: center;
  position: relative;
  z-index: 30;
}
body.theater-dimmed::after {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(5, 3, 7, 0.86);
  z-index: 25;
  pointer-events: none;
  transition: opacity 0.6s ease;
}
.cinema-frame {
  position: relative;
  z-index: 31;
  background: var(--paper);
  border: 1px solid var(--gold);
  border-radius: 30px;
  padding: 22px 22px 26px;
  box-shadow: 0 28px 75px rgba(0, 0, 0, 0.45), 0 0 50px rgba(232, 195, 145, 0.12);
  transition: box-shadow 0.5s ease, transform 0.4s ease;
}
.cinema-frame.playing {
  box-shadow: 0 32px 95px rgba(0, 0, 0, 0.75), 0 0 85px rgba(229, 140, 163, 0.28);
}
.cinema-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding: 0 6px;
}
.cinema-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
}
.lights-btn {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--gold);
  font-size: 0.74rem;
  padding: 5px 13px;
  border-radius: 99px;
  cursor: pointer;
  transition: 0.25s;
}
.lights-btn:hover { border-color: var(--gold); }
.video-container {
  position: relative;
  width: 100%;
  border-radius: 20px;
  overflow: hidden;
  background: #050307;
  border: 1px solid rgba(255, 255, 255, 0.08);
  aspect-ratio: 16 / 9;
}
#ourMovieVideo {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #050307;
}
.movie-chapters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
}
.chapter-pill {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font-size: 0.76rem;
  padding: 7px 14px;
  border-radius: 99px;
  cursor: pointer;
  transition: 0.25s ease;
}
.chapter-pill:hover, .chapter-pill.active {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--paper);
  transform: translateY(-2px);
}
.movie-caption {
  font: 1.3rem Caveat, cursive;
  color: var(--deep);
  margin: 14px 0 0;
}
