/* 首页（≤640px）竖屏大海报：照 Apple TV+ 首页的滚动模型
   1) 上边定死：hero 由 fmc-home-collapse 钉在 top:0
   2) 下拉：海报上边不动、整体放大（JS 驱动 .fca-art 的 scale，原点 50% 0%）
   3) 上滑：海报沿滚动时间轴加速上移、内容 1:1 自然滚动压上来，内容顶边 120px 羽化
   4) 内容是一整块不透明的面：行间距从 margin 改成 padding，行与行之间不再镂空
   5) 静止时海报下沿收到纯黑，和「相关」那块无缝

   性能（踩过两次坑，别退回去）：
   - **滚动联动动画交给 CSS `animation-timeline: scroll()`**：由浏览器在滚动时间轴上推进，
     JS 不再每帧写 transform。之前「内容由合成线程滚、海报由主线程 JS 在下一帧补」
     的错位就是「一顿一顿」的来源。
   - 不给 hero 做 opacity 动画（整幅带 mask 的图做组透明度会被每帧重新栅格化）。
   - 不每帧写 `:root` 自定义属性（整棵文档树样式失效）。
   不支持滚动时间轴的浏览器：JS 里有一套等价的手动实现（见 fmc-home-hero-scroll.js） */

:root {
  /* 调参入口：改这里不用动 JS（页面引用带 ?v=N，改完记得升版本号） */
  --fmc-hero-drift: .50;        /* 上滑时海报额外上移的比例（× hero 高度，曲线见 keyframes） */
  --fmc-hero-stretch: .30;      /* 下拉最多放大多少（0.30 = 放大 30%） */
  --fmc-hero-feather: 120px;    /* 内容顶边上方的羽化带高度 */
  --fmc-hero-lift-span: 138vw;  /* 上移走完所需滚动距离 = 0.92 × hero 高度（hero = 150vw） */
}

@media (max-width: 640px), (pointer: coarse) {
  body.fmc-tv-home .fmc-tv-app .fca-hero {
    will-change: transform;
  }
  body.fmc-tv-home .fmc-tv-app .fca-art {
    transform-origin: 50% 0%;
    will-change: transform;
  }
  /* 松手回弹（拖动中该 class 被摘掉，跟手不迟滞） */
  body.fmc-tv-home .fmc-tv-app .fca-art.fmc-spring {
    transition: transform var(--dur-3, 320ms) var(--ease-out, cubic-bezier(.16, 1, .3, 1));
  }

  /* —— 内容一整块：行间距改成内边距，背景一起铺满，行之间不再透出海报 —— */
  body.fmc-tv-home .fmc-tv-app .fca-row,
  body.fmc-tv-home .fmc-tv-app .fca-hero + .fca-row {
    margin-top: 0 !important;
    padding-top: 26px !important;
  }

  /* —— 海报下沿收到纯黑：静止时海报与「相关」那一块是无缝的同色 —— */
  body.fmc-tv-home .fmc-tv-app .fca-hero-copy {
    background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,.5) 32%, rgba(0,0,0,.92) 72%, #000 100%) !important;
    z-index: 3;
  }

  /* —— 羽化带：贴在内容顶边上随内容一起走 —— */
  body.fmc-tv-home .fmc-tv-app .fca-hero + .fca-row::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 100%;
    height: var(--fmc-hero-feather, 120px);
    background: linear-gradient(to top,
      #000 0%,
      rgba(0, 0, 0, .85) 30%,
      rgba(0, 0, 0, .45) 60%,
      rgba(0, 0, 0, 0) 100%);
    opacity: 0;
    pointer-events: none;
  }
}

/* ===== 滚动驱动：hero 上移 + 羽化淡入（浏览器自己跟滚动同步，零 JS） ===== */
@keyframes fmc-hero-lift {
  0%   { transform: translate3d(0, -0.00vw, 0); }
  10%  { transform: translate3d(0, -3.35vw, 0); }
  20%  { transform: translate3d(0, -8.54vw, 0); }
  30%  { transform: translate3d(0, -14.76vw, 0); }
  40%  { transform: translate3d(0, -21.77vw, 0); }
  50%  { transform: translate3d(0, -29.42vw, 0); }
  60%  { transform: translate3d(0, -37.63vw, 0); }
  70%  { transform: translate3d(0, -46.34vw, 0); }
  80%  { transform: translate3d(0, -55.49vw, 0); }
  90%  { transform: translate3d(0, -65.06vw, 0); }
  100% { transform: translate3d(0, -75.00vw, 0); }
}
@keyframes fmc-hero-feather-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@media (max-width: 640px), (pointer: coarse) {
  @supports (animation-timeline: scroll()) {
    body.fmc-tv-home .fmc-tv-app .fca-hero {
      animation: fmc-hero-lift linear both;
      animation-timeline: scroll();
      animation-range: 0 var(--fmc-hero-lift-span, 138vw);
    }
    body.fmc-tv-home .fmc-tv-app .fca-hero + .fca-row::before {
      animation: fmc-hero-feather-in linear both;
      animation-timeline: scroll();
      animation-range: 0 40px;
    }
  }
}

@media (max-width: 640px), (pointer: coarse) and (prefers-reduced-motion: reduce), (pointer: coarse) and (prefers-reduced-motion: reduce) {
  body.fmc-tv-home .fmc-tv-app .fca-hero,
  body.fmc-tv-home .fmc-tv-app .fca-hero + .fca-row::before {
    animation: none !important;
  }
}
