/* =========================================================
   Syzerly · 首页样式
   一镜到底 / 问题 / 技术 / 产品 / 应用
   ========================================================= */

/* =========================================================
   一镜到底 · 沉浸叙事（首屏 → 五道工序 → 收束）
   ========================================================= */
#journey { height: 820vh; background: var(--bg); position: relative; }
#journey .js { position: sticky; top: 0; height: 100vh; overflow: hidden; }

.j-tag { position: absolute; left: 64px; top: 96px; z-index: 12; }
.j-meta { position: absolute; right: 64px; bottom: 56px; text-align: right; z-index: 12; }
.j-scroll { position: absolute; left: 96px; bottom: 52px; display: flex; align-items: center; gap: 16px; z-index: 12; }
.j-scroll .bar {
  width: 48px; height: 1px; background: var(--ink); transform-origin: left;
  animation: bar 2.4s var(--ease) infinite;
}
@keyframes bar {
  0% { transform: scaleX(0); }
  45% { transform: scaleX(1); }
  100% { transform: scaleX(0); transform-origin: right; }
}

/* 居中大图（所有图片 = 文字的衬底） */
.j-obj {
  position: absolute; left: 50%; top: 50%; width: min(88vmin, 920px); aspect-ratio: 1;
  transform: translate(-50%, -50%); z-index: 2; will-change: transform;
}
.j-obj .obj {
  position: absolute; inset: 0; overflow: hidden; opacity: 0;
  will-change: opacity, transform, filter;
}
.j-obj .obj img { width: 100%; height: 100%; object-fit: contain; }
.j-shadow {
  position: absolute; left: 50%; top: calc(50% + min(44vmin, 460px) + 3vh);
  width: min(46vmin, 480px); height: 22px; border-radius: 50%; transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(18, 18, 18, .15), transparent 70%);
}
.j-veil {
  position: absolute; left: 50%; top: 50%; width: min(96vmin, 1000px); height: min(72vmin, 760px);
  transform: translate(-50%, -50%); z-index: 3; opacity: 0; pointer-events: none;
  background: radial-gradient(ellipse at center,
    rgba(250, 250, 247, .68) 0%, rgba(250, 250, 247, .26) 46%, rgba(250, 250, 247, 0) 72%);
}

/* 首屏居中标题（盖在衣物之上） */
.j-hero {
  position: absolute; inset: 0; z-index: 10; display: flex; flex-direction: column;
  justify-content: center; align-items: center; text-align: center;
  will-change: transform, opacity;
}
.j-hero h1 { font-size: clamp(80px, 11.5vw, 170px); font-weight: 900; line-height: 1.02; letter-spacing: .02em; }
.j-hero h1 span { display: block; }
.j-hero h1 span + span { margin-left: .9em; }
.j-hero .again {
  font-family: var(--font-en); font-weight: 100; font-size: clamp(64px, 9vw, 140px);
  letter-spacing: .01em; margin-top: .06em;
}
.j-hero .sub { margin-top: 34px; font-size: 16px; font-weight: 300; letter-spacing: .22em; color: var(--muted); }

/* 每道工序的巨幕词（压图中央） */
.j-words { position: absolute; inset: 0; z-index: 11; pointer-events: none; will-change: transform; }
.j-word {
  position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%) translateY(30px);
  opacity: 0; text-align: center; width: 100%;
  transition: opacity .7s var(--ease), transform .9s var(--ease);
}
.j-word.on { opacity: 1; transform: translate(-50%, -50%) translateY(0); }
.j-word .big { font-size: clamp(72px, 10vw, 150px); font-weight: 900; line-height: 1.05; letter-spacing: .04em; }
.j-word .en-name {
  font-family: var(--font-en); font-size: clamp(11px, 1vw, 14px); font-weight: 300;
  letter-spacing: .5em; color: var(--muted); text-transform: uppercase; margin-top: 18px;
}

/* 工序编号 · 左侧 */
.j-nums { position: absolute; left: 64px; top: 50%; transform: translateY(-50%); z-index: 11; }
.j-num {
  font-family: var(--font-en); font-weight: 200; font-size: clamp(40px, 4.6vw, 72px);
  line-height: 1; opacity: 0; transform: translateY(16px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.j-num.on { opacity: .92; transform: none; }
.j-num em {
  display: block; font-style: normal; font-family: var(--font-zh); font-weight: 300;
  font-size: 13px; letter-spacing: .3em; color: var(--muted); margin-top: 10px;
}

/* 工序描述 · 底部居中 */
.j-descs { position: absolute; left: 0; right: 0; bottom: 12vh; z-index: 11; text-align: center; }
.j-desc {
  position: absolute; left: 50%; transform: translateX(-50%) translateY(14px); width: min(560px, 86vw);
  opacity: 0; transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.j-desc.on { opacity: 1; transform: translateX(-50%); }
.j-desc p { font-size: 14px; font-weight: 300; line-height: 2; color: var(--ink); }
.j-desc .motion {
  margin-top: 14px; font-family: var(--font-en); font-size: 10px; letter-spacing: .2em;
  color: var(--faint); text-transform: uppercase;
}

/* 进度动线 */
.j-rail { position: absolute; left: 4.4%; top: 14vh; height: 72vh; width: 2px; background: var(--line); z-index: 11; }
.j-rail .fill { position: absolute; left: 0; top: 0; width: 100%; height: 0%; background: var(--moss); }
.j-rail .dot {
  position: absolute; left: 50%; width: 10px; height: 10px; border-radius: 50%;
  background: var(--line); transform: translate(-50%, -50%); transition: background .6s var(--ease);
}
.j-rail .dot.on { background: var(--moss); }
.j-step { position: absolute; right: 64px; top: 96px; z-index: 11; text-align: right; }

/* 粒子 */
.j-dust {
  position: absolute; left: 50%; top: 50%; width: min(86vmin, 880px); aspect-ratio: 1;
  transform: translate(-50%, -50%); z-index: 4; pointer-events: none;
}
.j-dust i { position: absolute; border-radius: 50%; background: var(--faint); opacity: 0; }
.j-dust i.m { background: var(--moss); }

/* 收束 */
.j-end {
  position: absolute; inset: 0; z-index: 13; display: flex; flex-direction: column;
  justify-content: center; align-items: center; text-align: center; opacity: 0;
  transform: translateY(40px);
  transition: opacity .9s var(--ease), transform 1.1s var(--ease);
  pointer-events: none;
}
.j-end.on { opacity: 1; transform: none; }
.j-end h2 { font-size: clamp(56px, 7.5vw, 110px); font-weight: 900; letter-spacing: .02em; }
.j-end .en-line {
  margin-top: 22px; font-family: var(--font-en); font-size: 12px; font-weight: 300;
  letter-spacing: .5em; color: var(--muted); text-transform: uppercase;
}

/* =========================================================
   问题
   ========================================================= */
#problem { min-height: 92vh; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; padding: 12vh var(--page-margin); }
.problem-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 6vw; align-items: center; width: 100%; margin-top: 8vh; }
.problem-title { font-size: clamp(30px, 3.8vw, 54px); font-weight: 900; line-height: 1.5; }
.problem-note { margin-top: 8vh; font-size: 13px; font-weight: 300; letter-spacing: .08em; color: var(--muted); }
.problem-side { display: flex; flex-direction: column; gap: 28px; align-items: flex-start; }
.problem-side .frame { width: 100%; max-width: 380px; overflow: hidden; }
.problem-side img { width: 100%; }

/* =========================================================
   技术
   ========================================================= */
#tech { background: var(--bg-secondary); padding: 16vh var(--page-margin); border-top: 1px solid var(--line); }
.tech-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6vw; margin-top: 8vh; align-items: start; }
.tech-title { font-size: clamp(36px, 4.4vw, 64px); font-weight: 900; line-height: 1.35; margin-top: 6vh; }
.tech-body { font-size: 16px; font-weight: 300; line-height: 1.9; max-width: 36em; }
.tech-note { margin-top: 10vh; font-size: 13px; font-weight: 300; letter-spacing: .08em; color: var(--muted); }

/* =========================================================
   产品
   ========================================================= */
#products { padding: 14vh 0 16vh; }
#products .tag { margin-left: var(--page-margin); }
.p-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 40px var(--page-margin); border-bottom: 1px solid var(--line);
  cursor: default; position: relative;
  transition: background .6s var(--ease);
}
#products .tag + .p-row { border-top: 1px solid var(--line); margin-top: 8vh; }
.p-row .en-name {
  font-family: var(--font-en); font-weight: 300; font-size: clamp(26px, 2.8vw, 40px);
  letter-spacing: .06em; transition: transform .6s var(--ease);
}
.p-row .cn-name {
  /* 标题化：老内核先吃 30px 兜底，支持 clamp 的再放大 */
  font-size: 30px;
  font-size: clamp(24px, 2.6vw, 38px);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: .02em;
  line-height: 1.3;
}
.p-row:hover { background: var(--bg-secondary); }
.p-row:hover .en-name, .p-row:hover .cn-name { transform: translateX(16px); }
.p-row .cn-name { transition: transform .6s var(--ease); }
.p-preview {
  position: fixed; width: 230px; height: 230px; pointer-events: none; z-index: 40;
  opacity: 0; transform: scale(.85);
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.p-preview.show { opacity: 1; transform: scale(1); }
.p-preview img { width: 100%; height: 100%; object-fit: contain; }

/* =========================================================
   应用（黑屏反转）
   ========================================================= */
#apps { background: var(--dark); color: var(--bg); padding: 14vh var(--page-margin) 12vh; }
.apps-title {
  font-family: var(--font-en); font-weight: 100; font-size: clamp(48px, 6.5vw, 96px);
  letter-spacing: .02em; margin: 6vh 0 8vh;
}
.apps-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px; }
.app { position: relative; overflow: hidden; background: #1a1a17; }
.app img {
  width: 100%; height: 100%; object-fit: cover; transform: scale(1.08);
  transition: transform 1.2s var(--ease); opacity: .92;
}
.app:hover img { transform: scale(1.14); }
.app .lb {
  position: absolute; left: 16px; bottom: 14px; font-size: 12px; font-weight: 300;
  letter-spacing: .1em; color: #fff; text-shadow: 0 1px 8px rgba(0, 0, 0, .6); z-index: 2;
}
.app::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, .45), transparent 45%);
}
.app-1 { grid-column: 1 / 6; aspect-ratio: 500 / 330; }
.app-2 { grid-column: 6 / 9; aspect-ratio: 360 / 250; margin-top: -30px; }
.app-3 { grid-column: 9 / 13; aspect-ratio: 308 / 400; margin-top: 20px; }
.app-4 { grid-column: 1 / 4; aspect-ratio: 360 / 230; margin-top: -10px; }
.app-5 { grid-column: 4 / 9; aspect-ratio: 400 / 220; }
.apps-more {
  margin-top: 8vh; text-align: right; font-family: var(--font-en);
  font-size: 10px; letter-spacing: .3em; color: var(--muted);
}

/* =========================================================
   响应式
   ========================================================= */
@media (max-width: 900px) {
  /* 移动端降级：缩短一镜到底的滚动距离，避免连续滚动 8 屏 */
  #journey { height: 480vh; }
  /* 移动端浏览器地址栏会让 100vh 超出可视区，用 dvh 修正 */
  #journey .js { height: 100vh; height: 100dvh; }
  .j-obj { width: 92vw; }
  .j-tag { left: 24px; top: 76px; }
  .j-meta { display: none; }
  .j-scroll { left: 24px; }
  .j-nums { display: none; }
  .j-word .big { font-size: clamp(56px, 15vw, 96px); }
  .j-rail { left: 10px; }
  .j-step { right: 16px; top: 76px; }
  .j-desc { bottom: 16vh; }
  .problem-grid, .tech-grid { grid-template-columns: 1fr; gap: 48px; }
  .p-row { padding: 28px 24px; }
  #products .tag { margin-left: 24px; }
  .apps-grid .app { grid-column: 1 / 13 !important; margin-top: 0 !important; }
  #problem, #tech, #apps { padding-left: 24px; padding-right: 24px; }
}

/* =========================================================
   老内核兼容层（Chromium < 79 / 84 等，由 @supports 守护）
   现代浏览器满足条件时整体跳过，不影响新特性渲染
   ========================================================= */
@supports not (width: clamp(1px, 1vw, 2px)) {
  .j-hero h1 { font-size: 150px; }
  .j-hero .again { font-size: 120px; }
  .j-word .big { font-size: 130px; }
  .j-word .en-name { font-size: 13px; }
  .j-num { font-size: 56px; }
  .j-end h2 { font-size: 90px; }
  .problem-title { font-size: 44px; }
  .tech-title { font-size: 52px; }
  .p-row .en-name { font-size: 33px; }
  .apps-title { font-size: 80px; }
}
@supports not (width: min(1px, 1px)) {
  .j-obj { width: 88vmin; height: 88vmin; }
  .j-shadow { top: calc(50% + 44vmin + 3vh); width: 46vmin; }
  .j-veil { width: 96vmin; height: 72vmin; }
  .j-dust { width: 86vmin; height: 86vmin; }
  .j-desc { width: 560px; }
}
@supports not (aspect-ratio: 1) {
  .app-1 { height: 300px; }
  .app-2 { height: 190px; }
  .app-3 { height: 350px; }
  .app-4 { height: 175px; }
  .app-5 { height: 255px; }
}
@supports not (inset: 0) {
  .j-obj .obj, .j-hero, .j-words, .j-end, .app::after { top: 0; right: 0; bottom: 0; left: 0; }
}
@media (max-width: 900px) {
  @supports not (width: clamp(1px, 1vw, 2px)) {
    .j-hero h1 { font-size: 80px; }
    .j-hero .again { font-size: 64px; }
    .j-word .big { font-size: 64px; }
  }
}

/* =========================================================
   英文版专用收敛层
   拉丁字母横向占比远大于中文方块字，同一套字号会撑破版面，
   故对英文页的大字标题单独设限（中文版不受影响）。
   ========================================================= */
html[lang="en"] .j-word .big { font-size: clamp(40px, 7.6vw, 116px); letter-spacing: .02em; }
html[lang="en"] .j-end h2 { font-size: clamp(40px, 6.4vw, 94px); }
/* 英文长句不写死 <br>：断行点交给浏览器。
   拉丁字母比中文宽，同一栏宽下会挤成 4 行且末行只剩一个词，
   故按「一行容纳 ~17.7em」反推字号与栏宽，让断行落在语义边界上：
     Every year, tens of millions of / metric tons of synthetic garments /
     are incinerated or landfilled. */
@media (min-width: 901px) {
  html[lang="en"] .problem-grid { grid-template-columns: 1.35fr .65fr; gap: 4vw; }
}
html[lang="en"] .problem-title {
  font-size: clamp(26px, 2.75vw, 39px);
  line-height: 1.45;
  max-width: 17.7em;
}
html[lang="en"] .tech-title { font-size: clamp(30px, 3.8vw, 56px); }
/* 英文正文比中文长三倍，等分栏下会排到六行、末行只剩一个 scale.
   （1280 实测末行填充 9%）。让浏览器在末尾几行做均衡断行，末行不再吊着一个词。 */
html[lang="en"] .tech-body { text-wrap: pretty; }

/* 三栏数据块：与中文版同一套版式——三张等高卡并排，数值在上、说明在下。
   只有两处按英文特性让步，不改结构：
   1. 数值降档到 clamp(27px, 2.5vw, 34px)。中文 40px 时「130,000+」实宽 176px，
      而英文每格内容宽只有 142px（中文卡里这个数字本来就压着边框，英文会更狠），
      降档后留 8–18px 余量，数字仍然明显压过说明文字。
   2. 说明保留中文的两段式（第一段「单位 · 事实」，第二段补充），用 .nb 粘住不该被拆的
      词组，避免把 installed recycling capacity 劈成单行一个 capacity。 */
@media (min-width: 901px) {
  html[lang="en"] .tech-grid { grid-template-columns: 1fr 1.06fr; gap: 4vw; }
  html[lang="en"] .stat-row { display: flex; gap: 14px; }
  html[lang="en"] .stat {
    flex: 1 1 0; min-width: 0; min-height: 0;
    justify-content: flex-start;
    padding: 22px 12px;
    gap: 12px;
  }
  /* 数值字号按实测反推：「130,000+」在 40px 下实宽 176px，而 1280 视口每格可用宽 142px，
     故上限取 34px（实宽 149px 会越界，34px 是各档实测都不碰边框的最大值）。 */
  html[lang="en"] .stat .v { font-size: clamp(27px, 2.5vw, 34px); letter-spacing: -.015em; }
  html[lang="en"] .stat .l { font-size: 12px; line-height: 1.65; }
  /* 第一格多一句「planned total」，并进主体说明会把它撑成六行、另两格只有三行。
     降为卡底脚注：细线分隔、字号再小一档，三格主体都是三行，卡片高度也就齐了。 */
  html[lang="en"] .stat .l-sub {
    margin-top: auto; padding-top: 9px;
    border-top: 1px solid var(--line);
    font-size: 10.5px; line-height: 1.6; font-weight: 300; color: var(--muted);
  }
}

/* 901–1180 的桌面：等分栏下每格只有 116px，post-consumer textiles 会被拆成
   「post-consumer / textiles」两行、year · 也单独占一行。这一段把右栏比例提到 1.16，
   内边距收到 10px，格内可用宽度回到 128px 上下，说明回到三行以内。 */
@media (min-width: 901px) and (max-width: 1180px) {
  html[lang="en"] .tech-grid { grid-template-columns: 1fr 1.16fr; gap: 3.4vw; }
  html[lang="en"] .stat-row { gap: 12px; }
  html[lang="en"] .stat { padding: 20px 10px; }
  html[lang="en"] .stat .l { font-size: 11.5px; }
}

/* 英文首屏大字：中文两个方块字可撑到 170px，Latin 换成词组后同字号会横向溢出，
   故单独降档，并收窄第二行的缩进错位（中文版不受影响）。 */
html[lang="en"] .j-hero h1 { font-size: clamp(44px, 8.2vw, 132px); }
html[lang="en"] .j-hero h1 span + span { margin-left: .5em; }
html[lang="en"] .p-row .cn-name { font-size: clamp(18px, 2.1vw, 30px); }

@media (max-width: 900px) {
  /* 首屏标题区 inset:0 且 flex 居中，长副标题会顶到屏幕边缘，留出安全边距 */
  .j-hero { padding-left: 24px; padding-right: 24px; }
  html[lang="en"] .j-hero h1 { font-size: clamp(38px, 10.4vw, 76px); }
  html[lang="en"] .j-hero h1 span + span { margin-left: 0; }
  /* 小屏单栏，17.7em 已超出可视宽，改按均衡排版压到 4 行，避免末行只剩一个词 */
  html[lang="en"] .problem-title { font-size: 24px; max-width: none; text-wrap: balance; }
}
