/* ===== CSS Custom Properties ===== */
:root {
  --gold: #d4a853;
  --gold-light: #f0d48a;
  --gold-dark: #b08930;
  --maroon: #1a0a0a;
  --maroon-light: #2d1515;
  --cream: #faf3e0;
  --cream-dark: #f0e6c8;
  --marigold: #e8871e;
  --rose: #c94c5a;

  --font-script: 'Great Vibes', cursive;
  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body: 'Montserrat', 'Segoe UI', sans-serif;

  --fs-xs: clamp(0.7rem, 1.5vw, 0.85rem);
  --fs-sm: clamp(0.85rem, 2vw, 1rem);
  --fs-base: clamp(1rem, 2.5vw, 1.15rem);
  --fs-md: clamp(1.1rem, 3vw, 1.35rem);
  --fs-lg: clamp(1.5rem, 4vw, 2rem);
  --fs-xl: clamp(2rem, 6vw, 3rem);
  --fs-xxl: clamp(2.5rem, 8vw, 4rem);
}

/* ===== Reset ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--maroon);
  color: var(--cream);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.content-revealed {
  overflow-y: auto;
  overflow-x: hidden;
}

.hidden {
  display: none !important;
}

/* ===== Loading Screen ===== */
#loading-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--maroon);
  transition: opacity 0.6s ease;
}

#loading-screen.fade-out {
  opacity: 0;
  pointer-events: none;
}

.mandala-spinner {
  margin-bottom: 1.5rem;
}

.loading-text {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: var(--fs-sm);
  color: var(--gold);
  letter-spacing: 0.1em;
}

/* ===== WebGL Fallback ===== */
#webgl-fallback {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--maroon);
  text-align: center;
  padding: 2rem;
}

.fallback-title {
  font-family: var(--font-heading);
  font-size: var(--fs-xxl);
  color: var(--cream);
  margin-bottom: 1rem;
}

.gold-text {
  color: var(--gold);
}

.fallback-content p {
  font-size: var(--fs-base);
  color: var(--gold);
  line-height: 1.6;
}

/* ===== Canvas Container ===== */
#canvas-container {
  position: fixed;
  inset: 0;
  z-index: 1;
}

#canvas-container canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

/* ===== Names Overlay ===== */
#names-overlay {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  gap: clamp(8rem, 30vh, 16rem);
}

#names-overlay .name-top,
#names-overlay .name-bottom {
  font-family: var(--font-heading);
  font-size: var(--fs-xxl);
  font-weight: 700;
  color: var(--gold-light);
  letter-spacing: 0.25em;
  text-shadow: 0 0 20px rgba(212, 168, 83, 0.4), 0 2px 4px rgba(0,0,0,0.5);
  text-align: center;
}

/* Tap-here hint */
.tap-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  animation: tapPulse 2s ease-in-out infinite;
}

.tap-hint span {
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: 400;
  color: var(--gold);
  letter-spacing: 0.08em;
  text-shadow: 0 0 10px rgba(212, 168, 83, 0.3);
}

.tap-hint__icon {
  color: var(--gold);
  flex-shrink: 0;
}

@keyframes tapPulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

/* ===== Audio Toggle ===== */
#audio-toggle {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 100;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  background: rgba(26, 10, 10, 0.85);
  color: var(--gold);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s, transform 0.2s;
  backdrop-filter: blur(4px);
}

#audio-toggle:hover {
  background: rgba(212, 168, 83, 0.2);
  transform: scale(1.1);
}

#audio-toggle:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

#audio-toggle.muted .speaker-on {
  display: none;
}

#audio-toggle.muted .speaker-off {
  display: block;
}

#audio-toggle:not(.muted) .speaker-on {
  display: block;
}

#audio-toggle:not(.muted) .speaker-off {
  display: none;
}

/* ===== Invitation Overlay ===== */
#invitation-overlay {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  opacity: 0;
  pointer-events: none;
  display: flex;
  justify-content: center;
  padding: clamp(2rem, 5vw, 4rem) clamp(1rem, 4vw, 2rem);
  background: linear-gradient(
    180deg,
    rgba(250, 243, 224, 0) 0%,
    rgba(250, 243, 224, 0.95) 3%,
    var(--cream) 8%,
    var(--cream) 92%,
    rgba(250, 243, 224, 0.95) 97%,
    rgba(250, 243, 224, 0) 100%
  );
}

#invitation-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.invitation-content {
  max-width: 600px;
  width: 100%;
  text-align: center;
  padding-top: 2rem;
  padding-bottom: 4rem;
}

/* ===== Invitation Sections ===== */
.inv-section {
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
  opacity: 0;
  transform: translateY(30px);
}

.inv-section.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Blessing */
.ornament-top {
  display: block;
  margin: 0 auto 1rem;
  opacity: 0.7;
}

.blessing-text {
  font-family: var(--font-script);
  font-size: var(--fs-lg);
  color: var(--maroon);
  line-height: 1.6;
}

/* Couple */
.couple-name {
  font-family: var(--font-heading);
  font-size: var(--fs-xxl);
  font-weight: 700;
  color: var(--maroon);
  letter-spacing: 0.15em;
  margin: 0.5rem 0 0.25rem;
}

.parent-names {
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: 300;
  color: #5a3a2a;
  margin-bottom: 0.5rem;
}

.with-text {
  font-family: var(--font-script);
  font-size: var(--fs-lg);
  color: var(--gold-dark);
  margin: 0.75rem 0;
}

/* Date */
.date-text {
  font-family: var(--font-heading);
  font-size: var(--fs-md);
  color: var(--maroon);
  letter-spacing: 0.05em;
}

.date-text strong {
  font-size: var(--fs-lg);
  color: var(--maroon);
}

/* Programme */
.section-heading {
  font-family: var(--font-heading);
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--maroon);
  letter-spacing: 0.2em;
  margin-bottom: 1.25rem;
}

/* ===== Thematic Event Cards ===== */
.event-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1rem, 3vw, 1.5rem);
  margin-top: 1rem;
}

.event-card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  padding: clamp(1.5rem, 4vw, 2.5rem) clamp(1rem, 3vw, 1.5rem);
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.event-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

/* Haldi Card — warm yellows, turmeric oranges */
.event-card--haldi {
  background: linear-gradient(145deg, #fff9e6 0%, #fff3cc 30%, #ffeaa0 100%);
  border: 1.5px solid rgba(232, 135, 30, 0.25);
}

/* Wedding Card — deep crimson, rich gold, royal feel */
.event-card--wedding {
  background: linear-gradient(145deg, #1a0a0a 0%, #2d0f0f 40%, #3a1520 100%);
  border: 1.5px solid rgba(212, 168, 83, 0.3);
}

/* Background animations container */
.event-card__bg-anim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

/* Turmeric splash bursts — Haldi card */
.turmeric-burst {
  position: absolute;
  opacity: 0;
  animation: turmericPulse 3s ease-in-out infinite;
}

.burst-1 {
  top: 10%;
  right: 5%;
  animation-delay: 0s;
}

.burst-2 {
  bottom: 15%;
  left: 8%;
  animation-delay: 1s;
}

.burst-3 {
  top: 50%;
  right: 30%;
  animation-delay: 2s;
}

@keyframes turmericPulse {
  0%, 100% { opacity: 0; transform: scale(0.6); }
  50% { opacity: 1; transform: scale(1.1); }
}

/* Marigold garland */
.marigold-garland {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 40px;
  animation: garlandSway 4s ease-in-out infinite;
}

@keyframes garlandSway {
  0%, 100% { transform: translateX(-3px); }
  50% { transform: translateX(3px); }
}

/* Diya flames — Wedding card */
.diya {
  position: absolute;
  opacity: 0;
  animation: diyaGlow 2.5s ease-in-out infinite;
}

.diya-1 {
  bottom: 8%;
  left: 10%;
  animation-delay: 0s;
}

.diya-2 {
  bottom: 12%;
  right: 12%;
  animation-delay: 0.8s;
}

.diya-3 {
  bottom: 5%;
  left: 45%;
  animation-delay: 1.6s;
}

@keyframes diyaGlow {
  0%, 100% { opacity: 0.5; transform: scale(0.95); }
  50% { opacity: 1; transform: scale(1.05); }
}

/* Card content */
.event-card__content {
  position: relative;
  z-index: 1;
  text-align: center;
}

.event-card__icon {
  display: block;
  margin: 0 auto 1rem;
}

/* Haldi title — playful elegant script */
.event-card__title--haldi {
  font-family: var(--font-script);
  font-size: var(--fs-xl);
  color: #7a5500;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

/* Wedding title — regal serif */
.event-card__title--wedding {
  font-family: var(--font-heading);
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--gold-light);
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.event-card--haldi .event-card__time {
  font-family: var(--font-body);
  font-size: var(--fs-md);
  font-weight: 500;
  color: #9a6800;
}

.event-card--wedding .event-card__time {
  font-family: var(--font-body);
  font-size: var(--fs-md);
  font-weight: 400;
  color: var(--gold);
  letter-spacing: 0.05em;
}

/* ===== Contact / RSVP ===== */
.contact-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.75rem;
}

.contact-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--gold-dark);
  text-decoration: none;
  border: 1.5px solid var(--gold);
  border-radius: 999px;
  padding: 0.6rem 1.5rem;
  transition: background 0.3s, color 0.3s, transform 0.2s;
}

.contact-pill:hover {
  background: var(--gold);
  color: var(--maroon);
  transform: scale(1.05);
}

.contact-pill:focus-visible {
  outline: 2px solid var(--gold-dark);
  outline-offset: 3px;
}

/* ===== Footer ===== */
#site-footer {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 1.5rem 1rem 2rem;
  background: var(--maroon);
}

#site-footer p {
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: 300;
  color: rgba(250, 243, 224, 0.45);
  letter-spacing: 0.05em;
}

#site-footer a {
  color: var(--gold);
  text-decoration: none;
  font-weight: 400;
  transition: color 0.3s;
}

#site-footer a:hover {
  color: var(--gold-light);
}

/* Venue */
.venue-name {
  font-family: var(--font-heading);
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--maroon);
  margin-bottom: 0.5rem;
}

.venue-address {
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: 300;
  color: #5a3a2a;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.maps-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--gold-dark);
  text-decoration: none;
  border: 1.5px solid var(--gold);
  border-radius: 999px;
  padding: 0.5rem 1.25rem;
  transition: background 0.3s, color 0.3s;
}

.maps-link:hover {
  background: var(--gold);
  color: var(--maroon);
}

.maps-link:focus-visible {
  outline: 2px solid var(--gold-dark);
  outline-offset: 3px;
}

/* Hosts */
.host-name {
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: 400;
  color: var(--maroon);
  margin-bottom: 0.35rem;
}

.relation {
  font-weight: 300;
  color: #5a3a2a;
}

/* Compliments */
.compliments-label {
  font-family: var(--font-script);
  font-size: var(--fs-md);
  color: var(--gold-dark);
  margin-bottom: 0.25rem;
}

.compliments-text {
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: 400;
  color: var(--maroon);
}

/* Ornament Dividers */
.ornament-divider {
  display: flex;
  justify-content: center;
  margin: clamp(1rem, 2vw, 1.5rem) 0;
  opacity: 0;
  transform: translateY(20px);
}

.ornament-divider.revealed {
  opacity: 0.6;
  transform: translateY(0);
}

.ornament-bottom {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
  opacity: 0;
}

.ornament-bottom.revealed {
  opacity: 0.5;
}

/* ===== Responsive Breakpoints ===== */
@media (max-width: 480px) {
  #names-overlay {
    gap: clamp(6rem, 25vh, 10rem);
  }

  .invitation-content {
    padding-top: 1rem;
  }

  .event-cards {
    grid-template-columns: 1fr;
  }

  .event-card {
    min-height: 220px;
  }
}

@media (min-width: 481px) and (max-width: 768px) {
  #names-overlay {
    gap: clamp(8rem, 28vh, 12rem);
  }

  .event-cards {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (min-width: 769px) {
  .invitation-content {
    max-width: 720px;
  }
}

@media (min-width: 1024px) {
  .invitation-content {
    max-width: 780px;
  }
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
  .mandala-spinner circle animateTransform {
    animation: none;
  }

  .inv-section,
  .ornament-divider,
  .ornament-bottom {
    opacity: 1;
    transform: none;
    transition: none;
  }

  #invitation-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  .turmeric-burst,
  .diya {
    animation: none;
    opacity: 0.5;
  }

  .marigold-garland {
    animation: none;
  }

  .event-card {
    transition: none;
  }
}
