/* ==========================================================================
   MANGALMAY WEDDING ANIMATION — 3-LAYER PHERAS SCENE (MATCHING REFERENCE IMAGE 1)
   - Layer 1 (Background): Falling Rose Petals responding to scroll
   - Layer 2 (Middle): Couple walking smoothly with scroll
   - Layer 3 (Foreground): Stable Havan Kund with burning holy fire
   - Clean floating stage with no square box
   ========================================================================== */

/* Completely eliminate square box, white borders, and background card */
html, body {
  overflow-x: hidden !important;
  max-width: 100vw !important;
  width: 100% !important;
}

.hero,
.site-header,
.how-it-works-section,
.search-panel,
.section,
.site-footer {
  box-sizing: border-box !important;
  max-width: 100% !important;
}

.hero > .container {
  z-index: auto !important;
}

.hero .hero-inner .hero-visual,
.hero .hero-visual,
.hero-visual {
  background: transparent !important;
  background-image: none !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  min-height: auto !important;
  padding: 0 !important;
  overflow: visible !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative !important;
}

.hero .hero-inner .hero-visual:before,
.hero .hero-visual:before,
.hero-visual:before {
  display: none !important;
  content: none !important;
}

.hero-visual-card {
  display: none !important;
}

/* Master Clean Stage Container (Dynamically scales to fit right-side visual area) */
.pheras-clean-stage {
  position: relative;
  width: 100%;
  max-width: 980px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  user-select: none;
}

/* Increase Hero Grid allocation, shift hero content to right, and add generous breathing room */
@media (min-width: 993px) {
  .hero > .container {
    max-width: 1480px !important;
    padding-left: clamp(54px, 5.5vw, 92px) !important;
    padding-right: 28px !important;
  }
  .hero .hero-inner {
    grid-template-columns: minmax(490px, 0.92fr) minmax(480px, 1.38fr) !important;
    gap: 36px !important;
    align-items: center !important;
  }
  .hero-copy {
    min-width: 480px !important;
    max-width: 590px !important;
  }
  .hero-visual {
    justify-content: flex-end !important;
  }
  .pheras-clean-stage {
    margin-left: auto !important;
    margin-right: -20px !important;
  }
}

/* Scene Wrapper */
.pheras-scene-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Soft Mandala Watermark behind the scene */
.mandala-watermark {
  position: absolute;
  top: 10%;
  right: 5%;
  width: 500px;
  height: 500px;
  background-image: radial-gradient(circle, rgba(201, 162, 74, 0.12) 0%, rgba(143, 22, 54, 0.05) 50%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

/* Interactive 3D Rose Petals Stage (Responds to Cursor & Scroll) */
.petals-3d-stage {
  position: absolute;
  inset: 0;
  pointer-events: none;
  perspective: 900px;
  transform-style: preserve-3d;
  overflow: hidden;
  z-index: 5;
}

.petal-3d {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  will-change: transform;
  transform-style: preserve-3d;
  backface-visibility: visible;
}

.petal-shape {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 4px 12px rgba(136, 19, 55, 0.25));
  display: block;
}

/* Pheras Video Frames Layer (Dynamically resized and enlarged to fit the area) */
.pheras-canvas-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.phere-video-frame,
.phere-video-canvas {
  width: 100%;
  height: auto;
  max-height: none;
  aspect-ratio: 16 / 9;
  display: block;
  mix-blend-mode: multiply;
  transform: scale(1.24);
  transform-origin: center center;
}

/* Accessibility: prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .petals-falling-container {
    animation: none !important;
  }
}

/* Responsive Breakpoints & Mobile Layout Optimization */
@media (max-width: 992px) {
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    width: 100% !important;
  }

  .site-header {
    width: 100% !important;
    max-width: 100vw !important;
    height: 64px !important;
    min-height: 64px !important;
    overflow: visible !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 10000 !important;
  }

  .site-header > .container {
    height: 64px !important;
    min-height: 64px !important;
    position: relative !important;
    overflow: visible !important;
  }

  .main-nav {
    position: absolute !important;
    top: 64px !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    bottom: auto !important;
    height: auto !important;
    min-height: auto !important;
    max-height: calc(100vh - 70px) !important;
    overflow-y: auto !important;
    background: #ffffff !important;
    box-shadow: 0 14px 35px rgba(60, 20, 30, 0.16) !important;
    border-bottom: 3px solid #a01937 !important;
    display: none !important;
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 16px 20px !important;
    gap: 6px !important;
    z-index: 99999 !important;
    transform: none !important;
    box-sizing: border-box !important;
  }

  .main-nav.open {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: none !important;
    animation: sjNavDrop 0.22s ease-out !important;
  }

  .main-nav a {
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 12px 16px !important;
    border-radius: 10px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #2b2320 !important;
    min-height: 44px !important;
  }

  .main-nav a:hover,
  .main-nav a.active {
    background: #fdf2f4 !important;
    color: #a01937 !important;
  }

  .hero {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    padding: 28px 0 36px !important;
  }

  .hero > .container {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
  }

  .hero .hero-inner {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: 1fr !important;
    width: 100% !important;
    max-width: 100% !important;
    gap: 20px !important;
    box-sizing: border-box !important;
  }

  .hero-copy {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .hero-eyebrow {
    font-size: 12px !important;
    letter-spacing: 0.08em !important;
    margin-bottom: 12px !important;
  }

  .hero h1 {
    font-size: clamp(26px, 6.5vw, 36px) !important;
    line-height: 1.15 !important;
    letter-spacing: -0.02em !important;
    margin: 0 0 14px 0 !important;
    max-width: 100% !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
  }

  .hero h1 em {
    display: inline !important;
  }

  .hero p.lead,
  .hero .lead {
    font-size: clamp(14px, 3.8vw, 16px) !important;
    line-height: 1.55 !important;
    max-width: 100% !important;
    margin: 0 0 20px 0 !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
  }

  .hero-cta {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-top: 20px !important;
  }

  .hero .btn {
    height: 46px !important;
    padding: 0 20px !important;
    font-size: 14px !important;
    box-sizing: border-box !important;
  }

  .hero-stats {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 16px 24px !important;
    margin-top: 24px !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .hero-stats div strong {
    font-size: 1.5rem !important;
  }

  .hero-stats div span {
    font-size: 0.8rem !important;
  }

  .hero-visual {
    width: 100% !important;
    max-width: 100% !important;
    margin-top: 6px !important;
    justify-content: center !important;
  }

  .pheras-clean-stage {
    width: 100% !important;
    max-width: 540px !important;
    margin: 0 auto !important;
    transform: none !important;
  }

  .pheras-scene-wrapper {
    width: 100% !important;
    aspect-ratio: 16 / 9 !important;
    min-height: auto !important;
  }

  .mandala-watermark {
    width: 320px !important;
    height: 320px !important;
    top: 5% !important;
    right: 5% !important;
  }

  .phere-video-frame,
  .phere-video-canvas {
    width: 100% !important;
    height: auto !important;
    transform: scale(1.08) !important;
    transform-origin: center center !important;
  }
}

@media (max-width: 768px) {
  .site-header {
    width: 100% !important;
    max-width: 100vw !important;
    height: 64px !important;
    min-height: 64px !important;
    overflow: visible !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 10000 !important;
  }

  .site-header > .container {
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 64px !important;
    min-height: 64px !important;
    padding: 0 12px !important;
    position: relative !important;
    overflow: visible !important;
    box-sizing: border-box !important;
  }

  .brand {
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
  }

  .brand-logo {
    width: 90px !important;
    height: 28px !important;
    object-fit: contain !important;
  }

  .header-actions {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin-left: auto !important;
    flex-shrink: 0 !important;
  }

  select.ud-lang-selector,
  .header-actions select.ud-lang-selector,
  .ud-header-actions select.ud-lang-selector,
  .ud-lang-selector {
    display: inline-flex !important;
  }

  .header-actions #headerAuthSlot {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
  }

  .header-actions #headerAuthSlot .header-login-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 32px !important;
    min-height: 32px !important;
    padding: 0 10px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    border-radius: 999px !important;
    white-space: nowrap !important;
    border: 1.5px solid #b51e3d !important;
    color: #8f1636 !important;
    background: #ffffff !important;
    box-sizing: border-box !important;
  }

  .header-actions #headerAuthSlot .header-login-btn:hover {
    background: #fdf2f4 !important;
    color: #8f1636 !important;
  }

  .header-actions #headerAuthSlot .header-register-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 32px !important;
    min-height: 32px !important;
    padding: 0 10px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    border-radius: 999px !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
  }

  .nav-toggle {
    display: inline-flex !important;
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    border-radius: 8px !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 16px !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    z-index: 10001 !important;
    user-select: none !important;
  }

  .hero {
    padding: 22px 0 30px !important;
  }

  .hero > .container {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  .hero h1 {
    font-size: clamp(22px, 6.5vw, 28px) !important;
    line-height: 1.18 !important;
  }

  .hero p.lead,
  .hero .lead {
    font-size: 14px !important;
    line-height: 1.5 !important;
  }

  .hero-cta {
    display: flex !important;
    flex-direction: column !important;
    gap: 9px !important;
    width: 100% !important;
    max-width: 340px !important;
  }

  .hero-cta .btn {
    width: 100% !important;
    justify-content: center !important;
    height: 46px !important;
    padding: 0 16px !important;
    font-size: 14px !important;
  }

  .hero-stats {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 10px !important;
    margin-top: 22px !important;
    width: 100% !important;
  }

  .hero-stats div strong {
    font-size: 1.3rem !important;
  }

  .hero-stats div span {
    font-size: 0.75rem !important;
    line-height: 1.25 !important;
  }

  .pheras-clean-stage {
    max-width: 100% !important;
  }

  .mandala-watermark {
    width: 260px !important;
    height: 260px !important;
  }

  .phere-video-frame,
  .phere-video-canvas {
    transform: scale(1.04) !important;
  }
}
