/* Scroll-driven 3D story on the adapter page */
.story { position: relative; height: 400vh;   /* 300vh of scrolling + one screen */ border-top: 1px solid #17293f; background: #08111d; }
/* The pinned panel is one screen tall, but never more than 2.2x its width: on very
   tall, narrow screens it is centred so the model and text stay together. */
.story-sticky { position: sticky; top: 0; top: calc((100svh - min(100svh, 220vw)) / 2);
  height: 100vh; height: min(100svh, 220vw); overflow: hidden; }
.story-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.story-loading { position: absolute; inset: 0; display: grid; place-items: center; font-family: 'JetBrains Mono', monospace; font-size: 12px; color: #7a8ea6; }

.story-cap {
  --o: 0;
  position: absolute; top: 50%;
  left: max(clamp(16px, 4vw, 32px), calc((100vw - 1120px) / 2 + 32px));
  width: min(420px, 38vw);
  opacity: var(--o);
  transform: translateY(calc(-50% + (1 - var(--o)) * 28px - var(--rise, 0px)));
  pointer-events: none;
}
.story-cap.on { pointer-events: auto; }
/* soft dark backdrop so captions stay readable when the model passes behind them */
.story-cap { z-index: 1; }
.story-cap::before {
  content: ''; position: absolute; inset: -48px -72px -48px -96px; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse 70% 60% at 40% 50%, rgba(8,17,29,0.86) 0%, rgba(8,17,29,0.6) 55%, rgba(8,17,29,0) 100%);
}
.story-cap-bottom { top: auto; bottom: 48px; transform: translateY(calc((1 - var(--o)) * 28px - var(--rise, 0px))); width: min(560px, 48vw); }
/* Terminal Server: the script centres the caption + model group and sets these */
@media (min-width: 761px) {
  .story--balanced .story-cap { left: var(--cap-left, 32px); width: var(--cap-w, 380px); }
}
.story-label { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: #298fd6; letter-spacing: 0.08em; }
.story-cap h2 { margin: 12px 0 0; font-size: clamp(26px, 3.4vw, 40px); line-height: 1.1; letter-spacing: -0.025em; font-weight: 600; text-wrap: balance; }
.story-cap p { margin: 16px 0 0; font-size: clamp(15px, 1.5vw, 17px); line-height: 1.6; color: #b0c5dd; text-wrap: pretty; }
.story-cap ol { margin: 16px 0 0; padding-left: 20px; font-size: 15px; line-height: 1.8; color: #b0c5dd; }
.story-buy { margin-top: 20px; display: flex; align-items: center; gap: 20px; }
.story-buy span { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; }
.story-buy button, .story-buy a { padding: 13px 34px; background: #298fd6; border: 1px solid #298fd6; border-radius: 6px; color: #04121f; font-family: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
.story-hint { position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%); font-family: 'JetBrains Mono', monospace; font-size: 13px; letter-spacing: 0.12em; color: #768fad; }

@media (max-width: 760px) {
  .story-cap, .story-cap-bottom {
    top: auto; bottom: 0; left: 0; right: 0; width: auto;
    padding: 48px 16px 28px;
    background: linear-gradient(to bottom, rgba(8,17,29,0), rgba(8,17,29,0.92) 36%);
    transform: translateY(calc((1 - var(--o)) * 28px - var(--rise, 0px)));
  }
  .story-cap h2 { font-size: 26px; }
  .story-cap::before { display: none; }   /* phones already have a full-width fade */
  .story-hint { bottom: 12px; }
}

/* setup steps light up as each connection completes */
.story-steps li { transition: color 0.3s ease; }
.story-steps li::marker { color: #7a8ea6; }
.story-steps li.done { color: #e6edf5; }
.story-steps li.done::marker { content: '✓  '; color: #298fd6; }
