/* ==========================================================================
   Global luxury cinematic enhancements
   Progressive enhancement — usable without JS
   ========================================================================== */

/* JS gate: hide motion-only UI until enhanced */
html:not(.js) .site-loader,
html:not(.js) .scroll-progress,
html:not(.js) .back-to-top,
html:not(.js) .cursor-dot,
html:not(.js) .cursor-ring,
html:not(.js) .lux-petals {
  display: none !important;
}

/* Applied only after enhancement boots (avoids blank first paint) */
html.js.is-enhanced .lux-reveal {
  opacity: 0;
  transform: translateY(28px);
  will-change: opacity, transform;
}

html:not(.is-enhanced) .lux-reveal,
html.reduce-motion .lux-reveal {
  opacity: 1 !important;
  transform: none !important;
}

html.js.is-enhanced .lux-clip {
  clip-path: inset(100% 0 0 0);
  will-change: clip-path;
}

html:not(.is-enhanced) .lux-clip,
html.reduce-motion .lux-clip {
  clip-path: none !important;
}

/* Loading screen --------------------------------------------------------- */
.site-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: #0a0406;
  color: var(--color-champagne);
  transition: opacity 0.7s var(--ease-lux), visibility 0.7s;
}

.site-loader.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.site-loader-inner {
  text-align: center;
}

.site-loader-svg {
  width: 88px;
  height: 88px;
  margin: 0 auto 1rem;
}

.site-loader-svg .ring {
  fill: none;
  stroke: var(--color-gold);
  stroke-width: 0.8;
  transform-origin: 60px 60px;
  animation: loaderSpin 2.8s linear infinite;
}

.site-loader-svg .ring--mid {
  stroke: var(--color-gold-light);
  opacity: 0.55;
  animation-duration: 3.6s;
  animation-direction: reverse;
}

.site-loader-svg .mark {
  fill: var(--color-gold);
  opacity: 0.9;
}

.site-loader-label {
  margin: 0;
  font-family: var(--font-script);
  font-size: 1.55rem;
  color: var(--color-gold-light);
}

.site-loader-sub {
  margin: 0.4rem 0 0;
  font-size: 0.65rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(245, 230, 200, 0.45);
}

@keyframes loaderSpin {
  to { transform: rotate(360deg); }
}

/* Scroll progress -------------------------------------------------------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 200;
  width: 100%;
  height: 2px;
  pointer-events: none;
  background: transparent;
}

.scroll-progress-bar {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--color-maroon), var(--color-gold), var(--color-gold-light));
  transform-origin: left center;
  will-change: width;
}

/* Back to top ------------------------------------------------------------ */
.back-to-top {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  z-index: 90;
  width: 2.65rem;
  height: 2.65rem;
  border: 1px solid rgba(201, 168, 76, 0.55);
  background: rgba(250, 246, 239, 0.92);
  color: var(--color-maroon);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition:
    opacity 0.35s var(--ease-out),
    visibility 0.35s,
    transform 0.35s var(--ease-out),
    background 0.25s;
  touch-action: manipulation;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--color-maroon);
  color: var(--color-champagne);
  border-color: var(--color-maroon);
}

.back-to-top span {
  display: block;
  font-size: 1.1rem;
  line-height: 1;
}

/* Custom cursor (desktop pointer only) ---------------------------------- */
@media (hover: hover) and (pointer: fine) {
  html.has-cursor,
  html.has-cursor * {
    cursor: none !important;
  }

  .cursor-dot,
  .cursor-ring {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10000;
    pointer-events: none;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.25s ease;
  }

  html.has-cursor .cursor-dot,
  html.has-cursor .cursor-ring {
    opacity: 1;
  }

  .cursor-dot {
    width: 6px;
    height: 6px;
    background: var(--color-gold);
    mix-blend-mode: difference;
  }

  .cursor-ring {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(201, 168, 76, 0.65);
    transition:
      width 0.25s var(--ease-out),
      height 0.25s var(--ease-out),
      border-color 0.25s,
      opacity 0.25s;
  }

  html.has-cursor.is-hovering .cursor-ring {
    width: 52px;
    height: 52px;
    border-color: rgba(245, 230, 200, 0.85);
  }
}

/* Floating petals (subtle, few) ----------------------------------------- */
.lux-petals {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  overflow: hidden;
}

.lux-petal {
  position: absolute;
  top: -24px;
  width: var(--petal-size, 10px);
  height: calc(var(--petal-size, 10px) * 1.35);
  border-radius: 60% 40% 60% 40%;
  background: linear-gradient(145deg, #c45c6a, #7a2030 85%);
  opacity: 0;
  filter: blur(0.2px);
  will-change: transform, opacity;
}

/* Gold ornamental draw --------------------------------------------------- */
.lux-ornament-line {
  stroke: var(--color-gold);
  stroke-width: 1.2;
  fill: none;
  stroke-linecap: round;
}

html.js.is-enhanced .gold-rule.lux-rule {
  transform: scaleX(0.2);
  transform-origin: center;
  opacity: 0.35;
}

html.js .gold-rule.lux-rule.is-drawn {
  transform: scaleX(1);
  opacity: 1;
  transition: transform 0.9s var(--ease-lux), opacity 0.9s var(--ease-lux);
}

/* Section + typography polish ------------------------------------------- */
.section,
.story-section,
.celebrations-section,
.countdown-section,
.venue-destination,
.gallery-page {
  position: relative;
}

.lux-type {
  background-image: linear-gradient(90deg, currentColor 0%, currentColor 100%);
  background-repeat: no-repeat;
  background-size: 0% 1px;
  background-position: 0 100%;
}

html.js .lux-type.is-in {
  transition: background-size 1s var(--ease-lux);
  background-size: 100% 1px;
}

/* Nav open polish -------------------------------------------------------- */
@media (max-width: 768px) {
  .primary-nav .nav-list a {
    opacity: 0;
    transform: translateY(12px);
  }

  .primary-nav.is-open .nav-list a {
    opacity: 1;
    transform: none;
    transition:
      opacity 0.4s var(--ease-lux),
      transform 0.4s var(--ease-lux),
      color 0.2s;
  }

  .primary-nav.is-open .nav-list li:nth-child(1) a { transition-delay: 0.05s; }
  .primary-nav.is-open .nav-list li:nth-child(2) a { transition-delay: 0.09s; }
  .primary-nav.is-open .nav-list li:nth-child(3) a { transition-delay: 0.13s; }
  .primary-nav.is-open .nav-list li:nth-child(4) a { transition-delay: 0.17s; }
  .primary-nav.is-open .nav-list li:nth-child(5) a { transition-delay: 0.21s; }
  .primary-nav.is-open .nav-list li:nth-child(6) a { transition-delay: 0.25s; }
  .primary-nav.is-open .nav-list li:nth-child(7) a { transition-delay: 0.29s; }
}

/* Gallery tile transitions ---------------------------------------------- */
.gallery-tile {
  transition: opacity 0.45s var(--ease-out), transform 0.45s var(--ease-lux);
}

.gallery-tile.is-filtering-out {
  opacity: 0 !important;
  transform: scale(0.96);
  pointer-events: none;
}

.gallery-lightbox-figure img {
  transition: opacity 0.4s var(--ease-out), transform 0.5s var(--ease-lux) !important;
}

/* Lenis recommended */
html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

/* Reduced motion kill-switch -------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .site-loader,
  .lux-petals,
  .cursor-dot,
  .cursor-ring {
    display: none !important;
  }

  .site-loader-svg .ring {
    animation: none !important;
  }
}

@media (max-width: 768px) {
  .lux-petals {
    opacity: 0.65;
  }
}
