/* =====================================================================
   GROOM SIDE · Gujarati wedding × physical AI
   Palette = the first page's: kumkum maroon, marigold, gold, cream, rani.
   ===================================================================== */
body[data-side="groom"] {
  --bg: #2a0710; --bg2: #3d0a14; --ink: #fff4e0; --muted: #e6c9a8;
  --accent: #ffb703; --accent2: #ff8fab; --gold: #e9c46a; --saffron: #fb8500; --leaf: #3f8f5f; --kumkum: #c1121f;
  --line: rgba(233, 196, 106, .26); --card: rgba(255, 244, 224, .055); --card-line: rgba(233, 196, 106, .34);
  --btn-ink: #3d0a14;
  background-color: #2a0710;
  background-image:
    radial-gradient(circle at 50% 50%, rgba(233, 196, 106, .16) 1.1px, transparent 1.6px),
    radial-gradient(circle at 50% 50%, rgba(255, 183, 3, .09) 1.1px, transparent 1.6px),
    radial-gradient(ellipse at 50% 0%, #5b0f1a 0%, #3d0a14 40%, #26050c 100%);
  background-size: 26px 26px, 26px 26px, 100% 100%;
  background-position: 0 0, 13px 13px, 0 0;
  background-attachment: scroll, scroll, fixed;
}
body[data-side="groom"] .card { clip-path: none; border-radius: 18px; }
body[data-side="groom"] #topbar { background: linear-gradient(rgba(38, 5, 12, .92) 40%, transparent); }
body[data-side="groom"] .kicker { color: var(--accent); letter-spacing: .08em; }
body[data-side="groom"] .sec-h { border-bottom: 0; position: relative; padding-bottom: 14px; }
body[data-side="groom"] .sec-h::after { content: ""; position: absolute; left: 0; bottom: 0; width: 72px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--accent), var(--saffron)); }
body[data-side="groom"] .sec-h h2 { background: linear-gradient(180deg, #ffe9a8, #e9c46a 60%, #c99a2e); -webkit-background-clip: text; background-clip: text; color: transparent; }
body[data-side="groom"] .pc.gj { border-top-color: var(--accent); } body[data-side="groom"] .pc.rj { border-top-color: var(--accent2); }

/* ---------- appear / disappear on scroll ---------- */
body[data-side="groom"] [data-rv] {
  opacity: 0; transition: opacity .75s cubic-bezier(.2, .7, .2, 1), transform .85s cubic-bezier(.2, .7, .2, 1), filter .75s;
  transition-delay: calc(var(--i, 0) * 40ms);
}
body[data-side="groom"] [data-rv="up"] { transform: translateY(44px); }
body[data-side="groom"] [data-rv="left"] { transform: translateX(-56px); }
body[data-side="groom"] [data-rv="right"] { transform: translateX(56px); }
body[data-side="groom"] [data-rv="zoom"] { transform: scale(.86); filter: blur(6px); }
body[data-side="groom"] [data-rv="fold"] { transform: perspective(1000px) rotateX(-72deg); transform-origin: 50% 0; }
body[data-side="groom"] [data-rv].in { opacity: 1; transform: none; filter: none; }

/* ---------- HERO: carved doors that open as you scroll ---------- */
.gx-hero { position: relative; height: 240vh; --o: min(1, calc(var(--p, 0) * 1.8)); }
.gx-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; perspective: 1500px; }
.gx-inside {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
  background: radial-gradient(ellipse at 50% 42%, #7a1a28 0%, #4a0c16 45%, #26050c 100%);
  transform: scale(calc(.9 + var(--o) * .1));
}
.gx-inside::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 50% 40%, rgba(255, 183, 3, calc(var(--o) * .22)), transparent 55%); pointer-events: none; }
.gx-in { position: relative; z-index: 3; padding: 86px 16px 96px; max-width: 760px; opacity: calc(.15 + var(--o) * .85); transform: translateY(calc((1 - var(--o)) * 24px)); }
.gx-shree { width: clamp(92px, 24vw, 150px); margin: 0 auto 6px; }
.gx-shree svg { width: 100%; height: auto; display: block; }
.shree-petals { transform-origin: 100px 100px; transform-box: view-box; animation: spin 60s linear infinite; }
.gx-names { font-size: clamp(3rem, 13vw, 6.2rem); }
.gx-names span { background: linear-gradient(180deg, #ffe9a8, #e9c46a 60%, #b8860b); -webkit-background-clip: text; background-clip: text; color: transparent; }
.gx-tithi { display: inline-block; font-size: .78rem; color: var(--gold); border: 1px solid var(--card-line); border-radius: 99px; padding: 4px 12px; margin: 0; }
.gx-lotus { position: absolute; left: 0; right: 0; bottom: 0; height: 74px; z-index: 2; }
.lotus-band { width: 100%; height: 100%; display: block; }

.gx-doors { position: absolute; inset: 0; display: flex; z-index: 5; cursor: pointer; transform-style: preserve-3d; }
.gx-hero.opened .gx-doors { pointer-events: none; }
.gx-door {
  position: relative; flex: 1; height: 100%; display: grid; place-items: center; overflow: hidden;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, .35), transparent 14%, transparent 86%, rgba(0, 0, 0, .35)),
    repeating-linear-gradient(90deg, #5b0f1a 0 7px, #520d18 7px 9px, #621220 9px 17px, #570e1a 17px 22px);
  border: 2px solid #b8862e; box-shadow: inset 0 0 60px rgba(0, 0, 0, .5);
  backface-visibility: hidden; will-change: transform;
  opacity: calc(1 - max(0, var(--o) - .82) * 5.5);
}
.gx-door.l { transform-origin: 0 50%; transform: rotateY(calc(var(--o) * -104deg)); border-right-width: 1px; }
.gx-door.r { transform-origin: 100% 50%; transform: rotateY(calc(var(--o) * 104deg)); border-left-width: 1px; }
.door-art { width: 94%; height: 94%; }
.gx-scan {
  position: absolute; left: 0; right: 0; top: 0; height: 2px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 183, 3, .85), transparent);
  box-shadow: 0 0 14px 2px rgba(255, 183, 3, .35); animation: gxScan 4.8s linear infinite; opacity: .55;
}
.gx-door.r .gx-scan { animation-delay: -2.4s; }
@keyframes gxScan { 0% { top: 0; } 100% { top: 100%; } }
.gx-hint {
  position: absolute; left: 50%; bottom: max(26px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 6;
  display: flex; gap: 8px; align-items: center; white-space: nowrap; font-size: .76rem; color: var(--ink);
  background: rgba(38, 5, 12, .78); border: 1px solid var(--card-line); border-radius: 99px; padding: 7px 14px;
  opacity: calc(1 - var(--o) * 2.4); pointer-events: none;
}
.gx-hint b { color: var(--accent); min-width: 3.2em; text-align: right; }
.gx-hint i { font-style: normal; animation: gxBounce 1.4s ease-in-out infinite; }
@keyframes gxBounce { 50% { transform: translateY(4px); } }

/* ---------- countdown: training run ---------- */
.gx-cd { max-width: 760px; margin: 0 auto; padding: 56px 16px 24px; text-align: center; }
.gx-cd h2 { font-size: clamp(1.8rem, 6vw, 2.6rem); margin: 4px 0 18px; }
.gx-digits { display: flex; justify-content: center; gap: clamp(8px, 2.6vw, 16px); }
.gx-dg { min-width: clamp(68px, 19vw, 112px); padding: 12px 6px 10px; border-radius: 16px; border: 1px solid var(--card-line); background: linear-gradient(180deg, rgba(255, 244, 224, .07), rgba(0, 0, 0, .2)); position: relative; overflow: hidden; }
.gx-dg::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: rgba(0, 0, 0, .35); }
.gx-dg b { display: block; font: 700 clamp(1.9rem, 8.5vw, 3.3rem)/1 var(--f-mono); color: var(--accent); text-shadow: 0 0 18px rgba(255, 183, 3, .35); }
.gx-dg small { font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.gx-train { max-width: 520px; margin: 20px auto 0; }
.gx-bar { height: 12px; border-radius: 99px; border: 1px solid var(--card-line); background: rgba(255, 244, 224, .06); overflow: hidden; }
.gx-bar i { display: block; height: 100%; min-width: 12px; border-radius: 99px; background: radial-gradient(circle, rgba(255, 244, 224, .9) 1px, transparent 1.6px) 0 0 / 8px 8px, linear-gradient(90deg, var(--saffron), var(--accent)); }
.gx-train p { font-size: .76rem; color: var(--muted); margin: 8px 0 0; }

/* ---------- body + floating marigolds ---------- */
.gx-body { position: relative; overflow-x: hidden; overflow-x: clip; } /* slide-in elements start off-screen; don't widen the page */
html:has(body[data-side="groom"]), body[data-side="groom"] { overflow-x: clip; }
.gx-body .wrap { position: relative; z-index: 1; }
.gx-floats { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.gx-fl { position: absolute; opacity: .5; transform: translateY(var(--py, 0px)); }
.gx-fl svg { display: block; animation: spin 40s linear infinite; }

/* ---------- kankotri card ---------- */
.gx-kankotri {
  background: linear-gradient(180deg, #fff8ea, #fdeed2) !important; color: #3d0a14; border: 0 !important;
  box-shadow: 0 0 0 2px #c1121f, 0 0 0 7px #fff4e0, 0 0 0 9px #e9c46a, 0 24px 60px rgba(0, 0, 0, .45);
  margin: 10px 8px;
}
.gx-kankotri .ic-body b { color: #c1121f; }
.gx-kankotri .ic-presence { color: #7a4b3a; }
.gx-kankotri .ic-from { color: #5b0f1a; }
.gx-k-top { width: 92px; height: auto; display: block; margin: -8px auto 8px; }

/* ---------- jaan: procession walks to the mandap as you scroll ---------- */
.gx-jaan { position: relative; height: 280vh; margin-top: 40px; }
.gx-jaan-stage {
  position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden;
  --fh: clamp(118px, 24vh, 200px); --mw: calc(var(--fh) * 1.27);
  background: linear-gradient(#26050c 0%, #3d0a14 58%, #5b0f1a 100%);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.gx-jaan-h { position: absolute; top: 70px; left: 0; right: 0; text-align: center; padding: 0 16px; z-index: 3; }
.gx-jaan-h h2 { font-size: clamp(2rem, 7vw, 3rem); background: linear-gradient(180deg, #ffe9a8, #e9c46a 60%, #c99a2e); -webkit-background-clip: text; background-clip: text; color: transparent; }
.gx-cap { position: absolute; top: calc(70px + 5.6rem); left: 16px; right: 16px; text-align: center; margin: 0; z-index: 3; font-family: var(--f-display); font-size: clamp(1.05rem, 3.6vw, 1.45rem); color: var(--ink); opacity: 0; transform: translateY(10px); transition: opacity .45s, transform .45s; }
.gx-cap.show { opacity: 1; transform: none; }
.gx-sky { position: absolute; left: -8%; right: -8%; bottom: 20%; height: 36%; color: var(--gold); opacity: .32; transform: translateX(calc(var(--p, 0) * -6%)); }
.gx-road {
  position: absolute; left: 0; right: 0; bottom: 0; height: 21%;
  background:
    linear-gradient(90deg, rgba(233, 196, 106, .45) 50%, transparent 50%) 0 10px / 48px 3px repeat-x,
    linear-gradient(#4a0c16, #26050c);
  background-position: calc(var(--p, 0) * -900px) 10px, 0 0;
  border-top: 2px solid rgba(233, 196, 106, .35);
}
.gx-mandap { position: absolute; right: 3vw; bottom: calc(21% - 12px); width: var(--mw); z-index: 1; }
.mandap-art { width: 100%; height: auto; display: block; }
.gx-bride { position: absolute; left: 22%; bottom: 7%; height: calc(var(--fh) * .92); }
.gx-bride svg { height: 100%; width: auto; display: block; }
.gx-bride .vm { transform-box: fill-box; transform-origin: 50% 50%; transition: transform .7s cubic-bezier(.2, .8, .2, 1.2); }
.gx-jaan-stage.met .gx-bride .vm { transform: translate(-14px, -34px) scale(1.06); }
.gx-proc {
  position: absolute; left: 0; bottom: calc(21% - 6px); display: flex; align-items: flex-end; gap: 0; z-index: 2;
  --q: min(1, calc(var(--p, 0) / .88));
  transform: translateX(calc(-100% + var(--q) * (100vw - 3vw - var(--mw) * .72)));
  will-change: transform;
}
.gx-fig svg { height: var(--fh); width: auto; display: block; overflow: visible; }
.gx-fig { transform: translateY(calc(var(--bob, 0) * -3px)); margin-left: calc(var(--fh) * -.08); }
.gx-fig.dog svg { height: calc(var(--fh) * .44); }
.gx-proc .leg, .gx-proc .arm { transform-box: view-box; }
.gx-proc .leg.a { transform: rotate(calc(var(--sw, 0) * 22deg)); }
.gx-proc .leg.b { transform: rotate(calc(var(--sw, 0) * -22deg)); }
.gx-proc .arm.swing.a { transform: rotate(calc(var(--sw, 0) * -14deg)); }
.gx-proc .arm.swing.b { transform: rotate(calc(var(--sw, 0) * 14deg)); }
.gx-proc .arm.drum.a { transform: rotate(calc(var(--sw, 0) * 16deg)); }
.gx-proc .arm.drum.b { transform: rotate(calc(var(--sw, 0) * -16deg)); }
.gx-route { position: absolute; left: 16px; right: 16px; bottom: max(14px, env(safe-area-inset-bottom)); display: flex; gap: 10px; align-items: center; font-size: .7rem; color: var(--muted); z-index: 3; }
.gx-route i { flex: 1; height: 4px; border-radius: 4px; background: rgba(255, 244, 224, .12); overflow: hidden; }
.gx-route b { display: block; height: 100%; width: calc(var(--p, 0) * 100%); background: linear-gradient(90deg, var(--saffron), var(--accent)); }

/* shared character bits */
.fig .flame, .mandap-art .flame { transform-box: fill-box; transform-origin: 50% 100%; animation: gxFlicker 1.1s ease-in-out infinite alternate; }
.mandap-art .flame.f2 { animation-duration: .8s; }
@keyframes gxFlicker { 0% { transform: scale(1, 1); } 50% { transform: scale(.92, 1.12); } 100% { transform: scale(1.06, .94); } }
.fig .eye, .boot .eye { transform-box: fill-box; transform-origin: 50% 50%; animation: gxBlink 4.2s infinite; }
@keyframes gxBlink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
.fig .core { animation: pulse 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.fig .glow { animation: pulse 1.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }

/* ---------- today's lesson ---------- */
.gx-today { display: grid; gap: 22px; align-items: center; }
@media (min-width: 760px) { .gx-today { grid-template-columns: minmax(260px, 340px) 1fr; } }
.gx-photo { position: relative; margin: 0 auto; width: min(320px, 78vw); aspect-ratio: 4 / 5; border-radius: 160px 160px 18px 18px; overflow: hidden; border: 2px solid var(--gold); box-shadow: 0 0 0 6px rgba(233, 196, 106, .12), 0 20px 50px rgba(0, 0, 0, .45); background: #3d0a14; }
.gx-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gx-photo figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 12px 10px; font-size: .85rem; text-align: center; background: linear-gradient(transparent, rgba(38, 5, 12, .9)); }
.gx-ph-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--gold); }
.gx-ph-empty .mandala { position: absolute; width: 130%; height: auto; opacity: .3; animation: spin 90s linear infinite; }
.gx-ph-empty span { position: relative; font-family: var(--f-display); font-size: 1.05rem; color: var(--ink); padding: 0 24px; text-align: center; }
.gx-box {
  position: absolute; inset: 20% 16% 24%; pointer-events: none; animation: gxBox 3.6s ease-in-out infinite;
  background:
    linear-gradient(var(--accent), var(--accent)) 0 0 / 22px 2px no-repeat, linear-gradient(var(--accent), var(--accent)) 0 0 / 2px 22px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 100% 0 / 22px 2px no-repeat, linear-gradient(var(--accent), var(--accent)) 100% 0 / 2px 22px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 0 100% / 22px 2px no-repeat, linear-gradient(var(--accent), var(--accent)) 0 100% / 2px 22px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 100% 100% / 22px 2px no-repeat, linear-gradient(var(--accent), var(--accent)) 100% 100% / 2px 22px no-repeat;
}
@keyframes gxBox { 50% { inset: 18% 13% 22%; } }
.gx-tag { position: absolute; top: calc(20% - 24px); left: 16%; background: var(--accent); color: var(--btn-ink); font-size: .66rem; padding: 3px 7px; border-radius: 4px; white-space: nowrap; }
.gx-lesson { border-left: 4px solid var(--daily); }
.gx-fact { font-family: var(--f-display); font-size: clamp(1.15rem, 3.8vw, 1.4rem); line-height: 1.5; margin: 8px 0 14px; }
.gx-chips { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: .78rem; }
.gx-chips span { border: 1px solid var(--card-line); border-radius: 99px; padding: 3px 10px; color: var(--gold); }
.gx-chips b { color: var(--accent); }
.gx-today-foot { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; margin-top: 16px; }

/* ---------- timeline glows as you pass it ---------- */
body[data-side="groom"] .ev-ic { border-radius: 50%; transform: none; background: #3d0a14; transition: background .5s, box-shadow .5s, color .5s; }
body[data-side="groom"] .ev-ic svg { transform: none; }
body[data-side="groom"] .ev.in .ev-ic { background: var(--accent); color: #3d0a14; box-shadow: 0 0 0 5px rgba(255, 183, 3, .16), 0 0 22px rgba(255, 183, 3, .45); }
body[data-side="groom"] .timeline::after { content: ""; position: absolute; left: 27px; top: 12px; width: 2px; height: calc(var(--p, 0) * (100% - 24px)); background: var(--accent); box-shadow: 0 0 10px var(--accent); }
body[data-side="groom"] .ev-tithi { color: var(--gold); }

/* ---------- footer robot ---------- */
.gx-foot-bot { width: 74px; margin: -70px auto 8px; position: relative; }
.gx-foot-bot svg { width: 100%; height: auto; display: block; }

/* ---------- boot screen ---------- */
.boot-groom { background: radial-gradient(ellipse at 50% 30%, #4a0c16, #26050c 70%); color: #ffb703; }
.boot-groom .boot-art { width: 84px; height: 96px; }
.boot-groom .boot-art svg { animation: none; }

/* ---------- reduced motion: everything visible, doors already open ---------- */
@media (prefers-reduced-motion: reduce) {
  .gx-hero { height: auto; } .gx-stage { position: relative; height: auto; min-height: 100svh; }
  .gx-doors, .gx-hint { display: none; }
  .gx-jaan { height: auto; } .gx-jaan-stage { position: relative; }
  body[data-side="groom"] [data-rv] { opacity: 1; transform: none; filter: none; }
}
