/* The Beginning, painted edition: the reference artwork split into layers.
   Flowers behind the card and the vines printed on it sway from their stems;
   the lettering is live text (names/date come from wedding-config.js) and floats.
   Canvas = 1020 x 1337 px of the source art; all positions are % of it. */
#names .names-art {
  position: relative; width: min(470px,100%); max-width: 100%;
  aspect-ratio: 1020 / 1337; margin-inline: auto;
  container-type: inline-size; isolation: isolate;
}
#names .names-art img { display: block; max-width: none; pointer-events: none; user-select: none; }
#names .names-art-base {
  position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2;
  filter: drop-shadow(0 14px 22px #0000008c);
}
#names .names-art-layer { position: absolute; height: auto; will-change: transform; }
/* flowers outside the card stay behind it */
#names .names-art-out { z-index: 1; animation: vvArtSway 7.5s ease-in-out infinite; }
#names .names-art-out-left { left: 1.569%; top: 32.162%; width: 8.333%; transform-origin: 92% 100%; }
#names .names-art-out-right {
  left: 89.706%; top: 32.162%; width: 10.196%; transform-origin: 8% 100%;
  animation-duration: 8.4s; animation-delay: -3.2s; animation-direction: alternate-reverse;
}
/* Ciluk ba: Fifi and Arul rise together, slowly, from behind the top edge of the card (phones
   have room above the card, not beside it), then sway a little. No fade: the card itself hides
   them until they are up. --peek-hide: how far a bust sinks (in % of its own height) to vanish
   behind the card. Positions come from .claude/peek-build.py. */
#names .names-peek-bust {
  position: absolute; z-index: 1; width: 60%; height: auto; transform-origin: 50% 60%;
  animation: vvPeekRise 2.6s cubic-bezier(.22,.61,.36,1) 1.3s backwards, vvPeekSway 6s ease-in-out 3.9s infinite;
}
#names .names-peek-bride { left: -.98%; top: -23.08%; --peek-hide: 51%; }
#names .names-peek-groom { left: 38.73%; top: -23.53%; --peek-hide: 52%; animation-direction: normal, reverse; }
/* Until the card is on screen they stay behind it, so they rise again on every visit. */
.js #names .names-art:not(.is-visible) .names-peek-bust { animation: none; transform: translateY(var(--peek-hide)); }
@keyframes vvPeekRise { from { transform: translateY(var(--peek-hide)); } }
@keyframes vvPeekSway {
  0%, 100% { transform: none; }
  30% { transform: rotate(1.2deg); }
  70% { transform: rotate(-1.2deg); }
}
/* More flowers around the card: sprigs and roses behind its sides, a garland along the foot of
   the envelope. Every flower outside the card blooms (grows from nothing, with a little
   overshoot) once the card is on screen, one after another, then sways. Bloom uses `scale` and
   the new flowers sway with `rotate`, so neither disturbs the other or the older `transform`
   sway. Layout numbers match .claude/flowers-preview.py. */
#names .names-bloom {
  z-index: 1; rotate: var(--angle, 0deg); scale: var(--flip, 1) 1;
  animation: vvBloomSway 7.5s ease-in-out var(--sway-delay, 0s) infinite;
}
#names :is(.names-bloom, .names-art-out) { transition: scale 1.6s cubic-bezier(.34,1.45,.64,1) var(--bloom-delay, 1.2s); }
.js #names .names-art:not(.is-visible) :is(.names-bloom, .names-art-out) { scale: 0; transition: none; }
#names .names-bloom-right { --flip: -1; }
#names .names-bloom-sprig { width: 30%; left: -8%; top: 17%; --angle: -14deg; --bloom-delay: .9s; }
#names .names-bloom-sprig.names-bloom-right { left: 78%; --angle: 14deg; --bloom-delay: 1.05s; --sway-delay: -3s; }
#names .names-bloom-rose { width: 34%; left: -15%; top: 47%; --bloom-delay: 1.5s; --sway-delay: -1.5s; }
#names .names-bloom-rose.names-bloom-right { left: 81%; --bloom-delay: 1.65s; --sway-delay: -5s; }
#names .names-bloom-garland { z-index: 3; width: 84%; left: 8%; top: 84.5%; --bloom-delay: 2s; --sway-delay: -2s; }
@keyframes vvBloomSway {
  0%,100% { rotate: calc(var(--angle, 0deg) - 1.5deg); }
  50% { rotate: calc(var(--angle, 0deg) + 1.5deg); }
}
/* vines printed on the card */
#names .names-art-vine { z-index: 3; animation: vvArtVine 9s ease-in-out infinite; }
#names .names-art-vine-left { left: 10.196%; top: 33.059%; width: 21.471%; transform-origin: 18% 100%; }
#names .names-art-vine-right {
  left: 68.235%; top: 33.059%; width: 21.275%; transform-origin: 82% 100%;
  animation-duration: 10s; animation-delay: -4.4s; animation-direction: alternate-reverse;
}

/* Live lettering laid exactly over the blank stationery */
#names .names-art-copy { position: absolute; inset: 0; z-index: 4; width: auto; margin: 0; padding: 0; }
#names .names-art-copy > * {
  position: absolute; left: 0; right: .5%; height: 0; margin: 0; padding: 0;
  display: flex; align-items: center; justify-content: center;
  text-align: center; white-space: nowrap; overflow: visible;
}
/* `top` puts each word's ink centre on the source lettering; `right` nudges the
   optical centre (script capitals overhang to the left). */
#names .names-art-copy > .names-art-eyebrow {
  top: 15.98%; right: .45%; font: 500 2.32cqw/1 var(--serif); letter-spacing: .21em; text-indent: .21em;
  text-transform: uppercase; color: #8f6c41;
}
#names .names-art-copy > h2 {
  font-family: 'Pinyon Script','Great Vibes',var(--script); font-weight: 400;
  line-height: 1; letter-spacing: 0; color: #5a1525;
  -webkit-text-stroke: .012em #5a1525; text-shadow: 0 1px 0 #fff9;
}
#names .names-art-copy > .name-bride { top: 29.05%; right: 3.73%; font-size: 16.5cqw; }
#names .names-art-copy > .name-groom { top: 51.91%; right: 7.06%; font-size: 15cqw; }
#names .names-art-copy > .couple-amp {
  top: 40.73%; right: 1.67%; gap: 0; font: 400 8cqw/1 'Great Vibes',var(--script); color: #ad8443;
}
#names .names-art-copy > .couple-amp > span {
  background: linear-gradient(170deg,#dcbd7e 15%,#a87d3c 60%,#8a6229); -webkit-background-clip: text;
  background-clip: text; -webkit-text-fill-color: transparent; padding: .1em .08em;
}
#names .names-art-copy > .couple-amp::before, #names .names-art-copy > .couple-amp::after { content: none; }
#names .names-art-copy > .names-date-line { top: 64.98%; right: .31%; }
#names .names-art-copy .date-short {
  font: 500 2.32cqw/1 var(--serif); letter-spacing: .18em; text-indent: .18em;
  text-transform: uppercase; color: #8f6c41; padding: 0;
}
#names .names-art-copy .names-script-float { padding-inline: .1em; }

@keyframes vvArtSway {
  0%,100% { transform: rotate(-1.8deg); }
  50% { transform: rotate(1.6deg) translateY(-1px); }
}
@keyframes vvArtVine {
  0%,100% { transform: rotate(-.55deg); }
  50% { transform: rotate(.55deg); }
}
@media (prefers-reduced-motion:reduce) {
  #names .names-art-layer { animation: none !important; transition: none !important; }
}
