:root {
  --paper: #f4f0e8;
  --paper-deep: #ebe4d7;
  --ink: #1c1917;
  --muted: #6f665c;
  --line: rgba(28, 25, 23, 0.12);
  --card: rgba(255, 253, 248, 0.72);
  --accent: #c45c26;
  --accent-soft: rgba(196, 92, 38, 0.12);
  --shadow: 0 18px 50px rgba(28, 25, 23, 0.08);
  --radius: 18px;
  --max: 1080px;
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC",
    system-ui, -apple-system, sans-serif;
  --serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "SimSun", Georgia,
    serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(196, 92, 38, 0.08), transparent 28%),
    radial-gradient(circle at top right, rgba(80, 90, 120, 0.08), transparent 24%),
    var(--paper);
  line-height: 1.7;
  min-height: 100vh;
}

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 0;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  backdrop-filter: blur(14px);
  background: rgba(244, 240, 232, 0.78);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: 0.12em;
  font-size: 0.95rem;
}

.nav {
  display: flex;
  gap: 1.25rem;
  font-size: 0.92rem;
  color: var(--muted);
}

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

.menu-btn {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  padding: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
}

.menu-btn span {
  display: block;
  width: 16px;
  height: 1.5px;
  background: var(--ink);
}

main {
  position: relative;
  z-index: 1;
  width: min(var(--max), calc(100% - 2.5rem));
  margin: 0 auto;
  padding-bottom: 4rem;
}

.hero {
  padding: 5.5rem 0 4rem;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 1rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: var(--muted);
}

.hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.6rem, 7vw, 4.8rem);
  line-height: 1.12;
  font-weight: 700;
}

.name {
  color: var(--accent);
  position: relative;
}

.lede {
  max-width: 38rem;
  margin: 1.5rem 0 0;
  font-size: 1.08rem;
  color: var(--muted);
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2.5rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.hero-meta .label,
.contact-card .label,
.facts span {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.open {
  color: var(--accent);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 1.25rem;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}

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

.btn.primary {
  background: var(--ink);
  color: var(--paper);
}

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

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

.section {
  padding: 4rem 0 1rem;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.section-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}

.index {
  font-size: 0.85rem;
  color: var(--accent);
  letter-spacing: 0.12em;
}

.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1.5rem;
}

.about-text {
  margin: 0;
  font-size: 1.05rem;
  color: #3d372f;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.6rem;
  box-shadow: var(--shadow);
}

.facts {
  list-style: none;
  margin: 0;
  padding: 1.25rem 1.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.45);
  display: grid;
  gap: 1rem;
}

.facts strong {
  font-size: 1.05rem;
}

.skills,
.projects {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.skill-card,
.project,
.contact-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem 1.4rem;
  box-shadow: var(--shadow);
}

.skill-card h3,
.project h3 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
}

.skill-card p,
.project p {
  margin: 0 0 1rem;
  color: var(--muted);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.tags span {
  font-size: 0.78rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}

.timeline li {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 1.25rem;
  padding: 1.4rem 0;
  border-top: 1px solid var(--line);
}

.timeline li:last-child {
  border-bottom: 1px solid var(--line);
}

.when {
  font-size: 0.92rem;
  color: var(--accent);
  font-weight: 600;
  padding-top: 0.2rem;
}

.what h3 {
  margin: 0 0 0.2rem;
  font-size: 1.15rem;
}

.org {
  margin: 0 0 0.55rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.what p:last-child {
  margin: 0;
  color: #3d372f;
}

.project-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.year {
  color: var(--muted);
  font-size: 0.88rem;
}

.contact-lede {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.contact-card strong {
  font-size: 1.05rem;
}

a.contact-card:hover {
  border-color: var(--accent);
}

.footer {
  position: relative;
  z-index: 1;
  width: min(var(--max), calc(100% - 2.5rem));
  margin: 0 auto 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer a:hover {
  color: var(--accent);
}

.footer-left {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.footer-left p {
  margin: 0;
}

.icp {
  font-size: 0.85rem;
}

.icp a {
  color: var(--muted);
  border-bottom: 1px solid transparent;
}

.icp a:hover {
  color: var(--accent);
  border-bottom-color: currentColor;
}

@media (max-width: 820px) {
  .nav {
    display: none;
    position: absolute;
    top: 64px;
    right: 1.25rem;
    left: 1.25rem;
    flex-direction: column;
    gap: 0.85rem;
    padding: 1rem 1.1rem;
    background: rgba(255, 253, 248, 0.96);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
  }

  .nav.open {
    display: flex;
  }

  .menu-btn {
    display: inline-flex;
  }

  .hero {
    padding: 3.5rem 0 2.5rem;
  }

  .hero-meta,
  .about-grid,
  .skills,
  .projects,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .timeline li {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .footer {
    flex-direction: column;
  }
}
