/* ============================================================
   Chentaishuai — 个人主页
   配色：暖白底 + 墨黑正文 + 深绿点缀
   ============================================================ */

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

:root {
  --bg: #fbfaf8;
  --surface: #ffffff;
  --ink: #17181a;
  --ink-soft: #3d4045;
  --muted: #717680;
  --line: #e5e1da;
  --line-strong: #d5d0c7;
  --accent: #245c4e;
  --accent-soft: #e8f0ec;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(23, 24, 26, 0.04), 0 8px 24px rgba(23, 24, 26, 0.05);
  --wrap: 980px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121314;
    --surface: #191b1c;
    --ink: #f2f1ee;
    --ink-soft: #cfcdc8;
    --muted: #918f8a;
    --line: #2a2c2e;
    --line-strong: #3a3d3f;
    --accent: #7fc4ae;
    --accent-soft: #1c2a26;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.25);
  }
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    animation: none !important;
    transition: none !important;
  }
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 28px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--bg);
  z-index: 999;
}
.skip:focus {
  left: 12px;
  top: 12px;
}

/* ---------------- 页头 ---------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(150%) blur(10px);
  -webkit-backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 1px 0 rgba(23, 24, 26, 0.02);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  font-family: Georgia, "Times New Roman", "Songti SC", "Source Han Serif SC", serif;
  font-size: 17px;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}

.nav {
  display: flex;
  gap: 26px;
}

.nav a {
  position: relative;
  color: var(--muted);
  text-decoration: none;
  font-size: 14.5px;
  padding: 4px 0;
  transition: color 0.2s ease;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1.5px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.nav a:hover,
.nav a.is-active {
  color: var(--ink);
}

.nav a.is-active::after,
.nav a:hover::after {
  transform: scaleX(1);
}

/* ---------------- 首屏 ---------------- */

.hero {
  padding: 96px 0 84px;
}

.eyebrow {
  margin: 0 0 18px;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-name {
  margin: 0;
  font-family: Georgia, "Times New Roman", "Songti SC", "Source Han Serif SC", serif;
  font-size: clamp(42px, 8.4vw, 76px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 600;
}

.hero-tagline {
  margin: 26px 0 0;
  font-size: clamp(17px, 2.4vw, 20px);
  color: var(--ink-soft);
}

.hero-desc {
  margin: 16px 0 0;
  max-width: 560px;
  color: var(--muted);
  font-size: 15.5px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
}

/* ---------------- 按钮 ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 999px;
  font-size: 14.5px;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.18s ease, background 0.2s ease, border-color 0.2s ease,
    color 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  color: #fbfaf8;
}

@media (prefers-color-scheme: dark) {
  .btn-primary {
    color: #101211;
  }
}

.btn-primary:hover {
  filter: brightness(1.06);
}

.btn-ghost {
  border-color: var(--line-strong);
  color: var(--ink);
  background: transparent;
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------------- 通用区块 ---------------- */

.section {
  padding: 76px 0;
  border-top: 1px solid var(--line);
}

.section-title {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 0 0 30px;
  font-family: Georgia, "Times New Roman", "Songti SC", "Source Han Serif SC", serif;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.section-title .num {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  color: var(--accent);
  letter-spacing: 0.08em;
  padding-top: 2px;
}

.section-lead {
  margin: -14px 0 32px;
  color: var(--muted);
  font-size: 14.5px;
  max-width: 620px;
}

/* ---------------- 关于 ---------------- */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}

.about-text p {
  margin: 0 0 18px;
  color: var(--ink-soft);
}

.about-text p:last-child {
  margin-bottom: 0;
}

.facts {
  margin: 0;
  border-top: 1px solid var(--line);
}

.fact {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14.5px;
}

.fact dt {
  color: var(--muted);
  flex: 0 0 auto;
}

.fact dd {
  margin: 0;
  text-align: right;
  color: var(--ink);
}

/* ---------------- 技能 ---------------- */

.skill-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 34px;
}

.skill-group h3 {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chips li {
  padding: 5px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 13.5px;
  color: var(--ink-soft);
  background: var(--surface);
  transition: border-color 0.2s ease, color 0.2s ease;
}

.chips li:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.chips-sm li {
  font-size: 12.5px;
  padding: 3px 10px;
}

/* ---------------- 作品 ---------------- */

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(262px, 1fr));
  gap: 20px;
}

.project-card {
  display: flex;
  flex-direction: column;
  padding: 26px 24px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.project-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: 0 2px 4px rgba(23, 24, 26, 0.05), 0 16px 36px rgba(23, 24, 26, 0.08);
}

.project-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.project-head h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.project-year {
  flex: 0 0 auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--muted);
}

.project-desc {
  margin: 12px 0 16px;
  color: var(--muted);
  font-size: 14.5px;
  flex: 1 1 auto;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--accent);
  text-decoration: none;
}

.project-link .arrow {
  transition: transform 0.2s ease;
}

.project-link:hover .arrow {
  transform: translateX(4px);
}

/* ---------------- 联系 ---------------- */

.section-contact {
  border-top: 1px solid var(--line);
}

.contact-lead {
  margin: -14px 0 28px;
  color: var(--muted);
  max-width: 560px;
  font-size: 15px;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------------- 页脚 ---------------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 36px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
}

/* ---------------- 占位符 ---------------- */

.todo {
  display: inline-block;
  padding: 0 6px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  font-style: normal;
  box-shadow: inset 0 -1px 0 var(--accent);
  white-space: nowrap;
}

.todo-chip {
  border-style: dashed !important;
  border-color: var(--accent) !important;
  color: var(--accent) !important;
  background: var(--accent-soft) !important;
}

/* ---------------- 入场动画 ---------------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

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

/* ---------------- 响应式 ---------------- */

@media (max-width: 860px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .skill-groups {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .hero {
    padding: 68px 0 60px;
  }

  .section {
    padding: 60px 0;
  }
}

@media (max-width: 560px) {
  .wrap {
    padding: 0 20px;
  }

  .nav {
    gap: 16px;
  }

  .nav a {
    font-size: 13.5px;
  }

  .header-inner {
    height: 58px;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }
}
