.home-story-page {
  overflow: hidden;
}

.home-story-page .shell {
  min-height: 100svh;
}

.home-story {
  position: relative;
  isolation: isolate;
}

.home-story-page .site-nav .nav-menu {
  position: relative;
}

.home-story-page .site-nav .nav-menu > .nav-link.active::after {
  opacity: 0;
}

.story-nav-indicator {
  position: absolute;
  bottom: 0;
  left: 0;
  z-index: 3;
  width: 0;
  height: 2px;
  border-radius: 999px;
  background: var(--purple, var(--nav-purple));
  box-shadow: 0 0 14px var(--purple, var(--nav-purple));
  opacity: 0;
  pointer-events: none;
  transform: translateX(0);
  transition:
    width .38s cubic-bezier(.2,.8,.2,1),
    transform .56s cubic-bezier(.2,.8,.2,1),
    opacity .2s ease;
}

.story-nav-indicator.is-visible {
  opacity: 1;
}

.story-track {
  display: flex;
  width: 100%;
  height: calc(100svh - 77px);
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  touch-action: pan-x;
}

.story-track::-webkit-scrollbar {
  display: none;
}

.story-scene {
  --scene-accent: 158, 114, 255;
  position: relative;
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  padding: clamp(38px, 6vh, 76px) 0 92px;
  overflow: hidden;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.story-scene.hero {
  display: grid;
  height: 100%;
  min-height: 0;
  padding-top: clamp(38px, 7vh, 78px);
}

.story-copy,
.story-window {
  opacity: .3;
  transform: translateY(26px);
  transition: opacity .6s ease, transform .7s cubic-bezier(.2,.8,.2,1);
}

.story-copy {
  min-width: 0;
  max-width: 100%;
}

.story-window {
  transform: translateX(34px) scale(.98);
  transition-delay: .07s;
}

.story-scene.is-active .story-copy,
.story-scene.is-active .story-window {
  opacity: 1;
  transform: none;
}

.story-scene-layout {
  display: grid;
  grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr);
  align-items: center;
  gap: clamp(42px, 6vw, 88px);
  height: 100%;
}

.story-kicker {
  margin: 0 0 20px;
  color: rgb(var(--scene-accent));
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .25em;
  text-transform: uppercase;
}

.story-copy h2 {
  max-width: 720px;
  margin: 0;
  color: var(--white);
  font-size: clamp(3rem, 6.1vw, 6.6rem);
  font-weight: 950;
  letter-spacing: -.065em;
  line-height: .84;
  text-transform: uppercase;
}

.story-copy h2 span {
  color: transparent;
  -webkit-text-stroke: 1px rgba(241,240,247,.52);
}

.story-scene-profiles .story-copy h2,
.story-scene-tools .story-copy h2 {
  font-size: clamp(2.9rem, 4.15vw, 4.65rem);
  line-height: .88;
}

.story-copy .story-lead {
  max-width: 560px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.55vw, 1.18rem);
  line-height: 1.65;
}

.story-copy .actions {
  margin-top: 30px;
}

.story-window {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid rgba(241,240,247,.19);
  border-radius: 26px;
  background:
    radial-gradient(circle at 86% 10%, rgba(var(--scene-accent),.16), transparent 34%),
    linear-gradient(135deg, rgba(255,255,255,.028), transparent 48%),
    rgba(14,13,20,.9);
  box-shadow:
    0 26px 78px rgba(0,0,0,.42),
    0 0 0 1px rgba(var(--scene-accent),.07),
    0 0 68px rgba(var(--scene-accent),.1);
  backdrop-filter: blur(20px);
}

.story-window-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border-bottom: 1px solid rgba(241,240,247,.1);
  background: rgba(255,255,255,.025);
  color: rgba(241,240,247,.54);
  font-size: .62rem;
  font-weight: 850;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.module-window {
  height: min(68vh, 620px);
  min-height: 500px;
}

.module-preview-frame {
  --preview-scale: .68;
  position: relative;
  height: calc(100% - 48px);
  overflow: hidden;
  background: #0d0c12;
}

.module-preview-frame::after {
  position: absolute;
  inset: auto 0 0;
  z-index: 2;
  height: 90px;
  background: linear-gradient(transparent, rgba(13,12,18,.94));
  content: "";
  pointer-events: none;
}

.module-preview-frame iframe {
  width: calc(100% / var(--preview-scale));
  height: calc(100% / var(--preview-scale));
  border: 0;
  background: #0d0c12;
  opacity: .38;
  pointer-events: none;
  transform: scale(var(--preview-scale));
  transform-origin: 0 0;
  transition: opacity .65s ease, filter .65s ease;
  filter: saturate(.82);
}

.story-scene.is-active .module-preview-frame iframe {
  opacity: 1;
  filter: saturate(1);
}

.module-preview-plans { --preview-scale: .62; }
.module-preview-locations { --preview-scale: .67; }
.module-preview-downloads { --preview-scale: .78; }

.module-preview-action {
  position: absolute;
  right: 18px;
  bottom: 17px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 17px;
  border: 1px solid rgba(var(--scene-accent),.6);
  border-radius: 999px;
  background: rgba(13,12,18,.92);
  box-shadow: 0 12px 30px rgba(0,0,0,.35);
  color: var(--white);
  font-size: .61rem;
  font-weight: 900;
  letter-spacing: .13em;
  text-decoration: none;
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}

.module-preview-action span {
  color: rgb(var(--scene-accent));
  font-size: 1rem;
}

.module-preview-action:hover,
.module-preview-action:focus-visible {
  border-color: rgb(var(--scene-accent));
  background: rgba(var(--scene-accent),.16);
  transform: translateY(-2px);
}

.window-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(241,240,247,.22);
}

.window-path {
  margin-left: 9px;
}

.profile-stack {
  display: grid;
  gap: 1px;
  background: rgba(241,240,247,.11);
}

.profile-row {
  position: relative;
  display: grid;
  grid-template-columns: 56px minmax(0,1fr) auto;
  align-items: center;
  gap: 18px;
  min-height: 128px;
  padding: 24px 28px;
  background: rgba(20,19,27,.96);
  color: inherit;
  text-decoration: none;
  transition: background .25s ease, color .25s ease;
}

.story-scene .profile-row,
.story-scene .location-stat,
.story-scene .flag-ribbon,
.story-scene .tool-card {
  opacity: 0;
  transform: translateY(18px);
}

.story-scene.is-active .profile-row,
.story-scene.is-active .location-stat,
.story-scene.is-active .flag-ribbon,
.story-scene.is-active .tool-card {
  animation: story-item-in .52s cubic-bezier(.2,.8,.2,1) forwards;
}

.story-scene.is-active .profile-row:nth-child(1),
.story-scene.is-active .location-stat-global,
.story-scene.is-active .tool-card:nth-child(1) { animation-delay: .22s; }
.story-scene.is-active .profile-row:nth-child(2),
.story-scene.is-active .location-stat-flex,
.story-scene.is-active .tool-card:nth-child(2) { animation-delay: .31s; }
.story-scene.is-active .profile-row:nth-child(3),
.story-scene.is-active .location-stat-pro,
.story-scene.is-active .tool-card:nth-child(3) { animation-delay: .4s; }
.story-scene.is-active .flag-ribbon { animation-delay: .48s; }

.profile-row::after {
  content: "\2192";
  color: rgb(var(--scene-accent));
  font-size: 1.2rem;
  transform: translateX(-4px);
  transition: transform .25s ease;
}

.profile-row:hover,
.profile-row:focus-visible {
  background: linear-gradient(90deg, rgba(var(--scene-accent),.19), rgba(20,19,27,.98) 72%);
}

.profile-row:hover::after,
.profile-row:focus-visible::after {
  transform: translateX(3px);
}

.profile-icon,
.tool-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(var(--scene-accent),.48);
  border-radius: 16px;
  background: rgba(var(--scene-accent),.1);
  color: rgb(var(--scene-accent));
  font-size: 1.15rem;
  font-weight: 900;
}

.profile-row strong {
  display: block;
  color: var(--white);
  font-size: .96rem;
  font-weight: 900;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.profile-row small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: .76rem;
  line-height: 1.45;
}

.profile-price {
  color: var(--white);
  font-size: clamp(1.25rem, 2.1vw, 1.9rem);
  font-weight: 950;
  letter-spacing: -.04em;
  white-space: nowrap;
}

.profile-price span {
  color: var(--muted);
  font-size: .58rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.story-scene-locations {
  --scene-accent: 94, 210, 190;
}

.network-map {
  position: relative;
  min-height: 510px;
  padding: 74px 42px 42px;
  background:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px),
    radial-gradient(circle at 62% 46%, rgba(var(--scene-accent),.18), transparent 32%);
  background-size: 48px 48px, 48px 48px, auto;
}

.network-map::before,
.network-map::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 260px;
  height: 260px;
  border: 1px solid rgba(var(--scene-accent),.24);
  border-radius: 50%;
  transform: translate(-50%,-50%);
}

.network-map::after {
  width: 390px;
  height: 390px;
  border-color: rgba(var(--scene-accent),.12);
}

.network-core-story {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  border: 1px solid rgba(var(--scene-accent),.62);
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(var(--scene-accent),.32), rgba(32,25,51,.92));
  box-shadow: 0 0 52px rgba(var(--scene-accent),.22);
  transform: translate(-50%,-50%) rotate(7deg);
}

.network-core-story img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  transform: rotate(-7deg);
}

.location-stat {
  position: absolute;
  z-index: 3;
  min-width: 164px;
  padding: 18px 20px;
  border: 1px solid rgba(241,240,247,.14);
  border-radius: 16px;
  background: rgba(14,13,20,.88);
  box-shadow: 0 18px 42px rgba(0,0,0,.28);
}

.location-stat strong {
  display: block;
  color: var(--white);
  font-size: 2rem;
  font-weight: 950;
  letter-spacing: -.05em;
}

.location-stat span {
  color: var(--muted);
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .09em;
  line-height: 1.45;
  text-transform: uppercase;
}

.location-stat-global { left: 7%; top: 18%; }
.location-stat-flex { right: 7%; top: 24%; }
.location-stat-pro { right: 13%; bottom: 12%; }

.flag-ribbon {
  position: absolute;
  left: 7%;
  bottom: 14%;
  z-index: 3;
  display: flex;
  gap: 8px;
}

.flag-ribbon span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(241,240,247,.14);
  border-radius: 11px;
  background: rgba(14,13,20,.84);
  font-size: 1rem;
}

.story-scene-tools {
  --scene-accent: 255, 184, 82;
}

.tools-window-body {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 1px;
  background: rgba(241,240,247,.11);
}

.tool-card {
  position: relative;
  min-height: 210px;
  padding: 28px;
  background: rgba(20,19,27,.96);
  color: inherit;
  text-decoration: none;
  transition: background .25s ease, transform .25s ease;
}

.tool-card:first-child {
  grid-row: span 2;
  min-height: 421px;
  background:
    radial-gradient(circle at 80% 14%, rgba(var(--scene-accent),.18), transparent 34%),
    rgba(20,19,27,.96);
}

.tool-card:hover,
.tool-card:focus-visible {
  background-color: rgba(35,31,43,.98);
}

.tool-card h3 {
  margin: 28px 0 10px;
  color: var(--white);
  font-size: clamp(1.2rem, 2vw, 1.75rem);
  font-weight: 900;
  letter-spacing: -.02em;
  text-transform: uppercase;
}

.tool-card p {
  margin: 0;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.55;
}

.tool-card strong {
  position: absolute;
  right: 24px;
  bottom: 22px;
  color: rgb(var(--scene-accent));
  font-size: .66rem;
  font-weight: 900;
  letter-spacing: .13em;
  text-transform: uppercase;
}

@keyframes story-item-in {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.ip-preview-story {
  margin-top: 34px;
  padding: 18px;
  border: 1px solid rgba(var(--scene-accent),.28);
  border-radius: 16px;
  background: rgba(8,8,12,.48);
}

.ip-preview-story span {
  display: block;
  color: var(--muted);
  font-size: .58rem;
  font-weight: 850;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.ip-preview-story b {
  display: block;
  margin-top: 8px;
  color: var(--white);
  font-size: 1.22rem;
  letter-spacing: .02em;
}

.story-controls {
  position: absolute;
  right: 0;
  bottom: 20px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px;
  border: 1px solid rgba(241,240,247,.12);
  border-radius: 999px;
  background: rgba(12,11,17,.8);
  box-shadow: 0 12px 34px rgba(0,0,0,.28);
  backdrop-filter: blur(16px);
}

.story-arrow,
.story-dot {
  appearance: none;
  border: 0;
  color: var(--white);
  cursor: pointer;
}

.story-arrow {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.07);
  font-size: 1rem;
  transition: background .2s ease, transform .2s ease;
}

.story-arrow:hover,
.story-arrow:focus-visible {
  background: rgba(158,114,255,.32);
  transform: scale(1.06);
}

.story-dots {
  display: flex;
  align-items: center;
  gap: 8px;
}

.story-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border-radius: 50%;
  background: rgba(241,240,247,.28);
  transition: width .25s ease, border-radius .25s ease, background .25s ease;
}

.story-dot[aria-current="true"] {
  width: 30px;
  border-radius: 999px;
  background: var(--accent, var(--purple, #9e72ff));
}

.story-a11y-status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1060px) {
  .story-scene-layout {
    grid-template-columns: minmax(0,.8fr) minmax(0,1.2fr);
    gap: 34px;
  }

  .story-scene.hero {
    grid-template-columns: minmax(0,.82fr) minmax(430px,1.18fr);
    gap: 26px;
    padding-top: 38px;
  }

  .story-scene.hero .hero-product-stage {
    width: 100%;
    height: 520px;
  }

  .story-copy h2 {
    font-size: clamp(2.55rem,5.7vw,4.65rem);
  }

  .profile-row {
    min-height: 118px;
    padding: 20px;
  }

  .network-map {
    min-height: 480px;
  }
}

@media (max-width: 820px) {
  .story-track {
    height: calc(100svh - 72px);
    touch-action: pan-x pan-y;
  }

  .story-scene,
  .story-scene.hero {
    overflow-y: auto;
    padding: 42px 0 94px;
  }

  .story-scene-layout,
  .story-scene.hero {
    display: grid;
    grid-template-columns: 1fr;
    align-content: start;
    gap: 28px;
  }

  .story-scene.hero .hero-product-stage {
    width: min(620px,100%);
    height: 430px;
  }

  .story-copy h2 {
    max-width: 620px;
    font-size: clamp(2.7rem,10vw,4.7rem);
  }

  .story-copy .story-lead {
    margin-top: 20px;
  }

  .story-window {
    width: min(620px,100%);
  }

  .module-window {
    height: 510px;
    min-height: 510px;
  }

  .network-map {
    min-height: 430px;
  }
}

@media (max-width: 560px) {
  .story-track {
    height: calc(100svh - 68px);
  }

  .story-scene,
  .story-scene.hero {
    padding: 30px 0 88px;
  }

  .story-kicker {
    margin-bottom: 14px;
    font-size: .62rem;
  }

  .story-copy h2 {
    font-size: clamp(2.5rem,14vw,4.1rem);
  }

  .story-copy .story-lead {
    font-size: .92rem;
  }

  .story-window {
    border-radius: 20px;
  }

  .module-window {
    height: 470px;
    min-height: 470px;
  }

  .module-preview-frame {
    --preview-scale: .52;
  }

  .module-preview-downloads {
    --preview-scale: .58;
  }

  .module-preview-action {
    right: 12px;
    bottom: 12px;
    min-height: 40px;
    padding: 0 14px;
    font-size: .55rem;
  }

  .profile-row {
    grid-template-columns: 44px minmax(0,1fr);
    gap: 13px;
    min-height: 110px;
    padding: 17px;
  }

  .profile-row::after {
    display: none;
  }

  .profile-icon,
  .tool-icon {
    width: 42px;
    height: 42px;
    border-radius: 13px;
  }

  .profile-price {
    grid-column: 2;
    font-size: 1.2rem;
  }

  .network-map {
    min-height: 500px;
    padding: 60px 16px 24px;
  }

  .network-map::before { width: 210px; height: 210px; }
  .network-map::after { width: 310px; height: 310px; }
  .network-core-story { width: 86px; height: 86px; border-radius: 23px; }
  .network-core-story img { width: 44px; height: 44px; }
  .location-stat { min-width: 138px; padding: 14px; }
  .location-stat strong { font-size: 1.55rem; }
  .location-stat-global { left: 4%; top: 17%; }
  .location-stat-flex { right: 4%; top: 22%; }
  .location-stat-pro { right: 7%; bottom: 11%; }
  .flag-ribbon { left: 4%; bottom: 14%; gap: 5px; }
  .flag-ribbon span { width: 32px; height: 32px; border-radius: 9px; }

  .tools-window-body {
    grid-template-columns: 1fr;
  }

  .tool-card,
  .tool-card:first-child {
    grid-row: auto;
    min-height: 190px;
  }

  .ip-preview-story {
    display: none;
  }

  .story-controls {
    right: 12px;
    bottom: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .story-track {
    scroll-behavior: auto;
  }

  .story-copy,
  .story-window,
  .story-arrow,
  .story-dot,
  .profile-row,
  .profile-row::after,
  .tool-card {
    transition: none !important;
  }

  .module-preview-frame iframe,
  .module-preview-action {
    transition: none !important;
  }

  .story-scene .profile-row,
  .story-scene .location-stat,
  .story-scene .flag-ribbon,
  .story-scene .tool-card {
    animation: none !important;
    opacity: 1;
    transform: none;
  }
}

/* Keep scene navigation reachable without covering the mobile reading area. */
.story-arrow { width: 44px; height: 44px; }
.story-dot {
  width: 24px; height: 24px; border: 8px solid transparent;
  background-clip: padding-box;
}
.story-dot[aria-current="true"] { width: 40px; }
@media (max-width: 820px) {
  .story-track { height: calc(100svh - 150px); }
  .story-controls {
    position: relative; right: auto; bottom: auto;
    width: max-content; margin: 8px 0 8px auto;
  }
}

/* Native summaries share the actual module data and need no embedded frames. */
.module-preview-content { height:100%; overflow:auto; padding:18px 18px 84px; display:grid; align-content:start; gap:12px; font-family:var(--text,"Avenir Next",sans-serif); }
.native-preview-card { padding:18px; border:1px solid rgba(241,240,247,.16); border-radius:16px; background:linear-gradient(130deg,rgba(158,114,255,.14),rgba(255,255,255,.025)); }
.native-preview-title { margin:0 0 8px; color:#cbb7ff; font-size:.68rem; font-weight:800; letter-spacing:.1em; line-height:1.5; }
.native-preview-value { display:block; color:#f1f0f7; font-size:1.45rem; line-height:1.3; }
.native-preview-detail { margin:8px 0 0; color:#c7c4cf; font-size:.88rem; line-height:1.5; }
.module-preview-content[data-preview-state="unavailable"] { color:#c7c4cf; line-height:1.6; }
