/* ANAMITRA invitation — a day-time look. Palette tokens from the brand (same as the Diwali page). */
:root {
  --midnight: #1B2B3B;
  --indigo: #2E546E;
  --mist: #91BFE2;
  --sage: #8FA59B;
  --sand: #F2C78D;
  --peach: #F8D3B9;
  --coral: #E67A5E;
  --mark-coral: #F27545;
  --ivory: #F7F8F1;

  --font-display: "Gloock", "Playfair Display", Georgia, serif;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-script: "Dancing Script", cursive;
}
:lang(mr), :lang(hi) {
  --font-display: "Tiro Devanagari Marathi", "Tiro Devanagari Hindi", Georgia, serif;
  --font-sans: "Mukta", system-ui, sans-serif;
  --font-script: var(--font-display);
}
:lang(hi) { --font-display: "Tiro Devanagari Hindi", "Tiro Devanagari Marathi", Georgia, serif; }

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--sand); }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; overflow: hidden;
  background: var(--sand); color: var(--midnight);
  font-family: var(--font-sans); font-size: 1rem; line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}
:lang(mr) body, :lang(hi) body { line-height: 1.6; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* soft, blurred copy of the picture fills the sides of wide screens and sits behind the language picker */
.bg {
  position: fixed; inset: -4%; z-index: 0;
  background: url("../assets/img/hero.webp") center / cover no-repeat;
  filter: blur(18px) saturate(1.05); transform: scale(1.04);
}
.bg::after { content: ""; position: absolute; inset: 0; background: rgba(247, 248, 241, .42); }
#app, #fallback { position: relative; z-index: 1; }

.screen {
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1rem; padding: 2rem 1.5rem; text-align: center;
}
.fb-img { width: min(70vw, 340px); height: auto; border-radius: 18px; }
.fb-h, .pick-title { font-family: var(--font-display); font-weight: 400; margin: 0; color: var(--midnight); line-height: 1.2; }
.fb-h { font-size: 1.7rem; }
.js #fallback { display: none; }

/* buttons */
.btn {
  appearance: none; border: 1.5px solid var(--indigo); background: rgba(247, 248, 241, .85); color: var(--indigo);
  font: 600 1.05rem/1 var(--font-sans); padding: .95rem 1.6rem; border-radius: 999px; cursor: pointer; min-height: 48px;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
  transition: transform .25s ease, background .25s ease, color .25s ease;
}
.btn:hover { background: var(--indigo); color: var(--ivory); }
.btn:focus-visible, .icon-btn:focus-visible, .social a:focus-visible { outline: 3px solid var(--mark-coral); outline-offset: 3px; }
.btn-primary { background: var(--indigo); color: var(--ivory); border-color: var(--indigo); }
.btn-primary:hover { background: var(--midnight); border-color: var(--midnight); }
.btn-small { font-size: .9rem; padding: .6rem 1.1rem; min-height: 44px; }

/* language picker */
#lang-select { background: radial-gradient(70% 55% at 50% 45%, rgba(247, 248, 241, .8), rgba(247, 248, 241, 0) 100%); }
.mark { width: 74px; height: auto; margin-bottom: .4rem; }
.pick-title { font-size: 1.7rem; }
.pick-sub { margin: -.4rem 0 .6rem; color: var(--indigo); font-size: 1rem; }
.lang-list { display: flex; flex-direction: column; gap: .8rem; width: min(80vw, 280px); }
.lang-list .btn { font-size: 1.15rem; }

/* the stage: a 9:16 column (full-screen on phones, centred on wide screens) */
.stage {
  position: relative; height: 100vh; height: 100dvh; width: min(100vw, calc(100vh * 9 / 16)); width: min(100vw, calc(100dvh * 9 / 16));
  margin: 0 auto; overflow: hidden; background: var(--sand); container-type: size;
  box-shadow: 0 0 60px rgba(27, 43, 59, .25);
}
.gl, .hero2d { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero2d { object-fit: cover; transform-origin: 50% 50%; will-change: transform; display: none; }
html:not(.mode3d) .hero2d { display: block; }
html.mode3d .gl { display: block; }
html:not(.mode3d) .gl { display: none; }

.top-veil {
  position: absolute; left: 0; right: 0; top: 0; height: 52cqh; pointer-events: none;
  background: linear-gradient(to bottom, rgba(255, 246, 222, .62), rgba(255, 246, 222, .3) 55%, rgba(255, 246, 222, 0));
  opacity: 0;
}

/* words on the picture */
.copy { position: absolute; left: 6cqw; right: 6cqw; top: 9cqh; text-align: center; pointer-events: none; }
.line {
  margin: 0; position: absolute; left: 0; right: 0; top: 0;
  font-family: var(--font-display); color: var(--midnight); font-weight: 400;
  font-size: clamp(28px, 10.6cqw, 54px); line-height: 1.16;
  text-shadow: 0 0 .45em rgba(255, 246, 222, .95), 0 0 1.1em rgba(255, 238, 196, .85), 0 0 2em rgba(255, 238, 196, .6);
}
.line-2 { font-size: clamp(20px, 6.2cqw, 40px); }
:lang(mr) .line-2, :lang(hi) .line-2 { font-size: clamp(24px, 8cqw, 42px); }
:lang(mr) .line, :lang(hi) .line { line-height: 1.3; }
.line .row { display: block; }
.line .w { display: inline-block; opacity: 0; will-change: transform, opacity; }
.line .hl { color: var(--mark-coral); }

/* veil that carries the logo and the end card */
.veil {
  position: absolute; inset: 0; opacity: 0; pointer-events: none;
  background: radial-gradient(95% 70% at 50% 46%, rgba(247, 248, 241, .94), rgba(247, 248, 241, .84) 55%, rgba(248, 211, 185, .7));
}
.final {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2.6cqh; padding: calc(max(12px, env(safe-area-inset-top)) + 54px) 7cqw 2cqh; text-align: center; pointer-events: none; visibility: hidden;
}
.final.on { visibility: visible; }
.final .end.live a, .final .end.live button { pointer-events: auto; }
.lockup { position: relative; width: min(80cqw, 440px); aspect-ratio: 2000 / 515; flex: none; }
.lk-mark, .lk-text { position: absolute; display: block; }
.lk-text { opacity: 0; }
.lk-mark * { transform-box: fill-box; transform-origin: center; }

.end { display: flex; flex-direction: column; align-items: center; gap: 1.5cqh; width: 100%; }
.end > * { opacity: 0; }
.quote { margin: 0; font-family: var(--font-display); font-size: clamp(18px, 5.4cqw, 26px); color: var(--indigo); line-height: 1.25; }
.family { margin: 0; max-width: 34ch; font-size: clamp(15px, 4.3cqw, 18.5px); line-height: 1.45; color: var(--midnight); }
.join { margin: .6cqh 0 0; font-weight: 600; font-size: clamp(14.5px, 4.1cqw, 17.5px); color: var(--indigo); letter-spacing: .01em; }
.end .btn-primary { font-size: clamp(16px, 4.6cqw, 20px); padding: 1rem 2rem; }
.social { display: flex; gap: .75rem; justify-content: center; }
.social a {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: var(--indigo); color: var(--ivory); transition: transform .25s ease, background .25s ease;
}
.social a:hover { background: var(--mark-coral); transform: translateY(-2px); }
.social svg { width: 22px; height: 22px; fill: currentColor; }
.handle { margin: -.4cqh 0 0; font-size: .98rem; color: var(--indigo); font-weight: 600; }
.signature { margin: .8cqh 0 0; font-family: var(--font-script); font-size: clamp(22px, 7cqw, 32px); color: var(--mark-coral); line-height: 1.2; text-shadow: 0 0 .5em rgba(247, 248, 241, .9); }
.actions { margin-top: .4cqh; }

/* start overlay (only when the page is opened with ?lang= and no tap has happened yet) */
.invite {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: .7rem;
  padding: 0 1.5rem 18cqh; background: linear-gradient(to top, rgba(247, 248, 241, .65), rgba(247, 248, 241, 0) 55%);
}
.invite.gone { display: none; }
.muted { margin: 0; color: var(--indigo); font-size: .9rem; font-weight: 600; text-shadow: 0 0 .6em rgba(247, 248, 241, .9); }

.icon-btn {
  appearance: none; border: 0; background: rgba(247, 248, 241, .78); color: var(--indigo); width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer; backdrop-filter: blur(6px);
}
.mute { position: absolute; top: max(12px, env(safe-area-inset-top)); right: 12px; z-index: 5; }
.mute .slash { display: none; }
.mute[aria-pressed="true"] .slash { display: block; }
.mute[aria-pressed="true"] .wave { display: none; }

/* Tap 1: open the book */
.tap-target {
  position: absolute; left: 5%; right: 5%; top: 34%; height: 36%; z-index: 3; background: transparent; border: 0; cursor: pointer;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.tap-target:focus-visible { outline: 3px solid var(--mark-coral); outline-offset: -3px; border-radius: 24px; }
.hint {
  position: absolute; left: 50%; top: 52%; width: 84%; transform: translate(-50%, -50%); z-index: 3; opacity: 0; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: .8rem;
}
.hint .ring {
  width: 88px; height: 88px; border-radius: 50%; border: 3px solid rgba(255, 253, 244, .95);
  background: radial-gradient(circle, rgba(255, 253, 244, .35), rgba(255, 253, 244, 0) 70%); animation: pulse 1.7s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 236, 190, .8), 0 0 24px rgba(255, 236, 190, .9); }
  100% { box-shadow: 0 0 0 40px rgba(255, 236, 190, 0), 0 0 24px rgba(255, 236, 190, .9); }
}
.hint-label { background: rgba(247, 248, 241, .92); color: var(--indigo); font: 600 .95rem/1.3 var(--font-sans); padding: .55rem 1.05rem; border-radius: 999px; text-align: center; }

/* Tap 2: three shapes to put together */
.asm { position: absolute; left: 50%; margin-left: -30cqw; width: 60cqw; top: calc(44cqh - 30cqw); overflow: visible; opacity: 0; pointer-events: none; }
.asm .pick { pointer-events: auto; cursor: pointer; outline: none; -webkit-tap-highlight-color: transparent; }
.asm .pick:focus-visible { stroke: var(--midnight); stroke-width: 12; }
.shape-hint { position: absolute; left: 8cqw; right: 8cqw; bottom: 11cqh; margin: 0; text-align: center; font-weight: 600; color: var(--indigo); font-size: clamp(14px, 4.2cqw, 18px); opacity: 0; }
.asm-cap { position: absolute; left: 0; right: 0; bottom: 17cqh; margin: 0; text-align: center; font-family: var(--font-display); font-size: clamp(20px, 6cqw, 28px); color: var(--mark-coral); min-height: 1.4em; opacity: 0; text-shadow: 0 0 .5em rgba(247, 248, 241, .9); }

/* sparkles for taps in the 2D fallback */
.spark { position: absolute; width: 10px; height: 10px; border-radius: 50%; z-index: 4; pointer-events: none; background: radial-gradient(circle, #fff6d8, #f2c78d 60%, rgba(242, 199, 141, 0)); }

@media (prefers-reduced-motion: reduce) { .btn, .social a { transition: none; } .hint .ring { animation: none; } }
