/* V4 — The invitation as a tiny theatre. Handcrafted paper, real depth, no heavy 3D dependency. */

/* Language should be available, but not a persistent visual headline. */
.float-lang,
.cover .lang {
  position: fixed;
  top: auto;
  bottom: calc(env(safe-area-inset-bottom,0px) + 13px);
  right: 12px;
  left: auto;
  z-index: 49;
  margin: 0;
  padding: 2px;
  background: rgba(255,253,249,.79);
  color: #766A68;
  border: 1px solid rgba(148,124,107,.22);
  box-shadow: 0 3px 12px rgba(58,49,43,.07);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: .82;
  transition: opacity .25s ease;
}
.float-lang:hover,.float-lang:focus-within,.cover .lang:hover,.cover .lang:focus-within { opacity:1; }
.float-lang button,.cover .lang button { min-width:31px; min-height:29px; height:29px; padding:0 .35rem; color:#766A68; font-size:.74rem; }
.float-lang button[lang="en"],.cover .lang button[lang="en"] { font-size:.75rem; }
.float-lang .thumb,.cover .lang .thumb { top:2px; bottom:2px; background:#EAE0D2; box-shadow:none; }
.cover .lang { z-index:52; }

/* Two physically separate hero zones: typography above, illustrated couple below. */
.hero {
  display:grid;
  grid-template-rows:minmax(0, .95fr) minmax(0, 1.05fr);
  min-height:100svh;
  height:100svh;
  background:radial-gradient(ellipse at 50% 88%,rgba(224,197,183,.20),transparent 57%),#FAF9F5;
}
.hero-content {
  grid-row:1;
  align-self:center;
  position:relative;
  z-index:3;
  padding: max(1.8rem, env(safe-area-inset-top,0px)) 1.2rem 0;
}
.hero-content .ganesha { width:34px; height:34px; }
.hero-kicker { font-size:.64rem; margin-top:.5rem; letter-spacing:.16em; }
.names { font-size:clamp(3.15rem,14.4vw,5.6rem); margin-top:.3rem; }
.hero-content .flourish { width:122px; height:18px; margin:.1rem auto; }
.hero-date { margin-top:.2rem; font-size:.89rem; }
.hero-personal { margin:.45rem auto 0; font-size:1.05rem; }
.hero-figure-wrap {
  grid-row:2; position:relative; width:100%; height:100%; align-self:end;
  z-index:2; overflow:visible; pointer-events:none;
}
.hero-figure-halo {
  position:absolute; left:50%; bottom:4rem; transform:translateX(-50%);
  width:min(77vw,20rem); height:min(44vh,26rem); border-radius:50% 50% 8% 8%;
  border:1px solid rgba(188,160,122,.34);
  background:radial-gradient(ellipse at 50% 82%,rgba(230,216,196,.35),transparent 67%);
}
.hero-figure-wrap .hero-figure {
  position:absolute; left:50%; bottom:3.1rem; top:auto;
  z-index:2; display:block; width:auto; max-width:85vw;
  height:calc(100% - 2.5rem); object-fit:contain;
  transform:translateX(-50%); filter:drop-shadow(0 6px 7px rgba(85,64,57,.08));
  animation:figureAppear .9s ease-out both;
}
.hero .scroll-cue { z-index:5; }

/* The couple photo enters like a keepsake, not a generic gallery tile. */
.duo-polaroid { transition:transform .5s cubic-bezier(.2,.8,.2,1),box-shadow .5s ease; }
.duo-polaroid:hover { transform:rotate(0deg) translateY(-5px); box-shadow:0 22px 39px rgba(79,65,58,.18); }
.pocket-note { transition:transform .35s ease,background .35s ease; }
.pocket-note:active { transform:rotate(-3deg) translateY(3px); }

/* Five cinematic moments on a single phone-sized rotating stage. */
.events.events-v4 {
  --scene-accent:#B9928D;
  --scene-dark:#76545B;
  --scene-pale:#F1DFDD;
  --scene-rim:#CBA9A1;
  position:relative; display:block; height:100svh; min-height:610px;
  width:100%; margin:0; padding:0; overflow:hidden; isolation:isolate;
  background:radial-gradient(ellipse 72% 60% at 50% 51%,var(--scene-pale),transparent 77%),#FAF9F5;
  transition:background .65s ease;
}
.events-v4[data-scene="mandvo"] { --scene-accent:#CC9B4E; --scene-dark:#88632C; --scene-pale:#F6EBD5; --scene-rim:#D3B16C; }
.events-v4[data-scene="sangeet"] { --scene-accent:#A68BA8; --scene-dark:#6C546F; --scene-pale:#EBE3EB; --scene-rim:#AD9BAF; }
.events-v4[data-scene="carnival"] { --scene-accent:#B79C80; --scene-dark:#68816D; --scene-pale:#E6EFE6; --scene-rim:#C9AE8D; }
.events-v4[data-scene="wedding"] { --scene-accent:#B17870; --scene-dark:#874953; --scene-pale:#F3E4DB; --scene-rim:#C4A182; }
.scene-shell { position:relative; margin:0 auto; width:min(100%,460px); height:100%; min-height:610px; isolation:isolate; }
.scene-heading { position:absolute; z-index:5; top:3%; left:0; right:0; padding:0 .9rem; }
.scene-heading .kicker { font-size:.85rem; letter-spacing:.13em; }
.scene-heading .sec-title { margin:.03rem 0 0; font-size:clamp(1.8rem,7.5vw,2.65rem); color:#67484F; }
.scene-intro { max-width:26ch; margin:.2rem auto 0; color:#8F7774; font:italic 1rem/1.1 var(--f-en); }
.scene-stage { position:absolute; z-index:1; top:16.4%; left:0; right:0; height:51.5%; overflow:visible; perspective:1100px; touch-action:pan-y; }
.scene-arch {
  position:absolute; z-index:0; inset:3% 16% 12%; border:1px solid rgba(178,148,114,.35);
  border-bottom:none; border-radius:50% 50% 0 0 / 33% 33% 0 0;
  box-shadow:inset 0 0 0 7px rgba(255,255,255,.22), 0 0 0 7px rgba(255,255,255,.17);
  transform:perspective(850px) rotateX(4deg);
}
.scene-arch::after { content:""; position:absolute; inset:8px 8px 0; border:1px solid rgba(184,164,136,.16); border-bottom:0; border-radius:inherit; }
.scene-symbol { position:absolute; z-index:1; left:50%; top:13%; transform:translateX(-50%); width:9rem; height:9rem; opacity:.21; color:var(--scene-dark); transition:opacity .4s ease; }
.scene-symbol svg { display:block; width:100%; height:100%; stroke:currentColor; fill:none; stroke-width:1; stroke-linecap:round; stroke-linejoin:round; }
.scene-sparkle { position:absolute; z-index:1; color:var(--scene-accent); opacity:.6; font-size:1.2rem; animation:sceneTwinkle 3.6s ease-in-out infinite; }
.sparkle-a { left:14%; top:24%; }
.sparkle-b { right:13%; top:38%; font-size:1rem; animation-delay:.7s; }
.sparkle-c { left:19%; top:58%; font-size:.75rem; animation-delay:1.6s; }
.stage-podium { position:absolute; inset:0; pointer-events:none; transform-style:preserve-3d; }
.stage-floor { position:absolute; z-index:2; left:8%; right:8%; bottom:4%; height:20%; border-radius:50%;
  background:radial-gradient(ellipse at 45% 20%,rgba(255,255,255,.78),rgba(233,222,207,.28) 58%,rgba(203,169,161,.30)),
    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);
  border:1px solid rgba(156,129,96,.22); box-shadow:0 25px 28px rgba(91,64,58,.14);
  transform:perspective(500px) rotateX(54deg) rotateZ(var(--spin, 0deg));
  transition:transform .75s cubic-bezier(.2,.7,.2,1),background .45s ease;
}
.stage-band { position:absolute; z-index:1; left:8%; width:84%; bottom:4.8%; height:8%; border-radius:0 0 48% 48%;
  background:linear-gradient(180deg,#DBD0C1,var(--scene-rim) 68%,#B5A08D); border-bottom:1px solid rgba(129,100,85,.25); }
.stage-rim { position:absolute; z-index:4; left:8%; width:84%; bottom:9.6%; height:9%; border-radius:50%;
  background:linear-gradient(180deg,rgba(255,255,255,.58),rgba(246,240,228,.24)); border:1px solid rgba(168,139,106,.34);
  transform:perspective(500px) rotateX(65deg); pointer-events:none; }
.scene-figure {
  position:absolute; z-index:3; left:50%; bottom:10%; height:91%; width:auto; max-width:96%; object-fit:contain;
  transform:translateX(-50%) translateZ(28px); transform-origin:50% 85%;
  filter:drop-shadow(0 8px 6px rgba(73,54,50,.10));
  will-change:transform,opacity; user-select:none; -webkit-user-drag:none;
}
.scene-shell.is-turning .scene-figure { animation:figureRotateOut .35s ease-in forwards; }
.scene-shell.is-entering .scene-figure { animation:figureRotateIn .55s cubic-bezier(.2,.8,.2,1) both; }
.scene-shell.figure-waving .scene-figure { animation:figureWave .75s ease-in-out; }
.scene-detail {
  position:absolute; z-index:6; left:6%; right:6%; top:68%; height:19.5%;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:.08rem;
  padding:.65rem 1.1rem .75rem;
  border:1px solid rgba(172,143,113,.38); border-radius:14px;
  background:rgba(255,253,249,.93); text-align:center;
  box-shadow:0 14px 30px rgba(76,59,53,.13),0 2px 5px rgba(76,59,53,.05);
  transform:perspective(700px) rotateX(2deg) translateY(-6px);
  backdrop-filter:blur(10px); -webkit-backdrop-filter:blur(10px);
}
.scene-detail::before { content:""; position:absolute; inset:6px; border:1px solid rgba(183,157,126,.21); border-radius:9px; pointer-events:none; }
.scene-detail .event-eyebrow { color:#AF8E69; font:600 .6rem var(--f-ui); letter-spacing:.17em; text-transform:uppercase; }
.scene-detail .event-name { margin:0; font:500 clamp(1.85rem,8.4vw,2.5rem)/1.0 var(--f-en); color:var(--scene-dark); }
html:not([lang="en"]) .scene-detail .event-name { font-family:var(--f-text); font-size:1.55rem; line-height:1.1; }
.scene-detail .event-description { margin:.1rem auto 0; max-width:31ch; font:italic .88rem/1.12 var(--f-en); color:#887A75; }
html:not([lang="en"]) .scene-detail .event-description { font: .8rem/1.18 var(--f-text); }
.scene-detail .event-datetime { margin:.25rem 0 0; font:500 .76rem var(--f-ui); color:#6C5757; }
.scene-controls { position:absolute; z-index:7; bottom:5.15%; width:100%; display:flex; justify-content:center; align-items:center; gap:1.05rem; }
.scene-arrow { display:grid; place-items:center; width:45px; height:45px; border:1px solid #DCCABD; border-radius:50%; background:rgba(255,255,255,.9); color:#76575A; box-shadow:0 3px 8px rgba(88,65,58,.06); cursor:pointer; }
.scene-arrow:active { transform:scale(.94); }
.scene-arrow svg { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.scene-progress { display:flex; gap:.35rem; align-items:center; justify-content:center; }
.scene-dot { width:27px; height:33px; padding:0; border:0; background:none; cursor:pointer; display:grid; place-items:center; }
.scene-dot::before { content:""; display:block; width:5px; height:5px; border-radius:100%; background:#CDBFB2; transition:width .32s ease,background .32s ease,border-radius .32s ease; }
.scene-dot[aria-pressed="true"]::before { width:20px; border-radius:5px; background:var(--scene-dark); }
.scene-gesture { position:absolute; z-index:5; bottom:1.2%; width:100%; margin:0; font:italic .84rem var(--f-en); color:#998B83; text-align:center; }
@keyframes figureRotateOut { from {opacity:1;transform:translateX(-50%) perspective(900px) rotateY(0deg) scale(1);} to {opacity:.12;transform:translateX(-50%) perspective(900px) rotateY(-84deg) scale(.83);} }
@keyframes figureRotateIn { from {opacity:.16;transform:translateX(-50%) perspective(900px) rotateY(83deg) scale(.84);} to {opacity:1;transform:translateX(-50%) perspective(900px) rotateY(0deg) scale(1);} }
@keyframes figureWave {0%,100% {transform:translateX(-50%) rotate(0deg);} 35% {transform:translateX(-50%) rotate(-3deg);} 70% {transform:translateX(-50%) rotate(3deg);} }
@keyframes sceneTwinkle {0%,100% {opacity:.33; transform:scale(.85) rotate(0);} 50% {opacity:.75;transform:scale(1.1) rotate(16deg);} }

/* A closing gesture makes the guest part of the final scene. */
.closing { padding-bottom:5rem; }
.blessing-button { display:flex; align-items:center; justify-content:center; gap:.7rem; margin:2rem auto .5rem; padding:.65rem 1.2rem .65rem .7rem;
  border:1px solid #D8C5AF; border-radius:999px; background:#FFFDF8; color:#76515A;
  font:500 .8rem var(--f-ui); letter-spacing:.04em; cursor:pointer; box-shadow:0 6px 15px rgba(86,60,55,.08); }
.blessing-seal { width:29px; height:29px; display:grid; place-items:center; border-radius:50%; background:#885665; color:#FFF8E9; font-size:1.1rem; }
.blessing-response { min-height:1.3rem; margin:.35rem auto 0; font:italic 1.08rem var(--f-en); color:#856E6C; }

@media (max-height:740px) {
  .scene-heading { top:2%; }
  .scene-heading .kicker { font-size:.78rem; }
  .scene-heading .sec-title { font-size:1.9rem; }
  .scene-intro { font-size:.9rem; }
  .scene-stage { top:15.3%; height:52.5%; }
  .scene-detail { top:67.5%; height:20%; padding:.5rem 1.1rem; }
  .scene-detail .event-name { font-size:1.95rem; }
  .scene-detail .event-description { font-size:.81rem; }
  .scene-controls { bottom:4.5%; }
  .hero-figure-wrap .hero-figure { bottom:2.9rem; }
}
@media (max-width:350px) {
  .scene-detail { left:4%; right:4%; }
  .scene-controls { gap:.55rem; }
  .scene-dot { width:23px; }
  .hero-content { padding-left:.45rem; padding-right:.45rem; }
  .names { font-size:14vw; }
}
@media (max-height:610px) {
  .events.events-v4,.scene-shell { min-height:0; height:100svh; }
  .scene-heading { top:1.5%; }
  .scene-heading .sec-title { font-size:1.58rem; }
  .scene-intro { font-size:.83rem; }
  .scene-stage { top:14.5%; height:51.5%; }
  .scene-detail { top:65.5%; height:21%; }
  .scene-detail .event-name { font-size:1.68rem; }
  .scene-detail .event-description { font-size:.75rem; }
  .scene-controls { bottom:4.1%; }
  .scene-gesture { bottom:.8%; font-size:.75rem; }
}
@media (prefers-reduced-motion:reduce) {
  .scene-sparkle,.scene-shell.is-turning .scene-figure,.scene-shell.is-entering .scene-figure,.scene-shell.figure-waving .scene-figure { animation:none!important; }
  .stage-floor { transition:none!important; }
}
