/* ---------- design tokens ---------- */
:root {
  color-scheme: light;
  --page-bg: #f9f9f7;
  --surface: #fcfcfb;
  --surface-raised: #ffffff;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #898781;
  --border: rgba(11, 11, 11, 0.1);
  --gridline: #e1e0d9;
  --series-lang: #2a78d6;
  --series-infra: #eb6834;
  --series-interest: #1baf7a;
  --radius: 12px;
  --max-width: 860px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --page-bg: #0d0d0d;
    --surface: #1a1a19;
    --surface-raised: #202020;
    --text-primary: #ffffff;
    --text-secondary: #c3c2b7;
    --text-muted: #898781;
    --border: rgba(255, 255, 255, 0.1);
    --gridline: #2c2c2a;
    --series-lang: #3987e5;
    --series-infra: #d95926;
    --series-interest: #199e70;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--text-primary);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
}
.skip-link:focus {
  left: 0;
  background: var(--surface);
  padding: 8px 12px;
  z-index: 200;
}

.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3 {
  line-height: 1.25;
}

/* ---------- nav ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-weight: 600;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 24px;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.95rem;
}
.nav-links a:hover {
  color: var(--text-primary);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text-primary);
}

@media (max-width: 680px) {
  .nav-inner {
    flex-wrap: wrap;
  }
  .nav-toggle {
    display: flex;
  }
  .nav-links {
    flex: 1 1 100%;
    order: 3;
    flex-direction: column;
    gap: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }
  .nav-links.is-open {
    max-height: 320px;
  }
  .nav-links a {
    display: block;
    padding: 14px 24px;
    border-top: 1px solid var(--border);
  }
}

/* ---------- hero ---------- */
.hero {
  text-align: center;
  padding: 72px 24px 56px;
}

.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.hero-portrait {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--surface-raised);
  box-shadow: 0 0 0 1px var(--border);
  margin-bottom: 20px;
}

.hero h1 {
  margin: 0 0 4px;
  font-size: 2rem;
}

.hero-title {
  margin: 0 0 12px;
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.hero-tagline {
  max-width: 520px;
  margin: 0 auto 24px;
  color: var(--text-secondary);
}

.social-links {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 16px;
  margin: 0;
  padding: 0;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.9rem;
  transition: color 0.15s, border-color 0.15s;
}
.social-links a:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

/* ---------- sections ---------- */
.section {
  padding: 56px 0;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.section.is-visible {
  opacity: 1;
  transform: none;
}

.section h2 {
  font-size: 1.5rem;
  margin: 0 0 20px;
}

.section-intro {
  color: var(--text-secondary);
  margin-top: -8px;
}

/* ---------- timeline ---------- */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 2px solid var(--gridline);
}

.timeline-item {
  position: relative;
  padding: 0 0 28px 28px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.timeline-item.is-visible {
  opacity: 1;
  transform: none;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--series-lang);
  border: 2px solid var(--page-bg);
}

.timeline-dates {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 4px;
}

.timeline-content h3 {
  margin: 0 0 2px;
  font-size: 1.05rem;
}

.timeline-org {
  color: var(--text-secondary);
  font-weight: 400;
}

.timeline-meta {
  margin: 0 0 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.timeline-content ul {
  margin: 0;
  padding-left: 1.1em;
  color: var(--text-secondary);
}
.timeline-content li {
  margin-bottom: 4px;
}

/* ---------- education ---------- */
.edu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 600px) {
  .edu-grid {
    grid-template-columns: 1fr;
  }
}

.edu-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.edu-card.is-visible {
  opacity: 1;
  transform: none;
}
.edu-card h3 {
  margin: 4px 0 2px;
  font-size: 1.05rem;
}
.edu-card p {
  margin: 0 0 4px;
  color: var(--text-secondary);
}

/* ---------- project card ---------- */
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  position: relative;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.project-card + .project-card {
  margin-top: 20px;
}
.project-card.is-visible {
  opacity: 1;
  transform: none;
}

.project-year {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--series-infra);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 10px;
  margin-bottom: 10px;
}

.project-card h3 {
  margin: 0 0 8px;
}

.project-card p {
  color: var(--text-secondary);
  margin: 0 0 14px;
}

.project-link {
  text-decoration: none;
  font-weight: 600;
  color: var(--series-lang);
}
.project-link:hover {
  text-decoration: underline;
}

/* ---------- footer ---------- */
.site-footer {
  text-align: center;
  padding: 40px 24px 56px;
  color: var(--text-muted);
}
.site-footer .social-links {
  margin-bottom: 16px;
}
.site-footer p {
  margin: 0;
  font-size: 0.85rem;
}
