/* ============================================================
   RÜM CINEMATIC NARRATIVE — Tech-trailer scroll story
   ============================================================ */

/* ─── Hero (Act 0) overrides ───────────────────────────────── */
.story-hero--narrative {
  --hero-text-op: 1;
  --hero-text-y: 0px;
  --hero-line-0-y: 0px;
  --hero-line-1-y: 0px;
  --hero-video-scale: 1.04;
  --hero-scrim: 0.72;
  --hero-cue-op: 1;
  min-height: 100vh;
}
.story-hero--scroll-driven .story-hero__overlay--cinematic {
  opacity: var(--hero-scrim, 0.72);
}
.story-hero--scroll-driven .story-hero__video {
  transform: scale(var(--hero-video-scale, 1.04));
  transition: transform 0.15s linear;
  will-change: transform;
}
.story-hero--scroll-driven .story-hero__content--narrative {
  transform: translateY(var(--hero-text-y, 0));
  opacity: var(--hero-text-op, 1);
  transition: opacity 0.15s linear, transform 0.15s linear;
  will-change: transform, opacity;
}
.story-hero--scroll-driven .story-hero__title-line:nth-child(1) {
  transform: translateY(var(--hero-line-0-y, 0));
  opacity: var(--hero-text-op, 1);
}
.story-hero--scroll-driven .story-hero__title-line:nth-child(2) {
  transform: translateY(var(--hero-line-1-y, 0));
  opacity: var(--hero-text-op, 1);
}
.story-hero--scroll-driven .story-hero__scroll-cue--narrative {
  opacity: var(--hero-cue-op, 1);
  transition: opacity 0.2s ease;
}
.story-hero__overlay--cinematic {
  background: linear-gradient(
    180deg,
    rgba(2, 3, 10, 0.12) 0%,
    rgba(2, 3, 10, 0.35) 38%,
    rgba(2, 3, 10, 0.78) 72%,
    rgba(2, 3, 10, 0.96) 100%
  );
}
.story-hero__grain {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}
.story-hero__content--narrative {
  padding-top: 72px;
  max-width: 960px;
}
.story-hero__title--narrative {
  font-size: clamp(2.5rem, 6.4vw, 5.2rem);
  margin-bottom: 32px;
  line-height: 1.12;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.14em;
}
.story-hero__title--narrative .story-hero__title-line {
  white-space: nowrap;
  line-height: 1.12;
  padding-block: 0.04em;
  animation-delay: calc(0.35s + var(--line-i, 0) * 0.5s);
}
@media (max-width: 1180px) {
  .story-hero__title--narrative .story-hero__title-line:first-child {
    white-space: normal;
    text-wrap: balance;
    max-width: 15ch;
  }
}
.story-hero--scroll-driven.is-hero-scrolling .story-hero__title-line {
  animation: none;
}
.story-hero--scroll-driven.is-hero-scrolling .story-hero__scroll-cue--narrative {
  animation: none;
}
.story-hero__title--narrative .story-hero__title-line:last-child {
  background: linear-gradient(140deg, #fff8f0 0%, var(--brand, #f6a868) 48%, #ff8f4a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 28px rgba(246, 168, 104, 0.28));
}
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .story-hero__title--narrative .story-hero__title-line:last-child {
    -webkit-text-fill-color: currentColor;
    background: none;
    filter: none;
    color: var(--brand, #f6a868);
  }
}
.story-hero__types {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35em 0.5em;
  margin: 0;
  opacity: 0;
  transform: translateY(12px);
  animation: storyHeroIn 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) 1.45s forwards;
}
.story-hero__sub--narrative {
  font-family: 'Inter', sans-serif;
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-weight: 500;
  line-height: 1.55;
  color: rgba(226, 232, 240, 0.72);
  max-width: 52ch;
  margin: 0 auto;
  opacity: 0;
  transform: translateY(14px);
  animation: storyHeroIn 0.85s cubic-bezier(0.2, 0.8, 0.2, 1) 1.35s forwards;
}
.story-hero__manifesto {
  font-family: 'Baloo 2', sans-serif;
  font-size: clamp(1.15rem, 2.4vw, 1.65rem);
  font-weight: 700;
  line-height: 1.35;
  color: #fff8f0;
  max-width: 34ch;
  margin: clamp(20px, 3vh, 28px) auto 0;
  opacity: 0;
  transform: translateY(14px);
  animation: storyHeroIn 0.85s cubic-bezier(0.2, 0.8, 0.2, 1) 1.55s forwards;
  text-wrap: balance;
}
.story-hero__type {
  font-family: 'Inter', sans-serif;
  font-size: clamp(0.82rem, 1.5vw, 1rem);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.72);
}
.story-hero__type-sep {
  color: rgba(246, 168, 104, 0.45);
  font-weight: 400;
  user-select: none;
}
.story-hero--narrative .story-hero__cta-group {
  display: none;
}
.story-hero__scroll-cue--narrative {
  animation-delay: 2.4s;
}

/* ─── Narrative scroll chapter ─────────────────────────────── */
.story-narrative {
  --narrative-p: 0;
  --beat-op-lost: 1;
  --beat-op-connect: 0;
  --beat-op-capabilities: 0;
  --beat-op-scenarios: 0;
  --beat-op-reveal: 0;
  position: relative;
  z-index: 2;
}
.story-narrative__scroll-room {
  height: 520vh;
}
.story-narrative__pin {
  position: sticky;
  top: 0;
  height: 100vh;
  min-height: 560px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.story-narrative__visuals {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.story-narrative__visual {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.15s linear;
}
.story-narrative__visual img,
.story-narrative__media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.04);
  filter: saturate(0.78) brightness(0.58) contrast(1.08);
}
.story-narrative__media--scenario {
  opacity: 0;
  transition: opacity 0.55s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.story-narrative__visual--scenarios .story-narrative__media--scenario.is-scenario-active {
  opacity: 1;
}
.story-narrative__visual img {
  position: absolute;
  inset: 0;
}
.story-narrative__visual--lost .story-narrative__media:not(.story-narrative__media--scenario),
.story-narrative__visual--connect .story-narrative__media:not(.story-narrative__media--scenario),
.story-narrative__visual--capabilities .story-narrative__media:not(.story-narrative__media--scenario),
.story-narrative__visual--reveal .story-narrative__media:not(.story-narrative__media--scenario) {
  opacity: 1;
}
.story-narrative__visual--lost {
  opacity: var(--beat-op-lost);
}
.story-narrative__visual--connect {
  opacity: var(--beat-op-connect);
}
.story-narrative__visual--capabilities {
  opacity: var(--beat-op-capabilities);
}
.story-narrative__visual--scenarios {
  opacity: var(--beat-op-scenarios);
}
.story-narrative__visual--reveal {
  opacity: var(--beat-op-reveal);
}
.story-narrative__visual--reveal img,
.story-narrative__visual--reveal .story-narrative__media {
  filter: saturate(0.88) brightness(0.42) contrast(1.12);
}
.story-narrative__wireframe {
  position: absolute;
  inset: 8% 12%;
  border: 1px solid rgba(120, 200, 255, 0.35);
  background:
    linear-gradient(rgba(120, 200, 255, 0.08) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(90deg, rgba(120, 200, 255, 0.08) 1px, transparent 1px) 0 0 / 48px 48px;
  mask-image: linear-gradient(180deg, transparent, #000 18%, #000 82%, transparent);
  opacity: calc(var(--beat-op-connect) * 0.85);
  transform: perspective(900px) rotateX(12deg) scale(0.98);
  transform-origin: center bottom;
}
.story-narrative__scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    180deg,
    transparent 0,
    transparent 3px,
    rgba(120, 200, 255, 0.03) 3px,
    rgba(120, 200, 255, 0.03) 4px
  );
  opacity: calc(var(--beat-op-capabilities) * 0.9);
  pointer-events: none;
}
.story-narrative__reveal-glow {
  position: absolute;
  inset: auto 0 0;
  height: 55%;
  background: radial-gradient(ellipse 80% 60% at 50% 100%, rgba(246, 168, 104, 0.28), transparent 70%);
  opacity: var(--beat-op-reveal);
}
.story-narrative__scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    180deg,
    rgba(2, 3, 10, 0.55) 0%,
    rgba(2, 3, 10, 0.42) 40%,
    rgba(2, 3, 10, 0.72) 100%
  );
  pointer-events: none;
}
.story-narrative__grain {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}
.story-narrative__stage {
  position: relative;
  z-index: 3;
  width: min(920px, calc(100% - 48px));
  min-height: 320px;
  display: grid;
  place-items: center;
}
.story-narrative__beat {
  grid-area: 1 / 1;
  width: 100%;
  text-align: center;
  opacity: 0;
  transform: translateY(28px);
  pointer-events: none;
  transition:
    opacity 0.45s cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 0.55s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.story-narrative__beat.is-active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.story-narrative__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(246, 168, 104, 0.55);
  margin: 0 0 20px;
  font-variant-numeric: tabular-nums;
}
.story-narrative__title {
  font-family: 'Baloo 2', sans-serif;
  font-size: clamp(1.75rem, 3.6vw, 3rem);
  font-weight: 800;
  line-height: 1.12;
  color: #fff;
  letter-spacing: -0.025em;
  margin: 0 0 28px;
  max-width: 22ch;
  margin-inline: auto;
  text-shadow: 0 2px 32px rgba(2, 3, 10, 0.65);
}
.story-narrative__beat--connect .story-narrative__title,
.story-narrative__beat--capabilities .story-narrative__title,
.story-narrative__beat--scenarios .story-narrative__title {
  max-width: 28ch;
}
.story-narrative__body,
.story-narrative__lede {
  font-family: 'Inter', sans-serif;
  font-size: clamp(0.92rem, 1.55vw, 1.05rem);
  font-weight: 400;
  line-height: 1.6;
  color: rgba(226, 232, 240, 0.72);
  max-width: 52ch;
  margin: -8px auto 24px;
}
.story-narrative__lede {
  font-weight: 500;
  color: rgba(226, 232, 240, 0.78);
  margin-bottom: 20px;
}
.story-narrative__beat--capabilities .story-narrative__title {
  margin-bottom: 12px;
}
.story-narrative__items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-width: 720px;
  margin-inline: auto;
}
.story-narrative__items--chips .story-narrative__item {
  display: inline-flex;
  padding: 10px 16px;
  border-radius: 100px;
  font-size: clamp(0.82rem, 1.4vw, 0.95rem);
  font-weight: 500;
  color: rgba(226, 232, 240, 0.82);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  opacity: var(--chip-in, 0);
  transform: translateY(calc((1 - var(--chip-in, 0)) * 22px))
    scale(calc(0.9 + var(--chip-in, 0) * 0.1));
  filter: blur(calc((1 - var(--chip-in, 0)) * 3px));
  transition: none;
}
.story-narrative__beat.is-active .story-narrative__items--chips .story-narrative__item {
  opacity: var(--chip-in, 0);
  transform: translateY(calc((1 - var(--chip-in, 0)) * 22px))
    scale(calc(0.9 + var(--chip-in, 0) * 0.1));
}
.story-narrative__items--phases {
  gap: 0;
  flex-wrap: nowrap;
  max-width: 100%;
}
.story-narrative__items--phases .story-narrative__item {
  font-family: 'Inter', sans-serif;
  font-size: clamp(0.88rem, 1.6vw, 1.05rem);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.7);
  padding: 0 14px;
  position: relative;
}
.story-narrative__items--phases .story-narrative__item:not(:last-child)::after {
  content: '→';
  position: absolute;
  right: -4px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(246, 168, 104, 0.5);
  font-size: 0.85em;
  letter-spacing: 0;
}
.story-narrative__items--stack {
  flex-direction: column;
  gap: 0.28em;
}
.story-narrative__item {
  font-family: 'Inter', sans-serif;
  font-size: clamp(0.95rem, 1.8vw, 1.15rem);
  font-weight: 500;
  color: rgba(226, 232, 240, 0.62);
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 0.4s ease,
    transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
  transition-delay: calc(var(--item-i, 0) * 0.07s);
}
.story-narrative__beat.is-active .story-narrative__item {
  opacity: 1;
  transform: translateY(0);
}
.story-narrative__kicker {
  margin: 32px auto 0;
  max-width: 42ch;
  font-family: 'Baloo 2', sans-serif;
  font-size: clamp(1.1rem, 2.2vw, 1.45rem);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: rgba(255, 248, 240, 0.92);
}
.story-narrative__capabilities {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-width: 780px;
  margin: 0 auto;
}
.story-narrative__cap {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  transition:
    opacity 0.45s ease,
    transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1),
    border-color 0.3s ease,
    background 0.3s ease;
  transition-delay: calc(var(--cap-i, 0) * 0.06s);
}
.story-narrative__beat.is-active .story-narrative__cap {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.story-narrative__cap:nth-child(odd) {
  border-color: rgba(120, 200, 255, 0.22);
}
.story-narrative__scenarios {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
  max-width: 640px;
  margin-inline: auto;
  text-align: left;
}
.story-narrative__scenario {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  font-size: clamp(0.95rem, 1.65vw, 1.08rem);
  font-weight: 500;
  line-height: 1.45;
  color: rgba(226, 232, 240, 0.85);
  opacity: 0;
  transform: translateX(-16px);
  transition:
    opacity 0.45s ease,
    transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
  transition-delay: calc(var(--scenario-i, 0) * 0.1s);
}
.story-narrative__beat.is-active .story-narrative__scenario {
  opacity: 1;
  transform: translateX(0);
}
.story-narrative__scenario.is-scenario-active {
  color: rgba(255, 248, 240, 0.95);
}
.story-narrative__scenario.is-scenario-active .story-narrative__scenario-dot {
  box-shadow: 0 0 16px rgba(246, 168, 104, 0.85);
  transform: scale(1.25);
}
.story-narrative__scenario-dot {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  margin-top: 0.55em;
  border-radius: 50%;
  background: var(--brand, #f6a868);
  box-shadow: 0 0 12px rgba(246, 168, 104, 0.55);
  transition: box-shadow 0.35s ease, transform 0.35s ease;
}
.story-narrative__reveal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.story-narrative__reveal-quote {
  font-family: 'Inter', sans-serif;
  font-size: clamp(0.95rem, 1.7vw, 1.12rem);
  font-weight: 500;
  line-height: 1.55;
  color: rgba(226, 232, 240, 0.82);
  max-width: 44ch;
  margin: 0 0 20px;
}
.story-narrative__label--reveal {
  margin-bottom: 12px;
}
.story-narrative__brand {
  font-family: 'Baloo 2', sans-serif;
  font-size: clamp(4rem, 12vw, 7.5rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.04em;
  margin: 0;
  color: #fff;
  text-shadow:
    0 0 60px rgba(246, 168, 104, 0.35),
    0 4px 40px rgba(2, 3, 10, 0.8);
}
.story-narrative__tagline {
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  font-weight: 500;
  letter-spacing: 0.01em;
  color: rgba(226, 232, 240, 0.72);
  margin: 8px 0 28px;
  max-width: 36ch;
}
.story-narrative__reveal-cta {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}
.story-narrative__progress {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 4;
  width: min(200px, 40vw);
}
.story-narrative__progress-track {
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.story-narrative__progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand, #f6a868), #ff8f4a);
  transition: width 0.12s linear;
}

/* Hide connector between hero and narrative */
.story-hero--narrative + .story-connector {
  display: none;
}
#story-narrative + .story-connector {
  margin-top: -8px;
}

/* ─── Reduced motion ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .story-hero__types,
  .story-hero__sub--narrative,
  .story-hero__manifesto,
  .story-hero__title-line {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
  .story-narrative__scroll-room {
    height: auto;
  }
  .story-narrative__pin {
    position: relative;
    height: auto;
    min-height: 0;
    padding: 64px 0;
  }
  .story-narrative__visuals {
    display: none;
  }
  .story-narrative__beat {
    position: relative;
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto;
    padding: 48px 0;
  }
  .story-narrative__beat:not(:first-child) {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }
  .story-narrative__item,
  .story-narrative__cap,
  .story-narrative__scenario {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
  .story-narrative__progress {
    display: none;
  }
}

/* ─── Mobile ───────────────────────────────────────────────── */
@media (max-width: 640px) {
  .story-narrative__scroll-room {
    height: 460vh;
  }
  .story-hero__title--narrative {
    font-size: clamp(2.4rem, 11vw, 3.6rem);
  }
  .story-hero__title--narrative .story-hero__title-line {
    white-space: normal;
  }
  .story-narrative__title {
    font-size: clamp(1.5rem, 6.8vw, 2.1rem);
    max-width: none;
  }
  .story-narrative__items--phases {
    flex-wrap: wrap;
    gap: 8px 0;
  }
  .story-narrative__items--phases .story-narrative__item {
    padding: 0 10px;
  }
  .story-narrative__items--phases .story-narrative__item::after {
    display: none;
  }
  .story-narrative__capabilities {
    gap: 8px;
  }
  .story-narrative__cap {
    font-size: 11px;
    padding: 6px 12px;
  }
  .story-narrative__brand {
    font-size: clamp(3.2rem, 18vw, 5rem);
  }
}
