/* ============================================================================
   BIRTHDAY WEBSITE — style.css
   Warm / romantic / soft. Blush pink, rose gold, lavender, cream + gold.
   Mobile-first. Glassmorphism cards, soft shadows, gentle everything.
   Sections in this file follow the order of the page itself.
   ========================================================================== */

/* ---------- 0. Design tokens ---------- */
:root {
  /* palette */
  --blush:        #F8C8D4;
  --blush-soft:   #FADCE4;
  --rose:         #B76E79;
  --rose-deep:    #9C5462;
  --rose-light:   #E8B4B8;
  --lavender:     #D7C9F0;
  --lavender-soft:#EDE7F8;
  --cream:        #FFF8F0;
  --cream-2:      #FDF3E7;
  --gold:         #D4AF37;
  --gold-light:   #F2D06B;
  --ink:          #4A3B45;   /* warm dark plum for text */
  --ink-soft:     #86707B;
  --night:        #0B1026;
  --night-2:      #1A2148;

  /* type */
  --font-script: 'Great Vibes', 'Snell Roundhand', cursive;
  --font-hand:   'Dancing Script', 'Segoe Script', cursive;
  --font-body:   'Quicksand', 'Avenir Next', system-ui, sans-serif;

  /* effects */
  --shadow-soft: 0 10px 30px rgba(183, 110, 121, 0.14);
  --shadow-card: 0 16px 40px rgba(74, 59, 69, 0.16);
  --radius: 22px;
  --radius-big: 28px;
}

/* ---------- 1. Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  line-height: 1.65;
  background:
    radial-gradient(900px 500px at -10% -5%,  var(--blush-soft) 0%, transparent 60%),
    radial-gradient(800px 520px at 110% 12%,  var(--lavender-soft) 0%, transparent 62%),
    radial-gradient(700px 500px at 50% 115%,  #FCE9EE 0%, transparent 60%),
    var(--cream);
  background-attachment: fixed;
  min-height: 100svh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
button { font-family: inherit; }
a { color: var(--rose-deep); }
[hidden] { display: none !important; }

body.no-scroll { overflow: hidden; }

/* soft floating background canvas (hearts / petals / sparkles) */
#bg-float {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}
#page { position: relative; z-index: 1; }

/* confetti above everything, never in the way */
#confetti-canvas {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 300; pointer-events: none;
}

/* accessibility: skip link */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: #fff; color: var(--ink);
  padding: 10px 16px; border-radius: 0 0 12px 0; z-index: 500;
}
.skip-link:focus { left: 0; }

/* ---------- 2. Reusable pieces ---------- */
.glass {
  background: rgba(255, 255, 255, 0.55);
  -webkit-backdrop-filter: blur(14px) saturate(1.25);
  backdrop-filter: blur(14px) saturate(1.25);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: var(--shadow-soft);
  border-radius: var(--radius);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 26px;
  border: none; border-radius: 999px;
  font-family: var(--font-body); font-weight: 700; font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
}
.btn:hover  { transform: translateY(-2px) scale(1.02); filter: brightness(1.03); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn:focus-visible { outline: 3px solid var(--gold-light); outline-offset: 2px; }

.btn-primary {
  background: linear-gradient(135deg, var(--blush) 0%, var(--lavender) 100%);
  color: #43303C;
  box-shadow: 0 10px 24px rgba(183, 110, 121, 0.28);
}
.btn-soft {
  background: rgba(255, 255, 255, 0.75);
  color: var(--ink);
  border: 1px solid rgba(183, 110, 121, 0.25);
  box-shadow: var(--shadow-soft);
}
.btn-gold {
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 100%);
  color: #3A2E1E;
  box-shadow: 0 10px 24px rgba(212, 175, 55, 0.35);
}
.btn-big { padding: 16px 34px; font-size: 1.05rem; }

.link-quiet {
  display: inline-block;
  background: none; border: none; cursor: pointer;
  color: var(--rose-deep);
  font-size: 0.85rem; font-weight: 600;
  text-decoration: underline dotted;
  margin-top: 12px;
  padding: 6px 10px;
}
.link-quiet:focus-visible { outline: 2px solid var(--gold); border-radius: 8px; }

/* sections */
.section {
  max-width: 1080px;
  margin: 0 auto;
  padding: 72px 20px;
}
.section-head { text-align: center; margin-bottom: 42px; }
.section-head h2 {
  font-family: var(--font-script);
  font-weight: 400;
  font-size: clamp(2.5rem, 6.5vw, 3.5rem);
  line-height: 1.15;
  background: linear-gradient(120deg, var(--rose) 10%, #9C6BB3 90%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.divider {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin: 6px 0 10px; color: var(--gold);
}
.divider::before, .divider::after {
  content: ""; width: 64px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--rose-light));
}
.divider::after { background: linear-gradient(90deg, var(--rose-light), transparent); }
.divider span { font-size: 0.9rem; }
.section-sub { color: var(--ink-soft); font-size: 0.98rem; }

.script { font-family: var(--font-script); font-weight: 400; }

/* scroll-reveal (JS adds .in when the element enters the viewport) */
[data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--rd, 0s);
}
[data-reveal].in { opacity: 1; transform: none; }

/* ---------- 3. Loading screen ---------- */
#loader {
  position: fixed; inset: 0; z-index: 200;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 26px; padding: 20px; text-align: center;
  background:
    radial-gradient(600px 400px at 30% 20%, var(--blush-soft) 0%, transparent 60%),
    radial-gradient(600px 420px at 75% 80%, var(--lavender-soft) 0%, transparent 60%),
    var(--cream);
  transition: opacity 0.7s ease, visibility 0.7s ease;
}
#loader.done { opacity: 0; visibility: hidden; pointer-events: none; }

.gift-wrap { position: relative; }
.gift { position: relative; width: 88px; height: 84px; animation: gift-bounce 1.6s ease-in-out infinite; }
.gift-body {
  position: absolute; bottom: 0; left: 0; right: 0; height: 58px;
  background: linear-gradient(160deg, var(--rose-light), var(--rose));
  border-radius: 8px 8px 10px 10px;
}
.gift-body::before { /* vertical ribbon */
  content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 14px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  opacity: 0.9;
}
.gift-lid {
  position: absolute; top: 18px; left: -8px; right: -8px; height: 18px;
  background: linear-gradient(160deg, #F0A2B0, var(--rose));
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(156, 84, 98, 0.3);
}
.gift-bow {
  position: absolute; top: -2px; left: 50%; transform: translateX(-50%);
  width: 40px; height: 22px;
}
.gift-bow::before, .gift-bow::after {
  content: ""; position: absolute; top: 0; width: 18px; height: 20px;
  background: radial-gradient(circle at 30% 30%, var(--gold-light), var(--gold));
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
}
.gift-bow::before { left: 0; transform: rotate(-24deg); }
.gift-bow::after  { right: 0; transform: rotate(24deg); }
.gift-sparkles {
  position: absolute; top: -26px; right: -20px;
  color: var(--gold); font-size: 1.2rem;
  animation: twinkle 1.4s ease-in-out infinite;
}
@keyframes gift-bounce {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50%      { transform: translateY(-9px) rotate(1.5deg); }
}

.loader-text {
  font-family: var(--font-hand);
  font-size: clamp(1.3rem, 4.5vw, 1.7rem);
  color: var(--ink);
}
.loader-text .js-her-name { color: var(--rose-deep); }

.loader-heart {
  width: 200px; height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(183, 110, 121, 0.25);
  overflow: hidden;
}
.loader-heart-fill {
  display: block; width: 0; height: 100%;
  background: linear-gradient(90deg, var(--blush), var(--rose-light), var(--gold-light));
  border-radius: 999px;
  animation: heart-fill 2.3s ease-in-out forwards;
}
@keyframes heart-fill { to { width: 100%; } }

/* ---------- 4. Password gate ---------- */
#gate {
  position: fixed; inset: 0; z-index: 190;
  display: grid; place-items: center; padding: 20px;
  background:
    radial-gradient(700px 460px at 30% 25%, var(--blush-soft) 0%, transparent 60%),
    radial-gradient(700px 480px at 70% 75%, var(--lavender-soft) 0%, transparent 60%),
    var(--cream);
}
.gate-card {
  width: min(400px, 92vw);
  padding: 36px 28px;
  text-align: center;
}
.gate-emoji { font-size: 2rem; margin-bottom: 6px; }
.gate-question { font-size: 2rem; color: var(--rose-deep); margin-bottom: 4px; }
.gate-q { font-weight: 600; margin-bottom: 18px; }
#gate-form { display: flex; flex-direction: column; gap: 12px; }
.gate-input {
  padding: 13px 16px;
  border-radius: 14px; border: 1.5px solid rgba(183, 110, 121, 0.35);
  background: rgba(255, 255, 255, 0.85);
  font-family: var(--font-hand); font-size: 1.15rem; color: var(--ink);
  text-align: center;
}
.gate-input:focus { outline: 2px solid var(--gold-light); }
.gate-hint { margin-top: 14px; font-size: 0.85rem; color: var(--ink-soft); font-style: italic; }
.gate-error { margin-top: 12px; color: #B0434F; font-weight: 600; font-size: 0.9rem; }
.gate-card.shake { animation: shake 0.4s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); } 50% { transform: translateX(7px); } 75% { transform: translateX(-4px); }
}

/* ---------- 5. Hero ---------- */
.hero {
  min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: 90px 20px 70px;
  gap: 18px;
  position: relative;
}
.hero-eyebrow {
  font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--rose);
}
.hero-title { line-height: 1.08; }
#type-line {
  display: block;
  font-family: var(--font-body); font-weight: 500;
  font-size: clamp(1.5rem, 5.5vw, 2.6rem);
  color: var(--ink);
  min-height: 1.4em;
}
.type-caret {
  display: inline-block;
  width: 3px; height: 0.9em;
  background: var(--gold);
  vertical-align: -0.08em;
  margin-left: 3px;
  animation: caret-blink 0.85s step-end infinite;
}
.type-caret.off { display: none; }
@keyframes caret-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.hero-name {
  display: block;
  font-family: var(--font-script);
  font-weight: 400;
  font-size: clamp(4rem, 15vw, 8rem);
  line-height: 1.15;
  background: linear-gradient(115deg, var(--rose) 15%, #B98AD1 55%, var(--gold) 95%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  opacity: 0;
  transform: scale(0.94);
  transition: opacity 1.1s ease, transform 1.1s cubic-bezier(0.22, 1, 0.36, 1);
  filter: drop-shadow(0 4px 18px rgba(183, 110, 121, 0.35));
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.hero-name.show { opacity: 1; transform: scale(1); animation: name-glow 3.2s ease-in-out 1.2s infinite; }
@keyframes name-glow {
  0%, 100% { filter: drop-shadow(0 4px 16px rgba(183, 110, 121, 0.30)); }
  50%      { filter: drop-shadow(0 4px 26px rgba(212, 175, 55, 0.45)); }
}

.hero-subtitle { color: var(--ink-soft); font-size: clamp(0.98rem, 2.6vw, 1.12rem); max-width: 36ch; }

.countdown {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 4px 18px;
  padding: 18px 26px 14px;
  margin-top: 6px;
}
.cd-cell { display: flex; flex-direction: column; align-items: center; min-width: 58px; }
.cd-num {
  font-weight: 700; font-size: clamp(1.45rem, 5vw, 1.9rem);
  font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, var(--rose-deep), #8D5FA8);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.cd-label {
  font-size: 0.62rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--ink-soft);
}
.cd-caption {
  width: 100%;
  margin-top: 8px;
  font-size: 0.78rem; color: var(--ink-soft); font-style: italic;
}
.today-badge {
  padding: 14px 30px;
  border-radius: 999px;
  font-weight: 700; font-size: clamp(1.15rem, 4vw, 1.4rem);
  color: #6B4A18;
  background: linear-gradient(135deg, var(--gold-light), var(--blush) 90%);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 10px 26px rgba(212, 175, 55, 0.3);
  animation: badge-pulse 1.8s ease-in-out infinite;
}
@keyframes badge-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 10px 26px rgba(212, 175, 55, 0.28); }
  50%      { transform: scale(1.045); box-shadow: 0 14px 34px rgba(212, 175, 55, 0.42); }
}

.scroll-hint { margin-top: 14px; height: 40px; width: 22px; position: relative; }
.scroll-hint span {
  position: absolute; left: 50%; top: 4px;
  width: 12px; height: 12px;
  border-right: 2.5px solid var(--rose-light);
  border-bottom: 2.5px solid var(--rose-light);
  transform: translateX(-50%) rotate(45deg);
  animation: hint-drop 1.8s ease-in-out infinite;
}
@keyframes hint-drop {
  0%   { opacity: 0; transform: translate(-50%, -6px) rotate(45deg); }
  40%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, 14px) rotate(45deg); }
}

/* ---------- 6. Music & motion floating controls ---------- */
.music-btn, .motion-btn {
  position: fixed; z-index: 150;
  border: 1px solid rgba(255, 255, 255, 0.7);
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}
.music-btn:hover, .motion-btn:hover { transform: scale(1.07); }
.music-btn:focus-visible, .motion-btn:focus-visible { outline: 3px solid var(--gold-light); outline-offset: 2px; }

.music-btn {
  right: 18px; bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  width: 56px; height: 56px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  display: grid; place-items: center;
}
.vinyl {
  width: 36px; height: 36px; border-radius: 50%;
  background:
    radial-gradient(circle, var(--rose-light) 0 5px, #2A2430 6px 10px, #1D1822 11px 14px, #2A2430 15px 17px, #1D1822 18px);
  position: relative;
}
.vinyl-label {
  position: absolute; inset: 13px; border-radius: 50%;
  background: radial-gradient(circle, var(--gold-light), var(--gold));
}
.music-btn .music-note {
  position: absolute; top: -7px; right: -5px;
  font-size: 0.85rem; color: var(--rose-deep);
  opacity: 0; transition: opacity 0.3s ease;
}
.music-btn.playing .music-note { opacity: 1; animation: note-float 1.6s ease-in-out infinite; }
.music-btn.playing .vinyl { animation: vinyl-spin 2.6s linear infinite; }
@keyframes vinyl-spin { to { transform: rotate(360deg); } }
@keyframes note-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}

.music-tip {
  position: fixed; z-index: 150;
  right: 20px; bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  background: rgba(74, 59, 69, 0.85); color: #FFF3E9;
  font-size: 0.75rem; font-weight: 600;
  padding: 7px 13px; border-radius: 999px;
  pointer-events: none;
  animation: tip-pulse 2s ease-in-out infinite;
  transition: opacity 0.5s ease;
}
.music-tip.hide { opacity: 0; }
@keyframes tip-pulse { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

.motion-btn {
  left: 18px; bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  width: auto; height: 40px;
  padding: 0 16px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  font-size: 0.72rem; font-weight: 700; color: var(--ink);
  display: inline-flex; align-items: center; gap: 6px;
}
.motion-btn[aria-pressed="true"] { opacity: 0.65; }

/* ---------- 7. Gallery (polaroids) ---------- */
.polaroid-grid {
  columns: 2; column-gap: 18px;
  max-width: 900px; margin: 0 auto;
}
.polaroid {
  break-inside: avoid;
  margin: 0 0 18px;
  background: #fff;
  padding: 10px 10px 12px;
  border-radius: 6px;
  box-shadow: var(--shadow-card);
  transform: rotate(var(--tilt, 0deg));
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  position: relative;
}
.polaroid::before { /* washi tape */
  content: ""; position: absolute; top: -9px; left: 50%;
  width: 74px; height: 20px;
  transform: translateX(-50%) rotate(-3deg);
  background: rgba(242, 208, 107, 0.55);
  border-left: 1px dashed rgba(255,255,255,0.8);
  border-right: 1px dashed rgba(255,255,255,0.8);
  z-index: 2;
}
.polaroid:nth-child(4n + 1) { --tilt: -2.4deg; }
.polaroid:nth-child(4n + 2) { --tilt:  1.9deg; }
.polaroid:nth-child(4n + 3) { --tilt: -1.2deg; }
.polaroid:nth-child(4n + 4) { --tilt:  2.6deg; }
.polaroid:hover { transform: rotate(0deg) scale(1.03); box-shadow: 0 22px 50px rgba(74, 59, 69, 0.22); z-index: 3; }
.polaroid-btn {
  display: block; width: 100%; border: none; padding: 0; background: none;
  cursor: zoom-in; border-radius: 4px; overflow: hidden;
}
.polaroid-btn img { width: 100%; border-radius: 4px; transition: transform 0.4s ease; }
.polaroid-btn:hover img { transform: scale(1.04); }
.polaroid figcaption {
  padding-top: 9px; text-align: center;
  font-size: 0.85rem; font-weight: 600; color: var(--ink-soft);
}

/* lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 210;
  display: flex; align-items: center; justify-content: center;
  background: rgba(26, 18, 30, 0.92);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  animation: lb-fade 0.3s ease;
}
@keyframes lb-fade { from { opacity: 0; } }
.lb-figure { max-width: 92vw; text-align: center; animation: lb-pop 0.35s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes lb-pop { from { opacity: 0; transform: scale(0.94); } }
.lb-figure img {
  max-width: 88vw; max-height: 72vh;
  border-radius: 10px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
  margin: 0 auto;
}
.lb-caption {
  margin-top: 14px; color: #FFEFE4; font-size: 0.95rem; font-weight: 600;
  display: flex; flex-direction: column; gap: 2px;
}
.lb-counter { font-size: 0.72rem; opacity: 0.65; font-weight: 400; }
.lb-close, .lb-nav {
  position: absolute;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #FFF3E9; cursor: pointer;
  border-radius: 50%;
  display: grid; place-items: center;
  transition: background 0.25s ease, transform 0.25s ease;
}
.lb-close:hover { background: rgba(255, 255, 255, 0.25); transform: scale(1.08); }
.lb-nav:hover { background: rgba(255, 255, 255, 0.25); transform: translateY(-50%) scale(1.08); }
.lb-close { top: calc(16px + env(safe-area-inset-top, 0px)); right: 16px; width: 44px; height: 44px; font-size: 1.5rem; }
.lb-nav   { top: 50%; transform: translateY(-50%); width: 46px; height: 46px; font-size: 1.8rem; padding-bottom: 4px; }
.lb-prev  { left: 12px; }
.lb-next  { right: 12px; }
.lb-nav:focus-visible, .lb-close:focus-visible { outline: 3px solid var(--gold-light); }

/* ---------- 8. Timeline ---------- */
.timeline {
  list-style: none;
  position: relative;
  max-width: 680px; margin: 0 auto;
  padding-left: 8px;
}
.timeline::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 21px;
  width: 2px;
  background: linear-gradient(180deg, var(--rose-light), var(--lavender), var(--gold-light));
  border-radius: 2px;
}
.tl-item { position: relative; padding: 0 0 34px 56px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
  position: absolute; left: 14px; top: 4px;
  width: 16px; height: 16px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--gold-light), var(--gold));
  border: 3px solid #FFF8F0;
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.4), 0 4px 10px rgba(212, 175, 55, 0.4);
}
.tl-date {
  display: inline-block;
  font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--rose-deep);
  background: rgba(248, 200, 212, 0.4);
  padding: 4px 12px; border-radius: 999px;
  margin-bottom: 8px;
}
.tl-title { font-family: var(--font-hand); font-size: 1.5rem; color: var(--ink); line-height: 1.3; }
.tl-text  { color: var(--ink-soft); font-size: 0.95rem; margin-top: 4px; max-width: 44ch; }

/* ---------- 9. Flip cards (things I admire) ---------- */
.flip-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  max-width: 760px; margin: 0 auto;
}
.flip-card {
  position: relative;
  aspect-ratio: 1 / 1;
  perspective: 1000px;
  background: none; border: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.flip-card:focus-visible { outline: 3px solid var(--gold-light); outline-offset: 3px; border-radius: 20px; }
.flip-inner {
  position: absolute; inset: 0;
  transform-style: preserve-3d;
  transition: transform 0.65s cubic-bezier(0.34, 1.2, 0.5, 1);
}
.flip-card.flipped .flip-inner { transform: rotateY(180deg); }
.flip-front, .flip-back {
  position: absolute; inset: 0;
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
  border-radius: 20px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 14px; text-align: center;
}
.flip-front {
  background: rgba(255, 255, 255, 0.6);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow-soft);
}
.flip-icon { font-size: clamp(1.9rem, 6vw, 2.4rem); line-height: 1; }
.flip-title { font-weight: 700; font-size: clamp(0.92rem, 2.8vw, 1.05rem); color: var(--ink); }
.flip-tap {
  font-size: 0.62rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--rose); font-weight: 700; opacity: 0.8;
}
.flip-back {
  background: linear-gradient(150deg, var(--rose-light), var(--lavender));
  color: #43303C;
  transform: rotateY(180deg);
  font-family: var(--font-hand);
  font-size: clamp(1.05rem, 3.4vw, 1.3rem);
  line-height: 1.4;
  box-shadow: var(--shadow-soft);
}

/* ---------- 10. Envelope + letter ---------- */
.envelope-zone {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  margin-bottom: 30px;
  max-height: 420px;
  transition: max-height 0.9s ease 0.15s, opacity 0.5s ease, margin-bottom 0.9s ease 0.15s;
}
.envelope-zone.collapsed {
  max-height: 0;
  opacity: 0;
  margin-bottom: 0;
  overflow: hidden;
  pointer-events: none;
}
.envelope {
  position: relative;
  width: min(340px, 82vw);
  height: 224px;
  cursor: pointer;
  perspective: 900px;
  filter: drop-shadow(0 18px 34px rgba(156, 84, 98, 0.28));
  transition: transform 0.4s ease, opacity 0.6s ease;
  -webkit-tap-highlight-color: transparent;
}
.envelope:hover { transform: translateY(-4px); }
.envelope:focus-visible { outline: 3px solid var(--gold-light); border-radius: 14px; }
.env-back {
  position: absolute; inset: 0;
  background: linear-gradient(160deg, #F3BFC9, var(--rose-light));
  border-radius: 14px;
}
.env-letter-mini {
  position: absolute; left: 14px; right: 14px; top: 12px; height: 150px;
  background:
    linear-gradient(#FFFDF8, #FFFDF8) padding-box,
    #FFFDF8;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(74, 59, 69, 0.18);
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.15s;
  z-index: 2;
}
.env-letter-mini::before {
  content: "♡"; position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  color: var(--rose-light); font-size: 1.2rem;
}
.env-letter-mini::after {
  content: ""; position: absolute; top: 44px; left: 20px; right: 20px; height: 5px;
  background: repeating-linear-gradient(90deg, #F3D9DE 0 34px, transparent 34px 42px);
  border-radius: 3px;
  box-shadow: 0 14px 0 -1px #F3D9DE, 0 28px 0 -1px #F8E8EC;
}
.env-front {
  position: absolute; inset: 0;
  background: linear-gradient(200deg, #F8CBD5, var(--rose-light));
  clip-path: polygon(0 0, 50% 52%, 100% 0, 100% 100%, 0 100%);
  border-radius: 14px;
  z-index: 3;
}
.env-flap {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, #F6BFCB, #EBA9B6);
  clip-path: polygon(0 0, 100% 0, 50% 56%);
  border-radius: 14px 14px 0 0;
  transform-origin: top center;
  transition: transform 0.65s cubic-bezier(0.4, 0, 0.2, 1), z-index 0s 0.3s;
  z-index: 4;
}
.env-seal {
  position: absolute; left: 50%; top: 51%;
  transform: translate(-50%, -50%);
  width: 46px; height: 46px; border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, var(--gold-light), var(--gold));
  color: #6B4A18; font-size: 1.2rem;
  display: grid; place-items: center;
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.5);
  z-index: 5;
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.envelope.open { transform: scale(0.98); }
.envelope.open .env-flap { transform: rotateX(178deg); z-index: 1; }
.envelope.open .env-seal { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
.envelope.open .env-letter-mini { transform: translateY(-58px); }
.envelope.gone { opacity: 0; transform: scale(0.92); pointer-events: none; }
.env-hint {
  font-size: 0.8rem; color: var(--ink-soft); font-style: italic;
  animation: hint-pulse 2.4s ease-in-out infinite;
}
@keyframes hint-pulse { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }

.letter-card {
  max-width: 580px;
  margin: 0 auto;
  padding: 34px 26px;
  background:
    linear-gradient(rgba(255, 253, 248, 0.96), rgba(255, 251, 243, 0.96));
  border-radius: var(--radius-big);
  animation: lb-pop 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.letter-text {
  font-family: var(--font-hand);
  font-size: clamp(1.25rem, 4vw, 1.45rem);
  line-height: 1.75;
  color: #4E3A44;
}
.letter-text p { margin-bottom: 0.9em; }
.letter-text .lt-opening, .letter-text .lt-closing { color: var(--rose-deep); }
.letter-text .lt-signature { text-align: right; margin-bottom: 0; color: var(--rose-deep); }
.type-caret.small { height: 1em; }
.letter-again {
  display: block; margin: 18px auto 0;
  background: none; border: none; cursor: pointer;
  color: var(--rose-deep); font-size: 0.85rem; font-weight: 600;
  text-decoration: underline dotted;
}

/* ---------- 11. Wishes wall + make a wish ---------- */
.wish-cloud {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 14px;
  max-width: 860px; margin: 0 auto 46px;
}
.wish-card {
  padding: 13px 20px;
  border-radius: 18px;
  font-size: 0.92rem; font-weight: 600; color: var(--ink);
  transform: rotate(var(--wr, 0deg));
  animation: wish-float var(--wd, 5s) ease-in-out var(--wy, 0s) infinite;
}
.wish-card:nth-child(5n + 1) { --wr: -1.6deg; }
.wish-card:nth-child(5n + 2) { --wr:  1.2deg; }
.wish-card:nth-child(5n + 3) { --wr: -0.8deg; --wd: 6s; }
.wish-card:nth-child(5n + 4) { --wr:  2deg;  --wd: 4.6s; }
.wish-card:nth-child(5n + 5) { --wr: -2.2deg;--wd: 5.6s; }
@keyframes wish-float {
  0%, 100% { transform: rotate(var(--wr)) translateY(0); }
  50%      { transform: rotate(var(--wr)) translateY(-7px); }
}

.wish-candle-zone {
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  text-align: center;
}
.candle-scene { display: grid; place-items: center; }
.wish-candle {
  position: relative;
  width: 46px; height: 150px;
  background: none; border: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.wish-candle:focus-visible { outline: 3px solid var(--gold-light); outline-offset: 6px; border-radius: 12px; }
.wc-stick {
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 34px; height: 118px;
  background: repeating-linear-gradient(135deg, #FFFDF8 0 9px, var(--blush) 9px 18px);
  border-radius: 8px 8px 6px 6px;
  box-shadow: inset -6px 0 10px rgba(183, 110, 121, 0.18), 0 10px 20px rgba(74, 59, 69, 0.15);
}
.wc-wick {
  position: absolute; bottom: 114px; left: 50%; transform: translateX(-50%);
  width: 3px; height: 9px; background: #5A4A42; border-radius: 2px;
}
.wc-flame {
  position: absolute; bottom: 120px; left: 50%;
  width: 22px; height: 34px;
  transform: translateX(-50%);
  background: radial-gradient(circle at 50% 78%, #FFF6D8 0 18%, var(--gold-light) 40%, #F5A94B 72%, #E8843C 100%);
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  box-shadow: 0 0 22px 8px rgba(242, 208, 107, 0.55), 0 0 60px 22px rgba(242, 208, 107, 0.22);
  animation: flame-flicker 0.55s ease-in-out infinite alternate;
  transform-origin: 50% 100%;
  transition: transform 0.45s ease, opacity 0.45s ease;
}
@keyframes flame-flicker {
  from { transform: translateX(-50%) scale(1) rotate(-2deg); }
  to   { transform: translateX(-50%) scale(1.08, 1.14) rotate(2.5deg); }
}
.wc-smoke {
  position: absolute; bottom: 128px; left: 50%;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(140, 130, 140, 0.5);
  filter: blur(3px);
  opacity: 0;
}
.wish-candle.out .wc-flame { transform: translateX(-50%) scale(0.2, 0.05); opacity: 0; animation: none; }
.wish-candle.out .wc-smoke { animation: smoke-rise 1.8s ease-out 0.1s 2; }
@keyframes smoke-rise {
  0%   { opacity: 0.85; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0;    transform: translate(calc(-50% - 14px), -74px) scale(2.6); }
}
.wish-note { font-size: 0.92rem; color: var(--ink-soft); font-style: italic; min-height: 1.4em; }

/* ---------- 12. Interactive cake ---------- */
.cake-zone { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.cake { position: relative; width: min(320px, 80vw); height: 198px; margin-top: 40px; }
.cake-glow {
  position: absolute; inset: -40px -60px;
  background: radial-gradient(closest-side, rgba(242, 208, 107, 0.4), transparent 70%);
  opacity: 0; transition: opacity 0.8s ease;
  pointer-events: none;
}
.cake.lit .cake-glow { opacity: 1; }

.candles {
  position: absolute; left: 50%; top: -6px; transform: translateX(-50%);
  display: flex; gap: 14px; z-index: 4;
}
.candle { position: relative; width: 11px; height: 40px; }
.candle-stick {
  position: absolute; bottom: 0; left: 0; right: 0; top: 6px;
  background: repeating-linear-gradient(135deg, #FFFDF8 0 5px, var(--rose-light) 5px 10px);
  border-radius: 3px 3px 2px 2px;
}
.candle-wick {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 2px; height: 7px; background: #5A4A42; border-radius: 1px;
}
.candle-flame {
  position: absolute; top: -16px; left: 50%;
  width: 13px; height: 20px;
  transform: translateX(-50%) scale(0);
  opacity: 0;
  background: radial-gradient(circle at 50% 80%, #FFF6D8 0 20%, var(--gold-light) 45%, #F5A94B 75%, #E8843C 100%);
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  box-shadow: 0 0 14px 5px rgba(242, 208, 107, 0.55);
  transform-origin: 50% 100%;
  transition: opacity 0.3s ease;
}
.cake.lit .candle-flame {
  opacity: 1;
  /* ignite once, then flicker forever (both animate transform) */
  animation: flame-ignite 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
             flame-flicker 0.5s ease-in-out 0.4s infinite alternate;
}
.cake.lit.out .candle-flame { animation: flame-out 0.32s ease-out forwards; }
@keyframes flame-ignite {
  from { transform: translateX(-50%) scale(0); }
  to   { transform: translateX(-50%) scale(1); }
}
@keyframes flame-out {
  to { transform: translateX(-50%) scale(0.05, 0.03); opacity: 0; }
}
.candle-smoke {
  position: absolute; top: -8px; left: 50%;
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(140, 130, 140, 0.5); filter: blur(2px);
  opacity: 0;
}
.cake.lit .candle-flame  { transform: translateX(-50%) scale(1); }
.cake.lit.out .candle-flame { transform: translateX(-50%) scale(0.1, 0.04); transition: transform 0.3s ease; }
.cake.out .candle-smoke { animation: smoke-rise 1.6s ease-out 0.05s 2; }

.layer { position: relative; margin: 0 auto; }
.layer .drip {
  position: absolute; top: -1px; left: 0; right: 0; height: 24px;
  background:
    radial-gradient(circle at 9px 6px, #FFFDF8 8px, transparent 9px) repeat-x;
  background-size: 26px 26px;
  background-color: #FFFDF8;
  border-radius: 14px 14px 0 0;
}
.layer-top    { width: 66%; height: 58px; background: linear-gradient(180deg, #F4B7C4, var(--rose-light)); border-radius: 12px 12px 10px 10px; z-index: 3; }
.layer-mid    { width: 82%; height: 64px; background: linear-gradient(180deg, #E3CBEE, var(--lavender)); border-radius: 12px 12px 10px 10px; margin-top: -6px; z-index: 2; }
.layer-bottom { width: 100%; height: 72px; background: linear-gradient(180deg, #F7D7C4, #F0C9B2); border-radius: 12px 12px 14px 14px; margin-top: -6px; z-index: 1; }
.sprinkle {
  position: absolute; width: 9px; height: 3.5px; border-radius: 3px;
  bottom: 12px; opacity: 0.9;
}
.sprinkle.s1 { left: 14%; bottom: 16px; background: var(--gold); transform: rotate(24deg); }
.sprinkle.s2 { left: 38%; bottom: 10px; background: #FFFDF8; transform: rotate(-32deg); }
.sprinkle.s3 { left: 58%; bottom: 18px; background: var(--rose-deep); transform: rotate(56deg); }
.sprinkle.s4 { left: 78%; bottom: 12px; background: #9C6BB3; transform: rotate(-18deg); }
.sprinkle.s5 { left: 26%; bottom: 8px;  background: #7FB0D8; transform: rotate(40deg); }
.sprinkle.s6 { left: 66%; bottom: 8px;  background: var(--gold-light); transform: rotate(-52deg); }
.plate {
  position: absolute; left: 50%; bottom: -14px; transform: translateX(-50%);
  width: 116%; height: 26px;
  background: radial-gradient(closest-side, #FFFFFF 0 62%, #F3E3EA 78%, transparent 80%);
  border-radius: 50%;
  box-shadow: 0 12px 24px rgba(74, 59, 69, 0.18);
}

.cake-msg { font-size: 0.95rem; color: var(--ink-soft); font-weight: 600; min-height: 1.5em; text-align: center; }
.cake-controls { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.cake-controls [hidden] { display: none; }
#mic-btn.listening { animation: mic-pulse 1.2s ease-in-out infinite; }
@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(242, 208, 107, 0.5); }
  50%      { box-shadow: 0 0 0 12px rgba(242, 208, 107, 0); }
}

/* ---------- 13. Mini-game ---------- */
.game-frame {
  position: relative;
  height: 420px;
  max-width: 640px; margin: 0 auto;
  overflow: hidden;
  border-radius: var(--radius-big);
  background:
    radial-gradient(320px 200px at 80% 0%, rgba(215, 201, 240, 0.55), transparent 70%),
    radial-gradient(320px 200px at 15% 100%, rgba(248, 200, 212, 0.6), transparent 70%),
    linear-gradient(180deg, #FFFBF5, #FBE9F0);
}
.game-score {
  position: absolute; top: 14px; left: 14px; z-index: 5;
  background: rgba(255, 255, 255, 0.8);
  padding: 7px 14px; border-radius: 999px;
  font-weight: 700; font-size: 0.9rem;
  box-shadow: var(--shadow-soft);
  font-variant-numeric: tabular-nums;
}
.game-start-zone {
  position: absolute; inset: 0; z-index: 4;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; text-align: center; padding: 20px;
}
.balloon {
  position: absolute; bottom: -110px;
  width: var(--size, 54px); height: calc(var(--size, 54px) * 1.2);
  border: none; cursor: pointer;
  background: radial-gradient(circle at 32% 28%, rgba(255,255,255,0.85) 0 12%, var(--bc, var(--rose-light)) 45%, var(--bc2, var(--rose)) 100%);
  border-radius: 50% 50% 50% 50% / 46% 46% 54% 54%;
  box-shadow: inset -6px -8px 14px rgba(0, 0, 0, 0.08);
  animation: balloon-rise var(--dur, 7s) linear forwards;
  -webkit-tap-highlight-color: transparent;
  z-index: 3;
}
.balloon::after { /* knot */
  content: ""; position: absolute; bottom: -7px; left: 50%; transform: translateX(-50%);
  border-left: 6px solid transparent; border-right: 6px solid transparent;
  border-top: 8px solid var(--bc2, var(--rose));
}
.balloon::before { /* string */
  content: ""; position: absolute; top: 100%; left: 50%;
  width: 1.5px; height: 44px;
  background: rgba(74, 59, 69, 0.35);
}
@keyframes balloon-rise {
  from { transform: translateY(0) rotate(-2deg); }
  50%  { transform: translateY(calc(-46vh)) rotate(2.5deg); }
  to   { transform: translateY(calc(-120vh)) rotate(-2deg); }
}
.balloon.popped { animation: balloon-pop 0.22s ease-out forwards !important; }
@keyframes balloon-pop {
  60%  { transform: scale(1.35); opacity: 1; }
  100% { transform: scale(1.7); opacity: 0; }
}
.game-msg {
  position: absolute; z-index: 6;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(320px, 84%);
  padding: 30px 24px;
  text-align: center;
  background: rgba(255, 255, 255, 0.9);
  animation: lb-pop 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.game-msg-heart { font-size: 2rem; margin-bottom: 8px; }
.game-msg-text { font-family: var(--font-hand); font-size: 1.45rem; line-height: 1.5; color: var(--rose-deep); margin-bottom: 16px; }

/* ---------- 14. Finale (night sky) ---------- */
.finale {
  position: relative;
  min-height: 100svh;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  padding: 110px 22px;
  overflow: hidden;
  background: linear-gradient(180deg, var(--night) 0%, var(--night-2) 55%, #2A2447 100%);
  color: #F4EAF2;
}
.stars { position: absolute; inset: 0; pointer-events: none; }
.stars .star {
  position: absolute;
  width: var(--sz, 2px); height: var(--sz, 2px);
  background: #FFF;
  border-radius: 50%;
  opacity: 0.25;
  animation: star-twinkle var(--td, 3s) ease-in-out var(--ty, 0s) infinite;
}
@keyframes star-twinkle {
  0%, 100% { opacity: 0.18; transform: scale(0.85); }
  50%      { opacity: 1;    transform: scale(1.25); }
}
.shooting-star {
  position: absolute;
  top: var(--sy, 12%); left: var(--sx, 10%);
  width: 130px; height: 2px;
  background: linear-gradient(90deg, rgba(255,255,255,0.95), transparent);
  border-radius: 2px;
  transform: rotate(-28deg);
  animation: shoot 1.4s ease-out forwards;
  pointer-events: none;
}
@keyframes shoot {
  0%   { opacity: 0; transform: rotate(-28deg) translateX(0); }
  12%  { opacity: 1; }
  100% { opacity: 0; transform: rotate(-28deg) translateX(340px); }
}
.finale-inner { position: relative; z-index: 2; max-width: 640px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.finale-eyebrow {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--gold-light);
}
.finale-title {
  font-size: clamp(2.6rem, 9vw, 4.2rem);
  background: linear-gradient(115deg, var(--gold-light), #F7C8D8 70%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  line-height: 1.2;
}
.finale-line { font-size: clamp(1.02rem, 3vw, 1.18rem); color: #E9DCEC; max-width: 40ch; }
.finale-closing { font-family: var(--font-hand); font-size: clamp(1.5rem, 5vw, 2rem); color: var(--gold-light); }
.finale-signature { font-family: var(--font-hand); font-size: 1.15rem; color: #C9B8D8; }

/* ---------- 15. Footer ---------- */
.footer {
  text-align: center;
  padding: 34px 20px calc(46px + env(safe-area-inset-bottom, 0px));
  color: var(--ink-soft);
  font-size: 0.82rem;
}

/* ---------- 16. Modal ---------- */
.modal {
  position: fixed; inset: 0; z-index: 220;
  display: grid; place-items: center;
  padding: 20px;
  background: rgba(30, 20, 35, 0.5);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  animation: lb-fade 0.3s ease;
}
.modal-card {
  width: min(360px, 92vw);
  padding: 34px 26px;
  text-align: center;
  animation: lb-pop 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.modal-emoji { font-size: 2.1rem; margin-bottom: 10px; }
.modal-text { font-family: var(--font-hand); font-size: 1.4rem; line-height: 1.55; color: var(--ink); margin-bottom: 20px; }

/* ---------- 17. Cursor heart trail (desktop only, JS decides) ---------- */
.heart-trail {
  position: fixed;
  z-index: 400; pointer-events: none;
  font-size: var(--hs, 13px);
  color: var(--hc, var(--rose-light));
  animation: heart-rise 0.95s ease-out forwards;
  text-shadow: 0 2px 6px rgba(183, 110, 121, 0.3);
}
@keyframes heart-rise {
  0%   { opacity: 0.9; transform: translate(0, 0) scale(0.7); }
  100% { opacity: 0;   transform: translate(var(--hx, 6px), -44px) scale(1.25); }
}

/* ---------- 18. Larger screens ---------- */
@media (min-width: 640px) {
  .polaroid-grid { columns: 3; }
  .flip-grid { grid-template-columns: repeat(3, 1fr); }
  .cd-cell { min-width: 72px; }
}

@media (min-width: 900px) {
  .timeline::before { left: 50%; transform: translateX(-1px); }
  .tl-item { width: calc(50% - 52px); padding: 0 0 44px; }
  .tl-item:nth-child(odd)  { margin-right: auto; text-align: right; }
  .tl-item:nth-child(even) { margin-left: auto;  text-align: left; }
  .tl-item:nth-child(odd)  .tl-text { margin-left: auto; }
  .tl-item:nth-child(odd)  .tl-dot { right: -60px; left: auto; }
  .tl-item:nth-child(even) .tl-dot { left: -60px; }
  .flip-grid { grid-template-columns: repeat(3, 1fr); }
  .game-frame { height: 460px; }
}

/* ---------- 19. Reduced motion ---------- */
/* The toggle button adds .reduce-motion to <html>; the OS preference is
   respected too. Everything becomes instant & still — content is untouched. */
@media (prefers-reduced-motion: reduce) {
  html:not(.force-motion) *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
  .hero-name { opacity: 1; transform: none; }
}
html.reduce-motion *, html.reduce-motion *::before, html.reduce-motion *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}
html.reduce-motion { scroll-behavior: auto; }
html.reduce-motion [data-reveal] { opacity: 1; transform: none; }
html.reduce-motion .hero-name { opacity: 1; transform: none; }
html.reduce-motion .music-tip { display: none; }

/* tiny screens */
@media (max-width: 350px) {
  .countdown { gap: 2px 10px; }
  .cd-cell { min-width: 50px; }
  .btn-big { padding: 14px 22px; font-size: 0.95rem; }
}

/* ============================================================================
   ROYAL POLISH LAYER — extra beauty, Hinglish edition
   (every decorative animation is disabled when motion is reduced)
   ========================================================================== */

/* ---------- soft selection + scrollbar ---------- */
::selection { background: rgba(215, 201, 240, 0.75); color: #4A3B45; }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #F7EFF2; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--rose-light), var(--lavender));
  border-radius: 8px; border: 2px solid #F7EFF2;
}
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, var(--rose), #B98AD1); }

/* ---------- drifting aurora glow behind everything ---------- */
.aurora {
  position: fixed; inset: 0; z-index: -1; overflow: hidden;
  pointer-events: none;
}
.aurora i {
  content: ""; position: absolute; border-radius: 50%;
  filter: blur(70px); opacity: 0.5;
}
.aurora i:nth-child(1) {
  width: 46vw; height: 46vw; left: -12vw; top: -14vh;
  background: radial-gradient(circle, rgba(232, 180, 184, 0.55), transparent 65%);
  animation: aurora-a 26s ease-in-out infinite alternate;
}
.aurora i:nth-child(2) {
  width: 40vw; height: 40vw; right: -10vw; top: 22vh;
  background: radial-gradient(circle, rgba(215, 201, 240, 0.55), transparent 65%);
  animation: aurora-b 31s ease-in-out infinite alternate;
}
.aurora i:nth-child(3) {
  width: 36vw; height: 36vw; left: 22vw; bottom: -16vh;
  background: radial-gradient(circle, rgba(242, 208, 107, 0.35), transparent 65%);
  animation: aurora-c 24s ease-in-out infinite alternate;
}
@keyframes aurora-a { to { transform: translate(9vw, 7vh) scale(1.15); } }
@keyframes aurora-b { to { transform: translate(-8vw, -6vh) scale(1.1); } }
@keyframes aurora-c { to { transform: translate(-6vw, -8vh) scale(1.18); } }

/* ---------- hero name: living shimmer ---------- */
html:not(.reduce-motion) .hero-name {
  background-image: linear-gradient(115deg, var(--rose) 10%, #C08BD9 32%, var(--gold) 52%, var(--rose) 72%, #B98AD1 90%);
  background-size: 230% 230%;
}
html:not(.reduce-motion) .hero-name.show {
  animation: name-glow 3.2s ease-in-out 1.2s infinite,
             name-shine 7.5s ease-in-out 0.4s infinite;
}
@keyframes name-shine {
  0%, 100% { background-position: 0% 40%; }
  50%      { background-position: 100% 60%; }
}

/* hero eyebrow: gentle two-tone */
.hero-eyebrow { animation: eyebrow-breathe 4.5s ease-in-out infinite; }
@keyframes eyebrow-breathe {
  0%, 100% { opacity: 0.82; letter-spacing: 0.22em; }
  50%      { opacity: 1;    letter-spacing: 0.26em; }
}

/* ---------- buttons: shine sweep + glow ---------- */
.btn-primary, .btn-gold { position: relative; overflow: hidden; }
.btn-primary::before, .btn-gold::before {
  content: ""; position: absolute; top: 0; left: -80%;
  width: 45%; height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  transform: skewX(-22deg);
  transition: left 0.65s ease;
  pointer-events: none;
}
.btn-primary:hover::before, .btn-gold:hover::before { left: 135%; }
.btn-primary {
  box-shadow: 0 6px 18px rgba(183, 110, 121, 0.22);
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.3s ease;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(183, 110, 121, 0.34);
}
.btn-gold { transition: transform 0.25s ease, box-shadow 0.25s ease; }
.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(212, 175, 55, 0.42);
}

/* ---------- countdown: golden ring + slow float ---------- */
.countdown {
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: 0 14px 36px rgba(183, 110, 121, 0.16),
              inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}
html:not(.reduce-motion) .countdown { animation: cd-float 6s ease-in-out infinite; }
@keyframes cd-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-5px); }
}
.cd-num { text-shadow: 0 2px 10px rgba(156, 84, 98, 0.12); }

/* ---------- section headings: gradient script ---------- */
.section-head .script {
  background: linear-gradient(115deg, var(--rose-deep) 15%, #9C6BB3 55%, var(--gold) 95%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  filter: drop-shadow(0 3px 10px rgba(183, 110, 121, 0.18));
}
.divider span { display: inline-block; }
html:not(.reduce-motion) .divider span { animation: heart-beat 2.4s ease-in-out infinite; }
@keyframes heart-beat {
  0%, 100% { transform: scale(1); }
  12%      { transform: scale(1.28); }
  24%      { transform: scale(1); }
  36%      { transform: scale(1.18); }
  48%      { transform: scale(1); }
}

/* ---------- polaroids: warmer captions, softer lift ---------- */
.polaroid figcaption {
  font-family: var(--font-hand);
  font-size: 1.02rem; font-weight: 500;
  color: var(--ink-soft);
}
.polaroid::before {
  background: rgba(242, 208, 107, 0.6);
  box-shadow: 0 2px 6px rgba(74, 59, 69, 0.12);
}
.polaroid:hover { transform: rotate(0deg) scale(1.045); box-shadow: 0 26px 56px rgba(74, 59, 69, 0.26); }
.polaroid-btn img { filter: saturate(0.96); transition: transform 0.5s ease, filter 0.4s ease; }
.polaroid:hover .polaroid-btn img { transform: scale(1.05); filter: saturate(1.08); }

/* ---------- lightbox: polaroid-style frame + handwritten caption ----------
   The caption lives INSIDE the white frame (not on a fixed bottom border),
   so long captions wrap and the frame grows instead of spilling off. */
.lb-figure {
  background: #FFFDF8;
  padding: 10px 10px 14px;
  border-radius: 12px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
}
.lb-figure img {
  border: none;
  border-radius: 6px;
  box-shadow: none;
  max-width: min(88vw, 820px);
  max-height: 68vh;
  width: auto;
  margin: 0 auto;
}
.lb-caption {
  margin: 12px 6px 0;
  font-family: var(--font-hand); font-size: clamp(1.05rem, 3.6vw, 1.25rem); font-weight: 500;
  color: #3E3038;
}
.lb-counter { margin-top: 4px; color: #B9A6C9; }

/* ---------- timeline: glowing dots, shimmering line ---------- */
html:not(.reduce-motion) .timeline::before {
  background: linear-gradient(180deg, var(--rose-light), var(--lavender), var(--gold-light), var(--rose-light));
  background-size: 100% 300%;
  animation: tl-shimmer 9s ease-in-out infinite;
}
@keyframes tl-shimmer { 0%, 100% { background-position: 50% 0%; } 50% { background-position: 50% 100%; } }
.tl-dot { box-shadow: 0 0 0 4px rgba(232, 180, 184, 0.25); }
html:not(.reduce-motion) .tl-dot { animation: dot-glow 3.2s ease-in-out infinite; }
@keyframes dot-glow {
  0%, 100% { box-shadow: 0 0 0 4px rgba(232, 180, 184, 0.22); }
  50%      { box-shadow: 0 0 0 7px rgba(215, 201, 240, 0.4); }
}

/* ---------- flip cards: soft glow on hover ---------- */
.flip-card { transition: filter 0.3s ease; }
.flip-card:hover { filter: drop-shadow(0 10px 22px rgba(183, 110, 121, 0.2)); }

/* ---------- envelope: wax seal glow + hint bounce ---------- */
.env-seal {
  background: radial-gradient(circle at 32% 30%, var(--rose-light), var(--rose-deep) 70%);
  box-shadow: 0 4px 14px rgba(156, 84, 98, 0.45);
}
html:not(.reduce-motion) .envelope:not(.open) { animation: env-invite 3.4s ease-in-out infinite; }
@keyframes env-invite {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50%      { transform: translateY(-6px) rotate(1deg); }
}

/* letter: handwritten feel on soft ruled paper */
.letter-card {
  background-image:
    repeating-linear-gradient(transparent 0 33px, rgba(183, 110, 121, 0.08) 33px 34px),
    linear-gradient(rgba(255, 255, 255, 0.92), rgba(255, 251, 245, 0.94));
}
.letter-text { line-height: 2; }

/* ---------- wish cards: glowing hover ---------- */
.wish-card { transition: box-shadow 0.3s ease, border-color 0.3s ease; }
.wish-card:hover {
  box-shadow: 0 12px 26px rgba(183, 110, 121, 0.2);
  border-color: var(--rose-light);
}

/* ---------- music button: pulsing ring while playing ---------- */
.music-btn { position: fixed; }
html:not(.reduce-motion) .music-btn.playing::after {
  content: ""; position: absolute; inset: -5px;
  border-radius: 50%;
  border: 2px solid var(--rose-light);
  animation: ring-pulse 1.8s ease-out infinite;
  pointer-events: none;
}
@keyframes ring-pulse {
  0%   { transform: scale(0.9); opacity: 0.9; }
  100% { transform: scale(1.35); opacity: 0; }
}

/* ---------- finale: shooting star + golden signature ---------- */
html:not(.reduce-motion) .stars::after {
  content: ""; position: absolute;
  top: 14%; left: 72%;
  width: 3px; height: 3px; border-radius: 50%;
  background: #FFF;
  box-shadow: 0 0 8px 3px rgba(255, 255, 255, 0.85);
  opacity: 0;
  animation: shoot-star 8.5s ease-in infinite;
}
@keyframes shoot-star {
  0%       { opacity: 0; transform: translate(0, 0) rotate(35deg); }
  4%       { opacity: 1; }
  14%      { opacity: 0; transform: translate(-320px, 210px) rotate(35deg); }
  100%     { opacity: 0; transform: translate(-320px, 210px) rotate(35deg); }
}
.finale-signature {
  font-family: var(--font-script);
  font-size: clamp(1.7rem, 5vw, 2.3rem);
  background: linear-gradient(115deg, var(--gold-light), #F7E7B0 45%, var(--gold));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  filter: drop-shadow(0 3px 12px rgba(212, 175, 55, 0.35));
}
html:not(.reduce-motion) .finale-closing { animation: closing-glow 3.6s ease-in-out infinite; }
@keyframes closing-glow {
  0%, 100% { text-shadow: 0 0 10px rgba(242, 208, 107, 0.25); }
  50%      { text-shadow: 0 0 22px rgba(242, 208, 107, 0.55); }
}

/* ---------- footer: quiet and warm ---------- */
.footer p { letter-spacing: 0.02em; }

/* ============================================================================
   FIX LAYER — Oct 3 polish round
   ========================================================================== */
/* grid <img> now carries width/height attrs (no masonry jump) — keep the
   aspect ratio intact when the column scales it down */
.polaroid-btn img { height: auto; }

/* reduced-motion game: parked balloons rise not at all */
.balloon.static { animation: none; }

/* quiet hint under the letter while it types */
.letter-type-hint {
  margin: 10px 0 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--ink-soft);
  font-style: italic;
}
