/* ============================================================
   product.css — 产品章节：整屏吸附 + 滚动缩放
   ============================================================ */

.products {
  position: relative;
  background: var(--c-black);
  padding-top: clamp(80px, 12vh, 150px);
}

.products__head {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter) clamp(40px, 7vh, 90px);
}

.products__head .h2 { max-width: 18ch; margin-top: 20px; }

.products__head .lede { margin-top: 22px; }

/* ---------- 单章 ---------- */

.chapter {
  position: relative;
  height: 195vh;
}

.chapter__stage {
  position: sticky;
  top: 0;
  height: 100svh;
  padding: clamp(10px, 1.8vw, 26px);
  overflow: hidden;
}

.chapter__frame {
  position: absolute;
  inset: clamp(10px, 1.8vw, 26px);
  border-radius: var(--radius-l);
  overflow: hidden;
  background: #0b0b0c;
  transform-origin: 50% 50%;
  will-change: transform;
  /*
   * 描边直接画在带圆角裁切的 frame 自身上（border），
   * 不再用内部 hair 的 inset box-shadow：
   * frame 滚动时会被 JS 缩放（scale 1→0.972），
   * 内层 inset 阴影在子像素缩放下会从圆角底部“漏”出一条 1px 亮线。
   */
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.chapter__media {
  position: absolute;
  inset: -9%;
  will-change: transform;
}

.chapter__media img,
.chapter__media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.86) contrast(1.04) brightness(0.86);
  transform: scale(1.02);
}

/* 底部压暗，保证文字可读 */
.chapter__scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.42) 0%, rgba(0, 0, 0, 0) 34%, rgba(0, 0, 0, 0.34) 62%, rgba(0, 0, 0, 0.88) 100%),
    radial-gradient(80% 60% at 18% 100%, rgba(0, 0, 0, 0.6), transparent 70%);
}

/* 内描边，苹果式的“玻璃片”质感 */
.chapter__hair {
  /* 描边已改为 frame 自身 border，见 .chapter__frame；保留占位避免动 DOM */
  display: none;
}

/* ---------- 文案 ---------- */

.chapter__copy {
  position: absolute;
  left: clamp(34px, 6vw, 96px);
  right: clamp(34px, 6vw, 96px);
  bottom: clamp(46px, 9vh, 110px);
  z-index: 3;
  max-width: 620px;
  will-change: transform, opacity;
}

.chapter__index {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 10.5px;
  letter-spacing: 0.26em;
  color: var(--accent);
  margin-bottom: 18px;
}

.chapter__index span {
  color: rgba(245, 245, 247, 0.5);
  letter-spacing: 0.18em;
}

.chapter__index i {
  width: 40px;
  height: 1px;
  background: rgba(245, 245, 247, 0.28);
}

.chapter__title {
  font-size: clamp(30px, 4.8vw, 66px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: #fff;
}

.chapter__desc {
  margin-top: 18px;
  font-size: clamp(13.5px, 1.2vw, 16px);
  line-height: 2;
  color: rgba(245, 245, 247, 0.62);
  max-width: 36ch;
  text-align: justify;
}

.chapter__tags {
  margin-top: 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* 查看详情 */
.chapter__more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 26px;
  font-size: 12.5px;
  letter-spacing: 0.08em;
  color: rgba(245, 245, 247, 0.82);
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.24);
  transition: color var(--dur-s) var(--ease-soft),
    border-color var(--dur-s) var(--ease-soft);
}

.chapter__more:hover { color: #fff; border-color: #fff; }
.chapter__more .btn__arrow { transition: transform var(--dur-s) var(--ease); }
.chapter__more:hover .btn__arrow { transform: translateX(4px); }

.chapter__tag {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: rgba(245, 245, 247, 0.7);
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.04);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

/* 右对齐章节 */
.chapter--right .chapter__copy {
  left: auto;
  right: clamp(34px, 6vw, 96px);
  text-align: right;
}

.chapter--right .chapter__index { justify-content: flex-end; }
.chapter--right .chapter__desc { margin-left: auto; }
.chapter--right .chapter__tags { justify-content: flex-end; }
.chapter--right .chapter__more { align-self: flex-end; }

/* chapter__copy 是块级容器，让 more 靠右需要 flex */
.chapter--right .chapter__copy { display: flex; flex-direction: column; align-items: flex-end; }
.chapter--right .chapter__copy > * { width: auto; }

/* 章节间的过渡留白 */
.chapter + .chapter { margin-top: 0; }

@media (max-width: 900px) {
  .chapter { height: 150vh; }
  .chapter__frame { border-radius: 22px; }
  .chapter__media { inset: -6%; }
  .chapter__copy {
    left: 26px;
    right: 26px;
    bottom: 86px;
    max-width: none;
  }
  .chapter--right .chapter__copy { left: 26px; right: 26px; text-align: left; }
  .chapter--right .chapter__index { justify-content: flex-start; }
  .chapter--right .chapter__desc { margin-left: 0; }
  .chapter--right .chapter__tags { justify-content: flex-start; }
  .chapter__title { font-size: clamp(30px, 8.6vw, 46px); }
  .chapter__desc { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .chapter { height: auto; }
  .chapter__stage { position: relative; height: 82svh; min-height: 520px; }
  .chapter__frame,
  .chapter__media { transform: none !important; }
}
