/* cinema.css — 滚动叙事层（scrollytelling）
 *
 * 目标：用户往下滚的过程像在看一部片子，而不是页面上放了一段视频。
 * - 首屏随滚动推近/淡出（hero 内容被“镜头”推走）
 * - 章节按滚动顺序逐条入场（信念/入口/收口各自有自己的入画方式）
 * - 顶部/底部遮幅（letterbox）与章节 HUD 只在“片子”开始后出现
 * - 胶片颗粒与暗角常驻但极淡，不抢内容
 *
 * 实现优先级：原生 scroll-driven animations（animation-timeline: scroll()/view()）
 * → 不支持时由 cinema.js 用 rAF 写 --nl-cine-* 变量驱动同一套样式（.nl-cine-fallback）。
 * 所有位移都用 transform/opacity，避免滚动时触发布局。
 * 尊重 prefers-reduced-motion：全部动画与遮幅退化为静态。
 */

/* ── 变量 ───────────────────────────────────────────────────────────── */
.nl-page {
  --nl-cine-bar: clamp(0px, 2.6vh, 28px);
  --nl-cine-ink: #0b0d12;
  --nl-cine-paper: #f5f7f8;
  --nl-cine-hud: rgba(11, 13, 18, 0.62);
  --nl-cine-hud-dim: rgba(11, 13, 18, 0.28);
  --nl-cine-hair: rgba(11, 13, 18, 0.16);
  --nl-cine-p: 0;            /* 0..1，页面滚动进度（cinema.js 写入） */
  --nl-cine-chapter: 0;      /* 0..3，当前章节索引（cinema.js 写入） */
}
html[data-theme="dark"] .nl-page {
  --nl-cine-ink: #0b0d12;
  --nl-cine-paper: #e8ebf2;
  --nl-cine-hud: rgba(232, 235, 242, 0.66);
  --nl-cine-hud-dim: rgba(232, 235, 242, 0.26);
  --nl-cine-hair: rgba(232, 235, 242, 0.14);
}

/* ── 固定视觉层：上下遮幅 + 颗粒 + HUD + 进度 ───────────────────────── */
.nl-cine {
  position: fixed;
  inset: 0;
  z-index: 45;               /* 内容 z-10、header z-50：遮幅压在内容上、不挡导航 */
  pointer-events: none;
}
.nl-cine__bar {
  position: absolute;
  left: 0;
  right: 0;
  height: calc(var(--nl-cine-bar) + 18px);
  opacity: 0;
  transform: scaleY(0.2);
  transition: opacity 480ms ease, transform 640ms cubic-bezier(0.22, 1, 0.36, 1);
  transform-origin: top center;
}
.nl-cine__bar--top {
  top: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.5) calc(var(--nl-cine-bar) * 0.7), transparent 100%);
}
.nl-cine__bar--bottom {
  bottom: 0;
  transform-origin: bottom center;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.5) calc(var(--nl-cine-bar) * 0.7), transparent 100%);
}
.nl-page.is-cine-rolling .nl-cine__bar {
  opacity: 1;
  transform: scaleY(1);
}

.nl-cine__grain {
  position: absolute;
  inset: -40%;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 180px 180px;
  animation: nl-cine-grain 6.4s steps(8) infinite;
  will-change: transform;
}
html[data-theme="light"] .nl-cine__grain { opacity: 0.035; }
@keyframes nl-cine-grain {
  0% { transform: translate3d(0, 0, 0); }
  25% { transform: translate3d(-1.2%, 0.8%, 0); }
  50% { transform: translate3d(0.9%, -1.1%, 0); }
  75% { transform: translate3d(-0.7%, -0.6%, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

/* 章节 HUD：右下角 01 / 04 + 竖排进度。片头（未滚动）不出现。 */
.nl-cine__hud {
  position: absolute;
  right: clamp(14px, 2.2vw, 34px);
  bottom: calc(var(--nl-cine-bar) + clamp(14px, 2vh, 26px));
  display: flex;
  align-items: flex-end;
  gap: 10px;
  font: 600 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.22em;
  color: var(--nl-cine-hud);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 520ms ease 120ms, transform 520ms ease 120ms;
}
.nl-page.is-cine-rolling .nl-cine__hud { opacity: 1; transform: none; }
.nl-page.is-cine-end .nl-cine__hud { opacity: 0; transform: translateY(8px); transition-delay: 0ms; }
.nl-cine__num { font-size: 22px; letter-spacing: 0.06em; color: var(--nl-cine-hud); }
.nl-cine__of { opacity: 0.5; }
.nl-cine__meter {
  width: 2px;
  height: 56px;
  margin-left: 4px;
  background: var(--nl-cine-hud-dim);
  position: relative;
  overflow: hidden;
}
.nl-cine__meter::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: calc(var(--nl-cine-p) * 100%);
  background: var(--nl-cine-hud);
}

/* 顶部细进度条：与 HUD 同时出现 */
.nl-cine__progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 2px;
  width: 100%;
  transform: scaleX(var(--nl-cine-p));
  transform-origin: 0 50%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.65), rgba(255, 255, 255, 0.95));
  opacity: 0;
  transition: opacity 400ms ease;
  mix-blend-mode: difference;
}
.nl-page.is-cine-rolling .nl-cine__progress { opacity: 0.9; }

/* ── 首屏：镜头推近。滚动前 70vh，内容缓慢放大 + 下压 + 淡出 ───────── */
@supports (animation-timeline: scroll()) {
  .nl-hero__inner {
    animation: nl-cine-hero-push linear both;
    animation-timeline: scroll(root block);
    animation-range: 0 72vh;
  }
  .nl-plate {
    animation: nl-cine-plate-drift linear both;
    animation-timeline: scroll(root block);
    animation-range: 0 100vh;
  }
}
@keyframes nl-cine-hero-push {
  0% { opacity: 1; transform: translate3d(0, 0, 0) scale(1); filter: blur(0); }
  55% { opacity: 0.55; }
  100% { opacity: 0; transform: translate3d(0, 9vh, 0) scale(1.055); filter: blur(2px); }
}
@keyframes nl-cine-plate-drift {
  0% { transform: scale(1.02) translate3d(0, 0, 0); }
  100% { transform: scale(1.12) translate3d(0, 4.5vh, 0); }
}
.nl-cine-fallback .nl-hero__inner {
  opacity: calc(1 - var(--nl-cine-hero, 0));
  transform: translate3d(0, calc(var(--nl-cine-hero, 0) * 9vh), 0) scale(calc(1 + var(--nl-cine-hero, 0) * 0.055));
}
.nl-cine-fallback .nl-plate {
  transform: scale(calc(1.02 + var(--nl-cine-hero, 0) * 0.1));
}

/* 首屏角标：YOUR GAME · YOUR RULES 的“片头字幕”感 */
.nl-hero__note {
  letter-spacing: 0.34em;
  text-transform: uppercase;
  opacity: 0.72;
}
.nl-hero__title {
  text-wrap: balance;
  text-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

/* 片尾：全幅暗场，回到武器影像，收在“现在就进去”这一镜 */
.nl-cta {
  position: relative;
  isolation: isolate;
  min-height: 86vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  padding: 16vh 24px 18vh;
  overflow: hidden;
  background: #0b0d12;
}
.nl-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: url("/hero-assets/arena-nuke.webp") center 38% / cover no-repeat;
  filter: saturate(0.78) contrast(1.06) brightness(0.66);
  transform: scale(1.06);
}
.nl-cta::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(115% 85% at 50% 18%, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.36) 58%, rgba(0, 0, 0, 0.82) 100%),
    linear-gradient(180deg, rgba(11, 13, 18, 0.78) 0%, rgba(11, 13, 18, 0.06) 34%, rgba(11, 13, 18, 0.86) 100%);
}
.nl-cta > * { position: relative; }
.nl-cta .nullity-cta-anchor { height: auto !important; min-height: 0 !important; }
#cta.nl-cta { background: #0b0d12 url("/hero-assets/arena-nuke.webp") center 36% / cover no-repeat !important; }
.nl-cta .nl-cta__title {
  margin: 0 auto !important;
  max-width: 18ch;
  color: #fff;
  font-size: clamp(2.4rem, 6.2vw, 5.6rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  text-align: center;
  text-wrap: balance;
  text-shadow: 0 26px 70px rgba(0, 0, 0, 0.62);
}
.nl-cta .nl-cta__actions {
  justify-content: center;
  flex-wrap: wrap;
}
.nl-cta .nl-cta__note { color: rgba(255, 255, 255, 0.64); }
.nl-cta .nl-btn--ghost { border-color: rgba(255, 255, 255, 0.3); color: #fff; }
.nl-cta .nl-btn--ghost:hover { border-color: rgba(255, 255, 255, 0.55); }

/* 片头：首屏元素一拍一拍上画（只在载入时跑一次，不与滚动动画抢属性） */
@keyframes nl-cine-boot {
  0% { opacity: 0; transform: translate3d(0, 22px, 0); filter: blur(7px); }
  100% { opacity: 1; transform: none; filter: none; }
}
.nl-hero__inner > .nl-eyebrow,
.nl-hero__inner > .nl-hero__title,
.nl-hero__inner > .nl-hero__sub,
.nl-hero__inner > .nl-hero__actions,
.nl-hero__inner > .nl-hero__note,
.nl-hero__inner > .nl-scroll {
  animation: nl-cine-boot 980ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
.nl-hero__inner > .nl-eyebrow { animation-delay: 80ms; }
.nl-hero__inner > .nl-hero__title { animation-delay: 220ms; }
.nl-hero__inner > .nl-hero__sub { animation-delay: 360ms; }
.nl-hero__inner > .nl-hero__actions { animation-delay: 500ms; }
.nl-hero__inner > .nl-hero__note { animation-delay: 640ms; }
.nl-hero__inner > .nl-scroll { animation-delay: 860ms; }

/* ── 章节入场：视口进度驱动，逐条“剪”进来 ─────────────────────────── */
@supports (animation-timeline: view()) {
  .nl-belief,
  .nl-offer,
  .nl-cta__title,
  .nl-offers__head,
  .nl-cta__actions {
    animation: nl-cine-rise linear both;
    animation-timeline: view();
    animation-range: entry 6% entry 76%;
  }
  .nl-belief:nth-child(2),
  .nl-offer:nth-child(2) { animation-range: entry 12% entry 82%; }
  .nl-belief:nth-child(3),
  .nl-offer:nth-child(3) { animation-range: entry 18% entry 88%; }
}
@keyframes nl-cine-rise {
  0% { opacity: 0; transform: translate3d(0, 42px, 0); filter: blur(6px); }
  60% { opacity: 1; filter: blur(0); }
  100% { opacity: 1; transform: none; filter: none; }
}

/* 章节标题的“幕间字幕”：信念/入口/收口前的 eyebrow */
.nl-beliefs::before,
.nl-offers::before,
.nl-cta::before {
  content: "";
  display: block;
  width: min(120px, 18vw);
  height: 1px;
  margin: 0 auto clamp(18px, 4vh, 40px);
  background: linear-gradient(90deg, transparent, var(--nl-cine-hair), transparent);
}

/* 收口：标题像片尾主标题一样放大、收束 */
.nl-cta {
  background: radial-gradient(120% 130% at 50% 130%, rgba(11, 13, 18, 0.07), transparent 62%);
}
html[data-theme="dark"] .nl-cta {
  background: radial-gradient(120% 130% at 50% 130%, rgba(255, 255, 255, 0.05), transparent 62%);
}
@supports (animation-timeline: view()) {
  .nl-cta__title {
    animation-name: nl-cine-finale;
    animation-range: entry 0% entry 88%;
  }
}
@keyframes nl-cine-finale {
  0% { opacity: 0; transform: scale(0.86) translate3d(0, 30px, 0); letter-spacing: 0.18em; filter: blur(10px); }
  100% { opacity: 1; transform: none; letter-spacing: 0.02em; filter: none; }
}

/* 段落之间透出的“换镜”：滚到章节交界时，页面底色压暗一点点 */
.nl-beliefs,
.nl-offers,
.nl-cta {
  position: relative;
}
.nl-beliefs::after,
.nl-offers::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(120% 60% at 50% 0%, rgba(0, 0, 0, 0.05), transparent 60%);
}
html[data-theme="dark"] .nl-beliefs::after,
html[data-theme="dark"] .nl-offers::after {
  background: radial-gradient(120% 60% at 50% 0%, rgba(255, 255, 255, 0.035), transparent 60%);
}

/* ── 滚动提示：随滚动进度缩小并淡出，像片头“往下的箭头” ───────────── */
.nl-scroll {
  transition: opacity 500ms ease, transform 500ms ease;
}
.nl-page.is-cine-rolling .nl-scroll {
  opacity: 0.25;
  transform: translateY(4px) scale(0.9);
}

/* ── 产品实景：一屏钉住，滚动换镜 ───────────────────────────────────── */
.nl-showcase {
  position: relative;
  height: 340vh;
}
.nl-showcase__pin {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(10px, 1.8vh, 22px);
  padding: clamp(48px, 8vh, 92px) clamp(18px, 4vw, 60px) clamp(24px, 5vh, 48px);
}
.nl-showcase__head { text-align: center; }
.nl-showcase__title {
  margin: 8px 0 0;
  font-size: clamp(20px, 2.4vw, 38px);
  line-height: 1.2;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.nl-showcase__stage {
  position: relative;
  width: min(1080px, 86vw);
  margin: 0 auto;
  aspect-ratio: 16 / 10;
  border-radius: 14px;
  overflow: hidden;
  background: #07090d;
  box-shadow:
    0 40px 120px rgba(0, 0, 0, 0.36),
    0 0 0 1px rgba(255, 255, 255, 0.07) inset;
}
.nl-shot {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  transform: scale(1.04) translate3d(0, 20px, 0);
  filter: blur(7px) saturate(0.92);
  transition:
    opacity 640ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 900ms cubic-bezier(0.22, 1, 0.36, 1),
    filter 640ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
.nl-shot.is-active {
  opacity: 1;
  transform: none;
  filter: none;
  z-index: 2;
}
.nl-shot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.nl-shot figcaption {
  position: absolute;
  left: 14px;
  bottom: 14px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(8, 10, 14, 0.66);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #e8ebf2;
  font-size: 12px;
  line-height: 1;
  letter-spacing: 0.02em;
}
.nl-shot figcaption b { font-weight: 650; letter-spacing: 0.08em; }
.nl-shot figcaption span { opacity: 0.7; }
/* spacex.css 的 .nl-shot 是占位面板（min-height/padding 16/border-radius 2），这里承载真实截图要收紧 */
.nl-showcase__stage .nl-shot { min-height: 0 !important; padding: 0 !important; border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 14px; background: #07090d; overflow: hidden; }
.nl-showcase__steps {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  display: flex;
  gap: clamp(14px, 2.4vw, 32px);
  justify-content: center;
  font: 600 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.18em;
  color: var(--nl-cine-hud-dim);
}
.nl-showcase__steps li { display: flex; align-items: center; gap: 8px; transition: color 320ms ease; }
.nl-showcase__steps li i { font-style: normal; opacity: 0.6; }
.nl-showcase__steps li.is-active { color: var(--nl-cine-hud); }

/* ── 幕间字幕卡：像片子换场 ──────────────────────────────────────── */
.nl-act {
  background: #08090d;
  color: #e9ecf3;
  padding: clamp(72px, 16vh, 180px) clamp(20px, 6vw, 96px);
  text-align: center;
  position: relative;
  isolation: isolate;
}
.nl-act::before,
.nl-act::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 80px;
  pointer-events: none;
  z-index: 1;
}
.nl-act::before { top: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0.5), transparent); }
.nl-act::after { bottom: 0; background: linear-gradient(0deg, rgba(0, 0, 0, 0.5), transparent); }
.nl-act__inner { position: relative; z-index: 2; display: grid; gap: clamp(14px, 2.4vh, 26px); justify-items: center; }
.nl-act__num {
  font: 600 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.4em;
  opacity: 0.45;
}
.nl-act__line {
  margin: 0;
  max-width: 22em;
  font-size: clamp(24px, 3.4vw, 54px);
  line-height: 1.22;
  font-weight: 650;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
@supports (animation-timeline: view()) {
  .nl-act__line {
    animation: nl-act-in linear both;
    animation-timeline: view();
    animation-range: entry 12% entry 82%;
  }
}
@keyframes nl-act-in {
  0% { opacity: 0; transform: translate3d(0, 26px, 0); filter: blur(8px); letter-spacing: 0.04em; }
  100% { opacity: 1; transform: none; filter: none; letter-spacing: -0.02em; }
}

/* ── 常驻入口：滚动中段浮出，页尾收起 ────────────────────────────── */
.nl-sticky-cta {
  position: fixed;
  right: clamp(16px, 2.4vw, 34px);
  bottom: calc(var(--nl-cine-bar) + 22px);
  z-index: 46;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  border-radius: 999px;
  background: #0b0d12;
  color: #f2f4f8;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.14) inset;
  opacity: 0;
  transform: translate3d(0, 14px, 0) scale(0.96);
  pointer-events: none;
  transition:
    opacity 420ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
}
.nl-sticky-cta svg { transition: transform 280ms ease; }
.nl-page.is-cine-rolling .nl-sticky-cta {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.nl-page.is-cine-end .nl-sticky-cta {
  opacity: 0;
  transform: translate3d(0, 14px, 0) scale(0.96);
  pointer-events: none;
}
.nl-sticky-cta:hover svg { transform: translateX(3px); }

/* 收口页脚注 */
.nl-cta__note {
  margin: clamp(14px, 2.4vh, 22px) 0 0;
  font-size: 12px;
  letter-spacing: 0.04em;
  opacity: 0.55;
}

/* ── 移动端：解除钉住，产品实景改为纵向图册 ─────────────────────── */
@media (max-width: 900px) {
  .nl-showcase { height: auto; }
  .nl-showcase__pin {
    position: static;
    height: auto;
    display: block;
    padding: clamp(56px, 9vh, 96px) 18px clamp(28px, 6vh, 56px);
  }
  .nl-showcase__title { font-size: clamp(22px, 6vw, 30px); }
  .nl-showcase__stage { width: 100%; aspect-ratio: auto; border-radius: 12px; display: grid; gap: 14px; background: transparent; box-shadow: none; }
  .nl-shot {
    position: relative;
    opacity: 1;
    transform: none;
    filter: none;
    border-radius: 12px;
    overflow: hidden;
    background: #07090d;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  }
  .nl-shot img { aspect-ratio: 16 / 10; height: auto; }
  .nl-shot figcaption { font-size: 11px; left: 10px; bottom: 10px; }
  .nl-showcase__stage .nl-shot { display: block !important; padding: 0 !important; }
  .nl-showcase__stage .nl-shot img { width: 100%; height: auto; aspect-ratio: 16 / 10; display: block; }
  .nl-cine__hud { left: 14px; right: auto; }
  .nl-cine__meter { display: none; }
  .nl-sticky-cta { right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); padding: 9px 13px; font-size: 12px; gap: 6px; }
  .nl-showcase__steps { display: none; }
  .nl-act { padding: 84px 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .nl-cine__grain { animation: none; }
  .nl-page.is-cine-rolling .nl-cine__bar { transform: none; }
  .nl-cine__hud, .nl-cine__progress, .nl-scroll { transition: none; }
  .nl-hero__inner, .nl-plate, .nl-belief, .nl-offer, .nl-cta__title, .nl-cta__actions, .nl-offers__head {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
  .nl-hero__inner > * { animation: none !important; opacity: 1 !important; transform: none !important; filter: none !important; }
  .nl-act__line { animation: none !important; opacity: 1 !important; transform: none !important; filter: none !important; }
}
@media (max-width: 640px) {
  .nl-cine__hud { font-size: 9px; gap: 7px; }
  .nl-cine__num { font-size: 16px; }
  .nl-cine__meter { height: 40px; }
  .nl-cine__grain { opacity: 0.045; }
}

/* 2026-11-18 用户要求：屏幕上下那两条渐变遮幅删掉（不遮挡内容）。 */
.nl-cine__bar,
.nl-cine__bar--top,
.nl-cine__bar--bottom { display: none !important; opacity: 0 !important; }

/* FIX-STICKY-CTA-OFF (2026-11-18): 右下角常驻「进城」与 HUD 页数角标重叠 —— 用户要求删掉，这里双保险关死。 */
.nl-sticky-cta { display: none !important; }
