/* Amplified Insights - homepage story hero
   Blurred ambient film behind a centered value proposition, followed by
   a vertical glow-line narrative. Loaded on index.html only.
   Depends on css/style.css tokens. */

/* ---------------------------------------------------------------- */
/* Shell + opening-viewport film                                    */
/* ---------------------------------------------------------------- */
.story {
  position: relative;
  overflow-x: clip;
  overflow-y: hidden;
  background: #060b14;
  color: var(--white);
}

.story-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.story-poster,
.story-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(4px);
  transform: scale(1.045);
}

/* Poster sits underneath; the video fades in over it once frames are
   decodable, so there is never a black flash or layout shift. */
.story-video {
  opacity: 0;
  transition: opacity 1.2s ease;
}
.story-video.is-ready { opacity: 1; }

.story-shade {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(6, 11, 20, .38) 0%, rgba(6, 11, 20, .66) 70%),
    linear-gradient(180deg, rgba(6, 11, 20, .78) 0%, rgba(6, 11, 20, .5) 30%, rgba(6, 11, 20, .62) 72%, rgba(6, 11, 20, .96) 100%);
}

/* ---------------------------------------------------------------- */
/* Opening viewport: value proposition + immediate CTA               */
/* ---------------------------------------------------------------- */
.story-hero {
  position: relative;
  z-index: 2;
  display: grid;
  overflow: hidden;
  min-height: calc(100vh - var(--nav-h));
  min-height: calc(100svh - var(--nav-h));
  place-items: center;
  isolation: isolate;
  padding: clamp(3rem, 8vh, 5rem) 0 clamp(2rem, 5vh, 3rem);
}

.story-hero-inner {
  position: relative;
  z-index: 2;
  width: min(100% - 48px, 820px);
  margin-inline: auto;
  text-align: center;
}
.story-hero-inner .eyebrow { color: #8dd4ff; }
.story-hero-inner .eyebrow::before { display: none; }
.story-hero-inner h1 {
  margin-bottom: 1.3rem;
  font-size: clamp(2.5rem, 5.2vw, 4.3rem);
  text-wrap: balance;
  text-shadow: 0 1px 2px rgba(6, 11, 20, .35), 0 6px 28px rgba(6, 11, 20, .45);
}
.story-sub {
  max-width: 640px;
  margin: 0 auto 2rem;
  color: rgba(214, 226, 240, .88);
  font-size: clamp(1.02rem, 1.6vw, 1.18rem);
  line-height: 1.6;
}
.story-hero-inner .btn-row { justify-content: center; }

.story-trust {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .6rem 1rem;
  margin: 2.2rem 0 0;
  padding: 0;
  list-style: none;
}
.story-trust li {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 999px;
  background: rgba(6, 11, 20, .38);
  padding: .45rem .9rem;
  color: rgba(214, 226, 240, .85);
  font-size: .85rem;
  font-weight: 600;
}
.story-trust li::before {
  color: var(--cyan);
  content: "✓";
  font-weight: 800;
}

/* Buttons on dark */
.story .btn-secondary {
  border-color: rgba(255, 255, 255, .28);
  background: rgba(255, 255, 255, .06);
  color: var(--white);
}
.story .btn-secondary:hover {
  border-color: rgba(255, 255, 255, .5);
  background: rgba(255, 255, 255, .12);
}

/* ---------------------------------------------------------------- */
/* Connected scroll storyboard                                      */
/* ---------------------------------------------------------------- */
.story-flow {
  position: relative;
  z-index: 2;
  overflow: clip;
  border-top: 1px solid rgba(141, 212, 255, .08);
  background: linear-gradient(180deg, #060b14 0%, #07111e 48%, #060b14 100%);
  padding: clamp(3rem, 7vw, 6rem) max(24px, calc((100vw - 1248px) / 2)) clamp(6rem, 10vw, 9rem);
}

.story-sequence {
  position: relative;
  z-index: 2;
  width: min(100%, 1200px);
  margin-inline: auto;
}

.story-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr);
  grid-template-areas: "copy media";
  align-items: center;
  gap: clamp(4.5rem, 8vw, 8.5rem);
  min-height: clamp(650px, 82svh, 850px);
  padding-block: clamp(5rem, 10vh, 8rem);
}

.story-panel:nth-child(even) {
  grid-template-columns: minmax(0, 1.18fr) minmax(0, .82fr);
  grid-template-areas: "media copy";
}

.story-copy {
  grid-area: copy;
  max-width: 500px;
}

.story-step {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  margin-bottom: 1.25rem;
  color: #8dd4ff;
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.story-step::before {
  width: 28px;
  height: 1px;
  background: linear-gradient(90deg, var(--cyan), var(--blue));
  content: "";
}

.story-copy h2 {
  margin-bottom: 1rem;
  font-size: clamp(2rem, 3.5vw, 3.25rem);
  line-height: 1.04;
  text-wrap: balance;
  text-shadow: 0 1px 2px rgba(6, 11, 20, .35), 0 8px 30px rgba(6, 11, 20, .38);
}

.story-copy p {
  max-width: 470px;
  margin: 0;
  color: rgba(211, 222, 236, .82);
  font-size: clamp(1rem, 1.45vw, 1.14rem);
  line-height: 1.65;
}

.story-panel-cta {
  margin-top: 1.8rem;
  box-shadow: 0 14px 40px rgba(46, 124, 246, .2);
}

.story-panel:last-child .story-copy {
  border: 1px solid rgba(141, 212, 255, .15);
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(15, 31, 54, .82), rgba(6, 11, 20, .55));
  padding: clamp(1.5rem, 3vw, 2.4rem);
  box-shadow: 0 28px 80px rgba(0, 0, 0, .24);
}

.story-visual {
  position: relative;
  grid-area: media;
  width: 100%;
  margin: 0;
}

.story-visual picture {
  display: block;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 3 / 2;
  border: 1px solid rgba(141, 212, 255, .15);
  border-radius: clamp(22px, 3vw, 34px);
  background: #0c1524;
  box-shadow: 0 26px 80px rgba(0, 0, 0, .34), 0 0 0 1px rgba(255, 255, 255, .025) inset;
}

.story-visual::after {
  position: absolute;
  inset: 0;
  border-radius: clamp(22px, 3vw, 34px);
  background: linear-gradient(145deg, rgba(67, 182, 248, .08), transparent 32%, rgba(6, 11, 20, .18));
  content: "";
  pointer-events: none;
}

.story-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.045);
  transition: transform 1.15s cubic-bezier(.16, 1, .3, 1), filter .8s ease;
}

.story-node {
  position: absolute;
  z-index: 4;
  top: 50%;
  display: block;
  width: 16px;
  height: 16px;
  border: 3px solid #07111e;
  border-radius: 50%;
  background: #8dd4ff;
  box-shadow: 0 0 0 5px rgba(67, 182, 248, .12), 0 0 22px rgba(67, 182, 248, .45);
  transition: box-shadow .5s ease, transform .5s ease;
}

.story-panel:nth-child(odd) .story-node {
  left: 0;
  transform: translate(-50%, -50%);
}

.story-panel:nth-child(even) .story-node {
  right: 0;
  transform: translate(50%, -50%);
}

.story-panel.is-active .story-node {
  box-shadow: 0 0 0 7px rgba(67, 182, 248, .17), 0 0 34px rgba(67, 182, 248, .85);
}

.story-panel:nth-child(odd).is-active .story-node { transform: translate(-50%, -50%) scale(1.1); }
.story-panel:nth-child(even).is-active .story-node { transform: translate(50%, -50%) scale(1.1); }

.story-connector {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.story-connector-track,
.story-connector-progress {
  fill: none;
  vector-effect: non-scaling-stroke;
}

.story-connector-track {
  stroke: rgba(141, 212, 255, .13);
  stroke-width: 2;
}

.story-connector-progress {
  stroke: url(#story-line-gradient);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  filter: url(#story-line-glow);
}

.story-fallback {
  display: grid;
  gap: 1rem;
  max-width: 760px;
  margin-inline: auto;
}

.story-fallback article {
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 22px;
  background: rgba(255, 255, 255, .04);
  padding: 1.5rem;
}

.story-fallback span { color: #8dd4ff; font-size: .75rem; font-weight: 800; letter-spacing: .12em; }
.story-fallback h2 { margin: .7rem 0; font-size: clamp(1.5rem, 3vw, 2.2rem); }
.story-fallback p { color: rgba(211, 222, 236, .82); }

/* Panel entrance. The no-JS fallback remains fully visible. */
.js .story-panel .story-copy,
.js .story-panel .story-visual {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  transition: opacity .8s cubic-bezier(.16, 1, .3, 1), transform .8s cubic-bezier(.16, 1, .3, 1);
}

.js .story-panel .story-visual { transition-delay: .08s; }

.js .story-panel.is-active .story-copy,
.js .story-panel.is-active .story-visual {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.story-panel.is-active .story-visual img {
  transform: scale(1);
}

.story-panel.is-complete .story-panel-cta {
  box-shadow: 0 14px 50px rgba(67, 182, 248, .38), 0 0 0 1px rgba(141, 212, 255, .22) inset;
}

@keyframes story-cta-breathe {
  0%, 100% { box-shadow: 0 14px 40px rgba(46, 124, 246, .22); }
  50% { box-shadow: 0 14px 52px rgba(67, 182, 248, .4); }
}

.story-panel.is-complete .story-panel-cta {
  animation: story-cta-breathe 2.8s ease-in-out infinite;
}

/* A subtle travelling sheen lives only on the completed line. */
.story-flow.is-complete .story-connector-progress {
  content: "";
  filter: url(#story-line-glow) drop-shadow(0 0 6px rgba(141, 212, 255, .45));
}

/* ---------------------------------------------------------------- */
/* Navigation treatment while the story is on screen                 */
/* ---------------------------------------------------------------- */
.nav {
  transition: background .35s ease, border-color .35s ease;
}
.nav.nav-overlay {
  border-bottom-color: rgba(255, 255, 255, .08);
  background: rgba(6, 11, 20, .72);
}
.nav.nav-overlay .nav-brand { color: var(--white); }
.nav.nav-overlay .nav-brand-text > span { color: var(--cyan); }
.nav.nav-overlay .nav-links a:not(.nav-cta) { color: #d5e0ee; }
.nav.nav-overlay .nav-links a:not(.nav-cta):hover,
.nav.nav-overlay .nav-links a.active { color: var(--cyan); }
.nav.nav-overlay .nav-toggle span { background: var(--white); }
.nav.nav-overlay .nav-links .nav-cta { background: var(--blue-deep); }
@media (max-width: 940px) {
  .nav.nav-overlay .nav-links {
    border-bottom-color: rgba(255, 255, 255, .08);
    background: rgba(6, 11, 20, .96);
  }
  .nav.nav-overlay .nav-links li { border-bottom-color: rgba(255, 255, 255, .08); }
}

/* ---------------------------------------------------------------- */
/* Homepage sections that continue the story                         */
/* ---------------------------------------------------------------- */
.section-dark.section-bridge {
  background: linear-gradient(180deg, #060b14 0%, var(--ink) 18%);
}
.section-dark .problem-item {
  border-color: var(--line-dark);
  background: rgba(255, 255, 255, .045);
}
.section-dark .problem-item p { color: #b9c6d7; }
.section-dark .kicker-num { background: rgba(67, 182, 248, .14); color: #8dd4ff; }

.capability h3 { font-size: clamp(1.7rem, 3vw, 2.5rem); letter-spacing: -.03em; }

/* ---------------------------------------------------------------- */
/* Small screens                                                     */
/* ---------------------------------------------------------------- */
@media (max-width: 860px) {
  .story-flow {
    padding-right: 20px;
    padding-left: 56px;
  }

  .story-panel,
  .story-panel:nth-child(even) {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "copy" "media";
    gap: 2.25rem;
    min-height: 0;
    padding-block: clamp(4.5rem, 13vw, 6.5rem);
  }

  .story-copy { max-width: 620px; }
  .story-copy h2 { font-size: clamp(1.9rem, 7vw, 2.8rem); }
  .story-visual picture { aspect-ratio: 5 / 4; }

  .story-panel:nth-child(odd) .story-node,
  .story-panel:nth-child(even) .story-node {
    right: auto;
    left: -28px;
    transform: translate(-50%, -50%);
  }

  .story-panel:nth-child(odd).is-active .story-node,
  .story-panel:nth-child(even).is-active .story-node {
    transform: translate(-50%, -50%) scale(1.08);
  }
}

@media (max-width: 680px) {
  .story-hero-inner { width: min(100% - 32px, 820px); }
  .story-trust { gap: .5rem; }
  .story-trust li { font-size: .8rem; }
  .story-panel:last-child .story-copy { padding: 1.35rem; }
}

/* ---------------------------------------------------------------- */
/* Reduced motion: static poster, everything readable                */
/* ---------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .story-video { display: none; }
  .js .story-panel .story-copy,
  .js .story-panel .story-visual { opacity: 1; transform: none; transition: none; }
  .story-visual img,
  .story-panel.is-active .story-visual img { transform: none; transition: none; }
  .story-node { transition: none; }
  .story-connector-progress { stroke-dashoffset: 0; filter: none; }
  .story-panel.is-complete .story-panel-cta { animation: none; }
}
