/**
 * retech/home-hero —— 首页首屏块样式(原型 ret-ch/assets/css/retech.css 第 05 节
 * 657–998 行 + 第 17 节 1930–1984 行 + 第 18 节 2039–2064 行)。
 *
 * 唯一属主声明:
 *   `.retech-x-wrap` / `.retech-x-eyebrow(--light)` / `.retech-x-btn` /
 *   `--primary` / `--ghost` / `--lg` / `.retech-x-section--dark` / `.retech-x-rich`
 *   全部由 blocks/style-index.css 拥有 —— 本文件只**消费**,不重复定义
 *   (块文件里再锚一次会被 check-css 判 E5)。
 *   本文件只锚 `.retech-x-home-hero*`;
 *   `.retech-x-ico-pause` / `.retech-x-ico-play` 只在**复合作用域**
 *   (`.retech-x-home-hero-ctrl .retech-x-ico-x`)下出现,不算属主 —— 它们是
 *   blocks/view.js 视频开关模块切换的两个图标钩子(见 render.php)。
 *
 * 两个必须保住的坑:
 *   1) 光效层 .retech-x-home-hero-lights 是遮罩的**兄弟层**、独立 z-index(4),
 *      不是 .retech-x-home-hero-tint / -shade 的子元素 —— README §7 记过:tint 不透明度
 *      最高 0.95,扫光带做它的子元素会被整个吃掉。扫描关键帧两端 opacity 归零,
 *      避免光带「啪」地出现 / 消失。
 *   2) prefers-reduced-motion 关掉**全部**循环动效(扫光、光丝线、环境光呼吸、
 *      视频/兜底图推拉、标题与面板入场)。项目硬要求「禁止持续强烈动画」。
 *      分层体系下 retech-responsive 晚于 retech-block,后层直接压过前层,无需强制声明。
 */
@layer retech-block {
  /* ═══ 外壳 ═══════════════════════════════════════════════════════════════ */
  .retech-x-home-hero {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 100vh;
    min-height: 100svh;
    overflow: hidden;
    isolation: isolate;
    background: var(--retech-x-graphite);
    padding-top: var(--retech-x-header-h);
  }

  /* ═══ 影像层 ═════════════════════════════════════════════════════════════ */
  .retech-x-home-hero-media {
    position: absolute;
    inset: 0;
    z-index: 0;
  }
  .retech-x-home-hero-video,
  .retech-x-home-hero-fallback {
    position: absolute;
    inset: -5%;
    width: 110%;
    height: 110%;
    /* 重置层给 img 设了 max-width:100%,会截掉这里的 110% 溢出,必须显式放开 */
    max-width: none;
    object-fit: cover;
    transform-origin: center center;
    /* 极缓推拉:26s 一去一回,属「轻量渐入」范畴 */
    animation: retech-x-home-hero-drift 26s var(--retech-x-ease-ui) infinite alternate;
  }
  .retech-x-home-hero-video {
    z-index: 1;
  }
  .retech-x-home-hero-fallback {
    z-index: 0;
  }

  /* 双层渐变遮罩(与 page-hero 基座同构,按首页更重的左上压暗调过) */
  .retech-x-home-hero-tint {
    position: absolute;
    inset: 0;
    z-index: 2;
    background:
      linear-gradient(to bottom, rgba(17, 23, 28, .18) 0%, rgba(17, 23, 28, .50) 100%),
      linear-gradient(100deg, rgba(17, 23, 28, .93) 0%, rgba(17, 23, 28, .68) 46%, rgba(17, 23, 28, .10) 100%);
  }
  /* 品牌色环境光:绿(循环)左上 + 青(技术)右上 */
  .retech-x-home-hero-shade {
    position: absolute;
    inset: 0;
    z-index: 3;
    background:
      linear-gradient(135deg, rgba(118, 192, 67, .16) 0%, rgba(118, 192, 67, .03) 42%, transparent 66%),
      radial-gradient(circle at 82% 24%, rgba(24, 175, 196, .13) 0%, transparent 36%);
    animation: retech-x-home-hero-ambient 12s var(--retech-x-ease-ui) infinite;
  }

  /* ═══ 光效层(★ 必须是遮罩的兄弟层,独立 z-index)═════════════════════════ */
  .retech-x-home-hero-lights {
    position: absolute;
    inset: -10%;
    z-index: 4;
    pointer-events: none;
    overflow: hidden;
  }

  /* 斜向扫光带 —— 周期闪光的核心。
     克制化(README §7):周期 4.8s → 7.5s、峰值 0.34 → 0.26、颜色青柠 → Circular Green,
     保留 -18° 斜切与两端柔和过渡。变量沿用全局 :root 的 --retech-x-cycle-scan / -scan-peak。 */
  .retech-x-home-hero-scan {
    position: absolute;
    top: -25%;
    bottom: -25%;
    left: -34%;
    width: 34%;
    background: linear-gradient(90deg,
      transparent 0%,
      rgba(118, 192, 67, .05) 34%,
      rgba(118, 192, 67, var(--retech-x-scan-peak)) 50%,
      rgba(118, 192, 67, .05) 66%,
      transparent 100%);
    filter: blur(1px);
    transform: skewX(-18deg);
    animation: retech-x-home-hero-scan var(--retech-x-cycle-scan) var(--retech-x-ease-scan) infinite;
    will-change: left, opacity;
  }

  /* 光丝线 ×2(更慢更淡;青/绿各一,呼应双色语义) */
  .retech-x-home-hero-beam {
    position: absolute;
    top: -18%;
    bottom: -18%;
    left: 62%;
    width: 1px;
    background: linear-gradient(to bottom,
      transparent 0%,
      rgba(255, 255, 255, .34) 44%,
      rgba(24, 175, 196, .42) 50%,
      rgba(255, 255, 255, .10) 58%,
      transparent 100%);
    opacity: 0;
    transform: rotate(18deg);
    animation: retech-x-home-hero-beam var(--retech-x-cycle-beam) var(--retech-x-ease-entry) infinite;
    animation-delay: 1400ms;
    will-change: opacity, transform;
  }
  .retech-x-home-hero-beam--2 {
    left: 28%;
    background: linear-gradient(to bottom,
      transparent 0%,
      rgba(255, 255, 255, .30) 44%,
      rgba(118, 192, 67, .38) 50%,
      rgba(255, 255, 255, .08) 58%,
      transparent 100%);
    animation-delay: 6200ms;
  }

  /* ═══ 内容层 ═════════════════════════════════════════════════════════════ */
  .retech-x-home-hero-inner {
    position: relative;
    z-index: 5;
  }
  .retech-x-home-hero-grid {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 400px);
    align-items: end;
    gap: 72px;
    padding: 86px 0 96px;
  }
  /* 左侧竖向光柱(6px 流动 + 2px 静态) */
  .retech-x-home-hero-grid::before {
    content: "";
    position: absolute;
    left: -34px;
    top: 0;
    width: 6px;
    height: 100%;
    background: linear-gradient(to bottom,
      transparent 0%,
      rgba(118, 192, 67, .06) 26%,
      rgba(118, 192, 67, .55) 46%,
      var(--retech-x-flow) 50%,
      rgba(118, 192, 67, .55) 54%,
      rgba(118, 192, 67, .06) 74%,
      transparent 100%);
    background-size: 100% 320%;
    transform-origin: top center;
    animation:
      retech-x-home-hero-line-reveal 1000ms var(--retech-x-ease-entry) 300ms both,
      retech-x-home-hero-line-flow 8s linear 1300ms infinite;
  }
  .retech-x-home-hero-grid::after {
    content: "";
    position: absolute;
    left: -32px;
    top: 0;
    width: 2px;
    height: 100%;
    background: rgba(118, 192, 67, .34);
    transform-origin: top center;
    animation: retech-x-home-hero-line-reveal 1000ms var(--retech-x-ease-entry) 300ms both;
  }

  .retech-x-home-hero-copy {
    padding-left: 42px;
  }

  .retech-x-home-hero-title {
    font-size: 68px;
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -.028em;
    color: #fff;
    max-width: 17ch;
  }
  /* 标题手动分行 → 每行独立入场,形成 stagger 节奏 */
  .retech-x-home-hero-title-line {
    display: block;
    animation: retech-x-home-hero-rise 1000ms var(--retech-x-ease-entry) both;
  }
  .retech-x-home-hero-title-line:first-child {
    animation-delay: 260ms;
  }
  .retech-x-home-hero-title-line:last-child {
    animation-delay: 400ms;
  }

  .retech-x-home-hero-intro {
    max-width: 58ch;
    margin-top: 26px;
    font-size: 18px;
    line-height: 1.68;
    color: var(--retech-x-w72);
    animation: retech-x-home-hero-rise 900ms var(--retech-x-ease-entry) 560ms both;
  }

  .retech-x-home-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 34px;
    animation: retech-x-home-hero-rise 900ms var(--retech-x-ease-entry) 700ms both;
  }

  /* ═══ 右侧工程摘要面板 ═══════════════════════════════════════════════════ */
  .retech-x-home-hero-panel {
    position: relative;
    padding: 28px;
    border: 1px solid var(--retech-x-w20);
    border-radius: var(--retech-x-r-lg);
    background: linear-gradient(135deg, rgba(255, 255, 255, .14) 0%, rgba(255, 255, 255, .04) 100%);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    animation: retech-x-home-hero-panel-in 900ms var(--retech-x-ease-entry) 480ms both;
  }
  .retech-x-home-hero-panel-label {
    margin-bottom: 18px;
    color: var(--retech-x-flow);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
  }
  /* <ol> 显式清浏览器默认 padding-inline-start(与面包屑同一处理,不赌 :where() 重置) */
  .retech-x-home-hero-flow {
    position: relative;
    display: grid;
    gap: 15px;
    margin: 0;
    padding: 0 0 0 4px;
    list-style: none;
  }
  .retech-x-home-hero-flow::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 12px;
    bottom: 12px;
    width: 1px;
    background: linear-gradient(to bottom, var(--retech-x-tech-a30) 0%, var(--retech-x-tech) 50%, rgba(255, 255, 255, .14) 100%);
    transform-origin: top center;
    animation: retech-x-home-hero-line-reveal 800ms var(--retech-x-ease-entry) 760ms both;
  }
  .retech-x-home-hero-flow-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding-left: 26px;
    color: var(--retech-x-w90);
    font-size: 14px;
    font-weight: 600;
    animation: retech-x-home-hero-flow-rise 620ms var(--retech-x-ease-entry) both;
  }
  .retech-x-home-hero-flow-item:nth-child(1) {
    animation-delay: 820ms;
  }
  .retech-x-home-hero-flow-item:nth-child(2) {
    animation-delay: 920ms;
  }
  .retech-x-home-hero-flow-item:nth-child(3) {
    animation-delay: 1020ms;
  }
  .retech-x-home-hero-flow-item:nth-child(4) {
    animation-delay: 1120ms;
  }
  /* 青点 = 工艺 / 技术节点 */
  .retech-x-home-hero-flow-dot {
    position: absolute;
    left: 0;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: rgba(24, 175, 196, .18);
    box-shadow: inset 0 0 0 5px var(--retech-x-tech);
  }

  /* ═══ 视频控制(有视频源时才有这段标记)═════════════════════════════════ */
  .retech-x-home-hero-controls {
    position: absolute;
    right: 40px;
    bottom: 40px;
    z-index: 6;
  }
  .retech-x-home-hero-controls[hidden] {
    display: none;
  }
  .retech-x-home-hero-ctrl {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--retech-x-w20);
    border-radius: 50%;
    background: rgba(17, 23, 28, .4);
    color: #fff;
    cursor: pointer;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
  }
  .retech-x-home-hero-ctrl:hover {
    background: rgba(17, 23, 28, .65);
  }
  /* 图标钩子:view.js 的视频开关模块在播放/暂停间切 .is-paused */
  .retech-x-home-hero-ctrl .retech-x-ico-play {
    display: none;
  }
  .retech-x-home-hero-ctrl.is-paused .retech-x-ico-pause {
    display: none;
  }
  .retech-x-home-hero-ctrl.is-paused .retech-x-ico-play {
    display: block;
  }
  .retech-x-home-hero-ctrl svg {
    fill: currentColor;
  }

  /* ═══ 关键帧(两端 opacity 归零 —— 光带不得「啪」地进出)═════════════════ */
  @keyframes retech-x-home-hero-scan {
    0% {
      left: -34%;
      opacity: 0;
    }
    18%, 60% {
      opacity: 1;
    }
    84%, 100% {
      left: 116%;
      opacity: 0;
    }
  }
  @keyframes retech-x-home-hero-beam {
    0% {
      opacity: 0;
      transform: rotate(18deg) translateX(-70px) scaleY(.35);
    }
    20% {
      opacity: .75;
    }
    48% {
      opacity: .22;
      transform: rotate(18deg) translateX(0) scaleY(1);
    }
    100% {
      opacity: 0;
      transform: rotate(18deg) translateX(78px) scaleY(.7);
    }
  }
  @keyframes retech-x-home-hero-drift {
    from {
      transform: scale(1.04) translate3d(0, 0, 0);
    }
    to {
      transform: scale(1.10) translate3d(-1.4%, -1%, 0);
    }
  }
  @keyframes retech-x-home-hero-ambient {
    0%, 100% {
      opacity: .88;
    }
    50% {
      opacity: 1;
    }
  }
  @keyframes retech-x-home-hero-rise {
    from {
      opacity: 0;
      filter: blur(12px);
      transform: translateY(24px);
    }
    to {
      opacity: 1;
      filter: blur(0);
      transform: translateY(0);
    }
  }
  @keyframes retech-x-home-hero-panel-in {
    from {
      opacity: 0;
      transform: translate3d(28px, 22px, 0) scale(.97);
    }
    to {
      opacity: 1;
      transform: translate3d(0, 0, 0) scale(1);
    }
  }
  @keyframes retech-x-home-hero-flow-rise {
    from {
      opacity: 0;
      transform: translateY(12px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  @keyframes retech-x-home-hero-line-reveal {
    from {
      transform: scaleY(0);
    }
    to {
      transform: scaleY(1);
    }
  }
  @keyframes retech-x-home-hero-line-flow {
    from {
      background-position: 0 -170%;
    }
    to {
      background-position: 0 170%;
    }
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   响应式 —— 全部 @media 必须在本层(否则 check-css 报 E4)。
   断点仅 1240 / 1080 / 700(原型第 17 节)。
   ═══════════════════════════════════════════════════════════════════════════ */
@layer retech-responsive {
  /* Laptop:原型把 --fs-h1 从 68px 收到 58px,本块内联落地(不碰全局 :root) */
  @media (max-width: 1240px) {
    .retech-x-home-hero-title {
      font-size: 58px;
    }
  }

  /* Tablet:整块单列堆叠,左侧光柱在窄屏消失 */
  @media (max-width: 1080px) {
    .retech-x-home-hero-grid {
      grid-template-columns: 1fr;
      gap: 40px;
      padding: 56px 0 72px;
      align-items: start;
    }
    .retech-x-home-hero-grid::before,
    .retech-x-home-hero-grid::after {
      display: none;
    }
    .retech-x-home-hero-copy {
      padding-left: 0;
    }
    .retech-x-home-hero-title {
      font-size: 46px;
      max-width: 20ch;
    }
    .retech-x-home-hero-panel {
      max-width: 560px;
    }
  }

  /* Mobile:原型 ≤700 的 hero 段 */
  @media (max-width: 700px) {
    .retech-x-home-hero {
      min-height: auto;
      /* 移动端降低光效强度,保证可读性(原型 :root 的 --scan-peak: .11 局部化) */
      --retech-x-scan-peak: .11;
    }
    .retech-x-home-hero-grid {
      padding: 52px 0 84px;
    }
    .retech-x-home-hero-title {
      font-size: 34px;
    }
    .retech-x-home-hero-intro {
      margin-top: 20px;
    }
    .retech-x-home-hero-actions {
      margin-top: 26px;
    }
    .retech-x-home-hero-actions .retech-x-btn {
      width: 100%;
    }
    .retech-x-home-hero-panel {
      padding: 22px;
    }
    .retech-x-home-hero-controls {
      right: 20px;
      bottom: 20px;
    }
  }

  /* 无障碍:关掉**全部**循环与入场动效(原型第 18 节 2039–2064)。
     分层体系里本层晚于 retech-block,同特异性即可压过,故无需强制声明。
     扫光带 / 光丝线额外归零不透明度,避免静态下留一条常驻亮带。 */
  @media (prefers-reduced-motion: reduce) {
    .retech-x-home-hero-scan,
    .retech-x-home-hero-beam,
    .retech-x-home-hero-shade,
    .retech-x-home-hero-video,
    .retech-x-home-hero-fallback,
    .retech-x-home-hero-grid::before,
    .retech-x-home-hero-grid::after,
    .retech-x-home-hero-flow::before,
    .retech-x-home-hero-panel,
    .retech-x-home-hero-title-line,
    .retech-x-home-hero-intro,
    .retech-x-home-hero-actions,
    .retech-x-home-hero-flow-item {
      animation: none;
    }
    .retech-x-home-hero-scan,
    .retech-x-home-hero-beam {
      opacity: 0;
    }
    .retech-x-home-hero-ctrl {
      transition: none;
    }
  }

  /* 打印:光效层与视频控制不打印(原型第 18 节 print 段) */
  @media print {
    .retech-x-home-hero-lights,
    .retech-x-home-hero-controls {
      display: none;
    }
  }
  /* 面板底部小字 —— 逐条移植原型 `retech.css:886-890` 的 `.hero-panel-note`。 */
  .retech-x-home-hero-panel-note {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--retech-x-w12);
    color: var(--retech-x-w60);
    font-size: 13px;
    line-height: 1.6;
  }

}
