/* ---------- tokens ---------- */
:root {
  --bg: #fafaf9;
  --bg-elevated: #ffffff;
  --bg-subtle: #f1f1ef;
  --text: #16161a;
  --text-muted: #57575f;
  --text-faint: #8a8a92;
  --border: #e4e4e1;
  --accent: #3d5aff;
  --accent-text: #ffffff;
  --accent-soft: #eef1ff;
  --shadow: 0 1px 2px rgba(20,20,25,0.04), 0 8px 24px rgba(20,20,25,0.06);
  --radius: 14px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0c0c0e;
  --bg-elevated: #17171a;
  --bg-subtle: #1c1c20;
  --text: #f2f2f0;
  --text-muted: #a8a8b0;
  --text-faint: #6f6f78;
  --border: #2a2a30;
  --accent: #7c93ff;
  --accent-text: #0c0c0e;
  --accent-soft: rgba(124,147,255,0.12);
  --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 8px 30px rgba(0,0,0,0.4);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0c0e;
    --bg-elevated: #17171a;
    --bg-subtle: #1c1c20;
    --text: #f2f2f0;
    --text-muted: #a8a8b0;
    --text-faint: #6f6f78;
    --border: #2a2a30;
    --accent: #7c93ff;
    --accent-text: #0c0c0e;
    --accent-soft: rgba(124,147,255,0.12);
    --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 8px 30px rgba(0,0,0,0.4);
    color-scheme: dark;
  }
}

/* ---------- reset & base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.25s ease, color 0.25s ease;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

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

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: radial-gradient(circle at 15% 10%, var(--accent-soft), transparent 40%);
  opacity: 0.7;
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}
.logo .dot { color: var(--accent); }
.nav {
  display: flex;
  gap: 28px;
}
.nav a {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.15s ease;
}
.nav a:hover { color: var(--text); }

.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.icon-btn:hover { border-color: var(--accent); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  width: 36px; height: 36px;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}
.nav-toggle span {
  width: 16px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  z-index: 1;
  padding: 96px 24px 72px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 6px 12px;
  border-radius: 999px;
  margin: 0 0 20px;
}
.eyebrow::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
h1 {
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.12;
  margin: 0 0 20px;
  max-width: 16ch;
}
.highlight {
  background: linear-gradient(90deg, var(--accent), #9b7bff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 56ch;
  margin: 0 0 32px;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 32px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 22px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.94rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-outline { border-color: var(--border); background: var(--bg-elevated); }
.btn-outline:hover { border-color: var(--accent); }
.btn-ghost { color: var(--text-muted); }
.btn-ghost:hover { color: var(--text); }

.hero-links { display: flex; gap: 16px; }
.hero-links a {
  color: var(--text-faint);
  transition: color 0.15s ease;
}
.hero-links a:hover { color: var(--accent); }

/* ---------- sections ---------- */
.section {
  position: relative;
  z-index: 1;
  padding: 64px 24px;
  border-top: 1px solid var(--border);
}
.section-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 36px;
}
.tag {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
}

/* about */
.about-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 40px;
}
.about-text {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin: 0;
}
.about-facts {
  display: grid;
  gap: 16px;
  align-content: start;
}
.fact {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.fact-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}

/* skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.skill-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.skill-card h3 {
  margin: 0 0 14px;
  font-size: 0.95rem;
  font-weight: 700;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chips span {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 5px 10px;
  border-radius: 6px;
  background: var(--bg-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* projects */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}
.project-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.project-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}
.project-card.featured { grid-column: span 1; }
.project-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.project-head h3 { margin: 0; font-size: 1.08rem; font-weight: 700; }
.project-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-faint);
  white-space: nowrap;
}
.project-type {
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 600;
  margin: 0;
}
.project-card p:not(.project-type) { color: var(--text-muted); margin: 0; font-size: 0.94rem; }
.project-card ul {
  margin: 4px 0 0;
  padding-left: 18px;
  color: var(--text-muted);
  font-size: 0.9rem;
  display: grid;
  gap: 4px;
}
.project-links { margin-top: auto; padding-top: 6px; }
.project-links a {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
}

/* experience timeline */
.timeline {
  position: relative;
  display: grid;
  gap: 28px;
  padding-left: 28px;
  border-left: 2px solid var(--border);
}
.timeline-item { position: relative; }
.timeline-dot {
  position: absolute;
  left: -34px;
  top: 4px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.timeline-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  justify-content: space-between;
}
.timeline-head h3 { margin: 0; font-size: 1.05rem; font-weight: 700; }
.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-faint);
}
.timeline-sub { margin: 2px 0 8px; color: var(--accent); font-size: 0.9rem; font-weight: 600; }
.timeline-content p:not(.timeline-sub) { margin: 0; color: var(--text-muted); font-size: 0.94rem; }

/* contact */
.contact-lead {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 56ch;
  margin: -20px 0 28px;
}
.contact-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.contact-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.contact-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.contact-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}
.contact-value { font-weight: 600; font-size: 1rem; }

/* footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 24px 40px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-faint);
}
.footer-inner a { color: var(--text-faint); }
.footer-inner a:hover { color: var(--accent); }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .nav {
    position: absolute;
    top: 64px; left: 0; right: 0;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 16px 24px;
    gap: 16px;
    display: none;
  }
  .nav.open { display: flex; }
  .nav-toggle { display: flex; }
  .about-grid { grid-template-columns: 1fr; }
  .hero { padding: 64px 20px 48px; }
  .section { padding: 48px 20px; }
}

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