/* 整页：顶部导航、过场层、第二屏「与 AI 共舞」、后续板块
   颜色、字体、缓动只用 tokens.css 里的变量 */

html { scroll-behavior: auto; }
section[id] { scroll-margin-top: 0; }

/* =========================================================
   顶部导航
   ========================================================= */
.topnav {
  position: fixed; left: 0; right: 0; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: clamp(16px, 3vh, 28px) var(--gutter) 16px;
  background: linear-gradient(to bottom, rgba(17, 18, 22, .78), rgba(17, 18, 22, 0));
  pointer-events: none;
}
.topnav a { pointer-events: auto; text-decoration: none; }
.topnav-brand {
  display: flex; align-items: center; gap: 12px; flex: none;
  font-size: 13px; color: var(--dim); letter-spacing: .04em;
}
.topnav-brand em { font: italic 400 15px/1 var(--serif-en); margin-left: -4px; color: var(--faint); }
.brand-mark {
  width: 14px; height: 12px; background: var(--gold);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.topnav-links { display: flex; gap: clamp(12px, 2vw, 28px); }
.topnav-links a {
  position: relative; padding: 6px 0;
  font-size: 13px; letter-spacing: .06em; color: var(--faint); white-space: nowrap;
  transition: color .4s ease;
}
.topnav-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--gold-lit); transform: scaleX(0); transform-origin: left;
  transition: transform .8s var(--ease-out);
}
.topnav-links a:hover { color: var(--dim); }
.topnav-links a.on { color: var(--text); }
.topnav-links a.on::after { transform: scaleX(1); }
.topnav a:focus-visible { outline: 1px solid var(--gold); outline-offset: 4px; }

/* =========================================================
   过场层：固定在视口上，不挡鼠标
   ========================================================= */
.leafwind {
  position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 8;
  pointer-events: none; display: block;
}

/* =========================================================
   第二屏：与 AI 共舞（左人像、右文字）
   ========================================================= */
.dance-track { position: relative; }
.dance-stage {
  position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden;
  background:
    radial-gradient(50% 70% at 28% 52%, #221a17 0%, rgba(17, 18, 22, 0) 72%),
    var(--bg);
}
.dance-stage::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 95% at 40% 50%, transparent 55%, rgba(0, 0, 0, .55) 100%);
}
/* 人像占的位置：过场层按它的位置拼人像 */
.dance-figure { position: absolute; left: 0; top: 0; bottom: 0; width: 52%; }
.dance-still { position: absolute; left: 50%; bottom: 0; height: 92%; transform: translateX(-50%); }

.dance-copy {
  position: absolute; left: 54%; right: var(--gutter); top: 50%; transform: translateY(-50%);
  z-index: 9; display: grid; max-width: 520px;
}
.dance-copy .grp { grid-area: 1 / 1; align-self: center; pointer-events: none; }
.dance-copy .grp p { overflow: hidden; padding-bottom: .08em; font: 600 clamp(19px, 2vw, 30px)/1.6 var(--serif-cn); letter-spacing: .02em; }
.dance-copy .grp p > span {
  display: inline-block; transform: translateY(108%);
  transition: transform .7s var(--ease-out);
}
.dance-copy .grp.on p > span { transform: none; transition: transform 1.3s var(--ease-out); transition-delay: calc(var(--i) * .14s + .1s); }
.dance-copy .grp p:first-child { font-weight: 900; font-size: clamp(24px, 2.6vw, 40px); margin-bottom: .25em; }
.dance-copy .grp p:first-child:last-child { margin-bottom: 0; }
.dance-copy .k { font-style: normal; }
.dance-copy .k-ai { color: #5CF2C8; }
.dance-copy .k-me { color: var(--fire-5); }
.dance-copy .k-gold { color: var(--gold-lit); }
/* 落版：两行大标题，第二行铁锈红 */
.dance-copy .grp.end p { font: 900 clamp(34px, 4.4vw, 72px)/1.16 var(--serif-cn); margin: 0; }
.dance-copy .grp.end p:nth-child(2) > span { color: var(--rust-lit); }
.dance-copy .grp.end p.sub { margin-top: 22px; font: 400 14px/1.4 var(--serif-cn); letter-spacing: .14em; color: var(--faint); }

/* 进度：右侧一列细刻度 */
.dance-ticks {
  position: absolute; right: var(--gutter); top: 50%; transform: translateY(-50%); z-index: 9;
  display: flex; flex-direction: column; gap: 10px;
}
.dance-ticks i { display: block; width: 14px; height: 1px; background: var(--hairline); transition: background .5s ease, width .5s var(--ease-out); }
.dance-ticks i.on { background: var(--gold-lit); width: 22px; }

.dance-hint {
  position: absolute; left: 54%; bottom: clamp(24px, 4.5vh, 44px); z-index: 9;
  display: flex; align-items: center; gap: 12px;
  font: 500 11px/1 var(--mono); letter-spacing: .16em; color: var(--faint);
  transition: opacity .8s ease;
}
.dance-hint.gone { opacity: 0; }

/* =========================================================
   后续板块（占位）
   ========================================================= */
.todo {
  position: relative; z-index: 9; background: var(--bg);
  min-height: 60vh; padding: 120px var(--gutter);
  border-top: 1px solid var(--hairline);
}
.todo h2 { font: 900 clamp(32px, 4vw, 64px)/1.2 var(--serif-cn); }
.todo p { margin-top: 16px; font: 500 11px/1 var(--mono); letter-spacing: .16em; color: var(--faint); }

/* =========================================================
   窄窗口与手机：人像在上，文字在下
   ========================================================= */
@media (max-width: 760px) {
  .topnav { gap: 14px; padding-top: 14px; }
  .topnav-brand em { display: none; }
  .topnav-links { overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(to right, #000 85%, transparent); mask-image: linear-gradient(to right, #000 85%, transparent); padding-right: 24px; }
  .topnav-links::-webkit-scrollbar { display: none; }
  .topnav-links a { font-size: 12px; }

  .dance-stage { background: radial-gradient(90% 55% at 50% 34%, #221a17 0%, rgba(17, 18, 22, 0) 72%), var(--bg); }
  .dance-figure { width: auto; right: 0; bottom: 40%; top: 56px; }
  .dance-copy { left: var(--gutter); top: auto; bottom: 64px; transform: none; max-width: none; }
  .dance-copy .grp p { font-size: 17px; }
  .dance-copy .grp p:first-child { font-size: 21px; }
  .dance-copy .grp.end p { font-size: 34px; }
  .dance-ticks { display: none; }
  .dance-hint { left: var(--gutter); bottom: 20px; }
  .dance-hint span:first-child, .dance-hint .hint-line { display: none; }
}

/* =========================================================
   静态模式：减少动效 / 没有 WebGL —— 人像用原图，文字全部列出来
   ========================================================= */
.is-static .leafwind { display: none; }
.is-static .dance-track { height: auto !important; }
.is-static .dance-stage { position: relative; height: auto; overflow: visible; display: grid; grid-template-columns: 1fr 1fr; gap: 48px; padding: 120px var(--gutter); align-items: center; }
.is-static .dance-figure { position: relative; width: auto; height: 80vh; }
.is-static .dance-still { display: block; }
.is-static .dance-still[hidden] { display: block; }
.is-static .dance-copy { position: relative; left: auto; right: auto; top: auto; transform: none; display: flex; flex-direction: column; gap: 28px; }
.is-static .dance-copy .grp p > span { transform: none; transition: none; }
.is-static .dance-ticks, .is-static .dance-hint { display: none; }
@media (max-width: 760px) {
  .is-static .dance-stage { grid-template-columns: 1fr; padding-top: 80px; }
  .is-static .dance-figure { height: 60vh; }
}

/* ?embed：作品展示页的小窗里只看树 */
.is-embed .topnav, .is-embed .leafwind, .is-embed .headline, .is-embed .hint, .is-embed .dance-track, .is-embed .todo { display: none !important; }
.is-embed:not(.is-full) .bigword, .is-embed:not(.is-full) .cards, .is-embed:not(.is-full) .steps, .is-embed:not(.is-full) .ruler { display: none !important; }
.is-embed, .is-embed body { overflow: hidden; }

/* ?embed&full（作品展示页 02）：只留树和树背后的设计，不要说明卡和步骤条（10-16 品薇） */
.is-full .cards, .is-full .steps, .is-full .ruler { display: none !important; }

/* 作品展示页 02 嵌入：「AI」两个字母拆开、放到树的两边；字体和「设计 / 交互」一样（粗宋体、不斜）（10-16 品薇） */
.is-full .bigword[data-key="ai"] {
  font-family: var(--serif-cn); font-style: normal; font-weight: 900;
  font-size: clamp(200px, 22vw, 400px); letter-spacing: .85em; padding-left: .85em; left: var(--tree-x, 64%);
  -webkit-text-stroke: 1.4px rgba(243, 237, 228, .13);
}

/* 2026-10-20：已确认首屏文案、复用项目页品牌。 */
.topnav-brand { gap: 9px; }
.topnav-brand .brand-avatar { width: auto; height: 64px; }
.topnav-brand .brand-text { width: auto; height: 44px; }
.headline { top: 17vh; font-size: clamp(36px, 4.25vw, 82px); }
.headline .ln > .mixed-tone { color: var(--text); }
.headline .mixed-tone em { color: var(--rust-lit); font-style: normal; }
.cards { width: min(620px, 44vw); bottom: 12vh; }
.card[data-key="intro"] { max-height: 53vh; overflow-y: auto; scrollbar-width: thin; padding-right: 12px; }
.card[data-key="intro"] .eyebrow { margin-bottom: 12px; }
.lede { max-width: none; font-size: clamp(13px, 1.03vw, 16px); line-height: 1.85; }
.lede + .lede { margin-top: .85em; }
.years, .education { font: 400 14px/1.7 var(--sans); color: var(--dim); }
.education { margin-bottom: 12px; }
.card .lesson { font: 500 16px/1.7 var(--sans); color: var(--dim); }
.card[data-key="ai"] .lesson { font-weight: 600; }
.tree-drag-hint { position: absolute; right: 3.5%; top: calc(var(--ground-y, 68vh) - 52px); z-index: 5; pointer-events: none; color: var(--rust-lit); font-size: 14px; letter-spacing: .04em; }
.is-embed .tree-drag-hint { display: none; }
@media(max-width:1100px) { .topnav-links { gap: 12px; } .topnav-brand .brand-avatar { height: 48px; } .topnav-brand .brand-text { height: 32px; } }
@media(max-width:760px) {
 .topnav-brand .brand-avatar { height: 42px; } .topnav-brand .brand-text { height: 28px; }
 .headline { top: 100px; font-size: clamp(26px, 7.4vw, 44px); }
 .cards { width: auto; bottom: 72px; }
 .card[data-key="intro"] { max-height: 30svh; background: rgba(17,18,22,.84); padding: 10px 8px 0 0; }
 .lede { font-size: 13px; line-height: 1.8; }
 .tree-drag-hint { right: 5%; top: 55%; font-size: 11px; }
 .card .lesson { font-size: 15px; }
}

.headline .ln > span.mixed-tone { color: var(--text); }
.topnav-brand { background: #f2ece3; border-radius: 10px; padding: 5px 10px; }

/* 隐藏的备用SVG不拦截树的鼠标拖动。 */
.fallback[hidden] { display: none; }
.fallback { pointer-events: none; }
