/* Herbarium layer: the card's own leaf sprays framing the hero and closing,
   swaying gently, plus the drifting gold buds canvas (js/petals.js). */
.petals {
  position: fixed; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 1;
}
main { position: relative; z-index: 2; }

.hero {
  position: relative;
  min-height: 100svh;
  display: grid; place-items: center;
  text-align: center;
  padding: 90px var(--gutter) 110px;
  overflow: hidden;
  background: radial-gradient(90% 60% at 50% 45%, var(--paper-2) 0%, var(--paper) 70%);
}
.hero-inner { position: relative; z-index: 2; max-width: 420px; }
.names { margin: 6px 0 0; font-weight: 400; }
.names .name { display: block; font-size: clamp(64px, 19vw, 96px); color: var(--ink); }
.names .amp { display: block; font-family: var(--f-body); font-style: italic; font-size: 30px; color: var(--gold); margin: -4px 0 -8px; }
.hero-date { font-family: var(--f-caps); letter-spacing: .2em; text-transform: uppercase; font-size: 14px; margin: 0; }
.hero-place { font-style: italic; color: var(--muted); margin: 6px 0 0; }

.scroll-cue {
  position: absolute; left: 50%; bottom: max(26px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px; z-index: 2;
  font-family: var(--f-caps); font-size: 11px; letter-spacing: .3em; text-transform: uppercase;
  color: var(--ink-soft); text-decoration: none; min-height: 44px; padding: 4px 12px;
}
.scroll-cue i { width: 1px; height: 26px; background: linear-gradient(var(--gold), transparent); animation: cue 2.2s ease-in-out infinite; }
@keyframes cue { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* Leaf sprays: sizes keep the centre column clear on a 390px phone */
.leaf { position: absolute; pointer-events: none; user-select: none; z-index: 1; will-change: transform; }
.leaf-tl { top: 0; left: 0; width: min(30vw, 190px); transform-origin: 0 0; animation: sway-a 9s ease-in-out infinite; }
.leaf-tr { top: 0; right: 0; width: min(28vw, 200px); transform-origin: 100% 0; animation: sway-b 11s ease-in-out infinite; }
.leaf-bl { bottom: 0; left: 0; width: min(34vw, 240px); transform-origin: 0 100%; animation: sway-b 10s ease-in-out infinite; }
.leaf-br { bottom: 0; right: 0; width: min(25vw, 170px); transform-origin: 100% 100%; animation: sway-a 12s ease-in-out infinite; }

/* Grow-in once the envelope opens */
body.sealed .hero .leaf { opacity: 0; }
.hero .leaf { transition: opacity 1.6s ease; }
body.opened .hero .leaf-tl { animation: grow-tl 1.8s var(--ease-out) both, sway-a 9s ease-in-out 1.8s infinite; }
body.opened .hero .leaf-tr { animation: grow-tr 1.8s var(--ease-out) .15s both, sway-b 11s ease-in-out 1.95s infinite; }
body.opened .hero .leaf-bl { animation: grow-bl 1.8s var(--ease-out) .3s both, sway-b 10s ease-in-out 2.1s infinite; }
body.opened .hero .leaf-br { animation: grow-br 1.8s var(--ease-out) .45s both, sway-a 12s ease-in-out 2.25s infinite; }
body.sealed .hero-inner > * { opacity: 0; transform: translateY(14px); }
.hero-inner > * { transition: opacity 1.2s ease, transform 1.2s var(--ease-out); }
body.opened .hero-inner > :nth-child(1) { transition-delay: .5s; }
body.opened .hero-inner > :nth-child(2) { transition-delay: .8s; }
body.opened .hero-inner > :nth-child(3) { transition-delay: 1.1s; }
body.opened .hero-inner > :nth-child(4) { transition-delay: 1.3s; }
body.opened .hero-inner > :nth-child(5) { transition-delay: 1.5s; }

.skip .hero-inner > *, .skip .hero .leaf { transition: none !important; transition-delay: 0s !important; }
.hero:focus { outline: none; }

@keyframes sway-a { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(1.6deg); } }
@keyframes sway-b { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(-1.4deg); } }
@keyframes grow-tl { from { opacity: 0; transform: scale(.6) rotate(-8deg); } to { opacity: 1; transform: none; } }
@keyframes grow-tr { from { opacity: 0; transform: scale(.6) rotate(8deg); } to { opacity: 1; transform: none; } }
@keyframes grow-bl { from { opacity: 0; transform: scale(.6) rotate(8deg); } to { opacity: 1; transform: none; } }
@keyframes grow-br { from { opacity: 0; transform: scale(.6) rotate(-8deg); } to { opacity: 1; transform: none; } }

@media (min-width: 900px) {
  .leaf-tl { width: 240px; } .leaf-tr { width: 260px; } .leaf-bl { width: 300px; } .leaf-br { width: 220px; }
}
@media (prefers-reduced-motion: reduce) {
  .leaf, body.opened .hero .leaf-tl, body.opened .hero .leaf-tr,
  body.opened .hero .leaf-bl, body.opened .hero .leaf-br { animation: none; opacity: 1; }
  .scroll-cue i { animation: none; }
}
