/* ============================================================
   AI Developer Portfolio · E-Pro+ 杂志奢华编辑风
   纸感米白 × 朱砂红 × 细金线 · GSAP 滚动动效 · Lenis 平滑滚动
   ============================================================ */

:root {
  --paper: #faf7f2;
  --ink: #1c1917;
  --muted: #78716c;
  --red: #b3261e;
  --gold: #a8842c;
  --hair: #e7e0d5;
  --serif: 'Noto Serif SC', 'Songti SC', 'SimSun', serif;
  --sans: 'Inter', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); line-height: 1.8; -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
::selection { background: var(--red); color: var(--paper); }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--paper); }
::-webkit-scrollbar-thumb { background: #d6cebf; border-radius: 8px; border: 2px solid var(--paper); }
img, svg { display: block; max-width: 100%; }
ul, ol { margin: 0; padding: 0; list-style: none; }
p { margin: 0; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.15; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; border-radius: 4px; }
.container { width: 100%; max-width: 980px; margin-inline: auto; padding-inline: 28px; }
.section { position: relative; padding-block: clamp(56px, 8vw, 96px); }

/* ---------- 背景：纸纹 + 水印 + 竖排 + 印刷标记 ---------- */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -2; pointer-events: none; opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.72' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)' opacity='0.05'/%3E%3C/svg%3E");
}
.ghost-year {
  position: fixed; top: 6vh; right: -2vw; z-index: -1; pointer-events: none; user-select: none;
  font-family: var(--serif); font-weight: 900; font-size: min(38vw, 360px); line-height: 1;
  color: rgba(163, 138, 92, .10); letter-spacing: -.02em;
}
.vtext {
  position: fixed; right: 16px; top: 50%; transform: translateY(-50%); z-index: -1; pointer-events: none; user-select: none;
  writing-mode: vertical-rl; font-family: var(--serif); font-size: 12.5px; letter-spacing: .42em; color: rgba(28, 25, 23, .32);
}
.vtext b { color: var(--red); font-weight: 600; }
.regmark { position: fixed; z-index: -1; color: rgba(28, 25, 23, .28); font-size: 15px; font-family: var(--mono); }
.regmark.tl { top: 14px; left: 16px; } .regmark.tr { top: 14px; right: 16px; }
.regmark.bl { bottom: 14px; left: 16px; } .regmark.br { bottom: 14px; right: 16px; }

/* ---------- 顶栏 ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(250, 247, 242, .88); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--hair);
}
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; height: 60px; }
.brand-name { font-size: 18px; font-weight: 700; letter-spacing: .02em; }
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a, .ghost-link {
  font-size: 13px; letter-spacing: .06em; color: var(--muted); font-weight: 500;
  position: relative; padding: 4px 0;
}
.nav-links a::after, .ghost-link::after {
  content: ''; position: absolute; left: 0; bottom: -2px; height: 1.5px; width: 100%;
  background: var(--red); transform: scaleX(0); transform-origin: right; transition: transform .35s var(--ease);
}
.nav-links a:hover, .nav-links a.active, .ghost-link:hover { color: var(--ink); }
.nav-links a:hover::after, .nav-links a.active::after, .ghost-link:hover::after { transform: scaleX(1); transform-origin: left; }
.menu-toggle { display: none; flex-direction: column; gap: 6px; padding: 8px; }
.menu-toggle span { width: 20px; height: 2px; background: var(--ink); transition: transform .3s var(--ease), opacity .2s; }
.menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; padding-top: 120px; padding-bottom: 48px; position: relative; overflow: hidden; }
.hero .container { position: relative; }
.hero .container::after {
  content: ''; position: absolute; z-index: -1; right: -8%; top: -20%; width: min(460px, 46vw); height: min(460px, 46vw);
  border-radius: 50%; background: radial-gradient(circle, rgba(179, 38, 30, .10), rgba(179, 38, 30, .02) 62%, transparent 72%);
}
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--red); font-weight: 600; }
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); animation: blink 2.4s ease-in-out infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

.aw-wrap { perspective: 900px; margin-top: 22px; }
.aw-word {
  display: inline-block; opacity: 0; font-size: clamp(44px, 8vw, 88px); line-height: 1.12; letter-spacing: .01em;
  transform: translate3d(0, 44px, -70px) rotateX(58deg); transform-origin: 50% 100% -110px; will-change: transform, opacity;
}
.aw-word.em-red { color: var(--red); }
.sub { font-size: 19px; color: var(--muted); margin-top: 20px; }
.lede { font-size: 17px; line-height: 2; margin-top: 30px; max-width: 64ch; color: #3d3834; }
.lede em { font-style: normal; color: var(--red); font-weight: 600; }
.hero-actions { margin-top: 36px; }
.rule-gold { height: 3px; background: var(--gold); width: 96px; margin-top: 44px; }

/* ---------- 数据 ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; padding: 52px 28px; border-bottom: 1px solid var(--hair); will-change: clip-path; }
.stat .n { font-family: var(--serif); font-size: clamp(40px, 5.4vw, 60px); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 13px; color: var(--muted); margin-top: 10px; letter-spacing: .04em; }

/* ---------- 走马灯 ---------- */
.marq { overflow: hidden; border-bottom: 1px solid var(--hair); padding: 15px 0; }
.marq-track { display: flex; gap: 60px; width: max-content; font-family: var(--serif); font-size: 15px; letter-spacing: .14em; color: var(--muted); animation: marq 30s linear infinite; }
.marq-track span { white-space: nowrap; }
.marq-track span::after { content: ' · '; color: var(--red); }
@keyframes marq { to { transform: translateX(-50%); } }

/* ---------- 章节 ---------- */
.sec-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 18px; }
.sec-head .idx { font-size: 15px; color: var(--red); }
.sec-head h2 { font-size: clamp(28px, 4vw, 38px); font-weight: 700; }
.sec-sub { color: var(--muted); font-size: 15.5px; margin-bottom: 34px; }

/* ---------- 条目（经历/项目/流程通用） ---------- */
.item { position: relative; display: grid; grid-template-columns: 110px 1fr; gap: 24px; padding: 30px 0; border-top: 1px solid var(--hair); }
.item:first-of-type { border-top: 0; }
.item-idx {
  position: absolute; right: 0; top: 18px; font-size: 44px; line-height: 1; color: rgba(28, 25, 23, .13);
  transition: transform .7s var(--spring); pointer-events: none;
}
.item:hover .item-idx { transform: rotate(360deg); }
.item time { font-size: 13.5px; color: var(--muted); font-family: var(--mono); padding-top: 6px; }
.item h3 { font-size: 21px; font-weight: 700; }
.item p { font-size: 14.5px; color: var(--muted); margin-top: 8px; max-width: 68ch; line-height: 1.9; }
.item .tags { margin-top: 12px; font-size: 12px; letter-spacing: .08em; color: var(--red); text-transform: uppercase; }

/* ---------- 四步 ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; margin-top: 44px; padding-top: 26px; border-top: 1px solid var(--hair); }
.step { border-top: 2px solid var(--ink); padding-top: 14px; }
.step .step-idx { font-size: 14px; color: var(--red); }
.step h3 { font-size: 17px; margin-top: 8px; }
.step p { font-size: 13px; color: var(--muted); margin-top: 8px; line-height: 1.8; }

/* ---------- 技术栈 ---------- */
.stack-groups { display: flex; flex-direction: column; gap: 18px; }
.stack-group { display: grid; grid-template-columns: 150px 1fr; gap: 18px; align-items: baseline; padding: 16px 0; border-top: 1px solid var(--hair); }
.stack-group:first-of-type { border-top: 0; }
.sg-label { font-size: 13px; font-weight: 600; letter-spacing: .06em; color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips span { font-size: 12.5px; color: #4a443e; border: 1px solid var(--hair); border-radius: 999px; padding: 5px 13px; transition: border-color .25s, color .25s; }
.chips span:hover { border-color: var(--red); color: var(--red); }

/* ---------- 关于 ---------- */
.about-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: start; }
.about-lead { font-size: clamp(24px, 3vw, 32px); font-weight: 700; margin: 22px 0 6px; }
.about-copy > p { font-size: 15px; color: var(--muted); margin-top: 18px; line-height: 2; }
.about-copy > p strong { color: var(--ink); font-weight: 600; }
.about-copy > p em { font-style: normal; color: var(--red); font-weight: 600; }
.about-tags { display: flex; flex-direction: column; gap: 10px; margin-top: 26px; }
.about-tag { display: flex; align-items: baseline; gap: 12px; font-size: 14px; color: var(--muted); padding: 12px 16px; border: 1px solid var(--hair); border-radius: 8px; transition: border-color .25s, transform .3s var(--ease); }
.about-tag:hover { border-color: var(--red); transform: translateX(4px); }
.about-tag b { font-family: var(--mono); font-size: 12.5px; color: var(--red); letter-spacing: .06em; }
.beliefs { display: flex; flex-direction: column; }
.belief { padding: 24px 0; border-top: 1px solid var(--hair); }
.belief:first-of-type { border-top: 2px solid var(--ink); }
.b-idx { font-size: 13px; color: var(--red); }
.belief h3 { font-size: 18px; margin-top: 8px; }
.belief p { font-size: 13.5px; color: var(--muted); margin-top: 8px; line-height: 1.8; }

/* ---------- 联系 ---------- */
.contact-block { max-width: 820px; }
.contact-lead { font-size: clamp(26px, 4vw, 40px); font-weight: 700; margin-top: 22px; }
.contact-lead em { font-style: normal; color: var(--red); }
.contact-desc { font-size: 15.5px; color: var(--muted); margin-top: 16px; max-width: 56ch; line-height: 2; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }
.contact-meta { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: 30px; font-family: var(--mono); font-size: 13px; color: var(--muted); }
.contact-meta li { display: inline-flex; align-items: center; gap: 8px; }
.contact-meta svg { width: 14px; height: 14px; color: var(--red); }
.contact-meta a { color: var(--muted); border-bottom: 1px solid var(--hair); transition: color .25s, border-color .25s; }
.contact-meta a:hover { color: var(--ink); border-color: var(--red); }

/* ---------- 按钮（文字滚动胶囊） ---------- */
.roll-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; overflow: hidden;
  padding: 13px 26px; border-radius: 999px; background: var(--ink); color: var(--paper);
  font-size: 14.5px; letter-spacing: .04em; text-decoration: none; box-shadow: 0 1px 2px rgba(28,25,23,.25);
}
.roll-btn .t { display: block; transition: transform .5s var(--ease); }
.roll-btn .t2 { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; transform: translateY(135%) skewY(10deg); transition: transform .5s var(--ease); }
.roll-btn:hover .t { transform: translateY(-135%) skewY(10deg); }
.roll-btn:hover .t2 { transform: translateY(0) skewY(0); }
.roll-btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--ink); box-shadow: none; }

/* ---------- 页脚 ---------- */
.site-footer { border-top: 1px solid var(--hair); padding: 26px 0; }
.footer-inner { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.footer-brand { font-size: 14px; font-weight: 700; color: var(--ink); }
.footer-note { font-family: var(--mono); font-size: 12px; letter-spacing: .04em; }

/* ---------- 滚动显现 ---------- */
.reveal-up { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal-up.in { opacity: 1; transform: none; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .nav-links, .nav-cta { display: none; }
  .menu-toggle { display: flex; }
  .site-header.menu-open .nav-links {
    display: flex; flex-direction: column; align-items: stretch; gap: 2px;
    position: fixed; top: 60px; left: 16px; right: 16px;
    background: rgba(250, 247, 242, .97); border: 1px solid var(--hair); border-radius: 14px;
    padding: 12px 18px; box-shadow: 0 18px 50px rgba(28, 25, 23, .12);
  }
  .site-header.menu-open .nav-links a { padding: 10px 0; font-size: 15px; border-bottom: 1px solid var(--hair); }
  .site-header.menu-open .nav-links a:last-child { border-bottom: 0; }
  .about-grid { grid-template-columns: 1fr; gap: 36px; }
  .steps { grid-template-columns: repeat(2, 1fr); gap: 18px; }
  .stack-group { grid-template-columns: 1fr; gap: 8px; }
}
@media (max-width: 640px) {
  .container { padding-inline: 20px; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 22px; padding: 40px 20px; }
  .steps { grid-template-columns: 1fr; }
  .item { grid-template-columns: 1fr; gap: 8px; padding: 24px 0; }
  .item time { padding-top: 0; }
  .item-idx { font-size: 36px; top: 12px; }
  .vtext, .regmark { display: none; }
  .hero { padding-top: 110px; }
  .contact-actions .roll-btn { width: 100%; }
}

/* ---------- 打印 ---------- */
@media print {
  body { background: #fff; }
  body::before, .ghost-year, .vtext, .regmark, .site-header, .marq, .hero-actions { display: none !important; }
  .reveal-up { opacity: 1 !important; transform: none !important; }
  .section { padding: 20px 0; }
  .item { break-inside: avoid; }
}

/* ---------- 减弱动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .aw-word { opacity: 1; transform: none; }
  .reveal-up { opacity: 1; transform: none; }
}
