:root {
  --ink: #5a3005;
  --ink-soft: #7a4a12;
  --marigold: #e07b0b;
  --haldi: #f2b705;
  --cream: #fff6e2;
  --script: "Great Vibes", "Brush Script MT", cursive;
  --serif: "Cormorant Garamond", Georgia, serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: #fbefcf;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

#fx {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 40;
}

/* ---------- music button ---------- */
.music {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  right: 14px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px 9px 12px;
  border-radius: 999px;
  background: rgb(255 248 228 / 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 18px rgb(120 70 0 / 0.18);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.music .bars { display: flex; align-items: flex-end; gap: 2px; height: 14px; }
.music .bars i { width: 3px; height: 4px; background: var(--marigold); border-radius: 2px; }
.music[aria-pressed="true"] .bars i { animation: bar 0.9s ease-in-out infinite; }
.music .bars i:nth-child(2) { animation-delay: -0.3s; }
.music .bars i:nth-child(3) { animation-delay: -0.6s; }
.music .bars i:nth-child(4) { animation-delay: -0.15s; }
@keyframes bar { 0%, 100% { height: 4px; } 50% { height: 14px; } }

/* ---------- shared ---------- */
.scene {
  position: relative;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}
.bg, .bg img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.script {
  font-family: var(--script);
  font-weight: 400;
  line-height: 1;
  color: var(--marigold);
  text-shadow: 0 2px 0 rgb(255 240 200 / 0.9), 0 0 24px rgb(255 245 220 / 0.9);
}
.kicker {
  font-size: 0.95rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink-soft);
}
.names { font-size: 1.5rem; font-style: italic; }
.names span { font-style: normal; font-weight: 600; letter-spacing: 0.02em; }
.line { font-size: 1.2rem; line-height: 1.4; font-weight: 500; }

/* ---------- 1. pots ---------- */
.pots .spill { opacity: 0; }
.pots.started .spill { opacity: 1; }
.pots-text {
  position: absolute;
  left: 50%;
  top: 14%;
  transform: translateX(-50%);
  width: min(90vw, 640px);
  text-align: center;
  z-index: 2;
  text-shadow: 0 0 18px rgb(255 247 225 / 0.95);
}
.pots-text::before {
  content: "";
  position: absolute;
  inset: -12% -8%;
  z-index: -1;
  background: radial-gradient(closest-side, rgb(255 246 222 / 0.85), rgb(255 246 222 / 0));
}
.pots-text .script { font-size: clamp(5.5rem, 24vw, 10rem); margin: 0.05em 0 0.08em; }
.pot-btn {
  position: absolute;
  bottom: 0;
  width: 38%;
  height: 46%;
  z-index: 3;
  -webkit-tap-highlight-color: transparent;
}
.pot-btn.left { left: 0; }
.pot-btn.right { right: 0; }
.pot-btn:focus-visible { outline: 3px dashed var(--marigold); outline-offset: -10px; border-radius: 30px; }
.hint {
  position: absolute;
  left: 50%;
  bottom: 9%;
  transform: translateX(-50%);
  z-index: 2;
  padding: 10px 20px;
  border-radius: 999px;
  background: rgb(255 248 228 / 0.85);
  box-shadow: 0 6px 24px rgb(140 80 0 / 0.18);
  font-size: 1.15rem;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  animation: breathe 2.4s ease-in-out infinite;
}
.hint-next { display: none; }
.pots.started .hint-start { display: none; }
.pots.started .hint-next { display: inline; }
@keyframes breathe { 0%, 100% { transform: translateX(-50%) scale(1); } 50% { transform: translateX(-50%) scale(1.04); } }
.chev {
  position: absolute;
  left: 50%;
  bottom: 3.5%;
  width: 16px;
  height: 16px;
  margin-left: -8px;
  border-right: 2.5px solid var(--ink-soft);
  border-bottom: 2.5px solid var(--ink-soft);
  transform: rotate(45deg);
  opacity: 0;
  z-index: 2;
}
.pots.started .chev { opacity: 0.8; animation: bob 1.4s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(45deg); } 50% { transform: translateY(7px) rotate(45deg); } }

/* ---------- 2-3. squads ---------- */
.squad-card {
  position: absolute;
  z-index: 2;
  bottom: 7%;
  width: min(86vw, 420px);
  padding: 22px 24px 20px;
  border-radius: 22px;
  background: rgb(255 248 228 / 0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 10px 40px rgb(110 60 0 / 0.25);
  text-align: center;
}
.squad-card.left { left: 5%; }
.squad-card.right { right: 5%; }
.squad-card .script { font-size: clamp(2.8rem, 11vw, 4rem); margin: 4px 0 8px; }
@media (max-aspect-ratio: 1/1) {
  .squad-card, .squad-card.left, .squad-card.right { left: 50%; right: auto; transform: translateX(-50%); bottom: 4%; }
}

/* ---------- 4. shower ---------- */
.shower { height: 130vh; height: 130svh; }
.shower { overflow: clip; }
.shower-pin { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.shower-text {
  position: absolute;
  left: 50%;
  top: 30%;
  transform: translateX(-50%);
  width: min(90vw, 560px);
  text-align: center;
  text-shadow: 0 0 16px rgb(255 247 225 / 1), 0 0 4px rgb(255 247 225 / 1);
}
.shower-text .script { font-size: clamp(3.6rem, 15vw, 6.5rem); margin-bottom: 10px; }

/* ---------- 5. couple ---------- */
.couple {
  position: relative;
  background: #eeb52a; /* haldi, never a cream gap (stage 4) */
}
.couple-head {
  position: relative;
  z-index: 3;
  padding: 64px 20px 26px;
  text-align: center;
  background: linear-gradient(#fbefcf, #fff6e2);
  box-shadow: 0 10px 24px rgb(160 100 0 / 0.12);
}
.couple-head .script { font-size: clamp(3.4rem, 13vw, 5.5rem); }
.pair { display: flex; }
.stage {
  position: relative;
  flex: 1 1 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  touch-action: manipulation;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}
.stage + .stage { border-left: 3px solid #f5d27a; }
.stage img, .stage canvas {
  position: absolute;
  max-width: none;
  pointer-events: none;
  -webkit-user-drag: none;
}
.stage .covered { opacity: 0; }
.stage .paint { mix-blend-mode: multiply; }
.stage.done .covered { opacity: 1; }
.stage.done .paint { opacity: 0; transition: opacity 0.5s; }
.tag {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 5%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 190px;
  padding: 10px 20px;
  border-radius: 18px;
  background: rgb(255 248 228 / 0.9);
  box-shadow: 0 6px 24px rgb(140 80 0 / 0.2);
  pointer-events: none;
  text-align: center;
}
.tag b { font-family: var(--script); font-weight: 400; font-size: 2.2rem; line-height: 1; color: var(--marigold); }
.tag .count { font-size: 1.05rem; font-weight: 600; }
@media (max-aspect-ratio: 1/1) {
  .pair { flex-direction: column; }
  .stage + .stage { border-left: 0; border-top: 3px solid #f5d27a; }
  .stage { flex: none; width: 100%; }
}

/* ---------- 6. details ---------- */
.details {
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 60px 18px;
  background: radial-gradient(ellipse at 50% 30%, #fff7e3, #f9e2a8 70%, #f3cf72);
}
.card {
  width: min(92vw, 520px);
  padding: 38px 28px 32px;
  border-radius: 28px;
  background: rgb(255 250 236 / 0.92);
  box-shadow: 0 18px 60px rgb(130 75 0 / 0.22), inset 0 0 0 1.5px #ecc35f;
  text-align: center;
}
.card .script { font-size: clamp(3.2rem, 13vw, 4.6rem); margin: 6px 0 6px; }
.card dl { margin: 26px 0 26px; display: grid; gap: 14px; }
.card dt { font-size: 0.85rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--ink-soft); font-weight: 600; }
.card dd { font-size: 1.35rem; font-weight: 600; }
.btn {
  display: inline-block;
  padding: 13px 30px;
  border-radius: 999px;
  background: linear-gradient(#f6b21c, #e0860b);
  color: #fffaf0;
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  box-shadow: 0 6px 18px rgb(180 90 0 / 0.35);
}
.sign { margin-top: 24px; font-style: italic; font-size: 1.2rem; }

@media (prefers-reduced-motion: reduce) {
  .hint, .music[aria-pressed="true"] .bars i, .pots.started .chev { animation: none; }
}

@media (max-width: 480px) {
  .kicker { letter-spacing: 0.18em; font-size: 0.85rem; }
}

/* ================= v2 stage 1: journey (pots -> fall -> marigold burst -> groom's squad) ================= */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.journey { position: relative; height: 1750vh; height: 1750svh; } /* more scroll per scene = calmer */
.j-pin {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: #f4dfa6;
}
.j-sq, .j-sq video, .j-fallback, .j-fallback img, .j-showerpic, .j-showerpic img, .j-end, #gl {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.j-sq video, .j-fallback img, .j-showerpic img { object-fit: cover; }
.j-sq { z-index: 0; }
.j-bride { visibility: hidden; }
.j-sq .j-card { z-index: 2; opacity: 0; visibility: hidden; }
.j-showerpic { z-index: 1; opacity: 0; }
.js-gl .j-showerpic { display: none; }
.j-stext {
  position: absolute;
  left: 50%;
  top: 12%;
  z-index: 4;
  width: min(90vw, 560px);
  translate: -50% 26px;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  text-shadow: 0 0 16px rgb(255 247 225 / 1), 0 0 4px rgb(255 247 225 / 1);
}
.j-stext::before {
  content: "";
  position: absolute;
  inset: -16% -10%;
  z-index: -1;
  background: radial-gradient(closest-side, rgb(255 246 222 / 0.78), rgb(255 246 222 / 0));
}
.j-stext .script { font-size: clamp(3.6rem, 15vw, 6.5rem); margin-bottom: 10px; }
.j-end { z-index: 6; background: #eeb52a url("../assets/img/powder.webp") center / 420px; opacity: 0; pointer-events: none; } /* no-WebGL only */
.j-turn {
  position: absolute;
  left: 50%;
  top: 34%;
  z-index: 7;
  width: min(90vw, 620px);
  translate: -50% 22px;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  text-shadow: 0 0 16px rgb(255 247 225 / 1), 0 0 4px rgb(255 247 225 / 1);
}
.j-turn::before {
  content: "";
  position: absolute;
  inset: -34% -16%;
  z-index: -1;
  background: radial-gradient(closest-side, rgb(255 247 226 / 0.97) 45%, rgb(255 246 222 / 0.7) 70%, rgb(255 246 222 / 0));
}
.j-turn .script { font-size: clamp(3.6rem, 15vw, 6.5rem); margin-bottom: 8px; }
.j-fallback { z-index: 1; }
.js-gl .j-fallback { display: none; }
#gl { z-index: 2; touch-action: pan-y; }
.j-text {
  position: absolute;
  left: 50%;
  top: 11%;
  z-index: 4;
  width: min(90vw, 640px);
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
  text-shadow: 0 0 18px rgb(255 247 225 / 0.95);
  will-change: transform, opacity;
}
.j-text::before {
  content: "";
  position: absolute;
  inset: -14% -10%;
  z-index: -1;
  background: radial-gradient(closest-side, rgb(255 246 222 / 0.8), rgb(255 246 222 / 0));
}
.j-text .script { font-size: clamp(5.5rem, 24vw, 10rem); margin: 0.05em 0 0.08em; }
.j-pot {
  position: absolute;
  z-index: 5;
  border-radius: 46%;
  -webkit-tap-highlight-color: transparent;
}
.j-pot:focus-visible { outline: 3px dashed var(--marigold); outline-offset: 4px; }
.j-pot::after {
  /* soft "tap me" glow ring on the pot mouth until it is tapped */
  content: "";
  position: absolute;
  left: 50%;
  top: 6%;
  width: 46%;
  aspect-ratio: 1;
  translate: -50% 0;
  border-radius: 50%;
  border: 2px solid rgb(255 250 230 / 0.9);
  box-shadow: 0 0 22px rgb(255 214 90 / 0.9);
  animation: potPing 2s ease-out infinite;
  pointer-events: none;
}
.j-pot.poured::after { display: none; }
.j-pot[data-pot="1"]::after { animation-delay: -1s; }
@keyframes potPing { 0% { scale: 0.5; opacity: 0; } 25% { opacity: 1; } 100% { scale: 1.25; opacity: 0; } }
.j-hint { z-index: 5; bottom: 7%; }
.j-hint span { display: none; }
.j-hint[data-step="1"] .h1, .j-hint[data-step="2"] .h2, .j-hint[data-step="3"] .h3 { display: inline; }
.j-chev { z-index: 5; }
.j-chev.on { opacity: 0.8; animation: bob 1.4s ease-in-out infinite; }
.j-hint, .j-chev, .j-pot { transition: opacity 0.4s; }
.journey.falling .j-hint, .journey.falling .j-chev, .journey.falling .j-pot { opacity: 0; pointer-events: none; }
@media (max-aspect-ratio: 1/1) {
  .j-text { top: 9%; }
}
@media (prefers-reduced-motion: reduce) {
  .j-pot::after, .j-chev.on { animation: none; }
}

/* ================= v2 stage 2: finale (bride from the left, groom from the right, flowers) ================= */
.pair { position: relative; }
#gl2 { position: absolute; left: 0; top: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }
.flower {
  position: absolute;
  z-index: 4;
  left: 16%;
  top: 26%;
  width: clamp(104px, 28%, 230px);
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  -webkit-tap-highlight-color: transparent;
  background: url("../assets/img/mari-heads.webp") 100% 0 / 200% 100% no-repeat; /* no-WebGL look; WebGL draws a 3D flower */
}
.flower[data-who="groom"] { left: 84%; background-position: 0 0; }
.js-gl2 .flower { background: none; }
.flower { cursor: pointer; }
.flower:focus-visible { outline: 2px solid rgb(255 250 230 / 0.95); outline-offset: 2px; }

/* ================= v2 stage 2: details - wipe the haldi off his invite card ================= */
.details { display: block; place-items: normal; padding: 0 0 60px; background: radial-gradient(ellipse at 50% 70%, #fff7e3, #f9e2a8 70%, #f3cf72); }
.inv-maps { display: table; margin: 18px auto 0; opacity: 0; visibility: hidden; translate: 0 10px; transition: opacity 0.6s 0.5s, translate 0.6s 0.5s, visibility 0s 0.5s; }
.details.revealed .inv-maps { opacity: 1; visibility: visible; translate: 0 0; }
.inv { position: relative; height: 100vh; height: 100svh; overflow: hidden; background: #fbefcf; }
.inv picture, .inv-img, .inv-cover, .inv-fall { position: absolute; inset: 0; width: 100%; height: 100%; }
.inv-fall { pointer-events: none; z-index: 2; }
.inv-img { object-fit: cover; }
.inv-cover { touch-action: none; cursor: grab; transition: opacity 1s ease; }
.details.revealed .inv-cover { opacity: 0; pointer-events: none; }
.inv-hint { bottom: 8%; z-index: 3; }
.details.wiping .inv-hint, .details.revealed .inv-hint, .details:not(.filled) .inv-hint { opacity: 0; transition: opacity 0.4s; }
.inv-skip {
  display: block;
  margin: 14px auto 0;
  padding: 6px 14px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: underline;
  color: var(--ink-soft);
}
.details.revealed .inv-skip { display: none; }
@media (max-aspect-ratio: 1/1) {
  .details { padding-top: 26px; }
  .inv { height: auto; aspect-ratio: 1092 / 1469; margin: 0 10px; border-radius: 18px; box-shadow: 0 14px 40px rgb(130 75 0 / 0.25); }
  .inv picture, .inv-img, .inv-cover, .inv-fall { border-radius: 18px; overflow: hidden; }
  .inv-hint { top: 50%; bottom: auto; transform: translate(-50%, -50%); animation: none; font-size: 1rem; }
}
