/* ════════════════════════════════════════════════════════════════════
   "Get the Story" — full-screen scroll-driven cinematic walkthrough.
   Self-contained: pure black stage regardless of the site's light/dark
   toggle, reusing IBM Plex Mono (already loaded sitewide) rather than a
   new font. Built additively — nothing here touches existing page styles.
   ════════════════════════════════════════════════════════════════════ */

#story-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #000;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#story-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

#story-scroll {
  height: 100%;
  width: 100%;
  overflow-y: scroll;
  overflow-x: hidden;
  scrollbar-width: none;
}
#story-scroll::-webkit-scrollbar { display: none; }

#story-spacer {
  position: relative;
}

#story-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 100%;
  overflow: hidden;
}

.story-scene {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  will-change: opacity;
}

.story-scene-inner {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
}

/* ── Grain overlay ── */
#story-grain {
  position: absolute;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  opacity: 0.16;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='discrete' tableValues='0 1'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

/* ── Star warp canvas ── */
.story-warp-canvas {
  position: absolute;
  inset: 0;
  z-index: 30;
  pointer-events: none;
}

/* ── HUD chrome ── */
#story-hud {
  position: absolute;
  inset-inline: 0;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  pointer-events: none;
}
#story-hud span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: rgba(255,255,255,0.5);
}
#story-close {
  pointer-events: auto;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.7);
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
#story-close:hover { border-color: rgba(255,255,255,0.5); color: #fff; }

#story-progress-track {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  z-index: 50;
  height: 2px;
  background: rgba(255,255,255,0.1);
}
#story-progress-bar {
  height: 100%;
  width: 0%;
  background: rgba(255,255,255,0.7);
}

/* ── Shared scene typography ── */
.story-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.35em;
  color: rgba(255,255,255,0.4);
}
.story-eyebrow::before {
  content: '';
  width: 24px; height: 1px;
  background: rgba(255,255,255,0.3);
  display: inline-block;
}

.story-heading {
  margin-top: 20px;
  font-size: clamp(28px, 4.5vw, 48px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: #fff;
  text-align: center;
  max-width: 820px;
}

.story-sub {
  margin-top: 22px;
  font-size: 15px;
  line-height: 1.8;
  color: rgba(255,255,255,0.55);
  text-align: center;
  max-width: 560px;
}

.story-fine {
  margin-top: 10px;
  font-size: 12px;
  color: rgba(255,255,255,0.35);
  text-align: center;
  max-width: 540px;
}

.story-fade {
  opacity: 0;
  transform: translateY(18px);
  transition: none;
}

/* ── Hero ── */
.story-title {
  font-size: clamp(42px, 13vw, 140px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  color: #fff;
  text-align: center;
}
.story-hint {
  position: absolute;
  bottom: 44px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: rgba(255,255,255,0.4);
}
.story-hint span:first-child { animation: story-pulse 2s ease-in-out infinite; }
.story-hint .story-hint-line { width: 1px; height: 32px; background: rgba(255,255,255,0.3); }
@keyframes story-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

.story-sphere-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

/* ── Bracket nav (At LAUNCH scene) ── */
.story-bracket-nav {
  position: absolute;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 620px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  letter-spacing: 0.15em;
  color: rgba(255,255,255,0.5);
}
.story-bracket-nav span {
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 100px;
  padding: 6px 14px;
  white-space: nowrap;
}
.story-bracket-nav span.active {
  border-color: rgba(255,255,255,0.3);
  color: #fff;
}

/* ── How I Work: flow steps ── */
.story-flow {
  margin-top: 40px;
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  max-width: 920px;
  border-top: 1px solid rgba(255,255,255,0.1);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.story-flow-step {
  flex: 1 1 200px;
  padding: 20px 22px;
  border-left: 1px solid rgba(255,255,255,0.1);
}
.story-flow-step:first-child { border-left: none; }
.story-flow-num {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(255,255,255,0.4);
}
.story-flow-title {
  margin-top: 8px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
}
.story-flow-desc {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.6;
  color: rgba(255,255,255,0.45);
}

/* ── Odyssey timeline ── */
.story-timeline {
  margin-top: 36px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
  max-width: 560px;
}
.story-timeline-row {
  display: flex;
  align-items: center;
  gap: 16px;
}
.story-timeline-thumb {
  position: relative;
  flex-shrink: 0;
  width: 76px; height: 54px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.03);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.story-timeline-thumb svg { opacity: 0.7; }
.story-timeline-thumb::after {
  content: '';
  position: absolute; inset: 0;
  opacity: 0.35;
  mix-blend-mode: overlay;
  background-image: repeating-linear-gradient(0deg, rgba(255,255,255,0.5) 0px, rgba(255,255,255,0.5) 1px, transparent 1px, transparent 3px);
}
.story-timeline-text {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255,255,255,0.6);
}

/* ── Numbers (stats) ── */
.story-stats {
  margin-top: 32px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px 24px;
  width: 100%;
  max-width: 780px;
}
@media (min-width: 640px) {
  .story-stats { grid-template-columns: repeat(5, 1fr); }
}
.story-stat-num {
  font-size: clamp(26px, 3.4vw, 36px);
  font-weight: 700;
  color: #fff;
}
.story-stat-label {
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.5;
  color: rgba(255,255,255,0.45);
}
.story-node-burst {
  position: absolute;
  right: 6%;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  display: none;
}
@media (min-width: 900px) {
  .story-node-burst { display: block; }
}

/* ── Flow / orbit steps ── */
.story-orbit {
  position: relative;
  margin-top: 56px;
  width: 100%;
  max-width: 560px;
  height: 240px;
}
.story-orbit-ellipse {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.story-orbit-node {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transform: translate(-50%, -50%);
  opacity: 0.35;
  transition: opacity 0.3s ease;
}
.story-orbit-node.active { opacity: 1; }
.story-orbit-dot {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.4);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  color: #fff;
  transition: transform 0.3s ease;
}
.story-orbit-node.active .story-orbit-dot { transform: scale(1.15); }
.story-orbit-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: rgba(255,255,255,0.6);
  white-space: nowrap;
}

/* ── Finale ── */
.story-cta {
  margin-top: 36px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 32px;
  border-radius: 100px;
  background: #fff;
  color: #000;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s;
}
.story-cta:hover { opacity: 0.8; }
.story-esc-hint {
  margin-top: 14px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: rgba(255,255,255,0.3);
}
.story-chart {
  position: absolute;
  bottom: 14%;
  opacity: 0;
}

@media (max-width: 640px) {
  .story-flow { flex-direction: column; }
  .story-flow-step { border-left: none; border-top: 1px solid rgba(255,255,255,0.1); }
  .story-flow-step:first-child { border-top: none; }
  .story-bracket-nav span:not(.active) { display: none; }
}
