:root {
  --bg: #f6f8fc;
  --bg-spot-1: #dbeafe;
  --bg-spot-2: #e0e7ff;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #0f172a;
  --muted: #475569;
  --primary: #2563eb;
  --primary-text: #ffffff;
  --border: #dbe4f0;
  --link: #1d4ed8;
  --link-hover: #1e40af;
  --eyebrow: #1e40af;
  --header-bg: rgba(246, 248, 252, 0.88);
  --timeline-line: #bfd0ea;
  --shadow-sm: 0 10px 22px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 18px 42px rgba(15, 23, 42, 0.14);
}

[data-theme="dark"] {
  --bg: #0b1020;
  --bg-spot-1: #1d2c60;
  --bg-spot-2: #18264e;
  --surface: #111831;
  --surface-soft: #151f3d;
  --text: #e6ebff;
  --muted: #a4b1d4;
  --primary: #5ea0ff;
  --primary-text: #061126;
  --border: #253156;
  --link: #9bc0ff;
  --link-hover: #bfdbfe;
  --eyebrow: #9bc0ff;
  --header-bg: rgba(11, 16, 32, 0.88);
  --timeline-line: #2e3f73;
  --shadow-sm: 0 10px 22px rgba(2, 6, 23, 0.35);
  --shadow-md: 0 18px 42px rgba(2, 6, 23, 0.48);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 460px at 20% -10%, var(--bg-spot-1) 0%, transparent 58%),
    radial-gradient(900px 360px at 90% -15%, var(--bg-spot-2) 0%, transparent 58%),
    var(--bg);
  line-height: 1.62;
}

.container {
  width: min(1080px, 92vw);
  margin: 0 auto;
}

.lead {
  max-width: 72ch;
}

.site-header {
  position: sticky;
  top: 0;
  backdrop-filter: blur(10px);
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  z-index: 30;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 66px;
  gap: 1rem;
}

.brand {
  color: var(--text);
  font-weight: 800;
  letter-spacing: -0.02em;
  text-decoration: none;
}

nav {
  display: flex;
  align-items: center;
  gap: .95rem;
  flex-wrap: wrap;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  transition: color .2s ease;
}

nav a:hover { color: var(--text); }

.theme-toggle {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: .65rem;
  padding: .35rem .62rem;
  font-weight: 600;
  cursor: pointer;
}

.hero { padding: 88px 0 36px; }

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .78rem;
  color: var(--eyebrow);
  font-weight: 700;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: .45rem 0 .95rem;
  max-width: 20ch;
}

.lead {
  font-size: 1.06rem;
  color: var(--muted);
  max-width: 74ch;
  margin: 0;
}

.hero-actions {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}

.btn {
  display: inline-block;
  background: var(--primary);
  color: var(--primary-text);
  padding: .66rem .95rem;
  border-radius: .74rem;
  text-decoration: none;
  font-weight: 700;
  border: 1px solid transparent;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px color-mix(in srgb, var(--primary) 35%, transparent);
}

.btn-outline {
  background: transparent;
  color: var(--link);
  border-color: var(--border);
}

.btn-outline:hover {
  background: color-mix(in srgb, var(--surface) 85%, var(--primary) 15%);
  color: var(--text);
}

.btn-small { padding: .42rem .78rem; border-radius: .65rem; }

.icon-link {
  display: inline-flex;
  align-items: center;
  gap: .52rem;
  padding: .62rem .9rem;
  border: 1px solid transparent;
  border-radius: .78rem;
  color: #ffffff;
  text-decoration: none;
  font-weight: 700;
  box-shadow: 0 10px 22px rgba(2, 6, 23, 0.34);
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}

.icon-link svg { display: block; }
.icon-link span { font-size: 1rem; letter-spacing: 0.01em; }

.icon-github {
  background: #181717;
  border-color: #2f2f30;
}

.icon-linkedin {
  background: #0a66c2;
  border-color: #0a66c2;
}

.icon-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(2, 6, 23, 0.42);
  filter: brightness(1.06);
}

.section { padding: 34px 0; }
.section h2 {
  margin: 0 0 1.05rem;
  font-size: 1.42rem;
  letter-spacing: -0.015em;
}

.cards {
  display: grid;
  gap: 1rem;
}

.project-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-soft) 100%);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.15rem 1.2rem;
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--border) 60%, var(--primary) 40%);
}

.card h3 {
  margin: 0;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
}

.meta {
  margin: .24rem 0 .72rem;
  color: var(--muted);
  font-size: .92rem;
}

p, li {
  font-size: 1rem;
}

ul { padding-left: 1.1rem; margin: 0; }
li + li { margin-top: .4rem; }

.timeline {
  display: grid;
  gap: .9rem;
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  left: .4rem;
  top: .3rem;
  bottom: .3rem;
  width: 2px;
  background: var(--timeline-line);
}

.timeline-item {
  margin-left: .9rem;
}

.edu-list {
  display: grid;
  gap: .72rem;
}

.edu-list > div {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: .88rem;
  padding: .85rem 1rem;
}

.edu-list h3 { margin: 0 0 .25rem; }
.edu-list p { margin: 0; color: var(--muted); }

a { color: var(--link); }
a:hover { color: var(--link-hover); }

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 2rem;
  padding: 1rem 0 2rem;
}

.site-footer .container {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

@media (max-width: 980px) {
  .project-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .site-header {
    position: static;
    backdrop-filter: none;
  }

  .nav {
    flex-direction: column;
    align-items: flex-start;
    gap: .7rem;
    padding: .75rem 0;
  }

  nav {
    gap: .5rem;
    width: 100%;
  }

  nav a,
  .theme-toggle {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: .15rem .2rem;
  }

  .theme-toggle {
    min-width: 38px;
    min-height: 38px;
    justify-content: center;
    padding: 0;
    font-size: 0;
    line-height: 1;
  }

  .theme-toggle::before {
    content: attr(data-icon);
    font-size: 1rem;
  }

  .container { width: min(980px, 94vw); }
  .section { padding: 26px 0; }

  .hero {
    padding-top: 34px;
    padding-bottom: 20px;
  }

  h1 {
    font-size: clamp(1.75rem, 8vw, 2.1rem);
    margin-bottom: .72rem;
  }

  .lead {
    font-size: 1rem;
  }

  .hero-actions {
    gap: .55rem;
  }

  .btn,
  .icon-link {
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }

  .project-grid { grid-template-columns: 1fr; }
  .timeline::before { display: none; }
  .timeline-item { margin-left: 0; }

  .card {
    padding: 1rem;
    border-radius: .9rem;
  }
}
