:root {
  --fg: #f6f3ec;
  --fg-dim: #c5beaa;
  --accent: #e9b96a;
  --line: rgba(255,255,255,.18);
  --serif: "Cormorant Garamond", "Noto Serif SC", "Source Han Serif SC",
           "Songti SC", "STSong", "SimSun", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC",
           "Microsoft YaHei", "Segoe UI", sans-serif;
  --mono:  "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--sans);
  color: var(--fg);
  background: #050505;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  cursor: none;
}
@media (hover: none), (pointer: coarse) { body { cursor: auto; } }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: none; }
@media (hover: none) { button { cursor: pointer; } }
::selection { background: var(--accent); color: #000; }

/* ============ 全屏胶片质感叠加 ============ */
.grain {
  position: fixed; inset: 0; z-index: 50; pointer-events: none;
  opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grainShift .8s steps(6) infinite;
}
@keyframes grainShift {
  0%   { transform: translate(0,0); }
  16%  { transform: translate(-2%, 1%); }
  33%  { transform: translate(1%, -1%); }
  50%  { transform: translate(-1%, 2%); }
  66%  { transform: translate(2%, -2%); }
  83%  { transform: translate(-2%, -1%); }
  100% { transform: translate(0,0); }
}
.vignette {
  position: fixed; inset: 0; z-index: 30; pointer-events: none;
  background: radial-gradient(circle at center, transparent 55%, rgba(0,0,0,.55) 100%);
}
.progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0%;
  background: linear-gradient(90deg, var(--accent), #fff);
  z-index: 90;
  box-shadow: 0 0 12px rgba(233,185,106,.6);
}

/* ============ 自定义光标 ============ */
.cursor, .cursor-out {
  position: fixed; top: 0; left: 0;
  pointer-events: none; z-index: 100;
  transform: translate(-50%, -50%);
  will-change: transform;
}
.cursor {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(233,185,106,.7);
}
.cursor-out {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid rgba(246,243,236,.45);
  transition: width .2s, height .2s, border-color .2s, background .2s;
  mix-blend-mode: difference;
}
.cursor-out.hover {
  width: 64px; height: 64px;
  border-color: var(--accent);
  background: rgba(233,185,106,.08);
}
@media (hover: none), (pointer: coarse) { .cursor, .cursor-out { display: none; } }

/* ============ 顶部导航 ============ */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 60; pointer-events: none;
  padding: 24px 32px;
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px; letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--fg-dim);
  mix-blend-mode: difference;
  color: #fff;
}
.nav .brand {
  display: inline-flex; align-items: center; gap: 14px;
  pointer-events: auto;
}
.nav .brand .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: pulse 1.6s ease-in-out infinite;
}
.nav .brand-text { font-family: var(--serif); font-style: italic; font-size: 16px; letter-spacing: 2px; }
.nav .brand-en { opacity: .6; }
.nav-time { font-variant-numeric: tabular-nums; opacity: .7; }

/* ============ 侧边章节点 ============ */
.dots {
  position: fixed; right: 24px; top: 50%;
  transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 12px;
  z-index: 70;
}
.dot-btn {
  display: flex; flex-direction: column; align-items: flex-end; gap: 2px;
  padding: 6px 10px;
  font-family: var(--mono); font-size: 10px;
  color: var(--fg-dim);
  opacity: .55;
  transition: opacity .25s, color .25s, transform .25s;
  border-right: 1px solid transparent;
  pointer-events: auto;
}
.dot-btn span { font-size: 11px; letter-spacing: 1px; }
.dot-btn i { font-style: normal; font-family: var(--serif); font-size: 16px; }
.dot-btn.active {
  opacity: 1;
  color: var(--fg);
  border-right-color: var(--accent);
  transform: translateX(-4px);
}
.dot-btn:hover { opacity: 1; color: var(--fg); }

/* ============ 全屏背景层（4 张叠加交叉淡入） ============ */
.bg-layer {
  position: fixed; inset: 0;
  z-index: 1;
  background: #050505;
  overflow: hidden;
}
.bg-slide {
  position: absolute; inset: 0;
  opacity: 0;
  transition: opacity .6s cubic-bezier(.4, 0, .2, 1);
  will-change: opacity;
}
.bg-slide.active { opacity: 1; }
.bg-inner {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  background-color: #000;
}
/* 静态背景图，不做 Ken Burns 缓推 */

/* ============ 主容器（不滚动，纯叠层） ============ */
.reel {
  position: fixed; inset: 0;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
}
.scene {
  position: absolute; inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity .5s cubic-bezier(.4, 0, .2, 1);
  will-change: opacity;
}
.scene.active {
  opacity: 1;
  pointer-events: auto;
}
.scene-overlay {
  position: absolute; inset: 0;
  z-index: 1;
  /* 顶部微暗（导航可读）+ 左半椭圆聚焦暗罩（文字区可读，图片右侧不变灰）*/
  background:
    linear-gradient(180deg,
      rgba(0,0,0,.40) 0%,
      rgba(0,0,0,.05) 22%,
      rgba(0,0,0,.05) 70%,
      rgba(0,0,0,.20) 100%),
    radial-gradient(ellipse 65% 95% at 25% 50%,
      rgba(0,0,0,.55) 0%,
      rgba(0,0,0,.25) 45%,
      transparent 80%);
}
@media (max-width: 768px) {
  /* 手机文字在中央 → 聚焦罩改成居中椭圆 */
  .scene-overlay {
    background:
      linear-gradient(180deg, rgba(0,0,0,.40) 0%, rgba(0,0,0,.10) 25%, rgba(0,0,0,.20) 100%),
      radial-gradient(ellipse 90% 90% at 50% 50%, rgba(0,0,0,.45) 0%, rgba(0,0,0,.10) 60%, transparent 90%);
  }
}

.scene-inner {
  position: relative;
  z-index: 2;
  height: 100%;
  max-width: 1280px;
  margin: 0 auto;
  /* 右侧留出空间避开侧边章节点 (dots) */
  padding: 14vh 80px 10vh 8vw;
  display: flex; flex-direction: column;
  justify-content: center;
  justify-content: safe center;
  gap: 20px;
}

.meta {
  display: flex; align-items: center; gap: 14px;
  font-family: var(--mono);
  font-size: 11px; letter-spacing: 4px;
  color: var(--accent);
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .35s ease, transform .35s ease;
  text-shadow: 0 1px 6px rgba(0,0,0,.85);
}
.meta-num {
  font-family: var(--serif);
  font-size: 18px; font-style: italic;
  color: var(--fg);
  letter-spacing: 0;
}
.meta-line {
  flex: 0 0 60px; height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
}

.title {
  font-family: var(--serif);
  font-size: clamp(36px, 5.5vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.5px;
  margin: 0;
  font-weight: 500;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .5s ease, transform .5s ease;
  text-shadow: 0 2px 14px rgba(0,0,0,.7), 0 0 36px rgba(0,0,0,.5);
}
.title em {
  font-style: italic;
  color: var(--accent);
  font-weight: 400;
}

.lead {
  max-width: 540px;
  margin: 0;
  font-size: clamp(13px, 1.2vw, 16px);
  line-height: 1.75;
  color: var(--fg);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .45s ease, transform .45s ease;
  text-shadow: 0 1px 8px rgba(0,0,0,.75);
}

.brand-block, .kv-grid, .skill-list, .contact-grid, .end {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .5s ease, transform .5s ease;
}

/* 激活态：所有内层带交错延迟入场（fast）*/
.scene.active .meta         { opacity: 1; transform: none; transition-delay: .08s; }
.scene.active .title        { opacity: 1; transform: none; transition-delay: .15s; }
.scene.active .lead         { opacity: 1; transform: none; transition-delay: .25s; }
.scene.active .brand-block,
.scene.active .kv-grid,
.scene.active .skill-list,
.scene.active .contact-grid { opacity: 1; transform: none; transition-delay: .32s; }
.scene.active .end          { opacity: 1; transform: none; transition-delay: .42s; }

/* ===== 章节 01 元素 ===== */
.brand-block {
  margin-top: 32px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  max-width: 360px;
}
.brand-big {
  font-family: var(--serif);
  font-size: 24px;
  font-style: italic;
  letter-spacing: 4px;
}
.brand-sub {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--fg-dim);
}

/* ===== 章节 02 元素 ===== */
.kv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 28px;
  margin-top: 12px;
  max-width: 480px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--fg);
}
.kv-grid div {
  padding: 12px 0;
  border-top: 1px solid var(--line);
  text-shadow: 0 1px 8px rgba(0,0,0,.85), 0 0 4px rgba(0,0,0,.7);
}
.kv-grid b { color: var(--accent); font-weight: 600; margin-right: 12px; font-size: 11px; letter-spacing: 2px; text-transform: uppercase; }

/* ===== 章节 03 元素 ===== */
.skill-list {
  list-style: none; padding: 0; margin: 12px 0 0;
  max-width: 520px;
  display: flex; flex-direction: column; gap: 12px;
}
.skill-list li {
  font-family: var(--serif);
  font-size: 19px;
  letter-spacing: 0.5px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px;
  text-shadow: 0 1px 8px rgba(0,0,0,.85), 0 0 4px rgba(0,0,0,.7);
}
.dot-y {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

/* ===== 章节 04 元素 ===== */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  max-width: 560px;
  margin-top: 16px;
}
.ctc {
  display: flex; flex-direction: column; gap: 4px;
  padding: 18px 20px;
  text-align: left;
  background: rgba(0,0,0,.55);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform .2s, border-color .2s, background .2s;
}
.ctc:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  background: rgba(233,185,106,.08);
}
.ctc-k {
  font-family: var(--mono);
  font-size: 10px; letter-spacing: 2px;
  color: var(--accent);
  text-transform: uppercase;
}
.ctc-v {
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: 0.5px;
}
.end {
  margin-top: 32px;
  font-family: var(--mono);
  font-size: 11px; letter-spacing: 2px;
  color: var(--fg-dim);
}
.end a { color: var(--fg-dim); border-bottom: 1px dashed currentColor; }
.end a:hover { color: var(--accent); border-color: var(--accent); }

/* ============ 第一章右下 SCROLL ============ */
.scroll-hint {
  position: absolute; bottom: 40px; left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 10px; letter-spacing: 4px;
  color: var(--fg);
  opacity: .6;
  display: flex; align-items: center; gap: 10px;
  z-index: 3;
}
.scroll-hint span {
  display: inline-block; width: 1px; height: 30px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scrollLine 2s ease-in-out infinite;
}
@keyframes scrollLine {
  0%, 100% { transform: scaleY(.3); transform-origin: top; }
  50%      { transform: scaleY(1);  transform-origin: top; }
}

/* ============ 开屏 ============ */
.boot {
  position: fixed; inset: 0; z-index: 999;
  display: flex; align-items: center; justify-content: center;
  background: #000;
  transition: opacity .8s ease, visibility .8s;
}
.boot.gone { opacity: 0; visibility: hidden; }
.boot-inner {
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
}
.boot-brand {
  font-family: var(--serif);
  font-size: 38px;
  font-style: italic;
  letter-spacing: 6px;
  background: linear-gradient(180deg, #fff, var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.boot-tag {
  font-family: var(--mono);
  font-size: 10px; letter-spacing: 5px;
  color: var(--fg-dim);
}
.boot-bar {
  width: 220px; height: 1px;
  background: rgba(255,255,255,.1);
  overflow: hidden;
}
.boot-bar i {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), #fff);
  transition: width .15s linear;
}
.boot-pct {
  font-family: var(--mono); font-size: 11px;
  color: var(--accent); letter-spacing: 3px;
}

/* ============ Toast ============ */
.toast {
  position: fixed; left: 50%; bottom: 48px;
  transform: translate(-50%, 16px);
  background: rgba(15,15,15,.95);
  color: #fff;
  border: 1px solid var(--accent);
  padding: 10px 22px;
  font-family: var(--mono);
  font-size: 11px; letter-spacing: 2px;
  opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 200;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.5); opacity: .55; }
}

/* ============ 移动端 ============ */
@media (max-width: 768px) {
  .nav { padding: 14px 16px; font-size: 9px; letter-spacing: 2px; }
  .nav .brand-text { font-size: 13px; }
  .nav .brand-en { display: none; }
  .dots { right: 10px; gap: 4px; }
  .dot-btn { padding: 3px 5px; }
  .dot-btn i { font-size: 12px; }
  .dot-btn span { font-size: 9px; }
  .scene-inner { padding: 11vh 50px 8vh 6vw; gap: 14px; }
  .title { font-size: clamp(30px, 8vw, 48px); }
  .lead { font-size: 12px; line-height: 1.7; max-width: 100%; }
  .kv-grid { grid-template-columns: 1fr; gap: 8px 18px; }
  .kv-grid div { padding: 8px 0; font-size: 12px; }
  .contact-grid { grid-template-columns: 1fr; gap: 8px; }
  .ctc { padding: 12px 16px; }
  .ctc-v { font-size: 16px; }
  .skill-list { gap: 6px; }
  .skill-list li { font-size: 15px; padding: 8px 0; }
  .brand-block { margin-top: 16px; padding-top: 12px; }
  .brand-big { font-size: 18px; }
  .end { margin-top: 16px; font-size: 10px; }
  .boot-brand { font-size: 28px; }
  .scroll-hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; transition-duration: .001s !important; }
}
