/* ═══════════════════════════════════════════════════════════════
   Barshana's Birthday — Romantic aesthetic stylesheet
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400&family=Poppins:wght@300;400;500;600&display=swap');

:root {
  --rose:        #e8779a;
  --rose-deep:   #c9527a;
  --blush:       #ffe4ec;
  --cream:       #fff6f2;
  --peach:       #ffd9c7;
  --wine:        #5a2338;
  --gold:        #d9a441;
  --ink:         #3a2530;

  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans:  'Poppins', system-ui, sans-serif;

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 600ms;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(120% 100% at 50% 0%, var(--blush) 0%, var(--cream) 45%, var(--peach) 120%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
}

.name-highlight {
  font-family: var(--serif);
  font-style: italic;
  color: var(--rose-deep);
  font-weight: 600;
}
.name-highlight.big { display: inline-block; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.35em;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--rose-deep);
  opacity: 0.85;
}

code {
  font-family: 'SFMono-Regular', ui-monospace, monospace;
  background: rgba(201, 82, 122, 0.12);
  padding: 0.1em 0.45em;
  border-radius: 6px;
  font-size: 0.85em;
  color: var(--wine);
}

/* ── Floating hearts ── */
.hearts-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}
.heart {
  position: absolute;
  bottom: -40px;
  font-size: 1.4rem;
  opacity: 0;
  animation: floatUp linear forwards;
  will-change: transform, opacity;
}
@keyframes floatUp {
  0%   { transform: translateY(0) scale(0.6) rotate(0deg); opacity: 0; }
  10%  { opacity: 0.9; }
  90%  { opacity: 0.7; }
  100% { transform: translateY(-110vh) scale(1.1) rotate(40deg); opacity: 0; }
}

/* ── Screen system ── */
.screen { display: none; }
.screen.active { display: block; }

#countdown-screen.active,
#celebration-screen.active {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  position: relative;
  z-index: 2;
  padding: 2rem;
  text-align: center;
}

/* ── Countdown screen ── */
.countdown-inner { max-width: 720px; animation: rise var(--dur) var(--ease-out-expo); }

@keyframes rise {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.countdown-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  line-height: 1.05;
  margin: 1.2rem 0 0.6rem;
  color: var(--wine);
}
.countdown-sub {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--ink);
  opacity: 0.75;
  margin-bottom: 2.5rem;
}

.timer {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: clamp(0.4rem, 2vw, 1.4rem);
  flex-wrap: nowrap;
}
.time-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: clamp(64px, 16vw, 110px);
  background: rgba(255, 255, 255, 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(201, 82, 122, 0.18);
  border-radius: 20px;
  padding: clamp(0.7rem, 2vw, 1.3rem) clamp(0.4rem, 1.5vw, 1rem);
  box-shadow: 0 14px 40px -20px rgba(201, 82, 122, 0.55);
}
.time-value {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 7vw, 4.2rem);
  font-weight: 600;
  color: var(--rose-deep);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.time-label {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: clamp(0.55rem, 1.4vw, 0.72rem);
  color: var(--ink);
  opacity: 0.6;
  margin-top: 0.5rem;
}
.time-sep {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 5vw, 3rem);
  color: var(--rose);
  align-self: center;
  opacity: 0.5;
}
.countdown-foot {
  margin-top: 2.5rem;
  font-style: italic;
  font-family: var(--serif);
  font-size: 1.15rem;
  color: var(--rose-deep);
}

/* ── Celebration burst ── */
.celebration-inner { animation: pop 700ms var(--ease-out-expo); }
@keyframes pop {
  0%   { opacity: 0; transform: scale(0.8); }
  60%  { transform: scale(1.04); }
  100% { opacity: 1; transform: scale(1); }
}
.celebration-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.8rem, 9vw, 6.5rem);
  line-height: 1.02;
  color: var(--wine);
}
.celebration-sub {
  font-size: clamp(1.1rem, 3vw, 1.6rem);
  margin: 1.5rem 0 2.5rem;
  color: var(--rose-deep);
  letter-spacing: 0.05em;
}

/* ── Buttons ── */
.cta-btn {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 1.05rem;
  letter-spacing: 0.03em;
  color: #fff;
  background: linear-gradient(135deg, var(--rose) 0%, var(--rose-deep) 100%);
  border: none;
  border-radius: 999px;
  padding: 0.95rem 2.4rem;
  cursor: pointer;
  box-shadow: 0 16px 34px -14px rgba(201, 82, 122, 0.75);
  transition: transform 200ms var(--ease-out-expo), box-shadow 200ms;
}
.cta-btn:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 22px 44px -14px rgba(201, 82, 122, 0.85); }
.cta-btn:active { transform: translateY(-1px) scale(0.99); }
.cta-btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.cta-btn.small { padding: 0.7rem 1.6rem; font-size: 0.95rem; }

/* ── Main screen ── */
#main-screen { position: relative; z-index: 2; }
#main-screen.active { display: block; animation: fadein 800ms ease; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

.hero {
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  position: relative;
}
.hero-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.6rem, 7vw, 5.5rem);
  line-height: 1.05;
  margin: 1rem 0;
  color: var(--wine);
  max-width: 15ch;
}
.hero-sub {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.15rem, 2.6vw, 1.7rem);
  color: var(--rose-deep);
  opacity: 0.9;
}
.scroll-cue {
  position: absolute;
  bottom: 2.5rem;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.7rem;
  color: var(--rose-deep);
  animation: bob 1.8s ease-in-out infinite;
}
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(8px); } }

.section {
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 7rem) clamp(1.2rem, 5vw, 3rem);
}
.section-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2rem, 5vw, 3.4rem);
  color: var(--wine);
  text-align: center;
  margin-bottom: 0.6rem;
}
.section-note {
  text-align: center;
  color: var(--ink);
  opacity: 0.6;
  font-size: 0.9rem;
  max-width: 60ch;
  margin: 0 auto 2.5rem;
}

/* ── Collage ── */
.collage {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 160px;
  grid-auto-flow: dense; /* fill gaps so mixed spans pack tightly */
  gap: 14px;
}
.collage-item {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  box-shadow: 0 18px 40px -24px rgba(90, 35, 56, 0.6);
  background: linear-gradient(135deg, var(--blush), var(--peach));
  transition: transform 400ms var(--ease-out-expo), box-shadow 400ms;
}
.collage-item:hover { transform: translateY(-6px) rotate(-0.6deg); box-shadow: 0 28px 54px -22px rgba(90, 35, 56, 0.7); }
.collage-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* editorial variety */
.collage-item.wide  { grid-column: span 2; }
.collage-item.tall  { grid-row: span 2; }
.collage-item.big   { grid-column: span 2; grid-row: span 2; }

.collage-item .caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 1.2rem 1rem 0.8rem;
  background: linear-gradient(transparent, rgba(90, 35, 56, 0.75));
  color: #fff;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1rem;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 300ms, transform 300ms;
}
.collage-item:hover .caption { opacity: 1; transform: translateY(0); }

.placeholder-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  color: rgba(201, 82, 122, 0.5);
}
.placeholder-tile span { font-family: var(--serif); font-size: 1rem; font-style: italic; }

/* ── Videos ── */
/* Portrait clips pair up side by side; landscape clips take the full row. */
.video-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  max-width: 860px;
  margin: 0 auto;
}
.video-card {
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 18px 44px -24px rgba(90, 35, 56, 0.6);
  background: #fff;
}
.video-card.landscape { grid-column: 1 / -1; }
.video-card video { width: 100%; display: block; background: #000; }
.video-card.portrait video { aspect-ratio: 9 / 16; object-fit: cover; max-height: 640px; }
.video-card.landscape video { aspect-ratio: 16 / 9; object-fit: cover; }
.video-card .caption {
  padding: 0.9rem 1.1rem;
  font-family: var(--serif);
  font-style: italic;
  color: var(--wine);
}
.video-placeholder {
  aspect-ratio: 16 / 9;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--blush), var(--peach));
  color: var(--rose-deep);
  font-family: var(--serif);
  font-style: italic;
}
.video-placeholder .big-emoji { font-size: 2.6rem; }

/* ── Trivia ── */
.trivia-card {
  max-width: 560px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.7);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(201, 82, 122, 0.18);
  border-radius: 26px;
  padding: clamp(1.6rem, 4vw, 2.6rem);
  box-shadow: 0 24px 60px -30px rgba(90, 35, 56, 0.6);
  text-align: center;
}
.trivia-progress {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 1.6rem;
}
.trivia-progress .dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: rgba(201, 82, 122, 0.22);
  transition: background 300ms, transform 300ms;
}
.trivia-progress .dot.done { background: var(--rose-deep); transform: scale(1.15); }
.trivia-progress .dot.current { background: var(--gold); }

.trivia-badge {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.62rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--rose), var(--rose-deep));
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}

.trivia-question {
  font-family: var(--serif);
  font-size: clamp(1.4rem, 3.5vw, 2rem);
  color: var(--wine);
  margin-bottom: 0.4rem;
  line-height: 1.3;
}
.trivia-hint {
  font-size: 0.9rem;
  color: var(--ink);
  opacity: 0.55;
  font-style: italic;
  margin-bottom: 1.4rem;
}
.trivia-form { display: flex; gap: 0.6rem; flex-wrap: wrap; justify-content: center; }

/* Multiple-choice buttons */
.trivia-choices {
  display: grid;
  gap: 0.7rem;
  text-align: left;
}
.trivia-choice {
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid rgba(201, 82, 122, 0.25);
  border-radius: 16px;
  padding: 0.9rem 1.3rem;
  cursor: pointer;
  text-align: left;
  transition: transform 180ms var(--ease-out-expo), border-color 180ms, background 180ms, box-shadow 180ms;
}
.trivia-choice:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--rose-deep);
  box-shadow: 0 12px 26px -16px rgba(201, 82, 122, 0.7);
}
.trivia-choice:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.trivia-choice.correct {
  background: linear-gradient(135deg, #d8f3e0, #b9e9c9);
  border-color: #4caf7d;
  color: #256846;
  font-weight: 500;
}
.trivia-choice.incorrect {
  background: rgba(201, 82, 122, 0.08);
  border-color: var(--rose-deep);
  opacity: 0.7;
}
.trivia-choice:disabled { cursor: default; }
.trivia-input {
  flex: 1 1 240px;
  font-family: var(--sans);
  font-size: 1rem;
  padding: 0.85rem 1.2rem;
  border-radius: 999px;
  border: 1px solid rgba(201, 82, 122, 0.3);
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border-color 200ms, box-shadow 200ms;
}
.trivia-input:focus { border-color: var(--rose-deep); box-shadow: 0 0 0 4px rgba(232, 119, 154, 0.18); }
.trivia-feedback { margin-top: 1.1rem; min-height: 1.4em; font-weight: 500; }
.trivia-feedback.wrong { color: var(--rose-deep); }
.trivia-feedback.right { color: #3a8a5a; }

/* ── Secret letter ── */
.letter-section { position: relative; min-height: 420px; }
.letter-section.locked .letter-content { filter: blur(10px); opacity: 0.25; pointer-events: none; user-select: none; }

.lock-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 3;
  color: var(--wine);
  font-family: var(--serif);
  font-size: 1.3rem;
  font-style: italic;
  transition: opacity 500ms;
}
.letter-section:not(.locked) .lock-overlay { opacity: 0; pointer-events: none; }
.lock-icon { font-size: 3rem; }

.letter {
  max-width: 640px;
  margin: 0 auto;
  background:
    repeating-linear-gradient(transparent, transparent 37px, rgba(201, 82, 122, 0.08) 38px),
    #fffdfb;
  border-radius: 4px;
  padding: clamp(2rem, 6vw, 4rem);
  box-shadow: 0 30px 70px -30px rgba(90, 35, 56, 0.55);
  border: 1px solid rgba(201, 82, 122, 0.15);
  position: relative;
}
.letter::before {
  content: "♥";
  position: absolute;
  top: 1.2rem; right: 1.6rem;
  color: var(--rose);
  font-size: 1.6rem;
  opacity: 0.6;
}
.letter .greeting {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  color: var(--rose-deep);
  margin-bottom: 1.4rem;
}
.letter p {
  font-family: var(--serif);
  font-size: clamp(1.1rem, 2.4vw, 1.35rem);
  line-height: 1.9;
  color: var(--ink);
  margin-bottom: 1.2rem;
}
.letter .signature {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  color: var(--rose-deep);
  text-align: right;
  margin-top: 2rem;
}

/* letter reveal animation */
.letter-section.revealing .letter {
  animation: unseal 900ms var(--ease-out-expo);
}
@keyframes unseal {
  from { opacity: 0; transform: translateY(30px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Footer ── */
.site-footer {
  text-align: center;
  padding: 3rem 1rem 4rem;
  color: var(--rose-deep);
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.1rem;
}

/* ── Confetti canvas ── */
#confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
}

/* ── Responsive ── */
@media (max-width: 720px) {
  .collage { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 130px; }
  .collage-item.big { grid-column: span 2; grid-row: span 2; }
  .collage-item.wide { grid-column: span 2; }
  .time-sep { display: none; }
  .timer { gap: 0.5rem; }
}

/* ═══════════════════════════════════════════════════════════════
   Candle wish screen
   ═══════════════════════════════════════════════════════════════ */
#candle-screen.active {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  position: relative;
  z-index: 2;
  padding: 2rem;
  text-align: center;
}
.candle-inner { animation: rise var(--dur) var(--ease-out-expo); }
.candle-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.2rem, 6vw, 4rem);
  color: var(--wine);
  margin: 0.8rem 0 0.4rem;
}
.candle-sub { color: var(--ink); opacity: 0.7; margin-bottom: 2.5rem; }
.candle-foot {
  margin-top: 2rem;
  min-height: 1.6em;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.4rem;
  color: var(--rose-deep);
}

.cake { display: inline-block; }
.candles {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-bottom: -6px;
  position: relative;
  z-index: 2;
}
.candle {
  width: 14px;
  height: 54px;
  border-radius: 4px;
  background: repeating-linear-gradient(45deg, #f7c9d8 0 6px, #fff 6px 12px);
  position: relative;
  box-shadow: 0 4px 10px -6px rgba(90, 35, 56, 0.6);
}
.flame {
  position: absolute;
  top: -20px;
  left: 50%;
  width: 14px;
  height: 20px;
  transform: translateX(-50%);
  cursor: pointer;
}
.flame.lit::before {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 12px;
  height: 18px;
  background: radial-gradient(circle at 50% 70%, #fff6b0 0%, #ffd34d 45%, #ff8a3c 80%, transparent 100%);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  transform-origin: center bottom;
  animation: flicker 0.5s ease-in-out infinite alternate;
  box-shadow: 0 0 18px 6px rgba(255, 180, 80, 0.55);
}
.flame.out { cursor: default; }
@keyframes flicker {
  0%   { transform: scale(1) rotate(-3deg); opacity: 0.95; }
  100% { transform: scale(1.12) rotate(3deg); opacity: 1; }
}
.smoke {
  position: absolute;
  top: -6px; left: 50%;
  width: 6px; height: 6px;
  background: rgba(120, 120, 130, 0.5);
  border-radius: 50%;
  transform: translateX(-50%);
  animation: smokeRise 1.2s ease-out forwards;
}
@keyframes smokeRise {
  0%   { opacity: 0.6; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -34px) scale(2.4); }
}
.cake-tiers { position: relative; z-index: 1; }
.tier {
  margin: 0 auto;
  border-radius: 14px 14px 8px 8px;
  box-shadow: inset 0 -6px 0 rgba(0,0,0,0.05);
}
.tier-top {
  width: 150px; height: 34px;
  background: linear-gradient(#ffe0ec, #ffc2d6);
  border-bottom: 5px dotted #fff;
}
.tier-mid {
  width: 210px; height: 46px;
  background: linear-gradient(#ffd0a8, #f7b98a);
  border-bottom: 5px dotted #fff;
  margin-top: -2px;
}
.plate {
  width: 250px; height: 12px;
  background: rgba(255,255,255,0.7);
  border-radius: 0 0 40% 40%;
  margin-top: 4px;
  box-shadow: 0 16px 30px -18px rgba(90, 35, 56, 0.7);
}

/* ═══════════════════════════════════════════════════════════════
   Our Story — journey map
   ═══════════════════════════════════════════════════════════════ */
.journey {
  position: relative;
  margin: 2rem auto 4rem;
  padding: 1rem 0;
  max-width: 980px;
}
.journey-line {
  position: absolute;
  top: 34px; left: 4%; right: 4%;
  height: 3px;
  background: repeating-linear-gradient(90deg, rgba(201,82,122,0.3) 0 8px, transparent 8px 16px);
}
.journey-progress {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  width: 0;
  background: var(--rose-deep);
  transition: width 2.2s var(--ease-out-expo);
}
.journey.in-view .journey-progress { width: 100%; }
.journey-stops {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}
.stop {
  flex: 1;
  text-align: center;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 500ms var(--ease-out-expo), transform 500ms var(--ease-out-expo);
}
.journey.in-view .stop { opacity: 1; transform: translateY(0); }
.pin {
  width: 58px; height: 58px;
  margin: 0 auto 0.7rem;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.7rem;
  background: rgba(255,255,255,0.85);
  border: 2px solid var(--rose);
  border-radius: 50%;
  box-shadow: 0 12px 26px -14px rgba(201,82,122,0.7);
}
.stop-name { font-family: var(--serif); font-weight: 600; color: var(--wine); font-size: 1.05rem; }
.stop-note { font-size: 0.78rem; color: var(--ink); opacity: 0.6; font-style: italic; }

/* ═══════════════════════════════════════════════════════════════
   Our Story — timeline
   ═══════════════════════════════════════════════════════════════ */
.timeline-track {
  position: relative;
  max-width: 860px;
  margin: 0 auto;
  padding: 1rem 0;
}
.timeline-track::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  width: 2px;
  background: linear-gradient(var(--rose), var(--peach));
  transform: translateX(-50%);
}
.tl-item {
  position: relative;
  width: 50%;
  padding: 1rem 2.4rem;
  box-sizing: border-box;
  opacity: 0;
  transition: opacity 600ms var(--ease-out-expo), transform 600ms var(--ease-out-expo);
}
.tl-item.left  { left: 0; text-align: right; transform: translateX(-24px); }
.tl-item.right { left: 50%; text-align: left; transform: translateX(24px); }
.tl-item.revealed { opacity: 1; transform: translateX(0); }
.tl-marker {
  position: absolute;
  top: 1.5rem;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  background: #fff;
  border: 2px solid var(--rose);
  border-radius: 50%;
  box-shadow: 0 10px 22px -12px rgba(201,82,122,0.7);
  z-index: 2;
}
.tl-item.left  .tl-marker { right: -22px; }
.tl-item.right .tl-marker { left: -22px; }
.tl-card {
  background: rgba(255,255,255,0.72);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(201,82,122,0.16);
  border-radius: 20px;
  padding: 1.4rem 1.6rem;
  box-shadow: 0 20px 44px -26px rgba(90,35,56,0.55);
  display: inline-block;
  text-align: left;
}
.tl-year {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--rose), var(--rose-deep));
  padding: 0.25rem 0.8rem;
  border-radius: 999px;
  margin-bottom: 0.7rem;
}
.tl-title { font-family: var(--serif); font-size: 1.5rem; color: var(--wine); margin-bottom: 0.2rem; }
.tl-place { font-size: 0.82rem; color: var(--rose-deep); font-style: italic; margin-bottom: 0.6rem; }
.tl-text { font-size: 0.98rem; line-height: 1.65; color: var(--ink); opacity: 0.85; }

/* Polaroid snapshots pinned to the story */
.tl-polaroid {
  margin: 1.1rem auto 0.2rem;
  width: min(220px, 80%);
  background: #fff;
  padding: 10px 10px 12px;
  border-radius: 4px;
  box-shadow: 0 14px 30px -14px rgba(90, 35, 56, 0.55);
  position: relative;
  transition: transform 300ms var(--ease-out-expo);
}
.tl-polaroid.tilt-l { transform: rotate(-2.5deg); }
.tl-polaroid.tilt-r { transform: rotate(2.5deg); }
.tl-polaroid:hover { transform: rotate(0deg) scale(1.04); }
.tl-polaroid::before {
  /* washi tape */
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%) rotate(-3deg);
  width: 72px;
  height: 22px;
  background: rgba(232, 119, 154, 0.4);
  border-left: 1px dashed rgba(255, 255, 255, 0.7);
  border-right: 1px dashed rgba(255, 255, 255, 0.7);
}
.tl-polaroid img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 2px;
}
.tl-polaroid figcaption {
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.85rem;
  color: var(--ink);
  opacity: 0.65;
  padding-top: 8px;
}

/* ═══════════════════════════════════════════════════════════════
   Memory matching game
   ═══════════════════════════════════════════════════════════════ */
.memory-status {
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--rose-deep);
  margin-bottom: 1.6rem;
  min-height: 1.4em;
}
.memory-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  max-width: 640px;
  margin: 0 auto;
}
.mem-card {
  aspect-ratio: 3 / 4;
  perspective: 800px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.mem-inner {
  position: relative;
  width: 100%; height: 100%;
  transform-style: preserve-3d;
  transition: transform 500ms var(--ease-out-expo);
}
.mem-card.flipped .mem-inner,
.mem-card.done .mem-inner { transform: rotateY(180deg); }
.mem-back, .mem-front {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 14px 30px -18px rgba(90,35,56,0.6);
}
.mem-back {
  background: linear-gradient(135deg, var(--rose), var(--rose-deep));
  color: #fff;
  font-size: 1.8rem;
}
.mem-front {
  background: #fffdfb;
  border: 1.5px solid rgba(201,82,122,0.2);
  transform: rotateY(180deg);
  gap: 0.4rem;
  padding: 0.4rem;
  overflow: hidden;
}
.mem-front .mem-emoji { font-size: 2rem; }
.mem-front .mem-label {
  font-family: var(--serif);
  font-size: 0.82rem;
  color: var(--wine);
  text-align: center;
  line-height: 1.15;
}
.mem-front img { width: 100%; height: 100%; object-fit: cover; border-radius: 14px; }
.mem-card.done { cursor: default; }
.mem-card.done .mem-front {
  border-color: #4caf7d;
  box-shadow: 0 0 0 2px #4caf7d, 0 14px 30px -18px rgba(76,175,125,0.6);
  animation: matchPulse 500ms var(--ease-out-expo);
}
@keyframes matchPulse {
  0% { transform: rotateY(180deg) scale(1); }
  50% { transform: rotateY(180deg) scale(1.08); }
  100% { transform: rotateY(180deg) scale(1); }
}

/* ═══════════════════════════════════════════════════════════════
   Floating music control
   ═══════════════════════════════════════════════════════════════ */
#bg-audio { display: none; }
.music-toggle {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9998;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: none;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  padding: 0 0 18px;
  background: linear-gradient(135deg, var(--rose), var(--rose-deep));
  box-shadow: 0 14px 30px -12px rgba(201, 82, 122, 0.8);
  transition: transform 200ms var(--ease-out-expo), box-shadow 200ms;
}
.music-toggle.show { display: flex; animation: pop 400ms var(--ease-out-expo); }
.music-toggle:hover { transform: translateY(-3px) scale(1.05); }
.music-toggle:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.music-toggle .bar {
  width: 4px;
  height: 10px;
  border-radius: 2px;
  background: #fff;
}
/* animated equalizer while playing */
.music-toggle.playing .bar { animation: eq 900ms ease-in-out infinite; }
.music-toggle.playing .bar:nth-child(2) { animation-delay: 150ms; }
.music-toggle.playing .bar:nth-child(3) { animation-delay: 300ms; }
@keyframes eq {
  0%, 100% { height: 8px; }
  50% { height: 20px; }
}
/* paused: a small "muted" slash look via flat short bars */
.music-toggle:not(.playing) .bar { height: 8px; opacity: 0.85; }

/* ═══════════════════════════════════════════════════════════════
   Our New York — zoomable map
   ═══════════════════════════════════════════════════════════════ */
.nyc-map { max-width: 920px; margin: 0 auto; }
.nyc-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 5 / 4;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 30px 70px -34px rgba(90, 35, 56, 0.6);
  border: 1px solid rgba(201, 82, 122, 0.2);
  background: #a9d4dd;
  touch-action: manipulation;
}
.nyc-canvas {
  position: absolute;
  inset: 0;
  transform-origin: 0 0;
  transform: translate(0, 0) scale(1);
  transition: transform 700ms var(--ease-out-expo);
  --inv: 1;
}
.nyc-svg { width: 100%; height: 100%; display: block; }

.nyc-pin {
  position: absolute;
  transform: translate(-50%, -100%) scale(var(--inv));
  transform-origin: center bottom;
  transition: transform 700ms var(--ease-out-expo);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 3;
}
.pin-dot {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  background: #fff;
  border: 2px solid var(--rose-deep);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: 0 8px 18px -8px rgba(90, 35, 56, 0.7);
}
.pin-dot > * { transform: rotate(45deg); }
.nyc-pin .pin-label {
  font-family: var(--serif);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--wine);
  background: rgba(255, 255, 255, 0.85);
  padding: 1px 7px;
  border-radius: 999px;
  white-space: nowrap;
}
.nyc-pin::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(201, 82, 122, 0.5);
  animation: pinPulse 2s ease-out infinite;
  pointer-events: none;
}
@keyframes pinPulse {
  0% { box-shadow: 0 0 0 0 rgba(201, 82, 122, 0.45); }
  100% { box-shadow: 0 0 0 16px rgba(201, 82, 122, 0); }
}
.nyc-pin:hover .pin-dot { border-color: var(--gold); }
.nyc-pin.active .pin-dot { background: var(--rose-deep); border-color: #fff; }
.nyc-pin.active .pin-dot > * { filter: brightness(3); }
.nyc-viewport.zoomed .nyc-pin:not(.active) { opacity: 0; pointer-events: none; }

.nyc-reset {
  position: absolute;
  top: 14px; left: 14px;
  z-index: 5;
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--wine);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(201, 82, 122, 0.3);
  border-radius: 999px;
  padding: 0.5rem 1.1rem;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 300ms, transform 300ms;
}
.nyc-viewport.zoomed .nyc-reset { opacity: 1; transform: translateY(0); pointer-events: auto; }
.nyc-reset:hover { border-color: var(--rose-deep); }

.nyc-panel {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 4;
  background: rgba(255, 253, 251, 0.96);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(201, 82, 122, 0.2);
  padding: 1rem 1.2rem 1.2rem;
  transform: translateY(110%);
  transition: transform 450ms var(--ease-out-expo);
  max-height: 62%;
  overflow-y: auto;
}
.nyc-panel.open { transform: translateY(0); }
.nyc-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.8rem;
}
.nyc-panel-head h3 {
  font-family: var(--serif);
  font-size: 1.4rem;
  color: var(--wine);
}
.nyc-panel-head p { font-size: 0.85rem; color: var(--rose-deep); font-style: italic; }
.nyc-panel-close {
  flex: none;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(201, 82, 122, 0.3);
  background: #fff;
  color: var(--wine);
  cursor: pointer;
  font-size: 1rem;
}
.nyc-panel-close:hover { border-color: var(--rose-deep); }
.nyc-gallery {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.nyc-gallery img {
  height: 150px;
  width: auto;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 12px 26px -16px rgba(90, 35, 56, 0.6);
  flex: none;
}
.nyc-gallery img.missing {
  width: 200px;
  background: linear-gradient(135deg, var(--blush), var(--peach));
}

/* ── Responsive: new features ── */
@media (max-width: 720px) {
  .journey-stops { flex-wrap: wrap; gap: 1.4rem 0.5rem; }
  .stop { flex: 0 0 33%; }
  .journey-line { display: none; }

  .timeline-track::before { left: 22px; }
  .tl-item, .tl-item.left, .tl-item.right {
    width: 100%;
    left: 0;
    text-align: left;
    padding-left: 3.4rem;
    padding-right: 0.5rem;
    transform: translateX(0);
  }
  .tl-item.left .tl-marker, .tl-item.right .tl-marker { left: 0; right: auto; }

  .memory-board { grid-template-columns: repeat(3, 1fr); gap: 10px; }

  .nyc-viewport { aspect-ratio: 3 / 4; }
  .nyc-gallery img { height: 120px; }
  .nyc-pin .pin-label { font-size: 0.62rem; }
}

/* ═══════════════════════════════════════════════════════════════
   Foreshadowing the letter
   ═══════════════════════════════════════════════════════════════ */
.foreshadow-section { padding-top: clamp(2rem, 5vw, 4rem); padding-bottom: 0; }
.foreshadow-card {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
  background: linear-gradient(135deg, rgba(255,255,255,0.6), rgba(255,228,236,0.5));
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px dashed rgba(201, 82, 122, 0.4);
  border-radius: 24px;
  padding: clamp(1.6rem, 4vw, 2.4rem);
  box-shadow: 0 20px 50px -30px rgba(90, 35, 56, 0.5);
}
.foreshadow-seal {
  display: inline-block;
  font-size: 2.4rem;
  animation: sealFloat 3s ease-in-out infinite;
}
@keyframes sealFloat { 0%,100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-6px) rotate(4deg); } }
.foreshadow-text {
  font-family: var(--serif);
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  color: var(--wine);
  line-height: 1.4;
  margin: 0.6rem 0 0.8rem;
}
.foreshadow-sub {
  font-family: var(--serif);
  font-style: italic;
  color: var(--rose-deep);
  font-size: clamp(1rem, 2.2vw, 1.2rem);
}

/* ── Letter as a handwritten photo ── */
.letter.has-image {
  background: #fffdfb;
  padding: clamp(0.6rem, 2vw, 1rem);
}
.letter.has-image::before { display: none; }
.letter-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

/* ═══════════════════════════════════════════════════════════════
   Tablet / iPad refinements
   ═══════════════════════════════════════════════════════════════ */
@media (min-width: 721px) and (max-width: 1024px) {
  .section { padding-left: clamp(1.5rem, 4vw, 2.5rem); padding-right: clamp(1.5rem, 4vw, 2.5rem); }
  .collage { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 150px; }
  .collage-item.big { grid-column: span 2; grid-row: span 2; }
  .memory-board { max-width: 560px; }
  .nyc-viewport { aspect-ratio: 4 / 3; }
}

/* Touch devices (iPad, phones): no hover, so reveal captions/labels
   and enlarge tap targets. */
@media (hover: none) {
  .collage-item .caption { opacity: 1; transform: translateY(0); }
  .nyc-pin .pin-label { background: rgba(255, 255, 255, 0.92); }
  .pin-dot { width: 40px; height: 40px; }
  .trivia-choice { padding: 1.05rem 1.3rem; }
  .mem-card { min-height: 84px; }
}

/* iPad tends to report as (pointer: coarse) — give the music button
   and close controls comfortable sizes. */
@media (pointer: coarse) {
  .music-toggle { width: 60px; height: 60px; }
  .nyc-panel-close { width: 40px; height: 40px; }
  .nyc-reset { padding: 0.6rem 1.2rem; font-size: 0.9rem; }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .heart { display: none; }
}
