/* ============================================================
   Commity — "The 3 a.m. story" experience
   1) .xp-hook  — full-viewport night intro at the top of the home page
   2) .xp-story — Instagram-stories style overlay (tap · hold · swipe)
   The overlay is intentionally always-dark (like the app), regardless
   of the site theme. The hook is a "night" scene that melts into the
   page background at its bottom edge — night up top, daylight below.
   ============================================================ */

/* Shared night-sky paint — used by .xp-hook and the floating header so
   the chrome matches the landing background instead of sitting as a
   flat surface over it. */
:root {
  --xp-night-sky:
    radial-gradient(1100px 600px at 50% -12%, rgba(84, 92, 155, 0.28), transparent 62%),
    radial-gradient(800px 480px at 82% 18%, rgba(255, 208, 70, 0.05), transparent 55%),
    radial-gradient(700px 420px at 12% 64%, rgba(84, 92, 155, 0.10), transparent 60%),
    #0A0A10;
}

/* ---------------------------------------------------------------
   HEADER — same night-sky style as the landing view
   Only on pages that ship the hook (index). Always-dark chrome so it
   still reads if the visitor flipped the site to light theme.
--------------------------------------------------------------- */
body:has(.xp-hook) .site-header {
  background: var(--xp-night-sky);
  border-color: rgba(237, 235, 255, 0.10);
  box-shadow: 0 10px 32px -18px rgba(0, 0, 0, 0.55);
  color: #F0EFE9;
}
body:has(.xp-hook) .site-header.scrolled {
  background:
    radial-gradient(1100px 600px at 50% -12%, rgba(84, 92, 155, 0.22), transparent 62%),
    radial-gradient(800px 480px at 82% 18%, rgba(255, 208, 70, 0.04), transparent 55%),
    #0A0A10;
  border-color: rgba(237, 235, 255, 0.12);
  box-shadow: 0 14px 40px -16px rgba(0, 0, 0, 0.62);
}
body:has(.xp-hook) .site-header .brand { color: #F0EFE9; }
body:has(.xp-hook) .site-header .nav-links a { color: rgba(240, 239, 233, 0.62); }
body:has(.xp-hook) .site-header .nav-links a:hover,
body:has(.xp-hook) .site-header .nav-links a.active { color: #F0EFE9; }
body:has(.xp-hook) .site-header .nav-toggle { color: #F0EFE9; }
@media (max-width: 820px) {
  body:has(.xp-hook) .nav-links {
    background:
      radial-gradient(700px 360px at 50% -20%, rgba(84, 92, 155, 0.22), transparent 62%),
      rgba(10, 10, 16, 0.96);
    border-color: rgba(237, 235, 255, 0.10);
  }
}

/* ---------------------------------------------------------------
   THE HOOK
--------------------------------------------------------------- */
.xp-hook {
  position: relative;
  z-index: 1;
  /* slide underneath the floating pill header so the night sky owns
     the whole first viewport */
  margin-top: -90px;
  padding: 130px 24px 110px;
  min-height: 100svh;
  display: grid;
  place-items: center;
  text-align: center;
  overflow: clip;
  background: var(--xp-night-sky);
}
/* Night melts into the page below — the soft dawn edge the story section
   used to carry, now on the hook itself (story is button-only / no inline). */
.xp-hook::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 200px;
  background:
    linear-gradient(
      to bottom,
      rgba(10, 10, 16, 0) 0%,
      rgba(10, 10, 16, 0.35) 32%,
      rgba(255, 208, 70, 0.05) 58%,
      var(--bg) 100%
    );
  pointer-events: none;
  z-index: 1;
}

.xp-hook-inner { max-width: 780px; position: relative; }

/* --- stars --- */
.xp-star {
  position: absolute;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: #EDEBFF;
  opacity: 0.7;
  animation: xpTwinkle 3.4s ease-in-out infinite;
  pointer-events: none;
}
.xp-star.s2 { animation-delay: 0.9s; width: 2px; height: 2px; }
.xp-star.s3 { animation-delay: 1.7s; }
.xp-star.s4 { animation-delay: 2.4s; width: 2px; height: 2px; }
.xp-star.s5 { animation-delay: 0.4s; }
.xp-star.s6 { animation-delay: 2.9s; width: 4px; height: 4px; box-shadow: 0 0 8px rgba(237, 235, 255, 0.8); }
@keyframes xpTwinkle {
  0%, 100% { opacity: 0.15; transform: scale(0.8); }
  50%      { opacity: 0.9;  transform: scale(1); }
}
/* one lazy shooting star */
.xp-shoot {
  position: absolute;
  top: 14%; left: -12%;
  width: 130px; height: 1.5px;
  background: linear-gradient(90deg, transparent, rgba(237, 235, 255, 0.9));
  border-radius: 99px;
  transform: rotate(16deg);
  opacity: 0;
  animation: xpShoot 11s ease-in 3s infinite;
  pointer-events: none;
}
@keyframes xpShoot {
  0%    { opacity: 0; transform: rotate(16deg) translateX(0); }
  3%    { opacity: 0.9; }
  8%    { opacity: 0; transform: rotate(16deg) translateX(64vw); }
  100%  { opacity: 0; transform: rotate(16deg) translateX(64vw); }
}

/* --- 3:04 AM chip --- */
.xp-clock {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 208, 70, 0.26);
  background: rgba(255, 208, 70, 0.06);
  color: #FFD046;
  font-family: var(--font-head);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 3px;
  margin-bottom: clamp(26px, 4.5vh, 44px);
  backdrop-filter: blur(4px);
}
.xp-clock svg { width: 15px; height: 15px; }
.xp-clock .xp-colon { animation: xpBlink 1.25s steps(2, start) infinite; }
@keyframes xpBlink { to { visibility: hidden; } }

/* --- the lines --- */
.xp-line { margin: 0 auto; }
.xp-l1 {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(1.85rem, 5.3vw, 3.2rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
  color: #F4F3EE;
  max-width: 17ch;
}
.xp-l2 {
  font-family: var(--font-feel);
  font-weight: 600;
  font-size: clamp(1.45rem, 3.6vw, 2.15rem);
  line-height: 1.25;
  color: #FFD046;
  transform: rotate(-1.6deg);
  margin-top: clamp(14px, 2.4vh, 22px);
  max-width: 30ch;
}
.xp-l3 {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(1.85rem, 5.3vw, 3.2rem);
  line-height: 1.12;
  letter-spacing: -0.025em;
  color: #F4F3EE;
  margin-top: clamp(26px, 4.5vh, 46px);
}
.xp-l3 .xp-dim { color: rgba(244, 243, 238, 0.45); }
/* hand-drawn marker under the punchline, same gesture as the hero */
.xp-mark { position: relative; font-style: normal; color: #FFD046; white-space: nowrap; }
.xp-mark-stroke {
  position: absolute;
  left: -2%; right: -2%; bottom: -0.14em;
  width: 104%; height: 0.32em;
  overflow: visible;
}
.xp-mark-stroke path {
  stroke: #FFD046;
  stroke-width: 5;
  stroke-linecap: round;
  fill: none;
  opacity: 0.85;
}

/* --- actions --- */
.xp-hook-actions { margin-top: clamp(30px, 5vh, 52px); }
.xp-start {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 1.08rem;
  color: #1E1E1E;
  background: #FFD046;
  border: none;
  border-radius: 999px;
  padding: 18px 34px;
  cursor: pointer;
  box-shadow: 0 12px 44px -8px rgba(255, 208, 70, 0.55);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.xp-start:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 18px 54px -10px rgba(255, 208, 70, 0.7); }
.xp-start:active { transform: translateY(0) scale(0.99); }
/* soft radar ring so the button breathes */
.xp-start::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 999px;
  border: 2px solid rgba(255, 208, 70, 0.65);
  animation: xpRadar 2.6s ease-out 5.4s infinite;
  pointer-events: none;
}
@keyframes xpRadar {
  0%   { opacity: 0.9; transform: scale(1); }
  70%  { opacity: 0;   transform: scale(1.22); }
  100% { opacity: 0;   transform: scale(1.22); }
}
.xp-start-play {
  display: inline-grid;
  place-items: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #1E1E1E;
  flex: none;
}
.xp-start-play svg { width: 11px; height: 11px; margin-left: 1.5px; }
.xp-hook-note {
  margin-top: 16px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.4px;
  color: rgba(240, 239, 233, 0.45);
}
.xp-hook-note b { color: rgba(240, 239, 233, 0.7); font-weight: 700; }

/* --- scroll cue: continue into the rest of the site --- */
.xp-scroll {
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 2;
  text-align: center;
}
.xp-scroll-cue {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.86rem;
  font-weight: 600;
  color: rgba(240, 239, 233, 0.5);
  white-space: nowrap;
}
.xp-skip {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: rgba(240, 239, 233, 0.32);
  background: none;
  border: none;
  padding: 2px 6px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.25s var(--ease);
}
.xp-skip:hover { color: rgba(240, 239, 233, 0.7); }
/* once the story has been seen, the cue tells the truth again */
.xp-cue-seen { display: none; }
.xp-seen .xp-cue-first { display: none; }
.xp-seen .xp-cue-seen { display: inline-flex; color: rgba(240, 239, 233, 0.38); }
.xp-seen .xp-skip { display: none; }
.xp-scroll svg { width: 14px; height: 14px; animation: xpNudge 2s var(--ease) infinite; }
@keyframes xpNudge {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(4px); }
}

/* --- no reveal choreography: the hook shows all at once on load --- */
html.xp-js .xp-hook .xp-line,
html.xp-js .xp-hook .xp-clock {
  opacity: 1;
  transform: none;
  filter: none;
}

/* ---------------------------------------------------------------
   LIGHT THEME — the hook turns from night into an early-dawn scene:
   a soft warm sky, ink-toned copy, muted slate stars, and deepened
   gold that stays legible on a light page. Only the hook adapts; the
   story overlay stays always-dark (handled in its own section).
--------------------------------------------------------------- */
:root[data-theme="light"] {
  --xp-night-sky:
    radial-gradient(1100px 600px at 50% -12%, rgba(126, 148, 214, 0.16), transparent 62%),
    radial-gradient(820px 480px at 82% 14%, rgba(255, 196, 74, 0.16), transparent 55%),
    radial-gradient(700px 420px at 12% 64%, rgba(150, 168, 214, 0.10), transparent 60%),
    var(--bg);
}
/* dawn edge that melts the sky into the page below */
:root[data-theme="light"] .xp-hook::after {
  background:
    linear-gradient(
      to bottom,
      rgba(251, 249, 243, 0) 0%,
      rgba(251, 249, 243, 0.40) 38%,
      rgba(255, 208, 70, 0.06) 62%,
      var(--bg) 100%
    );
}
/* stars → soft slate dots that read on a light sky */
:root[data-theme="light"] .xp-star { background: #7C88B4; opacity: 0.5; }
:root[data-theme="light"] .xp-star.s6 { box-shadow: 0 0 8px rgba(124, 136, 180, 0.6); }
:root[data-theme="light"] .xp-shoot {
  background: linear-gradient(90deg, transparent, rgba(124, 136, 180, 0.7));
}
/* copy → ink tones */
:root[data-theme="light"] .xp-l1,
:root[data-theme="light"] .xp-l3 { color: var(--text); }
:root[data-theme="light"] .xp-l3 .xp-dim { color: rgba(27, 24, 19, 0.42); }
:root[data-theme="light"] .xp-hook-note { color: var(--text-dim); }
:root[data-theme="light"] .xp-hook-note b { color: var(--text-muted); }
:root[data-theme="light"] .xp-scroll-cue { color: var(--text-muted); }
:root[data-theme="light"] .xp-skip { color: var(--text-dim); }
:root[data-theme="light"] .xp-skip:hover { color: var(--text-muted); }
:root[data-theme="light"] .xp-seen .xp-cue-seen { color: var(--text-dim); }
/* gold accents → deepened so they stay legible on a light page */
:root[data-theme="light"] .xp-l2,
:root[data-theme="light"] .xp-mark { color: var(--gold-ink); }
:root[data-theme="light"] .xp-mark-stroke path { stroke: var(--gold-dark); }
:root[data-theme="light"] .xp-clock { color: var(--gold-ink); }

/* floating header chrome matches the dawn sky (else its white nav text
   would vanish once the sky turns light) */
:root[data-theme="light"] body:has(.xp-hook) .site-header {
  border-color: var(--border);
  box-shadow: 0 12px 32px -18px rgba(60, 50, 20, 0.20);
  color: var(--text);
}
:root[data-theme="light"] body:has(.xp-hook) .site-header.scrolled {
  background:
    radial-gradient(1100px 600px at 50% -12%, rgba(126, 148, 214, 0.12), transparent 62%),
    var(--bg);
  border-color: var(--border);
  box-shadow: 0 14px 40px -16px rgba(60, 50, 20, 0.24);
}
:root[data-theme="light"] body:has(.xp-hook) .site-header .brand { color: var(--text); }
:root[data-theme="light"] body:has(.xp-hook) .site-header .nav-links a { color: var(--text-muted); }
:root[data-theme="light"] body:has(.xp-hook) .site-header .nav-links a:hover,
:root[data-theme="light"] body:has(.xp-hook) .site-header .nav-links a.active { color: var(--text); }
:root[data-theme="light"] body:has(.xp-hook) .site-header .nav-toggle { color: var(--text); }
@media (max-width: 820px) {
  :root[data-theme="light"] body:has(.xp-hook) .nav-links {
    background:
      radial-gradient(700px 360px at 50% -20%, rgba(126, 148, 214, 0.12), transparent 62%),
      rgba(255, 255, 255, 0.97);
    border-color: var(--border);
  }
}

/* ---------------------------------------------------------------
   THE STORY
   Opens only via the Start button as a full-screen dialog (.xp-modal).
   Hidden from layout until then — scrolling the page never starts it.
--------------------------------------------------------------- */
.xp-story {
  position: relative;
  height: 100svh;
  overflow: clip;
  /* the night continues from the hook */
  background:
    radial-gradient(1000px 560px at 50% 0%, rgba(84, 92, 155, 0.16), transparent 62%),
    radial-gradient(760px 460px at 14% 78%, rgba(255, 208, 70, 0.05), transparent 58%),
    #0A0A10;
}
.xp-story[hidden] { display: none; }

.xp-story.xp-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  height: auto;
  background: none;
}

.xp-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 7, 11, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}
/* the dimming backdrop is a modal thing — inline, the section is its own sky */
.xp-story:not(.xp-modal) .xp-backdrop { display: none; }
.xp-story.open .xp-backdrop { opacity: 1; }

/* phone-shaped shell, full-bleed on mobile.
   --xp-drag is the live swipe-down-to-dismiss offset (JS-driven). */
.xp-shell {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: #0C0C12;
  overflow: hidden;
  opacity: 0;
  transform: scale(0.96) translateY(12px);
  transition: opacity 0.4s var(--ease), transform 0.45s var(--ease);
}
.xp-story.open .xp-shell { opacity: 1; transform: translateY(var(--xp-drag, 0px)); }
/* no JS = no .open — still show the first chapter rather than a void */
html:not(.xp-js) .xp-shell { opacity: 1; transform: none; }
/* while the finger is on it, the shell follows with no easing lag */
.xp-shell.ydrag { transition: none; }
.xp-shell:focus { outline: none; }

/* Scroll lock. The story can open while the page is already scrolled, so we
   pin the body at a negative offset rather than just hiding overflow — iOS
   Safari otherwise keeps rubber-banding the page behind the overlay. JS sets
   the `top` offset and restores the scroll position on close. */
html.xp-lock { overflow: hidden !important; }
html.xp-lock body {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  overflow: hidden !important;
}

/* --- chrome --- */
.xp-chrome {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 30;
  padding: max(12px, env(safe-area-inset-top)) 14px 18px;
  background: linear-gradient(to bottom, rgba(8, 8, 12, 0.72), rgba(8, 8, 12, 0));
  pointer-events: none;
}
.xp-bars { display: flex; gap: 5px; }
.xp-bars span {
  flex: 1;
  height: 3px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.22);
  overflow: hidden;
}
.xp-bars span i {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: 99px;
  background: #FFD046;
  transform: scaleX(0);
  transform-origin: left center;
}
.xp-bars span.done i { transform: none; }
.xp-bars span.active i { animation: xpFill linear forwards; animation-duration: 8s; }
.xp-story.paused .xp-bars span.active i { animation-play-state: paused; }
@keyframes xpFill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.xp-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  pointer-events: none;
}
.xp-top > * { pointer-events: auto; }
.xp-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.9rem;
  color: #F0EFE9;
}
.xp-brand img { width: 22px; height: 22px; }
.xp-brand small {
  font-family: var(--font-whisper);
  font-style: italic;
  font-weight: 500;
  font-size: 0.8rem;
  color: rgba(240, 239, 233, 0.55);
}
.xp-count {
  margin-left: auto;
  font-family: var(--font-head);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: rgba(240, 239, 233, 0.55);
  font-variant-numeric: tabular-nums;
}
/* the ✕ belongs to the modal — inline, you leave by scrolling on */
.xp-story:not(.xp-modal) .xp-close { display: none; }
.xp-close {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #F0EFE9;
  cursor: pointer;
  transition: background 0.25s var(--ease), transform 0.25s var(--ease);
}
.xp-close:hover { background: rgba(255, 255, 255, 0.14); transform: scale(1.06); }
.xp-close svg { width: 15px; height: 15px; }

/* --- stage & slides --- */
.xp-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  /* inline: vertical swipes must keep scrolling the page — only claim
     horizontal ones. Modal (page locked): the stage owns every gesture. */
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  cursor: pointer;
}
.xp-story.xp-modal .xp-stage { touch-action: none; }
.xp-track {
  display: flex;
  height: 100%;
  transition: transform 0.55s var(--ease);
  will-change: transform;
}
.xp-track.dragging { transition: none; }

.xp-slide {
  position: relative;
  flex: 0 0 100%;
  min-width: 0;
  display: grid;
  place-items: center;
  padding: 110px 30px 110px;
  overflow: hidden;
}
/* per-chapter ambience */
.xp-slide::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.xp-slide[data-mood="night"]::before   { background: radial-gradient(720px 460px at 50% -6%, rgba(84, 92, 155, 0.30), transparent 65%); }
.xp-slide[data-mood="neutral"]::before { background: radial-gradient(720px 460px at 50% 108%, rgba(255, 255, 255, 0.05), transparent 60%); }
.xp-slide[data-mood="gold"]::before    { background: radial-gradient(720px 460px at 50% -6%, rgba(255, 208, 70, 0.10), transparent 62%); }
.xp-slide[data-mood="glow"]::before    { background: radial-gradient(760px 520px at 50% 112%, rgba(255, 208, 70, 0.17), transparent 66%); }

.xp-slide-inner {
  position: relative;
  max-width: 340px;
  text-align: center;
  opacity: 0;
  transform: translateX(46px) scale(0.965);
}
.xp-slide.is-active .xp-slide-inner {
  opacity: 1;
  transform: none;
  transition: opacity 0.55s var(--ease) 0.08s, transform 0.55s var(--ease) 0.08s;
}
.xp-slide.from-left .xp-slide-inner { transform: translateX(-46px) scale(0.965); }
.xp-slide.is-active.from-left .xp-slide-inner { transform: none; }

.xp-kicker {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #FFD046;
  margin-bottom: 14px;
}
.xp-h {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(1.9rem, 7vw, 2.45rem);
  line-height: 1.06;
  letter-spacing: -0.025em;
  color: #F4F3EE;
  margin: 0 0 14px;
}
.xp-p {
  font-size: 1.02rem;
  line-height: 1.68;
  color: rgba(240, 239, 233, 0.72);
  margin: 0 auto;
  max-width: 32ch;
}
.xp-p b { color: #F4F3EE; }
.xp-p .xp-gold { color: #FFD046; font-weight: 700; }

/* handwritten aside used on a few slides */
.xp-note {
  display: inline-block;
  font-family: var(--font-feel);
  font-weight: 600;
  font-size: 1.35rem;
  color: #FFD046;
  transform: rotate(-1.6deg);
  margin-top: 18px;
}

/* --- artwork area --- */
.xp-art {
  height: 150px;
  display: grid;
  place-items: center;
  margin: 0 auto 26px;
}
.xp-art svg { overflow: visible; }

/* s1 · batteries */
.xp-batt-label { font-family: var(--font-head); font-size: 10px; font-weight: 700; letter-spacing: 1.6px; fill: rgba(240, 239, 233, 0.5); }
.xp-batt-fill-full { fill: #FFD046; }
.xp-batt-fill-empty { fill: #FF6B6B; animation: xpGasp 1.6s ease-in-out infinite; }
@keyframes xpGasp { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
.xp-moon { fill: #EDEBFF; opacity: 0.9; }
.xp-arrow-fade { stroke: rgba(240, 239, 233, 0.4); }

/* s2 · scale */
.xp-scale-group { transform-origin: 100px 74px; animation: xpSeesaw 5s ease-in-out infinite; }
@keyframes xpSeesaw {
  0%, 100% { transform: rotate(0deg); }
  50%      { transform: rotate(2.4deg); }
}
.xp-scale-line { stroke: #8E8C96; stroke-width: 4.5; stroke-linecap: round; }
.xp-scale-pan { fill: rgba(255, 255, 255, 0.07); stroke: #8E8C96; stroke-width: 2; }
.xp-scale-label { font-family: var(--font-head); font-size: 10.5px; font-weight: 700; letter-spacing: 1.4px; }

/* s3 · coin */
.xp-coin { animation: xpFloat 3.6s ease-in-out infinite; transform-origin: center; }
@keyframes xpFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-7px); }
}
.xp-chipf { fill: rgba(255, 255, 255, 0.07); stroke: rgba(255, 255, 255, 0.22); }
.xp-chipt { font-family: var(--font-head); font-size: 12px; font-weight: 700; fill: rgba(240, 239, 233, 0.75); }

/* s4 · pin + geofence rings */
.xp-ring {
  transform-origin: center;
  transform-box: fill-box;
  animation: xpPulse 2.8s ease-out infinite;
  opacity: 0;
}
.xp-ring.r2 { animation-delay: 0.9s; }
.xp-ring.r3 { animation-delay: 1.8s; }
@keyframes xpPulse {
  0%   { opacity: 0.75; transform: scale(0.45); }
  85%  { opacity: 0;    transform: scale(1.25); }
  100% { opacity: 0;    transform: scale(1.25); }
}
.xp-pin-bounce { animation: xpFloat 3.2s ease-in-out infinite; }

/* s5 · $0 ring — the check draws itself in when the slide activates */
.xp-zero-check { stroke-dasharray: 26; stroke-dashoffset: 26; }
.xp-slide.is-active .xp-zero-check { animation: xpDraw 0.6s var(--ease) 0.75s forwards; }
@keyframes xpDraw { to { stroke-dashoffset: 0; } }
.xp-zero-txt { font-family: var(--font-head); font-weight: 800; font-size: 56px; letter-spacing: -2px; fill: #FFD046; }

/* s6 · comeback dots pop one by one */
.xp-dot-fill { opacity: 0; transform: scale(0.4); transform-origin: center; transform-box: fill-box; }
.xp-slide.is-active .xp-dot-fill { animation: xpPop 0.45s var(--ease) forwards; }
.xp-slide.is-active .xp-dot-fill.d1 { animation-delay: 0.55s; }
.xp-slide.is-active .xp-dot-fill.d2 { animation-delay: 0.95s; }
.xp-slide.is-active .xp-dot-fill.d3 { animation-delay: 1.35s; }
.xp-slide.is-active .xp-dot-fill.d4 { animation-delay: 1.75s; }
.xp-slide.is-active .xp-dot-fill.d5 { animation-delay: 2.15s; }
@keyframes xpPop {
  0%   { opacity: 0; transform: scale(0.4); }
  70%  { opacity: 1; transform: scale(1.15); }
  100% { opacity: 1; transform: scale(1); }
}
.xp-badge66 { opacity: 0; transform: translateY(8px); transform-origin: center; transform-box: fill-box; }
.xp-slide.is-active .xp-badge66 { animation: xpBadge 0.5s var(--ease) 2.6s forwards; }
@keyframes xpBadge { to { opacity: 1; transform: translateY(0); } }

/* s7 · testimonial */
.xp-quote-stars { display: flex; justify-content: center; gap: 5px; margin-bottom: 20px; }
.xp-quote-stars svg { width: 20px; height: 20px; fill: #FFD046; }
.xp-quote {
  font-family: var(--font-whisper);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.2rem, 4.6vw, 1.45rem);
  line-height: 1.55;
  color: #F4F3EE;
  margin: 0 0 22px;
}
.xp-quote .xp-gold { color: #FFD046; }
.xp-attrib {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: rgba(240, 239, 233, 0.6);
}
.xp-attrib b { color: #F0EFE9; font-weight: 700; }
.xp-attrib .xp-av {
  display: inline-grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FFD046, #B89200);
  color: #1E1E1E;
  font-family: var(--font-head);
  font-size: 0.72rem;
  font-weight: 800;
}

/* s8 · finale */
.xp-final-art { height: 130px; margin-bottom: 18px; }
.xp-final-art lottie-player { width: 130px; height: 130px; margin: 0 auto; }
.xp-cta-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 26px;
}
.xp-cta-col .btn { width: 100%; max-width: 300px; justify-content: center; }
/* overlay is always dark — never let theme vars wash the ghost button out */
.xp-story .btn-ghost {
  color: #F0EFE9;
  border-color: rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.04);
}
.xp-story .btn-ghost:hover { border-color: rgba(255, 208, 70, 0.5); background: rgba(255, 255, 255, 0.08); }
.xp-final-note {
  margin-top: 16px;
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(240, 239, 233, 0.5);
}
.xp-final-note .dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #FFD046;
  box-shadow: 0 0 8px #FFD046;
  margin-right: 7px;
  vertical-align: 1px;
}
.xp-explore {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 20px;
  font-size: 0.9rem;
  font-weight: 700;
  color: rgba(240, 239, 233, 0.62);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.25s var(--ease);
}
.xp-explore:hover { color: #FFD046; }
.xp-explore svg { width: 14px; height: 14px; }

/* --- desktop side chevrons --- */
.xp-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  display: none;
  place-items: center;
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(20, 20, 26, 0.72);
  color: #F0EFE9;
  cursor: pointer;
  transition: background 0.25s var(--ease), transform 0.25s var(--ease), opacity 0.25s var(--ease);
}
.xp-nav:hover { background: rgba(40, 40, 48, 0.9); transform: translateY(-50%) scale(1.07); }
.xp-nav svg { width: 18px; height: 18px; }
.xp-nav[disabled] { opacity: 0.25; pointer-events: none; }

/* --- first-time gesture hint --- */
.xp-hint {
  position: absolute;
  bottom: max(22px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(20, 20, 26, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: rgba(240, 239, 233, 0.72);
  pointer-events: none;
  transition: opacity 0.4s var(--ease);
  white-space: nowrap;
}
.xp-hint svg { width: 14px; height: 14px; animation: xpNudgeX 1.8s var(--ease) infinite; }
@keyframes xpNudgeX {
  0%, 100% { transform: translateX(0); }
  50%      { transform: translateX(4px); }
}
.xp-hint.gone { opacity: 0; }

/* ---------------------------------------------------------------
   Desktop: a centered story card, like stories on the web
--------------------------------------------------------------- */
@media (min-width: 900px) {
  .xp-shell {
    inset: auto;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0.96);
    width: min(430px, 92vw);
    height: min(86vh, 820px);
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    box-shadow: 0 60px 140px -40px rgba(0, 0, 0, 0.9);
  }
  .xp-story.open .xp-shell { transform: translate(-50%, -50%) translateY(var(--xp-drag, 0px)) scale(1); }
  html:not(.xp-js) .xp-shell { transform: translate(-50%, -50%) scale(1); }
  .xp-nav { display: grid; }
  .xp-nav-prev { left: calc(50% - min(215px, 46vw) - 74px); }
  .xp-nav-next { right: calc(50% - min(215px, 46vw) - 74px); }
  .xp-slide { padding: 120px 34px; }
  .xp-hint { bottom: 22px; }
}

/* ---------------------------------------------------------------
   Inline on phones: the shell is full-bleed, so the site's floating
   header would sit on top of the progress bars. Duck under it.
   (In modal mode the header is covered by the overlay — no clash.)
--------------------------------------------------------------- */
@media (max-width: 899px) {
  .xp-story:not(.xp-modal) .xp-chrome {
    padding-top: calc(78px + env(safe-area-inset-top));
  }
  .xp-story:not(.xp-modal) .xp-slide {
    padding-top: 168px;
  }
}

/* ---------------------------------------------------------------
   Small phones
--------------------------------------------------------------- */
@media (max-width: 420px) {
  .xp-hook { padding-left: 18px; padding-right: 18px; }
  .xp-start { padding: 16px 26px; font-size: 1rem; }
  .xp-slide { padding: 96px 22px 104px; }
  .xp-art { height: 128px; margin-bottom: 20px; }
}

/* ---------------------------------------------------------------
   Reduced motion — everything readable, nothing moves
--------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html.xp-js .xp-hook .xp-line,
  html.xp-js .xp-hook .xp-clock {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
  }
  .xp-star, .xp-shoot, .xp-scroll svg, .xp-hint svg,
  .xp-start::after, .xp-coin, .xp-pin-bounce, .xp-ring,
  .xp-scale-group, .xp-batt-fill-empty { animation: none !important; }
  .xp-ring { opacity: 0.3; }
  .xp-track, .xp-shell, .xp-backdrop { transition: none !important; }
  .xp-slide-inner,
  .xp-slide.is-active .xp-slide-inner { opacity: 1; transform: none; transition: none; }
  .xp-bars span.active i { animation: none; transform: none; }
  .xp-dot-fill, .xp-badge66 { opacity: 1 !important; transform: none !important; animation: none !important; }
  .xp-zero-check { stroke-dashoffset: 0; animation: none !important; }
}
