/* Zyryn landing 3D scroll experience: fixed WebGL stage + DOM overlay beats.
   Copy sits directly over the scene (no glass boxes) with a soft radial scrim
   for legibility, and children reveal with a stagger when a beat activates.
   Static fallback (no WebGL2 / prefers-reduced-motion) turns the beats into a
   normal stacked page via body.exp-static. */

#gl {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

/* The nav pill is fixed (shared styles); on the landing page the overlay
   beats own the layout, so its flow placeholder must not push the runway. */
.nav-host { height: 0; }

/* Tall scroll runway; the camera path is mapped onto it. */
#exp-scroll {
  height: 1450vh;
  pointer-events: none;
}

/* ── Overlay beats ─────────────────────────────────────────────────── */

.exp-beat {
  position: fixed;
  inset: var(--nav-h) 0 0 0;
  z-index: 5;
  display: flex;
  align-items: center;
  padding: 24px clamp(20px, 7vw, 110px);
  opacity: 0;
  pointer-events: none;
  will-change: opacity, transform;
}

.exp-beat.beat-center { justify-content: center; text-align: center; }
.exp-beat.beat-left { justify-content: flex-start; }
.exp-beat.beat-right { justify-content: flex-end; }

/* Copy sits raw on the scene; the scrim keeps it readable over the bolt. */
.beat-card {
  position: relative;
  max-width: 540px;
}

.beat-card::before {
  content: '';
  position: absolute;
  inset: -22% -30%;
  z-index: -1;
  background: radial-gradient(closest-side, rgba(3, 3, 3, 0.62), rgba(3, 3, 3, 0.34) 55%, transparent 82%);
  pointer-events: none;
}

.beat-center .beat-card { max-width: 760px; }

.exp-beat.beat-active .beat-card { pointer-events: auto; }

/* Staggered reveal: each child rises in sequence when the beat activates. */
.exp-beat .beat-card > * {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.exp-beat.beat-active .beat-card > * {
  opacity: 1;
  transform: none;
}

.exp-beat .beat-card > *:nth-child(2) { transition-delay: 0.07s; }
.exp-beat .beat-card > *:nth-child(3) { transition-delay: 0.14s; }
.exp-beat .beat-card > *:nth-child(4) { transition-delay: 0.21s; }
.exp-beat .beat-card > *:nth-child(5) { transition-delay: 0.28s; }
.exp-beat .beat-card > *:nth-child(6) { transition-delay: 0.35s; }

/* ── Typography ────────────────────────────────────────────────────── */

.exp-beat .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--brushed-gold);
}

.exp-beat .eyebrow::before {
  content: '';
  width: 30px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--brushed-gold));
}

.beat-center .eyebrow::after {
  content: '';
  width: 30px;
  height: 1px;
  background: linear-gradient(270deg, transparent, var(--brushed-gold));
}

.exp-beat h1 {
  font-size: clamp(2.6rem, 6vw, 5rem);
  line-height: 1.02;
  margin: 0 0 20px;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.exp-beat h2 {
  font-size: clamp(1.8rem, 3.6vw, 2.9rem);
  line-height: 1.06;
  margin: 14px 0 16px;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.exp-beat p.lead { font-size: clamp(1rem, 1.35vw, 1.12rem); }
.exp-beat p { color: var(--ash); }
.exp-beat p .gold-text, .exp-beat h1 + p { color: var(--porcelain); }

/* ── Features: minimal hairline list, no boxes ─────────────────────── */

.beat-features .beat-card { max-width: 960px; }

.exp-feature-grid,
.premium-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0 34px;
  margin-top: 26px;
  text-align: left;
}

.premium-feature-grid {
  grid-template-columns: repeat(4, 1fr);
  gap: 0 24px;
  margin-top: 14px;
}

.feature-premium-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 214, 109, 0.28);
}

.feature-premium-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  text-align: left;
}

.feature-premium-head span {
  color: var(--molten-gold);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.feature-premium-head p {
  margin: 0;
  color: var(--ash);
  font-size: 0.76rem;
  line-height: 1.35;
}

.exp-feature,
.premium-feature {
  padding: 16px 0 14px;
  border-top: 1px solid rgba(216, 183, 90, 0.16);
}

.exp-feature .icon-badge,
.premium-feature .icon-badge {
  background: none;
  border: none;
  padding: 0;
  width: auto;
  height: auto;
  margin: 0 0 6px;
  color: var(--brushed-gold);
}

.exp-feature .icon-badge svg,
.premium-feature .icon-badge svg {
  width: 17px;
  height: 17px;
}

.exp-feature h3,
.premium-feature h3 {
  font-size: 0.9rem;
  margin: 0 0 4px;
  letter-spacing: 0.01em;
}

.exp-feature p,
.premium-feature p {
  font-size: 0.78rem;
  color: var(--ash);
  margin: 0;
  line-height: 1.45;
}

.exp-feature-heading {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 6px 8px;
}

.exp-feature-heading h3 { margin-bottom: 4px; }

.exp-feature-premium {
  display: inline-flex;
  align-items: center;
  min-height: 17px;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  background: var(--brand-gradient);
  box-shadow: 0 0 14px rgba(255, 214, 109, 0.18);
  color: #151005;
  font-size: 0.52rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Privacy gets a stronger gold treatment because it explains the trust model. */
.beat-privacy .beat-card { max-width: 960px; }

.privacy-panel {
  position: relative;
  margin-top: 28px;
  padding: 24px 0 4px;
  border-top: 1px solid rgba(255, 214, 109, 0.32);
  border-bottom: 1px solid rgba(216, 183, 90, 0.16);
}

.privacy-panel::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  width: min(280px, 70%);
  height: 1px;
  transform: translateX(-50%);
  background: var(--brand-gradient);
  box-shadow: 0 0 28px rgba(255, 214, 109, 0.45);
}

.privacy-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  text-align: left;
}

.privacy-item {
  position: relative;
  padding-left: 16px;
}

.privacy-item::before {
  content: '';
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 0;
  width: 1px;
  background: linear-gradient(var(--molten-gold), rgba(216, 183, 90, 0.08));
}

.privacy-kicker {
  display: block;
  margin-bottom: 8px;
  color: var(--molten-gold);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.privacy-item h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  letter-spacing: 0.01em;
}

.privacy-item p {
  margin: 0;
  color: var(--ash);
  font-size: 0.82rem;
  line-height: 1.52;
}

.privacy-link {
  display: inline-flex;
  margin-top: 20px;
  color: var(--champagne);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ── Scroll hint (hero) ────────────────────────────────────────────── */

.exp-hint {
  position: absolute;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--ash);
  font-size: 0.62rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.exp-hint::after {
  content: '';
  width: 1px;
  height: 42px;
  background: linear-gradient(var(--brushed-gold), transparent);
  animation: exp-hint-drop 1.8s ease-in-out infinite;
}

@keyframes exp-hint-drop {
  0% { transform: scaleY(0); transform-origin: top; opacity: 0; }
  35% { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1); transform-origin: top; opacity: 0; }
}

/* ── Section HUD, bottom-left ──────────────────────────────────────── */

.exp-hud {
  position: fixed;
  left: clamp(20px, 4vw, 48px);
  bottom: clamp(18px, 3.2vh, 34px);
  z-index: 30;
  display: flex;
  align-items: baseline;
  gap: 12px;
  pointer-events: none;
}

.exp-hud-num {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--brushed-gold);
  letter-spacing: 0.08em;
}

.exp-hud-name {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ash);
}

.exp-hud.tick .exp-hud-num,
.exp-hud.tick .exp-hud-name {
  animation: exp-hud-swap 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes exp-hud-swap {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ── Sound toggle + trailer volume slider ──────────────────────────── */

/* Sits inside the trailer beat card, next to the mute button. */
.trailer-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

/* Gold fill up to the thumb via --vol (set from JS on input). */
.exp-vol {
  -webkit-appearance: none;
  appearance: none;
  width: 92px;
  height: 26px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}

.exp-vol::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(
    90deg,
    var(--brushed-gold) var(--vol, 25%),
    rgba(216, 183, 90, 0.22) var(--vol, 25%)
  );
}

.exp-vol::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  margin-top: -5px;
  border: none;
  border-radius: 50%;
  background: var(--molten-gold);
  box-shadow: 0 0 10px rgba(255, 214, 109, 0.5);
}

.exp-vol::-moz-range-track {
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(
    90deg,
    var(--brushed-gold) var(--vol, 25%),
    rgba(216, 183, 90, 0.22) var(--vol, 25%)
  );
}

.exp-vol::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border: none;
  border-radius: 50%;
  background: var(--molten-gold);
  box-shadow: 0 0 10px rgba(255, 214, 109, 0.5);
}

.exp-sound {
  position: fixed;
  right: clamp(18px, 3vw, 40px);
  bottom: clamp(18px, 3.2vh, 34px);
  z-index: 30;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(8, 8, 6, 0.5);
  border: 1px solid rgba(216, 183, 90, 0.2);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--ash);
  cursor: pointer;
  transition: color 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.exp-sound svg { width: 18px; height: 18px; }

.exp-sound:hover { color: var(--champagne); border-color: rgba(216, 183, 90, 0.45); }

.exp-sound.on {
  color: var(--molten-gold);
  box-shadow: 0 0 16px rgba(255, 214, 109, 0.25);
}

/* ── Progress rail ─────────────────────────────────────────────────── */

.exp-rail {
  position: fixed;
  right: clamp(14px, 2.4vw, 34px);
  top: 50%;
  transform: translateY(-50%);
  height: min(50vh, 440px);
  width: 16px;
  z-index: 30;
}

.exp-rail-track {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  transform: translateX(-50%);
  background: rgba(216, 183, 90, 0.14);
  overflow: hidden;
}

.exp-rail-fill {
  width: 100%;
  height: 0%;
  background: linear-gradient(var(--molten-gold), var(--brushed-gold));
}

.exp-rail-dot {
  position: absolute;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 7px;
  height: 7px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(216, 183, 90, 0.4);
  background: rgba(3, 3, 3, 0.9);
  cursor: pointer;
  transition: background 0.25s, box-shadow 0.25s, transform 0.25s;
}

.exp-rail-dot:hover { transform: translate(-50%, -50%) scale(1.4); }

.exp-rail-dot.on {
  background: var(--molten-gold);
  box-shadow: 0 0 8px rgba(255, 214, 109, 0.7);
}

/* Gallery: card hugs the top so the 3D screenshot panels stay visible. */
.exp-beat.beat-gallery { align-items: flex-start; padding-top: 3vh; }
.beat-gallery .beat-card { max-width: 640px; }

/* Trailer: copy hugs the top; the video plays on a 3D panel below it (or
   inline with controls in the static fallback). */
.exp-beat.beat-trailer { align-items: flex-start; padding-top: 3vh; }
.beat-trailer .beat-card { max-width: 640px; }
.trailer-fallback { display: none; }
body.exp-static .trailer-fallback {
  display: block;
  width: min(920px, 100%);
  margin: 26px auto 0;
  border-radius: var(--radius-lg);
  border: 1px solid var(--hairline-strong);
}
body.exp-static .trailer-controls { display: none; }

/* Footer sits after the runway, floating over the still-running storm. */
.site-footer {
  position: relative;
  z-index: 6;
  background: linear-gradient(to bottom, rgba(3, 3, 3, 0) 0, rgba(3, 3, 3, 0.72) 150px, rgba(3, 3, 3, 0.88) 100%);
}

/* ── Small screens ─────────────────────────────────────────────────── */

@media (max-width: 760px) {
  /* Cards center in the band between the nav and the bottom HUD. No inner
     scrolling by default: type scales down instead so each beat fits the
     viewport whole (the hero must never grow its own scrollbar). */
  .exp-beat {
    padding: 10px 18px 60px;
    align-items: center;
    justify-content: center;
  }

  .beat-card { max-width: 100%; }
  .beat-card::before { inset: -12% -18%; }

  .exp-beat h1 {
    font-size: clamp(2rem, 8.5vw, 2.6rem);
    margin-bottom: 14px;
  }
  .exp-beat h2 { font-size: clamp(1.45rem, 6.5vw, 1.9rem); }
  .exp-beat p.lead { font-size: 0.95rem; }
  .exp-beat p { font-size: 0.9rem; }
  .exp-beat .eyebrow { font-size: 0.62rem; letter-spacing: 0.26em; }
  .exp-beat .btn-lg { padding: 13px 20px; font-size: 0.95rem; }

  /* Feature entries collapse to icon + title rows so the grid stays short. */
  .exp-feature-grid,
  .premium-feature-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0 18px;
    margin-top: 18px;
  }
  .premium-feature-grid { margin-top: 10px; }

  .exp-feature p,
  .premium-feature p {
    display: none;
  }

  .exp-feature,
  .premium-feature {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 8px 0 7px;
  }
  .exp-feature .icon-badge,
  .premium-feature .icon-badge { margin: 2px 0 0; }
  .exp-feature .icon-badge svg,
  .premium-feature .icon-badge svg { width: 15px; height: 15px; }
  .exp-feature h3,
  .premium-feature h3 { font-size: 0.8rem; margin: 0; }
  .exp-feature-heading h3 { margin-bottom: 0; }

  .feature-premium-section { margin-top: 12px; padding-top: 10px; }
  .feature-premium-head { display: block; }
  .feature-premium-head p { display: block; margin-top: 4px; font-size: 0.7rem; }
  .exp-feature-premium { font-size: 0.48rem; }

  .privacy-panel { margin-top: 20px; padding-top: 16px; }
  .privacy-grid { grid-template-columns: 1fr; gap: 14px; }
  .privacy-item h3 { font-size: 0.92rem; }
  .privacy-item p { font-size: 0.78rem; }
  .privacy-link { margin-top: 14px; }

  /* Dense beats fit the viewport instead of scrolling inside themselves:
     leads hidden, rows tightened. max-height + auto overflow stays only as a
     clip guard for very short phones, and scrolling there chains straight to
     the page (no overscroll trap). */
  .beat-features .beat-card > p.lead,
  .beat-privacy .beat-card > p.lead { display: none; }

  .beat-features .beat-card,
  .beat-privacy .beat-card {
    max-height: calc(100vh - var(--nav-h) - 84px);
    max-height: calc(100dvh - var(--nav-h) - 84px);
    overflow-y: auto;
    scrollbar-width: none;
  }
  .beat-features .beat-card::-webkit-scrollbar,
  .beat-privacy .beat-card::-webkit-scrollbar { display: none; }
  .beat-features .beat-card::before,
  .beat-privacy .beat-card::before { content: none; }

  /* Full-bleed dim behind the dense beats. The section's fixed inset starts
     below the nav, so the overlay stretches back up to the viewport top and
     never leaves an unfilled band. */
  .beat-features::before,
  .beat-privacy::before {
    content: '';
    position: absolute;
    inset: calc(-1 * var(--nav-h)) 0 0 0;
    z-index: -1;
    background: linear-gradient(180deg, rgba(3, 3, 3, 0.8), rgba(3, 3, 3, 0.58) 45%, rgba(3, 3, 3, 0.76));
    pointer-events: none;
  }

  /* Beats with a 3D screenshot hug the top so the shot gets the lower third
     (the JS drops portrait panels there instead of beside the copy). */
  .exp-beat.beat-left,
  .exp-beat.beat-right { align-items: flex-start; padding-top: 20px; }
  .exp-beat.beat-gallery,
  .exp-beat.beat-trailer { align-items: flex-start; padding-top: 2vh; }

  .exp-rail { display: none; }
  .exp-hud {
    left: 16px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }
  .exp-vol { width: 68px; }
  .exp-sound {
    width: 38px;
    height: 38px;
    right: 14px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  }
  /* Sits above the HUD/sound row so the three never collide. */
  .exp-hint {
    bottom: calc(46px + env(safe-area-inset-bottom, 0px));
    font-size: 0.56rem;
  }
  .exp-hint::after { height: 26px; }
}

/* ── Static fallback: no WebGL2 or reduced motion ──────────────────── */

body.exp-static #gl,
body.exp-static #exp-scroll,
body.exp-static .exp-rail,
body.exp-static .exp-hud,
body.exp-static .exp-hint {
  display: none;
}

body.exp-static .exp-beat {
  position: static;
  inset: auto;
  opacity: 1 !important;
  transform: none !important;
  pointer-events: auto;
  padding-top: 56px;
  padding-bottom: 56px;
}

body.exp-static .beat-card { pointer-events: auto; }
body.exp-static .beat-card::before { display: none; }

body.exp-static .exp-beat .beat-card > * {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

body.exp-static .exp-static-shot {
  display: block;
  width: min(920px, 100%);
  margin: 26px auto 0;
  border-radius: var(--radius-lg);
  border: 1px solid var(--hairline-strong);
}
