/* ============================================================
   cuepresenter.com — immersive scroll experience.
   Loaded by index.html only (legal pages stay on site.css alone).
   Everything gated on `html.cue-motion` degrades to the plain
   site when motion is off (?static or prefers-reduced-motion).
   ============================================================ */

/* ---- Mono (Cue design system: timecodes only) ---- */
@font-face {
  font-family: 'Source Code Pro';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../assets/fonts/source-code-pro-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Source Code Pro';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../assets/fonts/source-code-pro-500.woff2') format('woff2');
}

/* ---- Token additions (from the Cue design system / app Theme) ---- */
:root {
  --font-mono: 'Source Code Pro', ui-monospace, 'SF Mono', Menlo, monospace;
  --info: #4C9AFF;            /* AirPlay / info blue */
  --live-overlay: #BF5AF2;    /* overlay-layer indicator (purple) */
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ink-panel: #16181D;
  --ink-card: #1E2128;
  --glow-live: 0 0 0 1px rgba(255, 69, 58, 0.6), 0 0 22px rgba(255, 69, 58, 0.4);
  --blur-panel: saturate(160%) blur(24px);
}

/* Lenis owns smoothing; CSS smooth-scroll would fight it. */
html.cue-motion { scroll-behavior: auto; }
body { overflow-x: clip; }

/* GSAP owns reveals when motion is on — neutralize the site.css fallback. */
html.cue-motion .reveal { opacity: 1; transform: none; transition: none; }

/* ---- Intro states + failsafe ----
   .if elements start hidden only under cue-motion; a delayed CSS
   animation guarantees they appear even if a script never runs. */
@keyframes cueFade { to { opacity: 1; } }
@keyframes cueRise { to { transform: translateY(0); } }
html.cue-motion .if {
  opacity: 0;
  animation: cueFade 0.8s var(--ease-out) 2.6s forwards;
}
html.cue-motion .hero__title .hw {
  transform: translateY(112%);
  animation: cueRise 0.8s var(--ease-out) 2.6s forwards;
}

/* ---- Aurora sky (fixed, behind all content) ---- */
.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}
.sky__blob {
  position: absolute;
  border-radius: 50%;
  will-change: transform;
}
.sky__blob--pink {
  width: 54vw; height: 54vw; left: -10vw; top: -14vw;
  background: radial-gradient(closest-side, rgba(255, 143, 192, 0.38), transparent 72%);
}
.sky__blob--magenta {
  width: 42vw; height: 42vw; right: -12vw; top: 2vw;
  background: radial-gradient(closest-side, rgba(245, 61, 140, 0.22), transparent 72%);
}
.sky__blob--violet {
  width: 46vw; height: 46vw; left: 28vw; top: 30vh;
  background: radial-gradient(closest-side, rgba(191, 90, 242, 0.20), transparent 72%);
}
.sky__blob--blue {
  width: 48vw; height: 48vw; left: -14vw; top: 52vh;
  background: radial-gradient(closest-side, rgba(76, 154, 255, 0.18), transparent 72%);
}
.sky__blob--amber {
  width: 34vw; height: 34vw; right: 0; top: 38vh;
  background: radial-gradient(closest-side, rgba(255, 176, 32, 0.20), transparent 72%);
}
@media (max-width: 768px) {
  .sky__blob--violet, .sky__blob--amber { display: none; }
  .sky__blob { opacity: 0.8; }
}

/* ---- Hero: masked headline, gradient words ---- */
.hero__title .hm {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  /* let descenders breathe inside the mask */
  padding-bottom: 0.14em;
  margin-bottom: -0.14em;
}
.hero__title .hw { display: inline-block; will-change: transform; }
.hero__title .hw--grad {
  background: var(--brand-gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---- Hero: cinematic scene ---- */
.hero__scene {
  position: relative;
  justify-self: center;
  width: 100%;
  max-width: 640px;
  perspective: 1100px;
}
.hero__spot {
  position: absolute;
  inset: -24% -30%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(48% 44% at 62% 38%, rgba(255, 92, 158, 0.22), transparent 70%),
    radial-gradient(40% 40% at 26% 74%, rgba(191, 90, 242, 0.18), transparent 72%),
    radial-gradient(30% 30% at 82% 82%, rgba(76, 154, 255, 0.14), transparent 75%);
}
.hero__scene .devices {
  position: relative;
  z-index: 1;
  max-width: none;
  transform-style: preserve-3d;
}
.device { will-change: transform; }
.device--ipad {
  box-shadow:
    var(--shadow-preview),
    0 0 70px rgba(255, 92, 158, 0.26),
    -30px 12px 90px rgba(191, 90, 242, 0.18);
}
.device--iphone {
  box-shadow:
    0 24px 60px rgba(20, 0, 10, 0.5),
    0 0 40px rgba(255, 92, 158, 0.22);
}
.device__glare {
  position: absolute;
  inset: 12px;
  border-radius: 14px;
  overflow: hidden;
  pointer-events: none;
}
.device__glare i {
  position: absolute;
  top: -24%;
  bottom: -24%;
  left: 0;
  width: 34%;
  transform: skewX(-18deg) translateX(-140%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.10), transparent);
}

/* ---- Layers stage (dark band, pinned) ---- */
.stage {
  position: relative;
  background: var(--ink-0);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  overflow: clip;
}
.stage::before,
.stage::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.stage::before {
  width: 46vw; height: 46vw; left: -14vw; top: -10vw;
  background: radial-gradient(closest-side, rgba(191, 90, 242, 0.14), transparent 72%);
}
.stage::after {
  width: 50vw; height: 50vw; right: -16vw; bottom: -14vw;
  background: radial-gradient(closest-side, rgba(76, 154, 255, 0.10), transparent 72%);
}
.stage__pin {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 56px 0 96px;
  position: relative;
  z-index: 1;
}
.stage__head { text-align: center; position: relative; z-index: 2; }
.stage__head .kicker { color: var(--cue-pink-300); }
.stage__head h2 { color: #F5F6F8; }
.stage__head .section__lede { color: #A0A6B0; margin-left: auto; margin-right: auto; }

/* Media-type row: what you can throw on a layer */
.stage__media {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(20px, 4vw, 44px);
  margin-top: 28px;
}
.mtype {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--cue-pink-300);
  will-change: transform;
}
.mtype .ic { width: 26px; height: 26px; }
.mtype > span {
  font: 700 13px/1 var(--font-sans);
  color: #D5D8DE;
}
@media (max-width: 640px) {
  .stage__media { gap: 16px 22px; }
  .mtype .ic { width: 22px; height: 22px; }
  .mtype > span { font-size: 12px; }
}
/* Short viewports: keep the taller head + scene + GO inside the 100svh pin */
@media (max-height: 820px) {
  html.cue-motion .stage__media { margin-top: 20px; }
  html.cue-motion .stage__scene { margin-top: 40px; }
}
.stage__scene {
  position: relative;
  width: min(600px, 86vw);
  aspect-ratio: 16 / 9;
  margin-top: 64px;
  perspective: 1400px;
}
.stage__stack {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  will-change: transform;
}

/* A layer sheet — chrome per the DS SlideTile: 2px state ring, 16px
   radius, inset well, solid state pill bottom-left, label below. */
.sheet {
  position: absolute;
  inset: 0;
  margin: 0;
  border-radius: var(--radius-lg);
  border: 2px solid var(--standby);
  transform-style: preserve-3d;
  will-change: transform;
}
.sheet--background { --lyr: #30D158; }
.sheet--foreground { --lyr: #FF453A; }
.sheet--overlay    { --lyr: var(--live-overlay); }
.sheet__well {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.sheet--background .sheet__well {
  background:
    radial-gradient(42% 20% at 50% 100%, #16090d 32%, transparent 74%),
    radial-gradient(58% 48% at 50% 64%, rgba(255, 196, 110, 0.85) 0%, rgba(226, 122, 79, 0.55) 42%, transparent 76%),
    linear-gradient(180deg, #2b1420 0%, #6e2a35 36%, #b4513c 62%, #e0824f 80%, #f2b46a 94%);
}
.sheet__cross {
  position: absolute;
  left: 50%;
  bottom: 25%;
  width: 3px;
  height: 15px;
  background: #140a0e;
  border-radius: 1px;
}
.sheet__cross::before {
  content: '';
  position: absolute;
  top: 3px;
  left: -4px;
  width: 11px;
  height: 3px;
  background: #140a0e;
  border-radius: 1px;
}
.sheet__lyrics {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin: 0;
  padding: 6% 8%;
  font: 800 clamp(12px, 2.1vw, 18px)/1.42 var(--font-sans);
  color: #fff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
}
.sheet__timer {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(8, 9, 11, 0.62);
  color: #fff;
  font: 500 clamp(13px, 1.9vw, 17px)/1 var(--font-mono);
}
.sheet__tag {
  position: absolute;
  top: 10px;
  left: 10px;
  height: 20px;
  padding: 0 9px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--lyr) 18%, rgba(8, 9, 11, 0.5));
  color: var(--lyr);
  font: 800 10px/20px var(--font-sans);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
}
.sheet__name {
  position: absolute;
  left: 4px;
  bottom: -28px;
  font: 600 13px/1.2 var(--font-sans);
  color: #8A909C;
  white-space: nowrap;
}
.sheet__state {
  position: absolute;
  bottom: 8px;
  left: 8px;
  height: 20px;
  padding: 0 9px;
  border-radius: var(--radius-pill);
  font: 800 10px/20px var(--font-sans);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
}
.sheet__state--cued { background: var(--standby); color: #161006; }
.sheet__state--live { background: var(--lyr); color: #fff; opacity: 0; }

/* Composed-output chrome: red on-air ring + LIVE pill, revealed on GO */
.stage__frame {
  position: absolute;
  inset: -2px;
  border-radius: var(--radius-lg);
  border: 2px solid rgba(255, 69, 58, 0.9);
  box-shadow: var(--glow-live);
  opacity: 0;
  pointer-events: none;
}
.stage__onair {
  position: absolute;
  top: 10px;
  left: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  background: var(--live);
  color: #fff;
  font: 800 11px/22px var(--font-sans);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
}
.stage__onair i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  animation: cuePulse 1.6s var(--ease-standard) infinite;
}
@keyframes cuePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.5); }
  50% { box-shadow: 0 0 0 6px rgba(255, 255, 255, 0); }
}
.stage__go {
  position: absolute;
  right: 0;
  bottom: -86px;
  width: 104px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  background: var(--ok);
  color: #fff;
  font: 800 20px/1 var(--font-sans);
  letter-spacing: 0.03em;
  box-shadow: 0 10px 34px rgba(48, 209, 88, 0.4);
  opacity: 0;
  will-change: transform;
}

/* Static fallback: a composed exploded stack, live states lit. */
html:not(.cue-motion) .stage__pin { min-height: 0; padding: 88px 0 120px; }
html:not(.cue-motion) .stage__stack { transform: rotateX(48deg) rotateZ(-7deg); }
html:not(.cue-motion) .sheet { border-color: var(--lyr); }
html:not(.cue-motion) .sheet--background { transform: translateZ(-110px); }
html:not(.cue-motion) .sheet--overlay { transform: translateZ(110px); }
html:not(.cue-motion) .sheet__state--cued { opacity: 0; }
html:not(.cue-motion) .sheet__state--live { opacity: 1; }
html:not(.cue-motion) .stage__frame,
html:not(.cue-motion) .stage__go { display: none; }

/* ---- Feature rows: 3D float-ins ---- */
.show { perspective: 1000px; }
.show__media { will-change: transform; }

/* ---- Cards grid (two remaining) ---- */
.cards--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 840px;
  margin-left: auto;
  margin-right: auto;
}
@media (max-width: 640px) {
  .cards--two { grid-template-columns: 1fr; }
}

/* ---- How it works: oversized type + HUD ---- */
html.cue-motion .how__pin {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* 88px top clears the sticky nav while pinned at the viewport top */
  padding: 88px 0 32px;
}
html.cue-motion .how__beats {
  position: relative;
  flex: 1;
  min-height: 62svh;
}
.how__word {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: clamp(72px, 11vw, 168px);
  line-height: 0.95;
  letter-spacing: -0.045em;
  color: var(--text-primary);
  will-change: transform;
}
.how__word--go { color: var(--ok); }

/* Ghost step numerals: fill the middle ground behind the flying words.
   z-index -1 drops them behind each beat's content; .how__beats gets its own
   stacking context below so they never sink under the band background. */
.how__num {
  position: absolute;
  inset: 0;
  z-index: -1;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 800 clamp(280px, 38vw, 560px)/1 var(--font-sans);
  letter-spacing: -0.06em;
  color: rgba(245, 61, 140, 0.04);
  -webkit-text-stroke: 2px rgba(245, 61, 140, 0.10);
  pointer-events: none;
  will-change: transform;
}
html:not(.cue-motion) .how__num { display: none; }

/* Ambient glows: the empty stage floor breathes instead of sitting flat */
html.cue-motion .how__beats { z-index: 0; }
html.cue-motion .how__beats::before,
html.cue-motion .how__beats::after {
  content: '';
  position: absolute;
  z-index: -1;
  width: 46vw;
  height: 46vw;
  border-radius: 50%;
  pointer-events: none;
}
html.cue-motion .how__beats::before {
  top: -14%;
  left: -10%;
  background: radial-gradient(closest-side, rgba(255, 92, 158, 0.13), transparent 72%);
  animation: howGlow 11s var(--ease-standard) infinite alternate;
}
html.cue-motion .how__beats::after {
  bottom: -16%;
  right: -8%;
  background: radial-gradient(closest-side, rgba(191, 90, 242, 0.11), transparent 72%);
  animation: howGlow 9s var(--ease-standard) infinite alternate-reverse;
}
@keyframes howGlow {
  from { transform: translate3d(0, -26px, 0); }
  to { transform: translate3d(0, 26px, 0); }
}

/* Frosted HUD panels for the steps (motion mode only) */
html.cue-motion .how .step {
  background: rgba(20, 22, 27, 0.85);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  backdrop-filter: saturate(160%) blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
html.cue-motion .how .step h3 { color: #F5F6F8; }
html.cue-motion .how .step p { color: #A0A6B0; }
html.cue-motion .how .step .kicker { color: var(--cue-pink-300); }

@media (min-width: 769px) {
  html.cue-motion .how__beat {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0; /* JS drives visibility */
  }
  html.cue-motion .how__beat .step {
    position: absolute;
    width: min(380px, 42%);
  }
  html.cue-motion .how__beat[data-beat='1'] .step { right: 5%; bottom: 8%; }
  html.cue-motion .how__beat[data-beat='2'] .step { left: 5%; bottom: 8%; }
  html.cue-motion .how__beat[data-beat='3'] .step { right: 7%; top: 2%; }
}
@media (max-width: 768px) {
  html.cue-motion .how__beat {
    margin: 44px auto 0;
    max-width: 520px;
    padding: 0 22px;
  }
  html.cue-motion .how__word {
    font-size: clamp(46px, 14vw, 76px);
    margin-bottom: 16px;
  }
  html.cue-motion .how__chips { display: none; }
  html.cue-motion .how__num { display: none; }
}

/* Decorative HUD chrome */
.how__chips { position: absolute; inset: 0; pointer-events: none; }
html:not(.cue-motion) .how__word,
html:not(.cue-motion) .how__chips { display: none; }

/* Static fallback: container-width three-step grid (mirrors the stage). */
html:not(.cue-motion) .how__beats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  max-width: var(--content-max);
  margin: 44px auto 0;
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
}
html:not(.cue-motion) .how__beat { display: grid; } /* equal-height step cards */
@media (max-width: 900px) {
  html:not(.cue-motion) .how__beats { grid-template-columns: 1fr; max-width: 560px; }
}
.hudbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 1%;
  margin-inline: auto;
  width: max-content;
  max-width: 94%;
  display: flex;
  gap: 8px;
  padding: 10px;
  border-radius: 18px;
  background: rgba(22, 24, 29, 0.72);
  -webkit-backdrop-filter: var(--blur-panel);
  backdrop-filter: var(--blur-panel);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.hchip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: #D5D8DE;
  font: 700 12px/1 var(--font-sans);
  white-space: nowrap;
}
.hchip .ic { width: 15px; height: 15px; }
.hchip--cue { background: var(--brand); color: #fff; }
.hchip--go { background: var(--ok); color: #fff; font-weight: 800; letter-spacing: 0.02em; }
.htime {
  position: absolute;
  top: 5%;
  right: 7%;
  padding: 8px 12px;
  border-radius: 9px;
  background: rgba(8, 9, 11, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  font: 500 15px/1 var(--font-mono);
}
.hpill {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  font: 800 11px/24px var(--font-sans);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
}
.hpill i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.hpill--live {
  top: 9%;
  left: 6%;
  background: rgba(255, 69, 58, 0.14);
  color: #D2352C;
}
.hpill--live i { animation: cuePulse 1.6s var(--ease-standard) infinite; }
/* Upper-left HUD cluster: the only zone no step card ever occupies */
.hpill--cued {
  top: 26%;
  left: 12%;
  background: rgba(255, 176, 32, 0.18);
  color: #A36E00;
}
.hscene {
  position: absolute;
  top: 38%;
  right: 6%;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(8, 9, 11, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.82);
  font: 500 12px/1 var(--font-mono);
  letter-spacing: 0.08em;
}
.hwave {
  position: absolute;
  top: 11%;
  left: 13%;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 26px;
}
.hwave i {
  width: 4px;
  border-radius: 2px;
  background: var(--cue-pink-400);
  opacity: 0.65;
  will-change: transform;
}
.hwave i:nth-child(1) { height: 10px; }
.hwave i:nth-child(2) { height: 22px; }
.hwave i:nth-child(3) { height: 14px; }
.hwave i:nth-child(4) { height: 26px; }
.hwave i:nth-child(5) { height: 8px; }

/* ---- CTA: extra aurora orbs ---- */
.cta__orb--violet {
  top: auto;
  right: auto;
  bottom: -110px;
  left: -70px;
  background: radial-gradient(closest-side, rgba(191, 90, 242, 0.9), rgba(191, 90, 242, 0.2));
  opacity: 0.42;
}
.cta__orb--blue {
  top: 26%;
  right: auto;
  left: 36%;
  width: 240px;
  height: 240px;
  background: radial-gradient(closest-side, rgba(76, 154, 255, 0.9), rgba(76, 154, 255, 0.2));
  opacity: 0.3;
}

/* ---- Micro-interactions (fine pointers; JS drives --mx/--my) ---- */
html.cue-motion .card { position: relative; overflow: hidden; }
html.cue-motion .card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 300ms var(--ease-out);
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 92, 158, 0.14), transparent 65%);
}
html.cue-motion .card:hover::after { opacity: 1; }
