/* ==========================================================================
   hero.css — Hero section: radial backdrop, mandala watermark, arch frame,
   corner florals, content typography and the staggered entrance.
   The entrance runs when JS adds `hero-ready` to <html> (after the intro opens).
   Only opacity / transform / stroke-dashoffset are animated.
   ========================================================================== */

/* Reserve the scrollbar gutter so locking/unlocking scroll never shifts layout */
html {
  scrollbar-gutter: stable;
}

/* Hidden SVG sprite (see js/ornaments.js). Strokes inside stay 1px at any scale. */
.orn-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.orn-sprite symbol * {
  vector-effect: non-scaling-stroke;
}

/* Hidden (visibility, so no layout shift is counted) until fonts have loaded */
.fonts-pending .hero {
  visibility: hidden;
}

/* --------------------------------------------------------------------------
   Section + background
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(56px, 7.5vh, 96px) 12px; /* symmetric: content centred, scroll indicator sits in the bottom band */
  text-align: center;
  scroll-margin-top: 0;
  /* Ivory centre → blush edges. The ivory plateau keeps small gold text legible. */
  background: radial-gradient(ellipse 85% 75% at 50% 48%, var(--color-ivory) 0%, var(--color-ivory) 55%, var(--color-blush) 100%);
}

/* Gold line-art mandala watermark, one slow turn per 180s */
.hero__mandala {
  position: absolute;
  z-index: -1;
  top: 50%;
  left: 50%;
  width: min(150vw, 1100px);
  height: min(150vw, 1100px);
  color: var(--color-gold);
  opacity: 0.12;
  transform: translate(-50%, -50%);
  animation: heroMandalaTurn 180s linear infinite;
  pointer-events: none;
}

@keyframes heroMandalaTurn {
  from { transform: translate(-50%, calc(-50% + var(--parallax, 0px))) rotate(0deg); }
  to   { transform: translate(-50%, calc(-50% + var(--parallax, 0px))) rotate(360deg); }
}

/* --------------------------------------------------------------------------
   Corner florals (reusable <use href="#orn-floral">)
   -------------------------------------------------------------------------- */
.hero__floral {
  position: absolute;
  z-index: 0;
  width: clamp(120px, 24vw, 320px);
  aspect-ratio: 1;
  pointer-events: none;
}

.hero__floral--tl {
  top: 8px;
  left: -14px;
}

.hero__floral--br {
  right: -14px;
  bottom: -14px;
  transform: rotate(180deg);
}

.hero__floral-svg {
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: 0 0;
}

/* --------------------------------------------------------------------------
   Arch frame: cap (SVG) + straight sides (CSS) + lotus apex + end flourishes
   -------------------------------------------------------------------------- */
.hero__frame {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  width: min(100%, 880px);
}

.hero__cap {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 400 / 80;
  overflow: visible;
  fill: none;
  stroke: var(--color-gold);
  stroke-width: 1.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero__lotus {
  position: absolute;
  top: 0;
  left: 50%;
  width: clamp(30px, 6vw, 52px);
  height: auto;
  aspect-ratio: 60 / 40;
  transform: translate(-50%, -62%);
  color: var(--color-gold);
}

.hero__body {
  position: relative;
  padding: var(--space-xs) clamp(1.25rem, 6vw, 4rem) clamp(1.25rem, 3.5vh, 4rem);
  border-top: 0;
}

/* The two straight gold side lines (outer + inner, inner = 1.5% to match the arch) */
.hero__sides {
  position: absolute;
  inset: 0;
  border-inline: 1px solid var(--color-gold);
  pointer-events: none;
  transform-origin: top;
}

.hero__sides::before {
  content: "";
  position: absolute;
  inset: 0 1.5%;
  border-inline: 1px solid var(--color-gold);
  opacity: 0.8;
}

.hero__end {
  position: absolute;
  bottom: -22px;
  width: 48px;
  height: 26px;
  color: var(--color-gold);
}

.hero__end--l { left: -23px; }
.hero__end--r { right: -23px; }

/* --------------------------------------------------------------------------
   Content
   -------------------------------------------------------------------------- */
.hero__blessing {
  margin: 0 0 var(--space-sm);
  font-family: var(--font-heading);
  font-size: var(--fs-md);
  font-style: italic;
  color: var(--color-rose-gold-deep);
}

.hero__tagline {
  margin: 0 0 var(--space-xs);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--color-gold-deep);
}

.hero__names {
  /* Spec ~clamp(3.2rem, 11vw, 7.5rem); max lowered to 6.6rem so both names stay on one line inside the frame */
  --name-size: clamp(3.2rem, 11vw, 6.6rem);
  font-size: var(--name-size);
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
  font-weight: 400;
  line-height: 1.05;
}

.hero__names:focus {
  outline: none; /* programmatic focus target only (set after the intro opens) */
}

.hero__name {
  font-family: var(--font-script);
  font-size: var(--name-size);
  color: var(--color-maroon);
}

/* The "&" is the shared .amp (names.css); in this flex row it is nudged onto the names' x-height */
.hero__amp {
  position: relative;
  top: 0.04em;
}

.hero__fullnames {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  margin: clamp(0.25rem, 1vh, 0.5rem) 0 clamp(0.5rem, 1.8vh, 1.5rem);
  font-family: var(--font-heading);
  font-size: var(--fs-md);
  font-weight: 600;
  font-variant-caps: small-caps;
  letter-spacing: 0.1em;
  color: var(--color-text);
}

.hero__sep {
  display: none;
  margin-inline: 0.75em;
  color: var(--color-gold-deep);
}

.hero__date {
  margin: 0;
  font-family: var(--font-heading);
  font-size: var(--fs-lg);
  font-style: italic;
  color: var(--color-text);
}

.hero__numeric {
  margin: var(--space-xs) 0 0;
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.35em;
  color: var(--color-text);
}

.hero__venue {
  margin: clamp(0.5rem, 1.8vh, 1.5rem) 0 0;
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-gold-deep);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-sm);
  margin-top: clamp(0.5rem, 1.8vh, 1.5rem);
}

/* Scroll indicator */
.hero__scroll {
  position: absolute;
  z-index: 2;
  bottom: 18px;
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-left: -7px;
}

.hero__scroll-line {
  width: 1px;
  height: 26px;
  background: linear-gradient(to bottom, transparent, var(--color-gold));
}

.hero__scroll-chevron {
  width: 10px;
  height: 10px;
  margin-top: -6px;
  border-right: 1px solid var(--color-gold);
  border-bottom: 1px solid var(--color-gold);
  transform: rotate(45deg);
  animation: heroChevron 2s var(--ease-elegant) infinite;
}

@keyframes heroChevron {
  0%, 100% { transform: translateY(0) rotate(45deg); }
  50%      { transform: translateY(6px) rotate(45deg); }
}

/* Tighter divider inside the hero */
.hero .divider {
  margin-top: clamp(0.4rem, 1.5vh, 1rem);
}

@media (min-width: 600px) {
  .hero__fullnames {
    flex-direction: row;
    justify-content: center;
  }
  .hero__sep {
    display: inline;
  }
}

@media (min-width: 900px) {
  .hero__names {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0 0.1em;
  }
}

/* Narrow screens: thinner, simpler frame */
@media (max-width: 479.98px) {
  /* Smaller, more cropped floral so it never reaches the tagline */
  .hero__floral {
    width: 84px;
  }
  .hero__floral--tl {
    top: 6px;
    left: -24px;
  }
  .hero__floral--br {
    right: -22px;
    bottom: -22px;
  }
  .hero__tagline {
    letter-spacing: 0.2em;
  }
  .hero__cap-inner,
  .hero__sides::before {
    display: none;
  }
  .hero__end {
    width: 36px;
    height: 20px;
    left: auto;
  }
  .hero__end--l { left: -17px; }
  .hero__end--r { right: -17px; }
}

/* --------------------------------------------------------------------------
   Entrance (JS adds .hero-ready to <html>); gated on .js so no-JS shows all
   -------------------------------------------------------------------------- */
.js .hero-anim {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.8s var(--ease-elegant) calc(var(--i, 0) * 120ms),
    transform 0.8s var(--ease-elegant) calc(var(--i, 0) * 120ms);
}

.hero-ready .hero-anim {
  opacity: 1;
  transform: none;
  will-change: opacity, transform;
}

/* Arch draws itself (pathLength=1 on each path) */
.js .hero__cap path {
  stroke-dasharray: 1 2;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 1.6s var(--ease-elegant);
}

.hero-ready .hero__cap path {
  stroke-dashoffset: 0;
}

.js .hero__sides {
  transform: scaleY(0);
  transition: transform 1.4s var(--ease-elegant) 0.5s;
}

.hero-ready .hero__sides {
  transform: none;
}

.js .hero__lotus,
.js .hero__end {
  opacity: 0;
  transition: opacity 0.8s var(--ease-elegant) 1.1s;
}

.hero-ready .hero__lotus,
.hero-ready .hero__end {
  opacity: 1;
}

.js .hero__floral-svg {
  opacity: 0;
  transform: scale(0.9);
  transition:
    opacity 1.4s var(--ease-elegant) 0.3s,
    transform 1.4s var(--ease-elegant) 0.3s;
}

.hero-ready .hero__floral-svg {
  opacity: 1;
  transform: none;
  will-change: opacity, transform;
}

/* JS adds .hero-done after the entrance so will-change is dropped */
.hero-done .hero-anim,
.hero-done .hero__floral-svg {
  will-change: auto;
}

/* --------------------------------------------------------------------------
   Reduced motion: everything visible instantly, nothing moves
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .js .hero-anim,
  .js .hero__floral-svg,
  .js .hero__lotus,
  .js .hero__end {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .js .hero__cap path {
    stroke-dashoffset: 0;
    transition: none;
  }
  .js .hero__sides {
    transform: none;
    transition: none;
  }
  .hero__mandala {
    animation: none;
  }
  .hero__scroll {
    display: none;
  }
}

/* Keep the floral box clear of the first name at intermediate desktop widths. */
@media (min-width: 900px) and (max-width: 1200px) {
  .hero__floral--tl { width: 170px; top: 8px; left: -28px; }
}

.hero__date, .hero__numeric, [data-render="wedding-time"] { font-variant-numeric: lining-nums tabular-nums; font-feature-settings: "lnum" 1, "tnum" 1; }

/* Shorter name fades improve mobile LCP while preserving the entrance sequence. */
@media (max-width: 899.98px) { .hero__names .hero-anim { transition-duration: var(--dur-base); transition-delay: 120ms; } }
