/* ===== Design tokens ===== */
:root {
  --bg: #0a0e14;
  --bg-alt: #0d1219;
  --surface: #111826;
  --surface-2: #151d2e;
  --border: #223047;
  --border-soft: #1a2436;
  --text: #e7ecf5;
  --text-dim: #9aa7bd;
  --text-faint: #647089;
  --primary: #4fd1c5;
  --primary-strong: #38b8ac;
  --accent: #7c9fff;
  --font-display: "Space Grotesk", "Inter", sans-serif;
  --font-body: "Inter", -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", monospace;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-card: 0 1px 0 rgba(255,255,255,0.03) inset, 0 20px 40px -24px rgba(0,0,0,0.6);
  --container: 1040px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f8fb;
    --bg-alt: #eef1f6;
    --surface: #ffffff;
    --surface-2: #f3f5f9;
    --border: #dde3ec;
    --border-soft: #e6eaf1;
    --text: #121722;
    --text-dim: #4b5568;
    --text-faint: #8b93a5;
    --primary: #0f9a8c;
    --primary-strong: #0c8074;
    --accent: #3a5fd9;
    --shadow-card: 0 1px 0 rgba(255,255,255,0.6) inset, 0 20px 40px -28px rgba(20,30,50,0.18);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

img { max-width: 100%; display: block; }

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--primary);
  color: #06201d;
  padding: 12px 20px;
  border-radius: 0 0 var(--radius-sm) 0;
  font-weight: 600;
  z-index: 1000;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ===== Background grid ===== */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--border-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-soft) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 10%, transparent 70%);
  opacity: 0.5;
}

/* ===== Header / Nav ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px) saturate(140%);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--border-soft);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 68px;
}

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.02em;
}
.logo-dot { color: var(--primary); }

.nav-links {
  list-style: none;
  display: flex;
  gap: 32px;
  margin: 0;
  padding: 0;
}
.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 500;
  transition: color 0.15s ease;
}
.nav-links a:hover { color: var(--text); }

.nav-cta { display: inline-flex; }

@media (max-width: 720px) {
  .nav-links { display: none; }
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  touch-action: manipulation;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--primary);
  color: #06201d;
}
.btn-primary:hover { background: var(--primary-strong); }

.btn-outline {
  border-color: var(--border);
  color: var(--text);
  background: var(--surface);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

.btn-ghost {
  border-color: var(--border);
  color: var(--text);
  padding: 9px 18px;
}
.btn-ghost:hover { border-color: var(--primary); }

/* ===== Hero ===== */
.hero {
  padding: 96px 24px 72px;
  max-width: 820px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent);
  padding: 6px 14px;
  border-radius: 999px;
  margin: 0 0 24px;
}
.eyebrow .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent);
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 700;
  line-height: 1.05;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}

.role {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2.4vw, 1.4rem);
  color: var(--text-dim);
  margin: 0 0 24px;
  font-weight: 500;
}
.role .sep { color: var(--text-faint); margin: 0 4px; }
.role .accent { color: var(--primary); }

.lede {
  font-size: 1.08rem;
  color: var(--text-dim);
  max-width: 640px;
  margin: 0 0 36px;
}
.lede strong { color: var(--text); font-weight: 600; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 44px;
}

.hero-meta {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  padding: 0;
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-dim);
}
.hero-meta li { display: flex; align-items: center; gap: 8px; }
.hero-meta a { color: var(--text-dim); text-decoration: none; display: flex; align-items: center; gap: 8px; }
.hero-meta a:hover { color: var(--primary); }
.icon { width: 17px; height: 17px; flex-shrink: 0; color: var(--text-faint); }

/* ===== Sections ===== */
.section { padding: 64px 24px; }

.section-title {
  display: flex;
  align-items: baseline;
  gap: 14px;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0 0 40px;
  letter-spacing: -0.01em;
}
.section-title .num {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--primary);
}

/* ===== Skills ===== */
.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.skill-pill {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 9px 16px;
  border-radius: 999px;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.skill-pill:hover { border-color: var(--primary); color: var(--text); }

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

.timeline-item {
  position: relative;
  padding: 0 0 40px 36px;
}
.timeline-item:last-child { padding-bottom: 0; }

.timeline-marker {
  position: absolute;
  left: -7px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--primary);
}

.timeline-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px 28px;
  box-shadow: var(--shadow-card);
}

.timeline-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 14px;
}

.timeline-card h3 {
  font-family: var(--font-display);
  font-size: 1.12rem;
  margin: 0 0 4px;
  font-weight: 600;
}
.timeline-card h3 .at { color: var(--primary); font-weight: 500; }

.timeline-sub {
  margin: 0;
  color: var(--text-faint);
  font-size: 0.88rem;
  font-style: italic;
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-faint);
  white-space: nowrap;
  margin: 0;
}
.timeline-date .sep { margin: 0 4px; }

.timeline-list {
  margin: 0;
  padding-left: 20px;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.timeline-list li { font-size: 0.96rem; }
.timeline-list strong { color: var(--text); font-weight: 600; }

/* ===== Projects ===== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 26px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.project-card:hover {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
  transform: translateY(-3px);
}

.project-icon {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
  margin-bottom: 18px;
}
.project-icon svg { width: 22px; height: 22px; }

.project-card h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin: 0 0 8px;
  font-weight: 600;
}
.project-card p {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.92rem;
}

/* ===== Education ===== */
.edu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.edu-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 26px 28px;
  box-shadow: var(--shadow-card);
}
.edu-card h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin: 0 0 8px;
  font-weight: 600;
}

.lang-row {
  display: grid;
  grid-template-columns: 90px 1fr 100px;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
  font-size: 0.9rem;
  color: var(--text-dim);
}
.lang-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
  display: block;
}
.lang-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 999px;
}
.lang-level { color: var(--text-faint); font-family: var(--font-mono); font-size: 0.8rem; text-align: right; }

/* ===== CTA ===== */
.cta-section { padding-bottom: 96px; }
.cta-box {
  text-align: center;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 64px 32px;
  box-shadow: var(--shadow-card);
}
.cta-box h2 {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3.4vw, 2rem);
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}
.cta-box p {
  color: var(--text-dim);
  margin: 0 0 28px;
}

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--border-soft);
  padding: 28px 0;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: center;
  justify-content: space-between;
  font-size: 0.86rem;
  color: var(--text-faint);
}
.footer-links { display: flex; gap: 20px; }
.footer-links a { color: var(--text-faint); text-decoration: none; }
.footer-links a:hover { color: var(--primary); }

/* ===== Responsive ===== */
@media (max-width: 600px) {
  .hero { padding: 72px 20px 56px; }
  .section { padding: 48px 20px; }
  .timeline { margin-left: 2px; }
  .timeline-item { padding-left: 28px; }
  .lang-row { grid-template-columns: 70px 1fr 90px; gap: 10px; }
}
