/* V5: a paper-and-light wedding diorama. Layout is constrained by actual content height. */

/* The hero illustration is a distinct flex child. Its image can never extend into text. */
.hero {
  display:flex;
  flex-direction:column;
  justify-content:flex-start;
  min-height:100svh;
  height:100svh;
}
.hero-content {
  order:1;
  flex:0 0 auto;
  align-self:stretch;
  padding:max(16px,env(safe-area-inset-top,0px)) 1rem .65rem;
}
.hero-content .ganesha { width:29px; height:29px; }
.hero-kicker { margin-top:.18rem; font-size:.6rem; }
.hero .names {
  margin-top:.15rem;
  font-size:clamp(2.9rem,12.1vw,4.1rem);
  line-height:.9;
}
.hero .names .n1 { display:block; }
.hero .names .amp { display:inline; font-size:.43em; vertical-align:14%; }
.hero .names .n2 { display:inline; }
.hero-content .flourish { width:112px; height:16px; margin:0 auto; }
.hero-date { margin-top:.13rem; font-size:.84rem; }
.hero-personal { margin:.25rem auto 0; max-width:25ch; font-size:1rem; line-height:1.11; }
.hero-figure-wrap {
  order:2;
  flex:1 1 0;
  min-height:0;
  height:auto;
  width:100%;
  position:relative;
  overflow:hidden;
  align-self:stretch;
  isolation:isolate;
}
.hero-figure-wrap .hero-figure {
  width:auto;
  max-width:min(88vw,450px);
  height:calc(100% - 3.9rem);
  max-height:none;
  bottom:3.9rem;
  top:auto;
  object-fit:contain;
  object-position:bottom center;
}
.hero-figure-halo { bottom:4.2rem; }
.hero .scroll-cue { order:3; }
@media (max-height:700px) {
  .hero-content { padding-top:max(9px,env(safe-area-inset-top,0px)); padding-bottom:.3rem; }
  .hero-content .ganesha { width:24px; height:24px; }
  .hero .names { font-size:clamp(2.65rem,11vw,3.5rem); }
  .hero .scroll-cue { bottom:calc(env(safe-area-inset-bottom,0px) + .3rem); }
  .hero-figure-wrap .hero-figure { bottom:3.1rem; height:calc(100% - 3.1rem); }
}
@media (max-height:570px) {
  .hero-content .ganesha,.hero-content .flourish { display:none; }
  .hero-personal { font-size:.9rem; }
  .hero .names { font-size:clamp(2.3rem,9.8vw,3.15rem); }
}

/* Each event occupies a miniature illustrated room, assembled in distinct planes. */
.events.events-v4 {
  background:
    radial-gradient(ellipse 93% 54% at 50% 45%,var(--scene-pale),transparent 73%),
    radial-gradient(ellipse 46% 30% at 50% 83%,rgba(214,185,159,.16),transparent 100%),
    #FAF9F5;
}
.scene-stage {
  perspective:1000px;
  isolation:isolate;
  transform-style:preserve-3d;
}
.scene-stage::before {
  content:"";
  position:absolute;
  z-index:0;
  inset:8% 8% 7%;
  border-radius:48% 48% 9% 9%;
  background:radial-gradient(ellipse 58% 65% at 50% 63%,rgba(255,255,249,.72),transparent 90%);
  box-shadow:inset 0 -18px 30px -32px var(--scene-dark);
  pointer-events:none;
}
.scene-arch { opacity:.45; inset:2% 11% 8%; }
.scene-symbol { opacity:.1; z-index:1; }
.scene-environment {
  position:absolute; inset:0; z-index:2; overflow:visible;
  transform:translateZ(-65px);
  transform-origin:50% 76%;
  filter:drop-shadow(0 7px 6px rgba(85,62,58,.035));
  pointer-events:none;
}
.scene-environment svg {
  display:block; position:absolute; inset:0; width:100%; height:100%;
  overflow:visible;
}
.scene-environment .set-back { z-index:1; opacity:.90; transform:scale(.97) translateY(1%); }
.scene-environment .set-mid {
  z-index:2;
  transform:translateZ(20px) scale(1.016) translateY(.6%);
  filter:drop-shadow(0 3px 3px rgba(92,72,62,.08));
}
.scene-environment .set-glow { z-index:0; opacity:.65; }
.scene-environment .set-festoon { transform-origin:50% 0; animation:festoonBreathe 5s ease-in-out infinite alternate; }
.scene-environment .set-light { animation:setLight 3s ease-in-out infinite alternate; }
.scene-environment .set-light:nth-of-type(2n) { animation-delay:-1.5s; }
.scene-rotor {
  position:absolute; inset:0; z-index:4;
  transform-origin:50% 79%;
  transform-style:preserve-3d;
  backface-visibility:hidden;
  will-change:transform,opacity;
  pointer-events:none;
}
.scene-figure {
  height:92%; bottom:11.5%;
  transform:translateX(-50%) translateZ(35px);
  filter:drop-shadow(0 10px 5px rgba(75,53,47,.13));
  pointer-events:auto;
  cursor:pointer;
}
.stage-podium { transform:translateZ(0); }
.stage-floor {
  background:
    radial-gradient(ellipse at 50% 25%,rgba(255,255,255,.92),rgba(236,226,212,.35) 56%,rgba(168,120,110,.25)),
    repeating-conic-gradient(from 9deg,rgba(255,254,250,.95) 0deg 35deg,rgba(187,156,121,.34) 35deg 36deg,rgba(251,248,243,.95) 36deg 72deg);
  transform:perspective(500px) rotateX(54deg);
  transition:none;
  box-shadow:0 29px 30px rgba(91,64,58,.16),0 8px 8px rgba(91,64,58,.05);
}
.stage-band { box-shadow:0 12px 13px rgba(91,64,58,.11); }
.stage-rim { background:linear-gradient(180deg,rgba(255,255,255,.68),rgba(238,220,203,.22)); }
.scene-foreground {
  position:absolute; inset:0; z-index:5; pointer-events:none;
  transform:translateZ(68px);
  filter:drop-shadow(0 3px 6px rgba(77,52,50,.07));
}
.scene-foreground svg { position:absolute; inset:0; width:100%; height:100%; overflow:visible; }
.scene-sparkle { z-index:6; opacity:.52; }
.scene-detail {
  z-index:7;
  background:rgba(255,253,249,.96);
  box-shadow:0 15px 27px rgba(76,59,53,.105),0 1px 4px rgba(76,59,53,.055);
}
.scene-shell.is-turning .scene-rotor { animation:turntableOut .37s cubic-bezier(.43,.04,.72,.44) both; }
.scene-shell.is-entering .scene-rotor { animation:turntableIn .48s cubic-bezier(.22,.85,.3,1) both; }
.scene-shell.figure-waving .scene-rotor { animation:stageNod .7s ease-in-out both; }
/* V4 animated the human separately, making the disk look disconnected. */
.scene-shell.is-turning .scene-figure,
.scene-shell.is-entering .scene-figure,
.scene-shell.figure-waving .scene-figure { animation:none!important; }
.scene-shell.is-turning .scene-environment { animation:environmentOut .37s ease-in both; }
.scene-shell.is-entering .scene-environment { animation:environmentIn .48s ease-out both; }
.scene-shell.is-turning .scene-foreground { opacity:.42; transition:opacity .24s; }
.scene-shell.is-entering .scene-foreground { opacity:1; transition:opacity .48s; }
@keyframes turntableOut {
  from { transform:perspective(900px) rotateY(0deg); opacity:1; }
  to { transform:perspective(900px) rotateY(var(--turn-out,-88deg)); opacity:.035; }
}
@keyframes turntableIn {
  from { transform:perspective(900px) rotateY(var(--turn-in,88deg)); opacity:.035; }
  to { transform:perspective(900px) rotateY(0deg); opacity:1; }
}
@keyframes environmentOut {
  from { opacity:1;transform:translateZ(-65px) scale(1); }
  to { opacity:0;transform:translateZ(-90px) scale(.94); }
}
@keyframes environmentIn {
  from { opacity:0;transform:translateZ(-90px) scale(.94); }
  to { opacity:1;transform:translateZ(-65px) scale(1); }
}
@keyframes stageNod {
  0%,100% {transform:perspective(900px) rotateY(0deg) translateY(0);}
  30% {transform:perspective(900px) rotateY(-2deg) translateY(-6px);}
  70% {transform:perspective(900px) rotateY(2deg) translateY(-2px);}
}
@keyframes festoonBreathe { from {transform:rotate(-1deg);} to {transform:rotate(1deg);} }
@keyframes setLight {from {opacity:.42;} to {opacity:1;} }
@media (max-height:700px) {
  .scene-figure { height:91%; }
}
@media (prefers-reduced-motion:reduce) {
  .scene-environment .set-festoon,.scene-environment .set-light,
  .scene-shell.is-turning .scene-rotor,.scene-shell.is-entering .scene-rotor,
  .scene-shell.figure-waving .scene-rotor,
  .scene-shell.is-turning .scene-environment,.scene-shell.is-entering .scene-environment {
    animation:none!important; transition:none!important;
  }
}
