/* ===== 基础重置与变量 ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg:       #ede8df;
  --bg-card:  #f5f1ea;
  --bg-elevated: #e4dfd6;
  --text:     #2a2725;
  --text-dim: #7a746b;
  --accent:   #3a3a3a;
  --accent-glow: rgba(0, 0, 0, 0.05);
  --border:   rgba(0, 0, 0, 0.1);
  --radius:   8px;
  --font:     "Inter", "SF Pro Display", -apple-system, "Noto Sans SC", sans-serif;
  --mono:     "JetBrains Mono", "Fira Code", "SF Mono", monospace;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  scroll-snap-type: y proximity;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

::selection {
  background: var(--text);
  color: var(--bg);
}

a { color: var(--accent); text-decoration: none; }

.container {
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 0 24px;
  flex: 1;
  overflow-y: auto;
}

/* ===== Hero：全屏动态轮播 ===== */
.hero {
  position: relative;
  height: 100vh;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  scroll-snap-align: start;
}

.hero__content {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 场景 — 无极交叉淡入 + 微弹 */
.scene.no-transition {
  transition: none !important;
}

.scene {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  opacity: 0;
  transform: scale(0.985);
  transition: opacity 1.6s cubic-bezier(0.25, 0.1, 0.25, 1),
              transform 1.8s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.scene.active {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.scene__title {
  font-size: clamp(32px, 6vw, 64px);
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 1.2;
  text-align: center;
  color: var(--text);
}

.scene__sub {
  font-size: clamp(14px, 2vw, 20px);
  color: var(--text-dim);
  margin-top: 20px;
  text-align: center;
  font-weight: 300;
  letter-spacing: 0.05em;
}

.scene__headline {
  font-size: clamp(28px, 5vw, 52px);
  font-weight: 300;
  letter-spacing: -0.03em;
  text-align: center;
  color: var(--text);
}

.scene__desc {
  font-size: clamp(14px, 2vw, 18px);
  color: var(--text-dim);
  margin-top: 16px;
  text-align: center;
  font-weight: 300;
}

/* 打字机光标 */
.typewriter::after,
.typewriter-delay::after {
  content: "|";
  color: var(--text-dim);
  animation: blink 1s step-end infinite;
  margin-left: 2px;
  font-weight: 100;
}

.typewriter.done::after,
.typewriter-delay.done::after {
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* 关键词场景 */
.scene__keywords {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px 40px;
  max-width: 600px;
}

.kw {
  font-size: clamp(16px, 2.5vw, 24px);
  font-weight: 300;
  color: var(--text-dim);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  letter-spacing: 0.02em;
}

.kw.visible {
  opacity: 1;
  transform: translateY(0);
}

/* 数据场景 */
.scene__stats {
  display: flex;
  gap: 64px;
  flex-wrap: wrap;
  justify-content: center;
}

.stat {
  text-align: center;
}

.stat__num {
  font-size: clamp(40px, 7vw, 72px);
  font-weight: 200;
  font-family: var(--font);
  color: var(--text);
  display: block;
  line-height: 1;
}

.stat__num--text {
  font-size: clamp(28px, 5vw, 48px);
}

.stat__suffix {
  font-size: clamp(24px, 4vw, 40px);
  font-weight: 200;
  color: var(--text);
}

.stat__label {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 8px;
  display: block;
  letter-spacing: 0.05em;
}

/* 底部圆点导航 */
.hero__dots {
  position: absolute;
  bottom: 48px;
  display: flex;
  gap: 12px;
  z-index: 2;
}

.dot-nav {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.12);
  cursor: pointer;
  transition: background 0.6s ease, transform 0.6s ease;
}

.dot-nav.active {
  background: var(--text);
  transform: scale(1.3);
}

/* 滚动提示 */
.hero__scroll {
  position: absolute;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2;
  opacity: 0;
  animation: fadeIn 1s ease 5s forwards;
}

.hero__scroll-line {
  width: 1px;
  height: 32px;
  background: linear-gradient(to bottom, var(--text-dim), transparent);
  animation: scrollLine 2.5s ease infinite;
}

@keyframes scrollLine {
  0%   { transform: scaleY(0); transform-origin: top; }
  50%  { transform: scaleY(1); transform-origin: top; }
  50.1%{ transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

@keyframes fadeIn {
  to { opacity: 1; }
}

/* ===== 通用 Section ===== */
.section {
  min-height: 100vh;
  min-height: 100dvh;
  padding: 120px 0;
  display: flex;
  flex-direction: column;
  scroll-snap-align: start;
}

.section__header {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 64px;
}

.section__tag {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-dim);
  opacity: 0.5;
}

.section__title {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 300;
  letter-spacing: -0.02em;
}

/* 进场动画 — 纯淡入 */
.reveal {
  opacity: 0;
  transition: opacity 1.2s ease;
}

.reveal.visible {
  opacity: 1;
}

/* ===== About ===== */
.about__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.about__text p {
  color: var(--text-dim);
  margin-bottom: 16px;
  font-size: 15px;
  line-height: 1.8;
  font-weight: 300;
}

.about__text p:last-child {
  color: var(--text);
  font-style: italic;
  opacity: 0.7;
}

.about__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  overflow-wrap: break-word;
}

.tag {
  padding: 6px 14px;
  font-size: 12px;
  font-family: var(--mono);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-dim);
  transition: border-color 0.4s, color 0.4s;
}

.tag:hover {
  border-color: var(--text);
  color: var(--text);
}

/* ===== Projects ===== */
.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  margin-bottom: 24px;
  transition: border-color 0.4s, box-shadow 0.4s;
}

.project-card:hover {
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 8px 40px -12px rgba(0, 0, 0, 0.08);
}

.project-card--featured {
  padding: 40px;
  margin-bottom: 40px;
}

.projects__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.projects__grid .project-card {
  margin-bottom: 0;
}

.project-card__head {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.project-card__period {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
}

.project-card__role {
  font-size: 12px;
  color: var(--text-dim);
}

.project-card__title {
  font-size: 20px;
  font-weight: 500;
  margin-bottom: 12px;
}

.project-card__desc {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.8;
  margin-bottom: 20px;
  font-weight: 300;
  overflow-wrap: break-word;
}

.project-card__metrics {
  display: flex;
  gap: 32px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.metric__val {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 500;
  color: var(--text);
  display: block;
}

.metric__label {
  font-size: 12px;
  color: var(--text-dim);
}

.project-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  overflow-wrap: break-word;
}

.project-card__tags span {
  padding: 4px 10px;
  font-size: 11px;
  font-family: var(--mono);
  background: var(--bg-elevated);
  border-radius: 4px;
  color: var(--text-dim);
}

.project-card__link {
  display: inline-block;
  margin-top: 16px;
  padding: 8px 20px;
  font-size: 13px;
  font-family: var(--mono);
  font-weight: 500;
  background: var(--accent);
  color: var(--bg);
  border-radius: var(--radius);
  transition: opacity 0.2s, transform 0.2s;
}

.project-card__link:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

/* ===== Timeline ===== */
.timeline {
  position: relative;
  padding-left: 32px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border);
}

.timeline__item {
  position: relative;
  padding-bottom: 48px;
}

.timeline__item:last-child {
  padding-bottom: 0;
}

.timeline__dot {
  position: absolute;
  left: -32px;
  top: 4px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--text);
}

.timeline__period {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  display: block;
  margin-bottom: 8px;
}

.timeline__content h3 {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 8px;
}

.timeline__content p {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.8;
  font-weight: 300;
}

/* ===== Contact ===== */
.contact__intro {
  font-size: 18px;
  color: var(--text-dim);
  margin-bottom: 32px;
  max-width: 500px;
  font-weight: 300;
}

.contact__links {
  display: flex;
  gap: 16px;
}

.contact__link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  transition: border-color 0.4s, background 0.4s;
}

.contact__link:hover {
  border-color: var(--text);
  background: var(--accent-glow);
}

.contact__icon {
  display: flex;
  align-items: center;
}

/* ===== Footer ===== */
.footer {
  padding: 32px 0;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 13px;
  color: var(--text-dim);
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .hero {
    height: 100dvh;
    height: 100vh;
  }

  .scene { padding: 20px; }

  .scene__title {
    font-size: 32px;
  }

  .scene__headline {
    font-size: 26px;
  }

  .scene__sub {
    font-size: 14px;
  }

  .scene__stats { gap: 32px; }

  .hero__dots { bottom: 40px; }

  .hero__scroll { display: none; }

  .about__grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .section { padding: 80px 0; min-height: 100vh; min-height: 100dvh; }

  .section__header {
    margin-bottom: 40px;
  }

  .project-card { padding: 20px; }

  .project-card--featured { padding: 28px; }

  .projects__grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .project-card__metrics { gap: 20px; }

  .timeline { padding-left: 24px; }

  .timeline__dot { left: -24px; }

  .contact__link {
    padding: 14px 20px;
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .scene__title {
    font-size: 26px;
  }

  .scene__headline {
    font-size: 22px;
  }

  .scene__keywords {
    gap: 12px 20px;
  }

  .kw {
    font-size: 15px;
  }

  .scene__stats {
    flex-direction: column;
    gap: 20px;
  }

  .stat__num {
    font-size: 36px;
  }

  .stat__num--text {
    font-size: 24px;
  }

  .project-card__metrics {
    flex-direction: column;
    gap: 12px;
  }

  .project-card--featured {
    padding: 20px;
  }

  .section__tag {
    font-size: 11px;
  }

  .section__title {
    font-size: 24px;
  }

  .tag {
    font-size: 11px;
    padding: 5px 10px;
  }

  .about__text p {
    font-size: 14px;
  }

  .project-card__title {
    font-size: 17px;
  }

  .project-card__desc {
    font-size: 13px;
  }

  .timeline__content h3 {
    font-size: 14px;
  }

  .timeline__content p {
    font-size: 13px;
  }

  .contact__intro {
    font-size: 15px;
  }
}
