/* ============================================
   TOKENS
   ============================================ */
:root {
  --bg: #0F172A;
  --bg-alt: #111827;
  --cream: #F8F5EF;
  --gold: #D4AF37;
  --rose: #C08497;
  --white: #FFFFFF;

  --text-primary: var(--cream);
  --text-muted: rgba(248, 245, 239, 0.62);
  --text-faint: rgba(248, 245, 239, 0.4);

  --font-display: 'Playfair Display', serif;
  --font-script: 'Cormorant Garamond', serif;
  --font-body: 'Poppins', sans-serif;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-section: 0.9s;
  --dur-fast: 0.4s;

  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 40px;
  --space-5: 64px;

  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 28px;

  --tap-min: 44px;
}

/* ============================================
   RESET
   ============================================ */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100svh;
  background: radial-gradient(120% 100% at 50% 0%, #16213a 0%, var(--bg) 55%, var(--bg-alt) 100%);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
}

ul, ol { list-style: none; margin: 0; padding: 0; }
p { margin: 0; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ============================================
   BACKGROUND CANVAS
   ============================================ */
#stars {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ============================================
   PROGRESS DOTS
   ============================================ */
.progress {
  position: fixed;
  top: env(safe-area-inset-top, 0px);
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  justify-content: center;
  padding-top: var(--space-2);
  pointer-events: none;
}

.progress__dots {
  display: flex;
  gap: 7px;
  padding: 6px 10px;
}

.progress__dots li {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(248, 245, 239, 0.22);
  transition: background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease), width var(--dur-fast) var(--ease);
}

.progress__dots li.is-active {
  background: var(--gold);
  width: 16px;
  border-radius: 3px;
}

.progress__dots li.is-done {
  background: rgba(212, 175, 55, 0.55);
}

/* ============================================
   MUSIC BUTTON
   ============================================ */
.music-btn {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
  right: 20px;
  z-index: 40;
  width: var(--tap-min);
  height: var(--tap-min);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(248, 245, 239, 0.06);
  border: 1px solid rgba(212, 175, 55, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--gold);
  transition: background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}

.music-btn:active { transform: scale(0.92); }
.music-btn.is-playing { background: rgba(212, 175, 55, 0.14); }

/* ============================================
   LAYOUT / SCREENS
   ============================================ */
#app {
  position: relative;
  z-index: 1;
}

.screen {
  position: fixed;
  inset: 0;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5) var(--space-3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(18px) scale(0.99);
  filter: blur(6px);
  transition:
    opacity var(--dur-section) var(--ease),
    transform var(--dur-section) var(--ease),
    filter var(--dur-section) var(--ease),
    visibility 0s linear var(--dur-section);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.screen.is-active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  filter: blur(0);
  transition:
    opacity var(--dur-section) var(--ease),
    transform var(--dur-section) var(--ease),
    filter var(--dur-section) var(--ease),
    visibility 0s linear;
  position: relative;
}

.screen__inner {
  position: relative;
  width: 100%;
  max-width: 560px;
  margin: auto;
  text-align: center;
  padding-block: var(--space-4);
}

.screen--wide .screen__inner { max-width: 720px; }

.screen--dark { background: var(--bg-alt); }
.screen--end { background: radial-gradient(120% 100% at 50% 100%, #16213a 0%, var(--bg) 60%); }

/* ============================================
   TYPE
   ============================================ */
.eyebrow {
  font-family: var(--font-script);
  font-style: italic;
  font-size: clamp(1.05rem, 4vw, 1.3rem);
  color: var(--rose);
  letter-spacing: 0.02em;
  margin-bottom: var(--space-3);
}

.eyebrow--soft { color: var(--text-faint); font-style: normal; letter-spacing: 0.18em; text-transform: uppercase; font-size: 0.75rem; font-family: var(--font-body); }

.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.9rem, 7vw, 2.7rem);
  line-height: 1.2;
  margin-bottom: var(--space-3);
  color: var(--white);
}

.section-title--script {
  font-family: var(--font-script);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(2.4rem, 9vw, 3.6rem);
  color: var(--gold);
}

.section-text {
  font-size: clamp(0.98rem, 3.6vw, 1.08rem);
  color: var(--text-muted);
  max-width: 46ch;
  margin: 0 auto var(--space-2);
}

.section-text--emphasis {
  color: var(--cream);
  font-family: var(--font-script);
  font-style: italic;
  font-size: clamp(1.2rem, 4.4vw, 1.5rem);
}

.ameen {
  color: var(--gold);
  font-family: var(--font-script);
  font-style: italic;
  font-size: clamp(1.3rem, 4.5vw, 1.6rem);
  margin-top: var(--space-3);
}

.final-signoff {
  font-family: var(--font-script);
  font-style: italic;
  font-size: clamp(1.6rem, 6vw, 2.1rem);
  color: var(--white);
  margin-top: var(--space-4);
}

.final-signature {
  font-family: var(--font-display);
  color: var(--gold);
  margin-top: var(--space-1);
  letter-spacing: 0.04em;
}

.end-line {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 5.2vw, 1.9rem);
  color: var(--white);
  margin-bottom: var(--space-2);
}

.end-line--soft {
  font-family: var(--font-script);
  font-style: italic;
  color: var(--rose);
  font-size: clamp(1.1rem, 4.4vw, 1.4rem);
}

/* Reveal-on-view text */
[data-reveal] {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.screen.is-active [data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   OPENING SCREEN
   ============================================ */
.opening__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.1rem, 8vw, 3rem);
  line-height: 1.25;
  color: var(--white);
  margin-bottom: var(--space-2);
}

.opening__sub {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap-min);
  padding: 14px 30px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: transform var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}

.btn:active { transform: scale(0.97); }

.btn--primary {
  background: linear-gradient(135deg, var(--gold), #b8912b);
  color: #1a1408;
  box-shadow: 0 8px 24px rgba(212, 175, 55, 0.22);
}
.btn--primary:hover { box-shadow: 0 10px 30px rgba(212, 175, 55, 0.32); }

.btn--ghost {
  margin-top: var(--space-4);
  background: rgba(248, 245, 239, 0.04);
  border: 1px solid rgba(212, 175, 55, 0.4);
  color: var(--cream);
}
.btn--ghost:hover { background: rgba(212, 175, 55, 0.1); border-color: var(--gold); }

.reveal-btn { margin-top: var(--space-3); }

.restart-btn { margin-top: var(--space-5); }

/* ============================================
   QUALITY CARDS
   ============================================ */
.cards {
  display: grid;
  gap: var(--space-2);
  text-align: left;
  margin-top: var(--space-3);
}

.card {
  position: relative;
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: rgba(248, 245, 239, 0.04);
  border: 1px solid rgba(212, 175, 55, 0.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease), border-color var(--dur-fast) var(--ease);
}

.card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.card:hover { border-color: rgba(212, 175, 55, 0.45); }

.card__index {
  font-family: var(--font-display);
  color: var(--gold);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  margin-bottom: 6px;
  display: block;
}

.card__title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--white);
  margin-bottom: 6px;
}

.card__desc {
  font-size: 0.92rem;
  color: var(--text-muted);
}

/* ============================================
   GIFT CARDS
   ============================================ */
.gift-card {
  margin: var(--space-3) auto 0;
  max-width: 320px;
  padding: var(--space-3);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(248, 245, 239, 0.06), rgba(248, 245, 239, 0.02));
  border: 1px solid rgba(212, 175, 55, 0.25);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: cardReveal 0.8s var(--ease);
}

@keyframes cardReveal {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.gift-card__image-wrap {
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: rgba(0,0,0,0.2);
  margin-bottom: var(--space-2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.gift-card__image { width: 100%; height: 100%; object-fit: cover; }

.gift-card__eyebrow {
  font-family: var(--font-script);
  font-style: italic;
  color: var(--rose);
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.gift-card__title {
  font-family: var(--font-display);
  color: var(--white);
  font-size: 1.15rem;
}

.gift-card__meta {
  color: var(--text-faint);
  font-size: 0.85rem;
  margin-top: 4px;
}

/* ============================================
   CRESCENT MOON DECOR
   ============================================ */
.crescent {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-3);
  border-radius: 50%;
  box-shadow: 14px -4px 0 2px var(--gold);
  transform: rotate(-24deg);
  opacity: 0.85;
}

.crescent--small { width: 40px; height: 40px; box-shadow: 9px -3px 0 1px var(--rose); }

.screen--dua .screen__inner,
.screen--nikah .screen__inner {
  position: relative;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .screen__inner { padding-block: var(--space-3); }
  .btn--ghost { margin-top: var(--space-3); }
}

@media (min-width: 769px) {
  .screen__inner { max-width: 620px; }
  .screen--wide .screen__inner { max-width: 800px; }
  .cards { grid-template-columns: 1fr 1fr; }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    transition-duration: 0.001s !important;
    scroll-behavior: auto !important;
  }
}
