/* === Design Tokens === */
:root {
  --bg: #1a1d23;
  --bg-alt: #2a2e37;
  --fg: #e8e8e8;
  --fg-muted: #9ba0a8;
  --accent: #ff5a1f;
  --border: #333842;

  --max-w: 960px;
  --pad-x: 32px;
  --pad-x-mobile: 20px;

  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC",
               "Microsoft YaHei", "Segoe UI", sans-serif;
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3, p, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
button { font: inherit; cursor: pointer; background: none; border: 0; color: inherit; }

/* === Layout helpers === */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad-x);
}

/* === Typography primitives === */
.label {
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 12px;
}
.muted { color: var(--fg-muted); }

/* === Section base === */
.section {
  padding: 96px 0;
  border-top: 1px solid var(--border);
}
.section-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 32px;
}

/* === Nav === */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(26, 29, 35, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}
.nav-brand {
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--fg);
}
.nav-brand::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  margin-left: 6px;
  vertical-align: middle;
}
.nav-links {
  display: flex;
  gap: 28px;
  font-size: 14px;
}
.nav-links a {
  color: var(--fg-muted);
  transition: color 0.2s;
}
.nav-links a:hover,
.nav-links a.active { color: var(--accent); }

.nav-toggle {
  display: none;
  width: 36px;
  height: 36px;
  padding: 8px;
  flex-direction: column;
  justify-content: space-between;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--fg);
  border-radius: 1px;
  transition: transform 0.25s, opacity 0.25s;
}

/* === Hero === */
.hero {
  position: relative;
  padding: 120px 0 96px;
  overflow: hidden;
}
.hero-glow {
  position: absolute;
  top: -80px;
  right: -80px;
  width: 380px;
  height: 380px;
  background: var(--accent);
  opacity: 0.15;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}
.hero-title {
  font-size: 56px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1px;
  margin: 16px 0 20px;
}
.accent { color: var(--accent); }
.hero-sub {
  font-size: 16px;
  color: var(--fg-muted);
  line-height: 1.8;
  margin-bottom: 36px;
}
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-primary, .btn-ghost {
  display: inline-flex;
  align-items: center;
  padding: 12px 22px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 4px;
  transition: transform 0.15s, background 0.15s, border-color 0.15s, color 0.15s;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { transform: translateY(-1px); }
.btn-ghost {
  border: 1px solid var(--border);
  color: var(--fg);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* === Prose (shared paragraph block) === */
.prose p {
  font-size: 16px;
  line-height: 1.85;
  margin-bottom: 20px;
  max-width: 680px;
}
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--fg); font-weight: 700; }
.prose em { color: var(--accent); font-style: normal; }
.about .section-title { max-width: 720px; }

/* === Timeline === */
.timeline {
  position: relative;
  padding-left: 28px;
  border-left: 1px solid var(--border);
}
.tl-item {
  position: relative;
  padding-bottom: 32px;
}
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: "";
  position: absolute;
  left: -33px;
  top: 8px;
  width: 9px;
  height: 9px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 50%;
}
.tl-current::before { border-color: var(--accent); background: var(--accent); }
.tl-year {
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 4px;
}
.tl-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 4px;
}
.tl-body p { margin: 0; font-size: 14px; }

/* === Work grid === */
.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.work-card {
  padding: 24px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: border-color 0.2s, transform 0.2s;
}
.work-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.work-tag {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
  font-weight: 600;
}
.work-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}
.work-card p {
  font-size: 14px;
  color: var(--fg-muted);
  line-height: 1.7;
}

/* === Writing === */
.writing-block {
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
}
.writing-block:last-child { border-bottom: 0; }
.writing-heading {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}
.writing-block p {
  color: var(--fg-muted);
  margin-bottom: 16px;
  max-width: 620px;
}
.writing-list { display: flex; flex-direction: column; gap: 2px; }
.writing-link {
  display: flex;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 15px;
  transition: color 0.15s;
}
.writing-link:last-child { border-bottom: 0; }
.writing-link:hover { color: var(--accent); }

/* === Now === */
.now-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 620px;
}
.now-list li {
  position: relative;
  padding-left: 22px;
  font-size: 15px;
  line-height: 1.7;
}
.now-list li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* === Contact === */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  max-width: 560px;
}
.contact-card {
  padding: 24px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  text-align: center;
  transition: border-color 0.2s;
  display: block;
}
.contact-card:hover { border-color: var(--accent); }
.contact-tag {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 10px;
}
.contact-value {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
}
.contact-qr {
  width: 140px;
  height: 140px;
  margin: 12px auto 0;
  background: var(--border);
  border-radius: 4px;
}

/* === Footer === */
.footer { padding: 48px 0; border-top: 1px solid var(--border); }

/* === Responsive === */
@media (max-width: 768px) {
  .container { padding: 0 var(--pad-x-mobile); }
  .section { padding: 64px 0; }
  .section-title { font-size: 24px; margin-bottom: 24px; }

  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  .nav-links a {
    padding: 16px var(--pad-x-mobile);
    border-top: 1px solid var(--border);
  }
  .nav.open .nav-links { max-height: 400px; }
  .nav.open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav.open .nav-toggle span:nth-child(2) { opacity: 0; }
  .nav.open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .hero { padding: 80px 0 64px; }
  .hero-title { font-size: 40px; }
  .hero-glow { width: 240px; height: 240px; top: -40px; right: -40px; }

  .work-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
}
