/* ═══════════════════════════════════════════════════════════
   hero.css — Hero Section · Text · Scroll Indicator · Florals
   ═══════════════════════════════════════════════════════════ */

/* ── Hero Container ───────────────────────────────────────── */
#home {
  position: relative;
  height: 100svh;
  min-height: 690px;
  max-height: 1200px;
  text-align: center;
  isolation: isolate;
  overflow: hidden;
  background: var(--paper);
}

/* ── Hero Background Art ──────────────────────────────────── */
#home .hero-art {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url('../assets/images/palace-hero.webp') center / cover;
  transform: scale(1);
  transform-origin: 50% 65%;
}
#home .hero-art::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 70%, #fcf5ec12 88%, var(--paper) 100%);
}

/* Subtle ken-burns zoom on reveal */
.invitation-open .hero-art {
  animation: palace-arrive 8s cubic-bezier(0.2, 0.6, 0.3, 1) both;
}
@keyframes palace-arrive {
  from { transform: scale(1); }
  to   { transform: scale(1.025); }
}

/* ── Hero Florals Layer ────────────────────────────────────── */
.hero-florals {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: clip;
  pointer-events: none;
  user-select: none;
  container-type: size;
  perspective: 700px;
  opacity: 0;
  transition: opacity 1s ease;
}
.hero-florals.is-ready  { opacity: 1; }

.hero-petal {
  position: absolute;
  top: -45px;
  left: var(--x);
  width: var(--size);
  height: var(--size);
  opacity: 0;
  animation: garden-petal-drift var(--duration) linear var(--delay) infinite both paused;
}
.hero-petal img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  backface-visibility: visible;
  /* Wine-toned petals if real image is unavailable */
  animation: garden-petal-turn var(--flutter) ease-in-out var(--delay) infinite alternate both paused;
}
/* SVG petal fallback tinting */
.hero-petal svg { fill: #d1a2ad; }
.hero-petal:nth-child(3n) img  { filter: blur(0.35px); }
.hero-petal:nth-child(even) img { scale: -1 1; }

.is-running .hero-petal,
.is-running .hero-petal img { animation-play-state: running; }

@keyframes garden-petal-drift {
  0%  { opacity: 0; transform: translate3d(0, 0, 0) rotate(var(--tilt)); }
  8%  { opacity: .72; }
  28% { transform: translate3d(calc(var(--wind) * .18 + 12px), 30cqh, 0) rotate(calc(var(--tilt) + 40deg)); }
  54% { opacity: .83; transform: translate3d(calc(var(--wind) * .5 - 9px), 59cqh, 0) rotate(calc(var(--tilt) + 110deg)); }
  78% { opacity: .7;  transform: translate3d(calc(var(--wind) * .79 + 6px), 85cqh, 0) rotate(calc(var(--tilt) + 165deg)); }
  94% { opacity: .5; }
  100%{ opacity: 0;  transform: translate3d(var(--wind), calc(100cqh + 90px), 0) rotate(calc(var(--tilt) + 210deg)); }
}
@keyframes garden-petal-turn {
  0%   { transform: rotateY(-48deg) rotateX(15deg)  rotateZ(-12deg); }
  45%  { transform: rotateY(12deg)  rotateX(-28deg) rotateZ(8deg); }
  100% { transform: rotateY(62deg)  rotateX(32deg)  rotateZ(-18deg); }
}

/* ── Hero Copy ────────────────────────────────────────────── */
#home .hero-copy {
  position: absolute;
  top: 23%;
  left: 10%;
  width: 80%;
  z-index: 2;
  container-type: inline-size;
  color: var(--burgundy);
}

#home .hero-prelude,
#home .hero-forever {
  color: var(--muted);
  font-size: 22px;
  font-style: italic;
  line-height: 1.45;
  text-shadow: 0 1px 12px #fff8e880;
  margin: 0;
}
#home .hero-forever { margin-top: 4px; }

/* ── Couple Names (H1) ────────────────────────────────────── */
#home h1 {
  font-family: var(--names);
  font-weight: 400;
  letter-spacing: 0;
  font-size: clamp(30px, 6.8cqw, 48px);
  max-width: 100%;
  line-height: 1.15;
  gap: 0.16em;
  display: flex;
  justify-content: center;
  align-items: baseline;
  margin: 20px 0 0;
  padding: 0;
  color: var(--burgundy);
  text-shadow: 0 1px 8px #fff3d780;
  white-space: nowrap;
}
#home h1 em {
  color: var(--gold);
  font-style: italic;
}
/* Room for swash descenders */
#home h1 > * { padding: 0; margin: 0; }

#home .hero-subtitle {
  color: var(--muted);
  font-size: 20px;
  line-height: 1.5;
  margin-top: 28px;
}
#home .hero-date {
  font: 10px / 1.8 var(--serif);
  letter-spacing: 2.2px;
  color: #805025;
  margin-top: 21px;
}
.hero-date > span {
  margin: 0 7px;
  color: var(--gold);
}

/* ── Scroll Indicator ─────────────────────────────────────── */
.scroll-invitation {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 13px;
  text-decoration: none;
  font: 8px var(--serif);
  letter-spacing: 2.5px;
  white-space: nowrap;
  color: var(--burgundy);
  z-index: 2;
  padding: 10px 18px 0;
  text-shadow: 0 1px 8px var(--paper);
}
.scroll-line {
  width: 1px;
  height: 23px;
  background: linear-gradient(var(--burgundy), transparent);
  animation: scroll-breathe 2.5s infinite;
}
@keyframes scroll-breathe {
  50% { transform: translateY(6px); opacity: 0.4; }
}

/* ── Hero text staggered entry (after envelope opens) ─────── */
#home .hero-copy         { opacity: 1; transform: none; transition: none; }
#home .hero-copy > *,
#home h1 > *,
#home .scroll-invitation { opacity: 0; }
#home .hero-copy > h1    { opacity: 1; }

.invitation-open #home .hero-copy > *,
.invitation-open #home h1 > *,
.invitation-open #home .scroll-invitation {
  animation: hero-text-arrive 1s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: 3.5s;
}
.invitation-open #home .hero-prelude            { animation-delay: 0.65s; }
.invitation-open #home .hero-forever            { animation-delay: 1.25s; }
.invitation-open #home h1 > span:first-child    { animation-delay: 1.85s; }
.invitation-open #home h1 > em                  { animation-delay: 2.2s; }
.invitation-open #home h1 > span:last-child     { animation-delay: 2.55s; }
.invitation-open #home .hero-subtitle           { animation-delay: 3.0s; }
.invitation-open #home .hero-date               { animation-delay: 3.4s; }
.invitation-open #home .scroll-invitation       {
  animation-name: hero-text-opacity;
  animation-delay: 3.8s;
}
.invitation-open #home h1 > * { animation-name: hero-name-arrive; }

@keyframes hero-name-arrive {
  from { opacity: 0; translate: 0 14px; }
  to   { opacity: 1; translate: 0 0; }
}
@keyframes hero-text-arrive {
  from { opacity: 0; translate: 0 14px; filter: blur(3px); }
  to   { opacity: 1; translate: 0 0;    filter: blur(0); }
}
@keyframes hero-text-opacity {
  from { opacity: 0; }
  to   { opacity: 1; }
}
