/* ==========================================================================
   Design 4 — Kalyanam (Heritage Royal Wedding Invitation) Stylesheet
   ========================================================================== */

/* ── 1. Root & Custom Properties ───────────────────────────────────────── */
:root {
  --color-maroon: #6B0F1A;
  --color-maroon-deep: #4A0810;
  --color-maroon-velvet: #3A050B;
  --color-gold: #C89B3C;
  --color-gold-bright: #D4AF37;
  --color-gold-soft: #E8D5A3;
  --color-gold-light: #FAF3E0;
  --color-ivory: #FAF7F2;
  --color-ivory-light: #FFFDF9;
  --color-ink: #231815;
  --color-ink-muted: #665952;
}

/* ── 2. Base Typography & Smooth Scrolling ─────────────────────────────── */
html {
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  max-width: 100%;
  width: 100%;
}

body {
  font-family: 'Plus Jakarta Sans', 'Jost', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--color-ink);
  background-color: var(--color-ivory);
  overflow-x: hidden;
  max-width: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
  position: relative;
}

/* ── Typography Enhancements for Royal Heritage Aesthetic ──────────────── */
.font-display {
  font-family: 'Playfair Display', 'Cormorant Garamond', Georgia, serif !important;
  letter-spacing: 0.015em;
}

.font-italiana {
  font-family: 'Playfair Display', 'Cormorant Garamond', Georgia, serif !important;
  letter-spacing: 0.015em;
}

.font-script {
  font-family: 'Great Vibes', 'Alex Brush', cursive !important;
}

.font-serif {
  font-family: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
}

/* ── 3. Luxurious Gradients & Text Effects ───────────────────────────────── */
.gold-text-gradient {
  background: linear-gradient(135deg, #DFB85C 0%, #C89B3C 50%, #9B7426 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gold-divider {
  background: linear-gradient(90deg, transparent 0%, #C89B3C 30%, #DFB85C 50%, #C89B3C 70%, transparent 100%);
  height: 1px;
}

.gold-border-glow {
  box-shadow: 0 0 20px rgba(200, 155, 60, 0.18), inset 0 0 15px rgba(200, 155, 60, 0.08);
}

.lux-card {
  background: var(--color-ivory-light);
  border: 1px solid rgba(200, 155, 60, 0.35);
  box-shadow: 0 16px 36px -8px rgba(74, 8, 16, 0.08), 0 4px 16px -2px rgba(200, 155, 60, 0.08);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.lux-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 48px -10px rgba(74, 8, 16, 0.14), 0 6px 20px rgba(200, 155, 60, 0.16);
  border-color: rgba(200, 155, 60, 0.6);
}

/* ── 4. Decorative Arch Windows & Frames ─────────────────────────────────── */
.temple-arch {
  border-top-left-radius: 120px;
  border-top-right-radius: 120px;
}
@media (min-width: 768px) {
  .temple-arch {
    border-top-left-radius: 200px;
    border-top-right-radius: 200px;
  }
}

/* ── 5. Stationery Ruled Writing Lines ──────────────────────────────────── */
.ruled-stationery {
  line-height: 38px;
  background-size: 100% 38px;
  background-image: repeating-linear-gradient(
    transparent,
    transparent 37px,
    rgba(200, 155, 60, 0.28) 37px,
    rgba(200, 155, 60, 0.28) 38px
  );
}

/* ── 6. Audio Visualizer Equalizer Sound Bars ───────────────────────────── */
.sound-bars {
  display: flex;
  align-items: flex-end;
  gap: 2.5px;
  height: 14px;
}

.sound-bar {
  width: 2px;
  background: var(--color-maroon);
  border-radius: 2px;
  transition: height 0.2s ease;
  animation: equalize 1.2s ease-in-out infinite alternate;
}

.sound-bar:nth-child(1) { height: 6px; animation-delay: 0.1s; }
.sound-bar:nth-child(2) { height: 12px; animation-delay: 0.3s; }
.sound-bar:nth-child(3) { height: 8px; animation-delay: 0.2s; }
.sound-bar:nth-child(4) { height: 14px; animation-delay: 0.4s; }

body.audio-paused .sound-bar {
  animation: none !important;
  height: 3px !important;
  opacity: 0.5;
}

@keyframes equalize {
  0% { height: 3px; }
  50% { height: 14px; }
  100% { height: 7px; }
}

/* ── Hero Desktop Background Positioning (Elevate couple faces towards top) ── */
@media (min-width: 768px) {
  .hero-bg-desktop {
    background-position: center 72% !important;
    transform: scale(1.15) translateY(-5%) !important;
    transform-origin: center center;
  }
}

/* ── Hero Auspicious Date Cartouche Plaque ──────────────────────────────── */
.hero-date-plaque {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 28px;
  background: rgba(10, 5, 6, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(200, 155, 60, 0.65);
  border-radius: 6px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.85), inset 0 0 14px rgba(200, 155, 60, 0.15);
  transition: all 0.3s ease;
}

.hero-date-plaque:hover {
  border-color: rgba(229, 184, 86, 0.9);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.9), inset 0 0 20px rgba(200, 155, 60, 0.25);
  transform: translateY(-2px);
}

/* ── Malayalam Calligraphy Accent ────────────────────────────────────────── */
.font-malayalam-calligraphy {
  font-family: 'Chilanka', 'Gayathri', cursive, serif;
  line-height: 1.25;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.95)) drop-shadow(0 0 16px rgba(229, 184, 86, 0.45));
}

/* ── 7. Subtle Entrance & Scroll Reveal Animations ────────────────────────── */
@keyframes heroFadeUp {
  0% {
    opacity: 0;
    transform: translateY(22px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes heroFadeSoft {
  0% {
    opacity: 0;
    transform: scale(0.985);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.hero-fade-up {
  opacity: 0;
  animation: heroFadeUp 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  will-change: opacity, transform;
}

.hero-fade-soft {
  opacity: 0;
  animation: heroFadeSoft 1.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  will-change: opacity, transform;
}

.hero-delay-1 { animation-delay: 0.15s; }
.hero-delay-2 { animation-delay: 0.32s; }
.hero-delay-3 { animation-delay: 0.48s; }
.hero-delay-4 { animation-delay: 0.65s; }
.hero-delay-5 { animation-delay: 0.82s; }

/* Scroll-Triggered Reveal Animations */
.reveal,
.reveal-up {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 1.1s cubic-bezier(0.16, 1, 0.3, 1), transform 1.1s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-soft {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-left {
  opacity: 0;
  transform: translateX(-24px);
  transition: opacity 1.1s cubic-bezier(0.16, 1, 0.3, 1), transform 1.1s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-right {
  opacity: 0;
  transform: translateX(24px);
  transition: opacity 1.1s cubic-bezier(0.16, 1, 0.3, 1), transform 1.1s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.96) translateY(14px);
  transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

/* Revealed State */
.reveal.revealed,
.reveal-up.revealed,
.reveal-soft.revealed,
.reveal-left.revealed,
.reveal-right.revealed,
.reveal-scale.revealed,
.reveal.in,
.reveal-up.in,
.reveal-soft.in,
.reveal-left.in,
.reveal-right.in,
.reveal-scale.in {
  opacity: 1;
  transform: translateY(0) translateX(0) scale(1);
}

/* Stagger Delays */
.delay-75 { transition-delay: 75ms; }
.delay-100 { transition-delay: 100ms; }
.delay-150 { transition-delay: 150ms; }
.delay-200 { transition-delay: 200ms; }
.delay-250 { transition-delay: 250ms; }
.delay-300 { transition-delay: 300ms; }
.delay-400 { transition-delay: 400ms; }
.delay-500 { transition-delay: 500ms; }

/* Accessibility: Respect Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal-up,
  .reveal-soft,
  .reveal-left,
  .reveal-right,
  .reveal-scale,
  .hero-fade-up,
  .hero-fade-soft {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
  }
}

/* ── 9. Review / Wish Card Carousel Styling (Per Reference Image) ──────── */
.wishes-carousel-track {
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.wishes-carousel-track.fading {
  opacity: 0;
  transform: translateY(10px);
}

.wish-review-card {
  background-color: #FFFFFF;
  border: 1px solid rgba(200, 155, 60, 0.22);
  border-radius: 1.5rem;
  padding: 1.75rem;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.3s ease;
  min-height: 250px;
}

.wish-review-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 35px -10px rgba(107, 15, 26, 0.08);
  border-color: rgba(200, 155, 60, 0.45);
}

.carousel-nav-dot {
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background-color: #D1D5DB;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  border: none;
  padding: 0;
}

.carousel-nav-dot:hover {
  background-color: #9CA3AF;
}

.carousel-nav-dot.active {
  width: 32px;
  background-color: #231815;
  border-radius: 9999px;
}

/* ── 10. Chapter 1 Behind-Image Layered Stack & Parallax ────────────────── */
#story-card-stack {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 560px;
  height: 450px;
  margin: 2.5rem auto 1rem auto;
}

@media (max-width: 640px) {
  #story-card-stack {
    height: 360px;
    max-width: 360px;
  }
}

#story-card-left,
#story-card-right,
#story-card-center {
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), 
              z-index 0.2s ease, 
              box-shadow 0.45s ease, 
              opacity 0.45s ease;
  cursor: pointer;
  transform-origin: center center;
}

/* Base positions: Center is straight, Left and Right peek out symmetrically behind */
#story-card-center {
  position: relative !important;
  z-index: 20;
  transform: translate(0, 0) rotate(0deg);
  box-shadow: 0 20px 45px -10px rgba(107, 15, 26, 0.22), 0 4px 12px rgba(0, 0, 0, 0.05);
}

#story-card-left {
  position: absolute !important;
  left: 50%;
  top: 50%;
  z-index: 10;
  transform: translate(calc(-50% - 105px), calc(-50% + 10px)) rotate(-7deg);
  box-shadow: 0 14px 30px -8px rgba(35, 24, 21, 0.16);
}

#story-card-right {
  position: absolute !important;
  left: 50%;
  top: 50%;
  z-index: 10;
  transform: translate(calc(-50% + 105px), calc(-50% + 10px)) rotate(7deg);
  box-shadow: 0 14px 30px -8px rgba(35, 24, 21, 0.16);
}

@media (max-width: 640px) {
  #story-card-left {
    transform: translate(calc(-50% - 68px), calc(-50% + 8px)) rotate(-6deg);
  }
  #story-card-right {
    transform: translate(calc(-50% + 68px), calc(-50% + 8px)) rotate(6deg);
  }
}

/* Hovering left card brings it to the front, straightens, and scales */
#story-card-left:hover,
#story-card-left.card-featured {
  z-index: 45 !important;
  transform: translate(calc(-50% - 115px), calc(-50% - 18px)) rotate(0deg) scale(1.08) !important;
  box-shadow: 0 30px 60px -12px rgba(107, 15, 26, 0.3), 0 0 0 2px rgba(200, 155, 60, 0.7) !important;
  opacity: 1 !important;
}

/* Hovering right card brings it to the front, straightens, and scales */
#story-card-right:hover,
#story-card-right.card-featured {
  z-index: 45 !important;
  transform: translate(calc(-50% + 115px), calc(-50% - 18px)) rotate(0deg) scale(1.08) !important;
  box-shadow: 0 30px 60px -12px rgba(107, 15, 26, 0.3), 0 0 0 2px rgba(200, 155, 60, 0.7) !important;
  opacity: 1 !important;
}

/* Hovering center card gently elevates it */
#story-card-center:hover,
#story-card-center.card-featured {
  z-index: 35 !important;
  transform: translate(0, -10px) scale(1.04) !important;
  box-shadow: 0 28px 56px -12px rgba(107, 15, 26, 0.28), 0 0 0 2px rgba(200, 155, 60, 0.7) !important;
  opacity: 1 !important;
}

/* Dim non-hovered / non-featured cards so the active image is crystal clear */
#story-card-stack:has(#story-card-left:hover) #story-card-center,
#story-card-stack:has(#story-card-left:hover) #story-card-right,
#story-card-stack.has-left-featured #story-card-center,
#story-card-stack.has-left-featured #story-card-right {
  opacity: 0.65 !important;
  transform: scale(0.96) !important;
}

#story-card-stack:has(#story-card-right:hover) #story-card-center,
#story-card-stack:has(#story-card-right:hover) #story-card-left,
#story-card-stack.has-right-featured #story-card-center,
#story-card-stack.has-right-featured #story-card-left {
  opacity: 0.65 !important;
  transform: scale(0.96) !important;
}

@media (max-width: 640px) {
  #story-card-left:hover,
  #story-card-left.card-featured {
    transform: translate(calc(-50% - 70px), calc(-50% - 12px)) rotate(0deg) scale(1.06) !important;
  }
  #story-card-right:hover,
  #story-card-right.card-featured {
    transform: translate(calc(-50% + 70px), calc(-50% - 12px)) rotate(0deg) scale(1.06) !important;
  }
}

/* ── 11. Vintage Parchment Texture for Inviting All Section ─────────────── */
.parchment-bg {
  background-color: #FAF4EB;
  background-image: 
    radial-gradient(ellipse at 50% 50%, rgba(255, 253, 249, 0.9) 0%, rgba(244, 236, 225, 0.75) 60%, rgba(235, 222, 205, 0.85) 100%),
    repeating-linear-gradient(45deg, rgba(200, 155, 60, 0.02) 0px, rgba(200, 155, 60, 0.02) 2px, transparent 2px, transparent 4px);
}

/* ── 12. Interactive Elements & Custom Scrollbars ───────────────────────── */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: #FAF7F2;
}
::-webkit-scrollbar-thumb {
  background: #C89B3C;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #9B7426;
}
