/* ============================================================
   跑步的棒呆 · 个人主站
   DESIGN.md 图纸：背景 #fafafa / 主色 #ff5c1c / Space Grotesk
   阶段1：骨架 + 首屏（动效留待阶段3）
   ============================================================ */

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('assets/fonts/space-grotesk.woff2') format('woff2');
}

:root {
  /* 图纸色板 */
  --bg: #fafafa;
  --ink: #1a1a1a;
  --muted: #6b6b6b;
  --line: #e8e8e8;
  --primary: #ff5c1c;
  --primary-ink: #ffffff;
  --primary-soft: rgba(255, 92, 28, 0.08);

  /* 字体 */
  --font-display: 'Space Grotesk', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --font-body: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, sans-serif;

  /* 间距节奏 */
  --space-section: clamp(72px, 10vw, 128px);
  --gutter: clamp(20px, 5vw, 48px);

  /* 圆角（克制的小圆角） */
  --radius: 10px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--primary);
  color: #fff;
  padding: 8px 16px;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* ---------------- 顶栏 ---------------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px var(--gutter);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease;
}

/* 动效 6：下滑后顶栏浮现底边线 */
.site-header.is-scrolled {
  border-bottom-color: var(--line);
}

.wordmark {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.site-nav { display: flex; gap: 4px; }

.nav-link {
  font-size: 15px;
  color: var(--muted);
  padding: 12px 14px;          /* 点击目标 ≥ 44px */
  border-radius: var(--radius);
  transition: color .2s ease, background-color .2s ease;
}
.nav-link:hover { color: var(--ink); background: rgba(0, 0, 0, 0.04); }
.nav-link.active { color: var(--ink); font-weight: 600; }

/* ---------------- 首屏 ---------------- */
.section-hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: calc(64px + env(safe-area-inset-top)) var(--gutter) 48px;
}

/* 全局背景光晕（fixed 贯穿所有板块，滚动时无缝衔接；参考 DeepSeek Harness 手法换成站内橙色调） */
.page-aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

main, .site-footer {
  position: relative;
  z-index: 1;
}

.aurora-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  will-change: transform;
}

.aurora-1 {
  width: 560px;
  height: 560px;
  right: -8%;
  top: -12%;
  background: radial-gradient(circle, rgba(255, 92, 28, 0.16) 0%, rgba(255, 92, 28, 0) 70%);
  animation: aurora-drift-1 22s ease-in-out infinite alternate;
}

.aurora-2 {
  width: 720px;
  height: 720px;
  left: -14%;
  bottom: -20%;
  background: radial-gradient(circle, rgba(255, 92, 28, 0.12) 0%, rgba(255, 92, 28, 0) 70%);
  animation: aurora-drift-2 28s ease-in-out infinite alternate;
}

.aurora-3 {
  width: 420px;
  height: 420px;
  right: 22%;
  bottom: 6%;
  background: radial-gradient(circle, rgba(255, 92, 28, 0.10) 0%, rgba(255, 92, 28, 0) 70%);
  animation: aurora-drift-3 18s ease-in-out infinite alternate;
}

@keyframes aurora-drift-1 {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(-60px, 50px) scale(1.08); }
}

@keyframes aurora-drift-2 {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(70px, -40px) scale(0.94); }
}

@keyframes aurora-drift-3 {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(-40px, -60px) scale(1.12); }
}

.hero-inner { position: relative; z-index: 1; max-width: 880px; }

/* 动效 1：首屏入场（依次上浮渐显） */
@keyframes hero-rise {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-title,
.hero-identity,
.hero-tags,
.hero-actions {
  opacity: 0;
  animation: hero-rise .65s ease-out forwards;
}

.hero-title    { animation-delay: .05s; }
.hero-identity { animation-delay: .20s; }
.hero-tags     { animation-delay: .35s; }
.hero-actions  { animation-delay: .50s; }

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(56px, 10vw, 120px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.hero-accent { color: var(--primary); }

.hero-identity {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.6vw, 28px);
  font-weight: 500;
  color: var(--muted);
  margin-top: 24px;
}

.hero-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 32px;
}

.hero-tag {
  font-size: 15px;
  padding: 9px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: #ffffff;
}

.hero-tag-strong {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-ink);
  font-weight: 600;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 44px;
}

.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  padding: 15px 30px;          /* 点击目标 ≥ 44px */
  border-radius: var(--radius);
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-ink);
}
.btn-primary:hover { box-shadow: 0 8px 24px rgba(255, 92, 28, 0.28); transform: translateY(-1px); }

.btn-ghost {
  color: var(--ink);
  border: 1px solid var(--line);
  background: transparent;
}
.btn-ghost:hover { border-color: var(--ink); }

/* ---------------- 关于我 ---------------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(40px, 6vw, 96px);
  align-items: start;
}

.about-lead {
  font-size: clamp(17px, 1.6vw, 20px);
  line-height: 1.9;
  color: var(--ink);
  max-width: 34em;
}

.about-quote {
  margin-top: 36px;
  padding-left: 20px;
  border-left: 3px solid var(--primary);
  font-family: var(--font-display);
  font-size: clamp(18px, 1.8vw, 22px);
  font-weight: 500;
  color: var(--muted);
}

.timeline {
  list-style: none;
  border-left: 1px solid var(--line);
  padding-left: 24px;
}

.timeline-item {
  position: relative;
  padding: 10px 0 10px 8px;
}
.timeline-item:first-child { padding-top: 0; }
.timeline-item:last-child { padding-bottom: 0; }

.timeline-item::before {
  content: '';
  position: absolute;
  left: -28.5px;
  top: 18px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--line);
  box-shadow: 0 0 0 3px var(--bg);
}

/* 动效 4：时间线圆点依次点亮（由 .about-side.is-visible 触发） */
@keyframes tl-light {
  from { background: var(--line); box-shadow: 0 0 0 3px var(--bg); }
  to   { background: var(--primary); box-shadow: 0 0 0 3px var(--bg), 0 0 12px rgba(255, 92, 28, 0.35); }
}

.about-side.is-visible .timeline-item:nth-child(1)::before { animation: tl-light .45s ease-out .10s both; }
.about-side.is-visible .timeline-item:nth-child(2)::before { animation: tl-light .45s ease-out .40s both; }
.about-side.is-visible .timeline-item:nth-child(3)::before { animation: tl-light .45s ease-out .70s both; }
.about-side.is-visible .timeline-item:nth-child(4)::before { animation: tl-light .45s ease-out 1.00s both; }

.t-year {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--primary);
  margin-right: 14px;
}

.t-label { color: var(--ink); font-size: 16px; }

.about-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 40px;
}

.stat-item {
  flex: 1 1 140px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}

.stat-num {
  display: block;
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.1;
}

.stat-label {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}

/* ---------------- 板块外壳（共用） ---------------- */
.section-shell {
  padding: var(--space-section) var(--gutter);
  border-top: 1px solid var(--line);
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 32px;
}

.section-index {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--primary);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.placeholder-box {
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
}

/* ---------------- 作品区 ---------------- */
.section-sub {
  margin-left: auto;
  color: var(--muted);
  font-size: 15px;
  align-self: center;
}

.works-categories {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.works-category {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
}

.works-category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}

.work-tag {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
  border: 1px solid rgba(255, 92, 28, 0.35);
  border-radius: 6px;
  padding: 4px 10px;
}

.works-category-count {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--muted);
}

.work-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 12px;
  border-bottom: 1px solid var(--line);
  border-radius: 8px;
  transition: background-color .18s ease, padding-left .18s ease;
}
.work-item:last-child { border-bottom: none; }

/* 动效 5：作品项悬停微交互 */
.work-item:hover {
  background: var(--primary-soft);
  padding-left: 20px;
}

.work-item-main { flex: 1; display: flex; flex-direction: column; gap: 4px; }

.work-title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.work-desc {
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
}

.work-arrow {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--ink);
  transition: color .15s ease, transform .15s ease;
}

.work-item:hover .work-arrow { color: var(--primary); transform: translateX(4px); }

.works-note {
  margin-top: 28px;
  font-size: 13px;
  color: var(--muted);
}

/* ---------------- 联系方式 ---------------- */
.contact-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color .15s ease;
}
.contact-item:hover { border-color: rgba(255, 92, 28, 0.5); }

.contact-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary);
}

.contact-name {
  flex: 1;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

/* ---------------- 页脚 ---------------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 40px var(--gutter) calc(40px + env(safe-area-inset-bottom));
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

/* 动效 2：滚动渐显（JS 加 .is-visible） */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .6s ease-out, transform .6s ease-out;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------------- 动效尊重系统偏好 ---------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .aurora-blob { animation: none; }
  .btn { transition: none; }
  .hero-title, .hero-identity, .hero-tags, .hero-actions {
    opacity: 1;
    animation: none;
  }
  .reveal { opacity: 1; transform: none; transition: none; }
  .timeline-item::before { background: var(--primary); animation: none; }
  .site-header { transition: none; }
}

/* ---------------- 移动端 ---------------- */
@media (max-width: 640px) {
  .site-header { padding: 14px 20px; }
  .wordmark { font-size: 18px; }
  .nav-link { font-size: 14px; padding: 12px 10px; }
  .hero-title { font-size: clamp(48px, 15vw, 72px); }
  .hero-actions .btn { width: 100%; text-align: center; }
  .about-grid { grid-template-columns: 1fr; gap: 48px; }
  .stat-item { flex-basis: 100%; }
  .section-sub { margin-left: 0; width: 100%; }
  .works-categories { grid-template-columns: 1fr; }
  .contact-list { grid-template-columns: 1fr; }
}
