/* ═══════════════════════════════════════════════════
   For Himanshi — "Midnight Love Letter" theme
   Mobile-first · 375-430 px target
   ═══════════════════════════════════════════════════ */

:root {
  --bg:    #08070e;
  --bg2:   #0d0c16;
  --rose:  #c76b86;
  --blush: #e0a0b6;
  --gold:  #c8a45c;
  --amber: #d4a058;
  --cream: #f0e8df;
  --text:       rgba(237,229,220,.92);
  --text-soft:  rgba(237,229,220,.68);
  --text-faint: rgba(237,229,220,.40);
  --card-bg:    rgba(237,229,220,.04);
  --card-border:rgba(237,229,220,.08);
  --shadow: 0 20px 60px rgba(0,0,0,.50);
}

/* ── Reset ── */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; -webkit-text-size-adjust: 100%; }
body {
  min-height: 100%;
  font-family: 'Outfit', sans-serif;
  font-weight: 400;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background:
    radial-gradient(ellipse 500px 360px at 25% 12%, rgba(199,107,134,.14), transparent 60%),
    radial-gradient(ellipse 420px 300px at 78% 22%, rgba(200,164,92,.11), transparent 60%),
    radial-gradient(ellipse 700px 400px at 50% 55%, rgba(140,120,200,.06), transparent 60%),
    linear-gradient(180deg, var(--bg), var(--bg2));
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  padding-top:    env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* ── Grain overlay ── */
.grain {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 1;
}
.grain::after {
  content: '';
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px;
  opacity: .028;
  mix-blend-mode: overlay;
}

/* ── Canvas ── */
#particles {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 60;
}

/* ── Sound toggle ── */
.sound-btn {
  position: fixed;
  top: calc(14px + env(safe-area-inset-top, 0px));
  right: calc(14px + env(safe-area-inset-right, 0px));
  z-index: 100;
  font-family: 'Outfit', sans-serif;
  font-size: 12px; font-weight: 500;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: rgba(8,7,14,.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text-faint);
  cursor: pointer;
  transition: border-color .2s;
}
.sound-btn:active { transform: scale(.96); }
.sound-btn__icon { margin-right: 2px; }

/* ── Typography ── */
h1, h2, h3 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.08;
}
.hw { font-family: 'Caveat', cursive; font-size: 1.15em; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-size: 15px; font-weight: 500;
  border: none; border-radius: 14px;
  padding: 15px 24px;
  min-height: 48px;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform .12s ease, opacity .12s ease;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn--primary {
  background: linear-gradient(135deg, var(--rose), var(--gold));
  color: #0a0a10; font-weight: 600;
}
.btn--secondary {
  background: var(--card-bg);
  color: var(--text);
  border: 1px solid var(--card-border);
}
.btn--ghost {
  background: transparent;
  color: var(--text-soft);
  border: 1px solid var(--card-border);
  padding: 12px 18px;
}
.btn--rose {
  background: rgba(199,107,134,.16);
  color: var(--blush);
  border: 1px solid rgba(199,107,134,.26);
}
.btn--gold {
  background: linear-gradient(135deg, rgba(200,164,92,.22), rgba(200,164,92,.10));
  color: var(--gold);
  border: 1px solid rgba(200,164,92,.32);
}
.btn--gold:disabled {
  opacity: .7;
  color: var(--text-faint);
}
@keyframes btnPulseGold {
  0%, 100% { box-shadow: 0 0 0 0 rgba(200,164,92,.3); }
  50%      { box-shadow: 0 0 18px 4px rgba(200,164,92,.18); }
}
.btn--gold:not(:disabled) {
  animation: btnPulseGold 2.5s ease-in-out infinite;
}
.btn--wide { width: 100%; }
.link-btn {
  display: block;
  font-family: 'Outfit', sans-serif;
  font-size: 13px; font-weight: 400;
  background: none; border: none;
  color: var(--text-faint);
  padding: 10px; cursor: pointer;
  text-align: center;
}

/* ── Badge / Tag ── */
.badge {
  display: inline-block;
  font-family: 'Outfit', sans-serif;
  font-size: 11px; font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  color: var(--text-faint);
}
.badge--gold {
  border-color: rgba(200,164,92,.30);
  background: rgba(200,164,92,.10);
  color: var(--gold);
}

/* ── Rule / divider ── */
.rule {
  width: 40px; height: 1px;
  background: linear-gradient(90deg, var(--rose), transparent);
  margin: 10px 0 14px;
}

/* ═══════════════════════════════════════════════════
   OPENING SCREEN
   ═══════════════════════════════════════════════════ */
.opening {
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  padding: 24px 28px;
  position: relative;
}
.opening__content { max-width: 360px; }

.opening__date {
  font-family: 'Outfit', sans-serif;
  font-size: 12px; font-weight: 400;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0;
  animation: fadeIn .9s ease .4s both;
}

.opening__name {
  font-size: clamp(52px, 15vw, 68px);
  margin: 10px 0 0;
  line-height: 1;
}
.opening__name .letter {
  display: inline-block;
  opacity: 0;
  transform: translateY(22px) scale(.92);
  filter: blur(5px);
  animation: letterIn .75s cubic-bezier(.16,1,.3,1) forwards;
}

.opening__rule {
  width: 52px; height: 1px;
  margin: 18px auto;
  background: linear-gradient(90deg, transparent, var(--rose), transparent);
  opacity: 0;
  animation: fadeIn .8s ease 2s both;
}

.opening__line {
  font-size: 16px;
  color: var(--text-soft);
  margin: 6px 0;
  opacity: 0;
  animation: fadeSlideUp .8s ease 2.3s both;
}
.opening__line--2 { animation-delay: 2.6s; }

#startBtn {
  margin-top: 36px;
  opacity: 0;
  animation: fadeSlideUp .8s ease 3.1s both;
}
#skipBtn {
  margin-top: 10px;
  opacity: 0;
  animation: fadeIn .8s ease 3.6s both;
}

/* golden glow on name */
.opening__name .letter {
  text-shadow: 0 0 30px rgba(200,164,92,.0);
}
.opening__name .letter.lit {
  text-shadow: 0 0 30px rgba(200,164,92,.35), 0 0 60px rgba(199,107,134,.18);
}

/* ═══════════════════════════════════════════════════
   CARD (shared by letter pages, quiz)
   ═══════════════════════════════════════════════════ */
.card {
  margin: 20px 16px;
  padding: 22px 20px;
  border-radius: 22px;
  border: 1px solid var(--card-border);
  background:
    radial-gradient(ellipse 300px 200px at 30% 0%, rgba(199,107,134,.06), transparent 70%),
    var(--card-bg);
  box-shadow: var(--shadow);
}
.card__heading {
  font-size: 26px;
  margin: 14px 0 2px;
}
.card p, .card li {
  color: var(--text-soft);
  font-size: 15px;
  line-height: 1.65;
  margin: 10px 0;
}
.card__aside {
  color: var(--text-faint);
  margin-top: 16px !important;
}
.card__actions {
  display: flex; gap: 10px;
  justify-content: flex-end;
  margin-top: 18px;
  flex-wrap: wrap;
}
.card__actions--split { justify-content: space-between; }

/* ── Bullet list ── */
.bullet-list {
  list-style: none;
  padding: 0; margin: 14px 0 0;
}
.bullet-list li {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 0;
}
.bullet {
  color: var(--rose);
  font-size: 10px;
  margin-top: 6px;
  flex-shrink: 0;
}

/* ── Promises / Checkboxes ── */
.promises { display: grid; gap: 10px; margin-top: 14px; }
.promise-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  cursor: pointer;
  transition: border-color .25s;
}
.promise-row:has(.promise-check:checked) {
  border-color: rgba(199,107,134,.32);
}
.promise-check {
  position: absolute; opacity: 0; width: 0; height: 0;
}
.promise-box {
  width: 24px; height: 24px; flex-shrink: 0;
  border-radius: 7px;
  border: 2px solid rgba(237,229,220,.14);
  background: rgba(237,229,220,.03);
  display: grid; place-items: center;
  transition: background .2s, border-color .2s;
  margin-top: 1px;
}
.promise-check:checked + .promise-box {
  background: var(--rose);
  border-color: var(--rose);
}
.promise-check:checked + .promise-box::after {
  content: '\2713';
  color: #fff;
  font-size: 14px; font-weight: 700;
}
.promise-label {
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════════
   QUIZ
   ═══════════════════════════════════════════════════ */
.quiz-card { position: relative; }
.quiz-top {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 12px;
}
.quiz-sub {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-faint);
}
.quiz-counter {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  font-weight: 700; font-size: 14px;
  white-space: nowrap;
}
.quiz-q {
  margin: 16px 0;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--card-border);
  background: rgba(237,229,220,.03);
  font-size: 15px; line-height: 1.55;
  color: var(--text-soft);
}
.quiz-opts { display: grid; gap: 10px; }
.quiz-opt {
  width: 100%; text-align: left;
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  color: var(--text);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform .12s, background .12s, border-color .12s;
}
.quiz-opt:active { transform: scale(.98); }
.quiz-opt--primary {
  background: linear-gradient(135deg, rgba(199,107,134,.85), rgba(200,164,92,.68));
  color: #0a0a10;
  font-weight: 600;
  border-color: rgba(255,255,255,.14);
}

/* ═══════════════════════════════════════════════════
   BIRTHDAY
   ═══════════════════════════════════════════════════ */
.bday-head {
  text-align: center;
  padding: 44px 24px 24px;
}
.sparkle-line {
  font-size: 13px;
  color: var(--gold);
  letter-spacing: .12em;
}
.bday-title {
  font-size: clamp(32px, 9vw, 42px);
  margin: 10px 0;
}
.glow-text {
  background: linear-gradient(135deg, var(--rose), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
}
.bday-sub {
  color: var(--text-soft);
  font-size: 15px; line-height: 1.6;
  max-width: 320px;
  margin: 6px auto 0;
}

/* Wishes */
.wish-stack {
  display: grid; gap: 10px;
  padding: 0 18px;
}
.wish-row {
  display: flex; align-items: center; gap: 14px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
}
.wish-icon {
  width: 46px; height: 46px; flex-shrink: 0;
  border-radius: 13px;
  display: grid; place-items: center;
  font-size: 18px;
  background: var(--wbg);
  border: 1px solid var(--wbr);
}
.wish-row strong {
  display: block; font-size: 15px;
  color: var(--text);
}
.wish-row span {
  display: block; font-size: 13px;
  color: var(--text-faint);
  margin-top: 2px;
}

/* ═══════════════════════════════════════════════════
   PHOTO GALLERY — polaroid carousel
   ═══════════════════════════════════════════════════ */
.gallery-section {
  margin-top: 30px;
}
.gallery-label {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px; font-weight: 600;
  text-align: center;
  margin-bottom: 6px;
}
.gallery {
  display: flex; gap: 18px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 18px 22px 24px;
  scrollbar-width: none;
}
.gallery::-webkit-scrollbar { display: none; }

.polaroid {
  flex: 0 0 74vw;
  max-width: 310px;
  scroll-snap-align: center;
  background: var(--cream);
  padding: 10px 10px 38px;
  border-radius: 4px;
  transform: rotate(var(--tilt, 0deg));
  box-shadow:
    0 4px 14px rgba(0,0,0,.30),
    0 18px 50px rgba(0,0,0,.28);
  transition: transform .35s cubic-bezier(.16,1,.3,1);
}
.polaroid:active { transform: rotate(var(--tilt, 0deg)) scale(.98); }
.polaroid img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  display: block;
  border-radius: 2px;
}
.caption {
  display: block;
  text-align: center;
  color: #3a352e;
  margin-top: 10px;
  font-size: 17px;
}
.swipe-hint {
  text-align: center;
  font-size: 12px;
  color: var(--text-faint);
  animation: pulse 2.5s ease-in-out infinite;
}

/* Final actions */
.final-btns {
  display: grid; gap: 12px;
  padding: 28px 18px 0;
}

/* Footer */
.footer-msg {
  text-align: center;
  font-size: 14px;
  color: var(--text-soft);
  min-height: 22px;
  padding: 16px 20px 0;
  line-height: 1.5;
}
.made-with {
  text-align: center;
  color: var(--text-faint);
  font-size: 14px;
  padding: 24px 0 40px;
}

/* ═══════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════ */
.modal {
  border: none; background: transparent;
  padding: 0; max-width: 100vw;
}
.modal::backdrop {
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.modal__inner {
  width: min(360px, calc(100vw - 48px));
  margin: 28vh auto 0;
  padding: 24px;
  border-radius: 22px;
  border: 1px solid var(--card-border);
  background: linear-gradient(180deg, rgba(14,13,22,.98), rgba(8,7,14,.98));
  box-shadow: 0 30px 90px rgba(0,0,0,.6);
}
.modal__inner h3 {
  font-size: 24px; margin: 0 0 8px;
}
.modal__inner p {
  color: var(--text-soft);
  font-size: 15px; line-height: 1.6;
  margin: 0 0 18px;
}

/* ═══════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════ */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes letterIn {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}
@keyframes pulse {
  0%, 100% { opacity: .35; }
  50%      { opacity: .75; }
}

/* entrance class added by JS */
.anim-in {
  animation: fadeSlideUp .75s cubic-bezier(.16,1,.3,1) both;
}

/* stagger children inside birthday section */
.bday-head.anim-in     { animation-delay: 0s;    }
.wish-stack.anim-in    { animation-delay: .15s;   }
.gallery-section.anim-in { animation-delay: .25s; }
.final-btns.anim-in    { animation-delay: .35s;   }

/* ═══════════════════════════════════════════════════
   REDUCED MOTION
   ═══════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0s !important;
    transition-duration: 0s !important;
  }
}
