/* ════════════════════════════════════════════════════════════
   LIN MINHENG — base.css
   设计令牌 / 重置 / 全局组件 / 动画原语
   ════════════════════════════════════════════════════════════ */

/* ── 自托管字体（均为 OFL 授权子集）──
   Space Grotesk 标题 · Space Mono 等宽 · Fraunces Italic 西文衬线强调
   Noto Serif SC（思源宋体）中文衬线 700/900 —— 按站内实际用字子集化 */
@font-face {
  font-family: "Space Grotesk";
  src: url("../fonts/space-grotesk-700.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("../fonts/space-grotesk-500.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Space Mono";
  src: url("../fonts/space-mono-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-500-italic.woff2") format("woff2");
  font-weight: 400 600; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Noto Serif SC";
  src: url("../fonts/noto-serif-sc-900.woff2") format("woff2");
  font-weight: 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Noto Serif SC";
  src: url("../fonts/noto-serif-sc-700.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
/* 中文没有斜体传统——em 里的 CJK 交给直立宋体，禁止浏览器伪斜体/伪粗体 */
@font-face {
  font-family: "Noto Serif SC";
  src: url("../fonts/noto-serif-sc-700.woff2") format("woff2");
  font-weight: 700; font-style: italic; font-display: swap;
}

/* ── 设计令牌 ─────────────────────────────── */
:root {
  /* display：西文 Space Grotesk + 中文思源宋体——中西异质混排是全站的排版签名 */
  --font-display: "Space Grotesk", "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --font-serif: "Fraunces", "Noto Serif SC", "Georgia", "Songti SC", "STSong", serif;
  --font-body: "Space Grotesk", "Segoe UI", system-ui, -apple-system, "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Noto Sans SC", "Source Han Sans SC", "Microsoft YaHei", sans-serif;
  --font-sans-cn: "Space Grotesk", "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Noto Sans SC", "Source Han Sans SC", "Microsoft YaHei", sans-serif;
  --font-mono: "Space Mono", "Cascadia Mono", "Consolas", ui-monospace, "SFMono-Regular", "PingFang SC", "Noto Sans SC", "Microsoft YaHei", monospace;

  --pad: clamp(20px, 4.5vw, 72px);
  --gap: clamp(16px, 2.4vw, 32px);
  --radius: 18px;
  --radius-sm: 12px;
  --nav-h: 76px;

  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-io: cubic-bezier(.83, 0, .17, 1);
  --ease-back: cubic-bezier(.3, 1.36, .4, 1);
  --t-fast: .45s;
  --t-med: .8s;
  --t-slow: 1.1s;

  --z-nav: 250;
  --z-menu: 200;
  --z-shutter: 300;
  --z-loader: 400;
  --z-cursor: 500;
  --z-grain: 450;
  --z-toast: 350;
}

html[data-theme="dark"] {
  --bg: #0B0B0C;
  --bg2: #121214;
  --card: #161618;
  --ink: #EDEAE4;
  --ink2: #98948B;
  --line: rgba(237, 234, 228, .13);
  --accent: #FF4B1F;
  --accent-text: #FF6B43;
  --accent-fill: #FF4B1F;      /* 色块填充态（其上放 --accent-ink 文字，对比达标） */
  --accent-ink: #0B0B0C;
  --ok: #3DD68C;
  --err: #FF6B70;
  --grain-o: .055;
  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #F2EFE8;
  --bg2: #EAE6DD;
  --card: #FFFFFF;
  --ink: #16150F;
  --ink2: #6B675C;
  --line: rgba(22, 21, 15, .14);
  --accent: #E8430F;
  --accent-text: #C63207;
  --accent-fill: #B93005;      /* 浅色主题填充态单独加深：#F6F3EC 文字对比 ≥5:1 */
  --accent-ink: #F6F3EC;
  --ok: #1E7A47;
  --err: #B3261E;
  --grain-o: .05;
  color-scheme: light;
}

/* ── 重置 ─────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scrollbar-gutter: stable; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  font-synthesis: none;        /* 全站禁伪斜体/伪粗体——中文排版的底线 */
  overflow-x: clip;
  transition: background-color .7s var(--ease-out), color .7s var(--ease-out);
}
body.is-loading { overflow: hidden; }
body.menu-open { overflow: hidden; }

img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }
/* 强调：西文吃到真正的 Fraunces Italic，中文落在直立思源宋体（绝不伪斜） */
em { font-family: var(--font-serif); font-style: italic; }
::selection { background: var(--accent-fill); color: var(--accent-ink); }

/* 滚动条 */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--ink) 22%, transparent); border-radius: 99px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.skip-link {
  position: fixed; top: 10px; left: 10px; z-index: 999;
  padding: 10px 18px; background: var(--accent-fill); color: var(--accent-ink);
  border-radius: 99px; font-size: 14px; font-weight: 600;
  transform: translateY(-200%); transition: transform .3s var(--ease-out);
}
.skip-link:focus-visible { transform: none; }

.container { padding-left: var(--pad); padding-right: var(--pad); max-width: 1680px; margin-inline: auto; }

.noscript {
  position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center;
  background: var(--bg); color: var(--ink); text-align: center; font-size: 18px; line-height: 2;
}

/* ── 平滑滚动容器 ─────────────────────────────── */
#smooth { position: fixed; inset: 0; overflow: hidden; }
#smooth-content { will-change: transform; min-height: 100vh; }
/* 触屏 / 降级：还原为普通文档流 */
html.no-smooth #smooth { position: static; inset: auto; overflow: visible; }
html.no-smooth #smooth-content { will-change: auto; }

#view { outline: none; }

/* ── 噪点 ─────────────────────────────── */
.grain {
  position: fixed; inset: -4%; z-index: var(--z-grain); pointer-events: none;
  opacity: var(--grain-o);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.72' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain-shift 1.2s steps(4) infinite;
}
@keyframes grain-shift {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-1.2%, 1%); }
  50% { transform: translate(1%, -0.8%); }
  75% { transform: translate(-0.6%, -1.2%); }
  100% { transform: translate(0, 0); }
}

/* ── 预加载器 ─────────────────────────────── */
.loader {
  position: fixed; inset: 0; z-index: var(--z-loader);
  background: var(--bg); color: var(--ink);
  transition: visibility 0s linear 1.6s;
}
.loader__curtain {
  position: absolute; inset: 0; background: var(--accent);
  transform: translateY(101%);
}
.loader.is-done .loader__curtain { animation: curtain-sweep 1.15s var(--ease-io) forwards; }
/* 帘幕盖满屏的瞬间（45% ≈ 0.52s）撤掉 loader 自己的底色，
   让帘幕上抬时揭开的是正在进场的页面，而不是 loader 的黑底 */
.loader.is-done {
  background: transparent;
  transition: background 0s linear .52s, visibility 0s linear 1.6s;
}
@keyframes curtain-sweep {
  0% { transform: translateY(101%); }
  45% { transform: translateY(0); }
  55% { transform: translateY(0); }
  100% { transform: translateY(-101%); }
}
.loader.is-done { visibility: hidden; }
.loader.is-done .loader__inner { animation: loader-fade .4s ease forwards; }
@keyframes loader-fade { to { opacity: 0; } }

/* 开场沉降：帘幕揭开时首屏由 1.05 缓缓落定（一次性，含移动端）。
   必须用直接子代——透镜克隆体也带 .hero 类，fill:both 会永久压制其反向位移 */
body:not(.is-loading) .v-home > .hero {
  animation: hero-boot 1.5s var(--ease-out) both;
  transform-origin: 50% 32%;
}
@keyframes hero-boot {
  from { transform: scale(1.05); }
  to { transform: none; }
}

 }

.loader__inner { position: absolute; inset: 0; padding: var(--pad); }
.loader__greet {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  font-family: var(--font-serif); font-style: italic;
  font-size: clamp(28px, 5vw, 56px); letter-spacing: .02em;
}
.loader__star {
  position: absolute; top: calc(50% - clamp(48px, 7vw, 78px)); left: 50%;
  translate: -50% 0; width: clamp(18px, 2vw, 26px); color: var(--accent);
  animation: star-spin 7s linear infinite;
}
.loader__count {
  position: absolute; right: var(--pad); bottom: calc(var(--pad) + 40px);
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(64px, 14vw, 180px); line-height: 1; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.loader__count sup { font-size: .25em; font-weight: 400; color: var(--accent-text); margin-left: .08em; }
.loader__foot {
  position: absolute; left: var(--pad); right: var(--pad); bottom: var(--pad);
  display: flex; justify-content: space-between;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .12em; color: var(--ink2);
  border-top: 1px solid var(--line); padding-top: 14px;
}

/* ── 页面过渡帘幕 ─────────────────────────────── */
.shutter { position: fixed; inset: 0; z-index: var(--z-shutter); pointer-events: none; visibility: hidden; }
.shutter.is-active { visibility: visible; }
.shutter.is-active .shutter__col { will-change: transform; }
.shutter__cols { position: absolute; inset: 0; display: flex; }
.shutter__col {
  flex: 1; background: var(--bg2);
  transform: translateY(101%);
  border-top: 3px solid var(--accent);
}
.shutter.is-in .shutter__col { animation: col-in .5s var(--ease-io) forwards; }
.shutter.is-out .shutter__col { animation: col-out .5s var(--ease-io) forwards; }
.shutter__col:nth-child(1) { animation-delay: 0s !important; }
.shutter__col:nth-child(2) { animation-delay: .05s !important; }
.shutter__col:nth-child(3) { animation-delay: .1s !important; }
.shutter__col:nth-child(4) { animation-delay: .15s !important; }
.shutter__col:nth-child(5) { animation-delay: .2s !important; }
@keyframes col-in { from { transform: translateY(101%); } to { transform: translateY(0); } }
@keyframes col-out { from { transform: translateY(0); } to { transform: translateY(-101%); } }

.shutter__meta {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px;
  opacity: 0; transition: opacity .3s ease;
}
.shutter.is-in .shutter__meta { opacity: 1; transition-delay: .3s; }
/* 帘幕上抬前必须先撤干净页名与巨型序号——慢了会在新页上闪一下残影 */
.shutter.is-out .shutter__meta { opacity: 0; transition-delay: 0s; transition-duration: .07s; }
.shutter__name {
  font-family: var(--font-display); font-weight: 900;
  font-size: clamp(40px, 8vw, 96px); letter-spacing: .04em; line-height: 1.15;
}
.shutter__no { font-family: var(--font-mono); font-size: 13px; letter-spacing: .3em; color: var(--accent-text); }
.shutter__ghost {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -52%);
  font-family: var(--font-display); font-weight: 700; line-height: 1;
  font-size: clamp(220px, 42vw, 560px);
  color: transparent; -webkit-text-stroke: 1.5px color-mix(in srgb, var(--ink) 10%, transparent);
  pointer-events: none; user-select: none; z-index: -1;
}

/* ── 自定义光标 ─────────────────────────────── */
.cursor { position: fixed; inset: 0; z-index: var(--z-cursor); pointer-events: none; }
html.no-cursor .cursor { display: none; }
/* 隐藏系统指针，只留准星（has-cursor 由 JS 在成功初始化后添加——JS 挂了就不隐藏，永不裸奔） */
html.has-cursor, html.has-cursor * { cursor: none !important; }
.cursor__dot, .cursor__ring {
  position: absolute; top: 0; left: 0; border-radius: 50%;
  transform: translate(-100px, -100px);
}
.cursor__dot {
  width: 6px; height: 6px; margin: -3px;
  background: var(--accent);
  box-shadow: 0 0 0 1.6px color-mix(in srgb, var(--bg) 62%, transparent);
  transition: opacity .25s ease;
}
/* 准星光标：四刻线 + 待命圆环，呼应站内蓝图 ✚ 语言。
   不用 mix-blend-mode——祖先的 fixed+z-index 会把混合锁死在空容器里，
   且在彩色插画上会跳出荧光怪色；改用「背景色衬底 + 墨色实线」双层描边。 */
.cursor__ring {
  width: 40px; height: 40px; margin: -20px;
  display: grid; place-items: center;
  transition: width .35s var(--ease-out), height .35s var(--ease-out),
              margin .35s var(--ease-out), background-color .35s var(--ease-out),
              opacity .25s ease;
}
.cursor__svg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  overflow: visible;
  animation: cursor-spin 16s linear infinite;
  transition: opacity .25s ease;
}
@keyframes cursor-spin { to { rotate: 360deg; } }
.cursor.is-link .cursor__svg { animation-duration: 5s; }
.cursor__ticks {
  transform-origin: 24px 24px;
  transition: transform .4s var(--ease-out);
}
.cursor__ticks line { stroke: var(--ink); stroke-width: 1.7; stroke-linecap: round; }
.cursor.is-link .cursor__ticks { transform: rotate(45deg) scale(1.18); }
.cursor__o {
  fill: none; stroke: var(--ink); stroke-width: 1.2;
  opacity: 0; transform-origin: 24px 24px; transform: scale(.55);
  transition: opacity .3s ease, transform .45s var(--ease-out);
}
.cursor.is-link .cursor__o { opacity: .95; transform: scale(1); }
/* 衬底层：任何底色上都保证准星可读（含深色作品插画） */
.cursor__ticks--under line { stroke: var(--bg); stroke-width: 4.6; opacity: .55; }
.cursor__o--under { stroke: var(--bg); stroke-width: 3.6; opacity: .55; }
.cursor.is-link .cursor__ring { width: 58px; height: 58px; margin: -29px; }
/* 输入框上：准星收成一枚竖直插字标 */
.cursor.is-text .cursor__svg { animation-play-state: paused; }
.cursor.is-text .cursor__ticks { transform: scaleY(1.55); }
.cursor.is-text .cursor__ticks line:nth-child(2), .cursor.is-text .cursor__ticks line:nth-child(4) { opacity: 0; }
.cursor.is-text .cursor__o { opacity: 0; }
.cursor.is-hidden .cursor__dot, .cursor.is-hidden .cursor__ring { opacity: 0; }
.cursor__ring { will-change: transform; }
.cursor__dot { will-change: transform; }

/* ── 导航 ─────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: var(--z-nav);
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--pad);
  transition: transform .55s var(--ease-out), background-color .4s ease;
}
.nav.is-hidden { transform: translateY(-110%); pointer-events: none; }
/* 键盘用户 Tab 进导航时，被隐藏的导航必须自己回来 */
.nav.is-hidden:focus-within { transform: none; pointer-events: auto; }
.nav.is-scrolled {
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
body.is-loading .nav { transform: translateY(-110%); }

.nav__logo {
  font-family: var(--font-display); font-weight: 700; font-size: 19px; letter-spacing: .04em;
  display: inline-flex; align-items: baseline; gap: 2px; padding: 8px 0;
  transition: letter-spacing .5s var(--ease-out), color .3s ease;
}
.nav__logo:hover { letter-spacing: .1em; color: var(--accent-text); }
@media (max-width: 400px) { .nav__logo { font-size: 16px; } }
.nav__logo sup { font-size: 10px; color: var(--accent-text); }

.nav__links { display: flex; gap: clamp(18px, 3vw, 44px); }
.nav__link { position: relative; font-size: 15px; padding: 10px 2px; letter-spacing: .06em; }
.nav__link-t { display: block; overflow: hidden; height: 1.55em; }
.nav__link-t > span { display: block; transition: transform .45s var(--ease-out); }
.nav__link:hover .nav__link-t > span,
.nav__link:focus-visible .nav__link-t > span { transform: translateY(-1.55em); }
.nav__link::after {
  content: ""; position: absolute; left: 50%; bottom: 2px;
  width: 4px; height: 4px; border-radius: 50%; background: var(--accent);
  transform: translateX(-50%) scale(0); transition: transform .3s var(--ease-out);
}
.nav__link.is-active::after { transform: translateX(-50%) scale(1); }

.nav__ctrls { display: flex; align-items: center; gap: 8px; }

.theme-btn {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--line); transition: border-color .3s ease, background-color .3s ease;
}
.theme-btn:hover { border-color: var(--accent); }
.theme-btn svg { width: 20px; height: 20px; overflow: visible; }
.theme-btn__sun, .theme-btn__moon { transform-origin: 50% 50%; transition: opacity .45s ease, transform .6s var(--ease-out); }
html[data-theme="dark"] .theme-btn__sun { opacity: 1; transform: rotate(0); }
html[data-theme="dark"] .theme-btn__moon { opacity: 0; transform: rotate(-90deg) scale(.6); }
html[data-theme="light"] .theme-btn__sun { opacity: 0; transform: rotate(90deg) scale(.6); }
html[data-theme="light"] .theme-btn__moon { opacity: 1; transform: rotate(0); }

.burger { display: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); position: relative; }
.burger span {
  position: absolute; left: 50%; top: 50%; width: 18px; height: 1.6px;
  background: var(--ink); transform: translate(-50%, -50%);
  transition: transform .4s var(--ease-out);
}
.burger span:first-child { translate: 0 -3.5px; }
.burger span:last-child { translate: 0 3.5px; }
.burger[aria-expanded="true"] span:first-child { translate: 0 0; transform: translate(-50%, -50%) rotate(45deg); }
.burger[aria-expanded="true"] span:last-child { translate: 0 0; transform: translate(-50%, -50%) rotate(-45deg); }

/* ── 全屏菜单 ─────────────────────────────── */
.menu {
  position: fixed; inset: 0; z-index: var(--z-menu);
  background: var(--bg2);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: calc(var(--nav-h) + 24px) var(--pad) var(--pad);
  clip-path: inset(0 0 100% 0);
  visibility: hidden;
  transition: clip-path .7s var(--ease-io), visibility 0s linear .7s;
}
.menu.is-open { clip-path: inset(0 0 0 0); visibility: visible; transition: clip-path .7s var(--ease-io); }
.menu__links { display: flex; flex-direction: column; }
.menu__link {
  display: flex; align-items: baseline; gap: 18px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
  font-family: var(--font-display); font-weight: 900;
  font-size: clamp(38px, 9vw, 72px); line-height: 1.3;
  overflow: hidden;
}
.menu__link em { font-family: var(--font-mono); font-style: normal; font-size: 13px; color: var(--accent-text); }
.menu__link span { display: inline-block; transform: translateY(120%); transition: transform .7s var(--ease-out); }
.menu.is-open .menu__link span { transform: translateY(0); }
.menu.is-open .menu__link:nth-child(1) span { transition-delay: .1s; }
.menu.is-open .menu__link:nth-child(2) span { transition-delay: .16s; }
.menu.is-open .menu__link:nth-child(3) span { transition-delay: .22s; }
.menu.is-open .menu__link:nth-child(4) span { transition-delay: .28s; }
.menu.is-open .menu__link:nth-child(5) span { transition-delay: .34s; }
.menu__link:active span { color: var(--accent-text); }
.menu__foot { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center; }
.menu__mail { font-family: var(--font-serif); font-style: italic; font-size: 18px; }
.menu__socials { display: flex; gap: 18px; font-size: 14px; color: var(--ink2); }

/* ── 按钮 ─────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 52px; padding: 0 28px;
  border: 1px solid var(--line); border-radius: 99px;
  font-family: var(--font-sans-cn);
  font-size: 15px; font-weight: 600; letter-spacing: .05em;
  transition: border-color .35s ease, background-color .35s ease, color .35s ease;
}
.btn:hover { border-color: var(--accent); }
.btn--fill { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn--fill:hover { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--accent-ink); }
.btn--big { min-height: 66px; padding: 0 40px; font-size: 17px; }
.btn--icon { width: 52px; padding: 0; justify-content: center; border-radius: 50%; }
.btn--icon svg { width: 19px; height: 19px; }
.btn__t { display: block; overflow: hidden; height: 1.6em; }
.btn__t > span { display: block; transition: transform .45s var(--ease-out); }
.btn:hover .btn__t > span { transform: translateY(-1.6em); }
.btn__arr { width: 18px; height: 18px; transition: transform .45s var(--ease-out); }
.btn:hover .btn__arr { transform: translateX(4px); }
.btn[data-scrollto]:hover .btn__arr { transform: translateY(4px); }

.lnk {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 600; letter-spacing: .04em;
  padding: 6px 0; position: relative; color: var(--ink);
}
.lnk svg { width: 17px; height: 17px; transition: transform .4s var(--ease-out); }
.lnk:hover svg { transform: translateX(5px); }
.lnk span { position: relative; }
.lnk span::after {
  content: ""; position: absolute; left: 0; bottom: -3px; height: 1.5px; width: 100%;
  background: var(--accent); transform: scaleX(0); transform-origin: right;
  transition: transform .45s var(--ease-out);
}
.lnk:hover span::after { transform: scaleX(1); transform-origin: left; }

.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ink2); margin-right: 8px; vertical-align: 1px; }
.dot--live { background: var(--ok); animation: pulse 2.2s ease infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 45%, transparent); }
  50% { box-shadow: 0 0 0 7px transparent; }
}

/* ── 跑马灯 ─────────────────────────────── */
.marquee {
  overflow: hidden; white-space: nowrap; user-select: none;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: clamp(14px, 2vw, 26px) 0;
}
/* 双排字带：实心排 + 反向描边排，装进同一条边框带 */
.marquee-band {
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: clamp(14px, 2vw, 24px) 0;
}
.marquee-band .marquee { border: 0; padding: 0; }
.marquee--ghost { margin-top: clamp(2px, .8vw, 8px); }
.marquee--ghost .marquee__seg {
  font-size: clamp(20px, 3.4vw, 44px);
  color: transparent;
  -webkit-text-stroke: 1.3px color-mix(in srgb, var(--ink) 36%, transparent);
}
.marquee--ghost .marquee__seg i { -webkit-text-stroke: 0; color: var(--accent-text); opacity: .75; }
.marquee__track { display: inline-flex; will-change: transform; }
.marquee__seg {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(28px, 5vw, 64px); letter-spacing: .02em; line-height: 1.15;
  padding-right: .35em;
}
.marquee__seg i { font-style: normal; color: var(--accent-text); font-size: .6em; vertical-align: .22em; padding: 0 .3em; }

/* ── 版式原语 ─────────────────────────────── */
.sec { padding-block: clamp(70px, 11vw, 160px); position: relative; }

/* 幽灵章节序号：描边大字水印，带轻视差 */
.sec-ghost {
  position: absolute; top: clamp(16px, 3vw, 36px); right: calc(var(--pad) * .35);
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(120px, 21vw, 330px); line-height: .8;
  color: transparent; -webkit-text-stroke: 1.5px color-mix(in srgb, var(--ink) 13%, transparent);
  pointer-events: none; user-select: none; z-index: -1;
}

.sec-head {
  display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap;
  margin-bottom: clamp(36px, 5vw, 72px);
}
.sec-no { font-family: var(--font-mono); font-size: 13px; color: var(--accent-text); letter-spacing: .1em; }
.sec-label {
  font-family: var(--font-display); font-weight: 900;
  font-size: clamp(26px, 3.6vw, 44px); letter-spacing: .04em; line-height: 1.2;
}
.sec-rule { flex: 1; height: 1px; background: var(--line); align-self: center; min-width: 60px; }
.sec-more { margin-left: auto; }

.page-head { padding-top: calc(var(--nav-h) + clamp(48px, 8vw, 110px)); padding-bottom: clamp(40px, 6vw, 80px); }
.page-kicker {
  font-family: var(--font-mono); font-size: 13px; letter-spacing: .22em;
  color: var(--ink2); margin-bottom: clamp(18px, 2.5vw, 30px); text-transform: uppercase;
}
.page-kicker .crumb { color: var(--ink2); transition: color .25s ease; }
.page-kicker .crumb:hover { color: var(--accent-text); }
.page-title {
  font-family: var(--font-display); font-weight: 900;
  font-size: clamp(44px, 8.4vw, 124px); line-height: 1.16; letter-spacing: .01em;
  max-width: 14em;
}
.page-title em { color: var(--accent-text); font-weight: 500; letter-spacing: 0; }
.page-sub {
  margin-top: clamp(18px, 2.5vw, 28px); color: var(--ink2);
  font-size: clamp(16px, 1.5vw, 19px); max-width: 34em;
}
.page-count { font-family: var(--font-mono); font-size: .82em; color: var(--accent-text); margin-left: 1em; }

/* ── 动画原语 ───────────────────────────────
   [data-anim] 元素初始隐藏，进入视口加 .in 后过渡到位。
   --d 为 JS 注入的级联延迟。 */
[data-anim="up"] { opacity: 0; transform: translateY(26px); transition: opacity var(--t-med) var(--ease-out), transform var(--t-med) var(--ease-out); transition-delay: var(--d, 0s); }
[data-anim="up"].in { opacity: 1; transform: none; }

/* 入场按层级差分：小元素轻快、大块面沉稳 */
[data-anim="up-sm"] { opacity: 0; transform: translateY(12px); transition: opacity var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out); transition-delay: var(--d, 0s); }
[data-anim="up-sm"].in { opacity: 1; transform: none; }

/* 入场原语 v2：不同板块用不同语气，消灭「everything slides up」的模板感 */
[data-anim="blur"] { opacity: 0; filter: blur(12px); transform: scale(1.02); transition: opacity .9s ease, filter .9s ease, transform 1s var(--ease-out); transition-delay: var(--d, 0s); }
[data-anim="blur"].in { opacity: 1; filter: blur(0); transform: none; }

[data-anim="rise-rot"] { opacity: 0; transform: translateY(36px) rotate(2.5deg); transform-origin: 0 100%; transition: opacity .8s ease, transform .95s var(--ease-out); transition-delay: var(--d, 0s); }
[data-anim="rise-rot"].in { opacity: 1; transform: none; }

/* 用 mask 而非 clip-path：被观察元素若被自身 clip-path 完全裁剪，
   IntersectionObserver 判零相交，揭示永远不触发（已两次踩坑） */
[data-anim="mask-r"] {
  -webkit-mask: linear-gradient(#000 0 0) left / 0% 100% no-repeat;
  mask: linear-gradient(#000 0 0) left / 0% 100% no-repeat;
  transition: -webkit-mask-size .9s var(--ease-io), mask-size .9s var(--ease-io);
  transition-delay: var(--d, 0s);
}
[data-anim="mask-r"].in { -webkit-mask-size: 100% 100%; mask-size: 100% 100%; }

[data-anim="pop"] { opacity: 0; transform: scale(.6); transition: opacity .5s ease, transform .75s var(--ease-back); transition-delay: var(--d, 0s); }
[data-anim="pop"].in { opacity: 1; transform: none; }
[data-anim="up-lg"] { opacity: 0; transform: translateY(48px); transition: opacity var(--t-slow) var(--ease-out), transform var(--t-slow) var(--ease-out); transition-delay: var(--d, 0s); }
[data-anim="up-lg"].in { opacity: 1; transform: none; }

[data-anim="line-x"] { transform: scaleX(0); transform-origin: left; transition: transform 1.1s var(--ease-out) var(--d, .1s); }
[data-anim="line-x"].in { transform: scaleX(1); }

/* clip 施加在子元素上——若加在被观察元素自身，完全裁剪会让
   IntersectionObserver 判定零相交，揭示永远不触发。
   带 [data-parallax] 的子元素只做 clip，不做 scale（transform 由视差每帧接管） */
[data-anim="clip"] > * {
  clip-path: inset(0 0 100% 0);
  transition: clip-path 1.2s var(--ease-io) var(--d, 0s), transform 1.5s var(--ease-out) var(--d, 0s);
}
[data-anim="clip"] > *:not([data-parallax]) { transform: scale(1.12); }
[data-anim="clip"].in > * { clip-path: inset(0 0 0 0); }
[data-anim="clip"].in > *:not([data-parallax]) { transform: scale(1); }

/* 按行揭示 v2：上滑 + 微旋转扫入，带轻微回弹（JS 拆分后生成 .line > .line-inner） */
[data-split="lines"] .line { display: block; overflow: hidden; }
[data-split="lines"] .line-inner {
  display: block; transform: translateY(112%) rotate(3.2deg);
  transform-origin: 0 100%;
  transition: transform 1.05s cubic-bezier(.24, 1.12, .36, 1);
}
[data-split="lines"].in .line-inner { transform: translateY(0) rotate(0); }

/* 按字揭示 v2：3D 翻牌入场（透视 + 回弹），字符从下方翻起落定 */
[data-split="chars"] { display: inline-block; overflow: hidden; vertical-align: bottom; }
[data-split="chars"] > span { perspective: 900px; }
[data-split="chars"] .char {
  display: inline-block; opacity: 0;
  transform: translateY(118%) rotateX(-78deg);
  transform-origin: 50% 100%;
  transition: transform .95s var(--ease-back), opacity .4s ease;
}
[data-split="chars"].in .char { transform: translateY(0) rotateX(0); opacity: 1; }

/* 拆分前隐藏，避免闪烁 */
[data-split]:not(.is-split) { opacity: 0; }
[data-split].is-split { opacity: 1; }

/* ── 页脚 ─────────────────────────────── */
.footer { border-top: 1px solid var(--line); background: var(--bg); position: relative; }
.footer__cta { padding-block: clamp(80px, 12vw, 170px); text-align: center; position: relative; }
/* 鼠标聚光灯 */
.footer__cta::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(340px circle at var(--sx, 50%) var(--sy, -30%),
              color-mix(in srgb, var(--accent) 11%, transparent), transparent 72%);
  opacity: 0; transition: opacity .5s ease;
}
.footer__cta:hover::before { opacity: 1; }
.footer__cta { overflow: hidden; }
/* 压轴水印：巨型描边字随滚动横向漂移 */
.footer__ghostwrap {
  position: absolute; inset: 0; z-index: -1;
  display: grid; place-items: center;
  pointer-events: none; user-select: none;
}
.footer__ghost {
  font-family: var(--font-display); font-weight: 900; white-space: nowrap;
  font-size: clamp(150px, 23vw, 360px); line-height: 1; letter-spacing: .01em;
  color: transparent; -webkit-text-stroke: 1.5px color-mix(in srgb, var(--ink) 9%, transparent);
}

/* 环形旋转文字的圆钮 CTA */
.cta-orb {
  position: relative; display: inline-grid; place-items: center;
  width: clamp(176px, 19vw, 252px); aspect-ratio: 1; border-radius: 50%;
  border: 1px solid var(--line); color: var(--ink);
  transition: border-color .4s ease, background-color .4s ease, color .4s ease;
  will-change: transform;
}
.cta-orb__ring { position: absolute; inset: 9px; width: auto; height: auto; animation: star-spin 22s linear infinite; }
.cta-orb__ring text {
  font-family: var(--font-mono); font-size: 10.6px; letter-spacing: .3em;
  fill: currentColor; text-transform: uppercase;
}
.cta-orb__arr { width: clamp(30px, 3.4vw, 46px); height: auto; transition: transform .5s var(--ease-out); }
.cta-orb:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.cta-orb:hover .cta-orb__arr { transform: translateX(9px); }
.footer__kicker { font-family: var(--font-mono); font-size: 13px; letter-spacing: .24em; color: var(--ink2); margin-bottom: 22px; }
.footer__title {
  font-family: var(--font-display); font-weight: 900;
  font-size: clamp(42px, 8vw, 116px); line-height: 1.18; letter-spacing: .01em;
  margin-bottom: clamp(30px, 4vw, 48px);
}
.footer__title em { color: var(--accent-text); font-weight: 500; }
.footer__grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1.2fr;
  gap: var(--gap); padding-block: clamp(40px, 6vw, 70px);
  border-top: 1px solid var(--line);
}
.footer__logo { font-family: var(--font-display); font-weight: 700; font-size: 26px; margin-bottom: 14px; }
.footer__logo sup { font-size: 11px; color: var(--accent-text); }
.footer__slogan { color: var(--ink2); font-size: 15px; }
.footer__h { font-family: var(--font-mono); font-size: 12px; letter-spacing: .2em; color: var(--ink2); margin-bottom: 16px; text-transform: uppercase; }
.footer__a { display: block; padding: 5px 0; font-size: 15px; color: var(--ink); width: fit-content; position: relative; }
.footer__a::after {
  content: ""; position: absolute; left: 0; bottom: 2px; height: 1px; width: 100%;
  background: var(--accent); transform: scaleX(0); transform-origin: right;
  transition: transform .4s var(--ease-out);
}
.footer__a:hover::after { transform: scaleX(1); transform-origin: left; }
.footer__meta { color: var(--ink2); font-size: 14px; margin-top: 14px; font-variant-numeric: tabular-nums; }
.footer__tz { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; color: var(--accent-text); }
.footer__bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding-block: 22px; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--ink2);
}
.footer__made { font-family: var(--font-serif); font-style: italic; }
.footer__top {
  width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line);
  display: grid; place-items: center; transition: border-color .3s ease, background-color .3s ease, color .3s ease;
}
.footer__top svg { width: 18px; height: 18px; }
.footer__top:hover { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--accent-ink); }

/* ── Toast ─────────────────────────────── */
.toast {
  position: fixed; left: 50%; bottom: 34px; z-index: var(--z-toast);
  transform: translate(-50%, calc(100% + 46px));
  background: var(--ink); color: var(--bg);
  padding: 12px 26px; border-radius: 99px;
  font-size: 14px; font-weight: 600; letter-spacing: .03em;
  transition: transform .55s var(--ease-out);
  pointer-events: none; max-width: 90vw; text-align: center;
}
.toast.is-show { transform: translate(-50%, 0); }

/* ── 生成式插画（作品视觉） ───────────────────────────────
   每幅插画内联两套色板变量（--aw-*-d / --aw-*-l），
   SVG 线稿全部引用运行时变量——切主题时插画整体换装，无需重渲染 */
.artwork {
  position: absolute; inset: 0; overflow: hidden;
  contain: layout paint;
  --awBg: var(--aw-bg-d, #101013);
  --awA: var(--aw-a-d, #EDEAE4);
  --awB: var(--aw-b-d, #98948B);
  --awC: var(--aw-c-d, #FF4B1F);
  --awVg: rgba(0, 0, 0, .5);
  background: var(--awBg);
  transition: background-color .7s var(--ease-out);
}
html[data-theme="light"] .artwork {
  --awBg: var(--aw-bg-l, #EAE6DD);
  --awA: var(--aw-a-l, #55503F);
  --awB: var(--aw-b-l, #6B675C);
  --awC: var(--aw-c-l, #B93005);
  --awVg: rgba(85, 80, 63, .16);
}
.artwork svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.artwork .aw-spin { transform-origin: 50% 50%; animation: aw-rot 46s linear infinite; }
.artwork .aw-spin--rev { animation-direction: reverse; animation-duration: 60s; }
.artwork .aw-drift { animation: aw-drift 9s ease-in-out infinite alternate; }
@keyframes aw-rot { to { transform: rotate(360deg); } }
@keyframes aw-drift { from { transform: translateY(-2.5%); } to { transform: translateY(2.5%); } }

/* ── 通用媒体框 ─────────────────────────────── */
.frame { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--bg2); }
.frame::after { content: ""; position: absolute; inset: 0; border: 1px solid var(--line); border-radius: inherit; pointer-events: none; }

/* ── 拆分文本中的强调 token ─────────────────────────────── */
[data-split] .is-em {
  font-family: var(--font-serif); font-style: italic;
  color: var(--accent-text); font-weight: 500; letter-spacing: 0;
}

/* ── 主题切换过渡（无 View Transitions 时的回退） ─────────────────────────────── */
html.theme-anim *, html.theme-anim *::before, html.theme-anim *::after {
  transition: background-color .55s ease, color .55s ease, border-color .55s ease, fill .55s ease, stroke .55s ease !important;
}
/* 主题切换：从按钮位置圆形扩散揭开新主题 */
::view-transition-old(root) { animation: none; }
::view-transition-new(root) { animation: vt-reveal .62s var(--ease-io); }
@keyframes vt-reveal {
  from { clip-path: circle(0px at var(--vt-x, 92%) var(--vt-y, 4%)); }
  to   { clip-path: circle(142% at var(--vt-x, 92%) var(--vt-y, 4%)); }
}

/* ── 文字随滚动逐词点亮（--p 由引擎每帧驱动） ─────────────────────────────── */
[data-scrollfx="ink"] .w {
  opacity: clamp(0.18, calc(var(--p, 0) * (var(--n, 1) + 8) - var(--i, 0)), 1);
}

/* ── 媒体图层原语：出血视差层 / 裁切内层 ─────────────────────────────── */
.media-bleed { position: absolute; inset: -12% 0; }
.shot-in { position: absolute; inset: 0; }

.star-inline {
  width: 14px; height: 14px; display: inline-block; vertical-align: -2px;
  margin-right: 10px; color: var(--accent); animation: star-spin 9s linear infinite;
}

/* 大标题排版平衡：避免孤行 */
.page-title, .proj-title, .post-title, .footer__title { text-wrap: balance; }

/* ── 点击星火 ─────────────────────────────── */
.spark {
  position: fixed; top: -3px; left: -3px; width: 7px; height: 7px;
  background: var(--accent); pointer-events: none; z-index: 460;
  clip-path: polygon(50% 0, 64% 36%, 100% 50%, 64% 64%, 50% 100%, 36% 64%, 0 50%, 36% 36%);
}

/* ── transform 平滑滚动下 sticky 失效，改为静态布局 ─────────────────────────────── */
html:not(.no-smooth) .about-portrait { position: static; }
html:not(.no-smooth) .proj-metrics { position: static; }

.menu__socials a { padding: 6px 0; transition: color .25s ease; }
.menu__socials a:hover { color: var(--accent-text); }

/* ── 降级 / 无障碍 ─────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  [data-anim], [data-anim="clip"] > *, [data-split] .line-inner, [data-split] .char { opacity: 1 !important; transform: none !important; clip-path: none !important; filter: none !important; -webkit-mask: none !important; mask: none !important; }
  [data-scrollfx="ink"] .w { opacity: 1 !important; }
  [data-split="chars"] .char { opacity: 1 !important; }
  [data-split]:not(.is-split) { opacity: 1; }
  .grain { animation: none; }
  html { scroll-behavior: auto; }
}

@media (hover: none) {
  .cursor { display: none; }
}

/* ── 响应式（全局件）——断点与 views.css 统一为 860 ─────────────────────────────── */
@media (max-width: 860px) {
  :root { --nav-h: 64px; }
  .nav__links { display: none; }
  .burger { display: block; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .footer__col--brand { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .footer__grid { grid-template-columns: 1fr; gap: 34px; }
  .footer__bar { justify-content: center; text-align: center; }
  .btn--big { min-height: 58px; padding: 0 30px; font-size: 16px; }
}
