/* Shared look for the hub and the on-screen text of every experience.
   Festive night: Poppins throughout (the typeface of the client's "Diwali Yahin Se Shuru" logo; it also
   covers Devanagari), white type on deep night indigo, a marigold accent, with the logo's magenta and
   sky blue for highlights. Fonts are self-hosted (SIL OFL). */

@font-face { font-family: "Poppins"; src: url("fonts/Poppins-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("fonts/Poppins-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("fonts/Poppins-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("fonts/Poppins-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("fonts/Poppins-ExtraBold.woff2") format("woff2"); font-weight: 800; font-display: swap; }

:root {
  --bg: #070719;
  --bg-2: #140e38;
  --ink: #ffffff;
  --ink-2: rgba(255, 255, 255, 0.74);
  --ink-3: rgba(255, 255, 255, 0.48);
  --rule: rgba(255, 255, 255, 0.2);
  --gold: #ffb52e;                       /* marigold */
  --gold-soft: rgba(255, 181, 46, 0.4);
  --magenta: #e0479e;                    /* the logo's "Diwali" pink */
  --sky: #3ea2ff;                        /* the logo's blue */
  --display: "Poppins", "Nirmala UI", "Segoe UI", sans-serif;
  --deva: "Poppins", "Nirmala UI", sans-serif;
  --sans: "Poppins", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --label: "Poppins", "Segoe UI", sans-serif;
  --lift: 0 1px 2px rgba(0, 0, 0, 0.7), 0 0 22px rgba(0, 0, 0, 0.6);
  --edge: clamp(16px, 2.6vw, 36px);
}

/* accents are colour, not slant: Poppins has no designed italic here */
em { font-style: normal; }

/* ---------------------------------------------------------------- overlay type */
.x-label { font-family: var(--label); font-size: 11px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-2); }

/* loading curtain */
.x-loading { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; background: var(--bg); transition: opacity 1.2s ease; text-align: center; }
.x-loading.hide { opacity: 0; pointer-events: none; }
.x-loading .t { font-family: var(--display); font-weight: 700; font-size: clamp(34px, 5vw, 64px); color: var(--ink); line-height: 1; }
.x-loading .t.deva { font-family: var(--deva); font-style: normal; }
.x-loading .x-label { display: block; margin-top: 16px; }

/* loading intro: the client's logo, cut off its white paper (assets/brand/cut, made by tools/cut_logo.py),
   floating in warm light with a slow sweep of light across the paper pieces, a hairline progress bar and a
   label; on exit the logo lifts and fades into the game */
.x-intro { position: fixed; inset: 0; z-index: 10; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(ellipse 70% 50% at 50% 44%, #221256 0%, var(--bg) 70%); transition: opacity 1.1s ease 0.3s; text-align: center; }
.x-intro::before { content: ""; position: absolute; left: 50%; top: 44%; width: min(120vw, 76vh); aspect-ratio: 1; transform: translate(-50%, -50%);
  border-radius: 50%; background: radial-gradient(circle, rgba(255, 170, 90, 0.2), rgba(150, 60, 160, 0.1) 40%, rgba(0, 0, 0, 0) 66%); animation: x-breathe 4.5s ease-in-out infinite; pointer-events: none; }
.x-intro .float { animation: x-float 5.5s ease-in-out infinite; }
/* the sweep is masked to the logo's own shape, so only the paper catches the light */
.x-intro .logo { position: relative; width: min(84vw, 46vh); aspect-ratio: 1376 / 1355; overflow: hidden;
  -webkit-mask: url("brand/cut/logo.webp") center / 100% 100% no-repeat; mask: url("brand/cut/logo.webp") center / 100% 100% no-repeat;
  transition: transform 1.2s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 1s ease; }
.x-intro .logo img { display: block; width: 100%; height: 100%; }
.x-intro .logo::after { content: ""; position: absolute; inset: -30%; transform: translateX(-110%);
  background: linear-gradient(105deg, rgba(255, 244, 222, 0) 42%, rgba(255, 244, 222, 0.5) 50%, rgba(255, 244, 222, 0) 58%);
  animation: x-sweep 3.4s ease-in-out 0.5s infinite; }
.x-intro .bar { width: min(46vw, 28vh); height: 1px; background: var(--rule); margin-top: 5vh; position: relative; }
.x-intro .bar i { position: absolute; left: 0; top: -1px; width: 100%; height: 3px; transform-origin: left; transform: scaleX(0);
  background: var(--gold); box-shadow: 0 0 12px var(--gold-soft); transition: transform 0.45s ease; }
.x-intro .x-label { display: block; margin-top: 2.4vh; font-size: max(11px, 1.3vh); }
.x-intro.hide { opacity: 0; pointer-events: none; }
.x-intro.hide .logo { transform: translateY(-4vh) scale(1.04); opacity: 0; }

/* the client's line, "Diwali / Yahin Se Shuru", cut from the logo. A faint paper-white edge and a warm
   glow keep the purple readable on the night background. */
.x-lockup { display: block; height: auto; filter: drop-shadow(0 0 0.5px rgba(255, 255, 255, 0.35)) drop-shadow(0 0 20px rgba(255, 170, 110, 0.24)); }
/* in play: small in the top-right corner; it gives way to the finale (which shows it large) along with the
   progress label, so it must come after .x-progress in the page */
.x-mark { position: fixed; top: var(--edge); right: var(--edge); width: min(27vw, 15vh); pointer-events: none; transition: opacity 0.8s;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.85)) drop-shadow(0 0 16px rgba(0, 0, 0, 0.7)); } /* over a busy 3D scene: dark lift, not glow */
.x-progress.done ~ .x-mark { opacity: 0; }
@keyframes x-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.2vh); } }
@keyframes x-sweep { 0% { transform: translateX(-110%); } 55%, 100% { transform: translateX(110%); } }
@keyframes x-breathe { 0%, 100% { opacity: 0.75; } 50% { opacity: 1; } }

/* progress: a museum-label in the top-left corner */
.x-progress { position: fixed; top: var(--edge); left: var(--edge); text-shadow: var(--lift); transition: opacity 0.8s; pointer-events: none; }
.x-progress.done { opacity: 0; }
.x-progress .count { display: block; font-family: var(--display); font-weight: 700; font-size: clamp(34px, 4vw, 52px); line-height: 1; color: var(--ink); margin-top: 8px; font-variant-numeric: tabular-nums; }
.x-progress .count em { font-style: normal; color: var(--ink-3); font-size: 0.6em; }
.x-ticks { display: flex; gap: 5px; margin-top: 12px; }
.x-ticks i { width: 16px; height: 2px; background: var(--rule); transition: background 0.4s, box-shadow 0.4s; }
.x-ticks i.on { background: var(--gold); box-shadow: 0 0 10px var(--gold-soft); }
.x-bar { width: min(200px, 40vw); height: 1px; background: var(--rule); margin-top: 14px; position: relative; }
.x-bar > i { position: absolute; left: 0; top: -1px; height: 3px; width: 0; background: var(--gold); box-shadow: 0 0 10px var(--gold-soft); transition: width 0.4s; }

/* prompt: an italic line of invitation at the bottom */
.x-prompt { position: fixed; left: 50%; bottom: calc(var(--edge) + 2vh); transform: translate(-50%, 10px); width: min(90vw, 900px); text-align: center; text-shadow: var(--lift); opacity: 0; transition: opacity 0.8s, transform 0.8s; pointer-events: none; }
.x-prompt.show { opacity: 1; transform: translate(-50%, 0); }
.x-prompt .line { font-family: var(--display); font-weight: 600; font-size: clamp(22px, 3.2vw, 46px); line-height: 1.1; color: var(--ink); }
.x-prompt .x-label { display: block; margin-top: 10px; }

/* toast: a short status line between two hairlines */
.x-toast { position: fixed; top: var(--edge); left: 50%; transform: translate(-50%, -6px); font-family: var(--label); font-size: 11px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink); text-shadow: var(--lift); padding: 8px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); opacity: 0; transition: opacity 0.3s, transform 0.3s; pointer-events: none; max-width: calc(100vw - 32px); text-align: center; white-space: nowrap; }
.x-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* help: a small colophon in the top-right corner */
.x-help { position: fixed; top: var(--edge); right: var(--edge); width: 300px; max-width: calc(100vw - 2 * var(--edge)); padding: 18px 20px 16px; background: rgba(7, 7, 25, 0.86); border: 1px solid var(--rule); opacity: 0; transition: opacity 0.5s; pointer-events: none; }
.x-help.show { opacity: 1; }
.x-help h3 { font-family: var(--display); font-weight: 700; font-size: 26px; color: var(--ink); line-height: 1; padding-bottom: 10px; border-bottom: 1px solid var(--rule); margin-bottom: 10px; }
.x-help p { font-family: var(--sans); font-size: 13px; line-height: 1.5; color: var(--ink-2); margin: 0 0 6px; }
.x-help dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--rule); font-family: var(--label); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }
.x-help dt { color: var(--gold); }
.x-help dd { margin: 0; color: var(--ink-2); }

/* sound hint + stats */
.x-sound { position: fixed; left: var(--edge); bottom: var(--edge); transition: opacity 0.5s; text-shadow: var(--lift); pointer-events: none; }
.x-sound.hide { opacity: 0; }
.x-stats { position: fixed; left: var(--edge); bottom: var(--edge); font-family: var(--label); font-size: 11px; color: var(--ink-2); text-shadow: var(--lift); display: none; }
.x-stats.show { display: block; }

/* camera preview: a plain hairline frame */
.x-cam { position: fixed; right: var(--edge); bottom: var(--edge); border: 1px solid var(--rule); display: none; }
.x-cam.show { display: block; }
.x-cam canvas { display: block; width: 256px; height: 144px; }

/* festive finale: the Devanagari greeting, the client's line (the lockup), a sign-off */
.x-finale { position: fixed; inset: 0; display: grid; place-items: center; pointer-events: none; text-align: center; padding: 16px; }
/* a soft dark pool behind the card, so the lettering reads over whatever the scene is showing */
.x-finale::before { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse 80% 38% at 50% 40%, rgba(5, 5, 20, 0.78), rgba(5, 5, 20, 0)); opacity: 0; transition: opacity 1.6s ease; }
.x-finale.show::before { opacity: 1; }
.x-finale .card { position: relative; transform: translateY(-8vh); opacity: 0; transition: opacity 1.6s ease, transform 2s cubic-bezier(0.2, 0.8, 0.2, 1); text-shadow: 0 2px 30px rgba(0, 0, 0, 0.7); }
.x-finale.show .card { opacity: 1; transform: translateY(-10vh); }
/* the greeting sits above the lockup, centred over "Diwali" (the lockup's lower line is set to the right, so
   a centred line under it looks off) */
.x-finale h2 { font-family: var(--deva); font-weight: 600; font-size: clamp(24px, 3.4vw, 46px); line-height: 1.2; color: var(--gold); margin-bottom: 0.35em; }
.x-finale .x-lockup { width: min(80vw, 46vh); margin: 0 auto; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8)) drop-shadow(0 0 30px rgba(0, 0, 0, 0.65)); }
.x-finale p { margin-top: 2.6vh; font-family: var(--label); font-size: clamp(10px, 1.1vw, 13px); letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink); text-shadow: 0 0 3px #000, 0 0 10px #000, 0 0 24px #000; }

@media (max-width: 640px) {
  .x-help { width: auto; left: var(--edge); }
  .x-toast { white-space: normal; }
}
