:root {
  --bg: #f7f9fb;
  --surface: #ffffff;
  --text: #1c2b33;
  --muted: #5a6b74;
  --accent: #2a9d8f;
  --accent-dark: #21867a;
  --border: #e2e8ec;
  --shadow: 0 4px 18px rgba(20, 40, 50, 0.08);
  --radius: 12px;
  --font: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

html[data-theme="dark"] {
  --bg: #10171c;
  --surface: #182229;
  --text: #e7edf1;
  --muted: #9db0ba;
  --accent: #34c6b4;
  --accent-dark: #2aa899;
  --border: #26333c;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 70px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s ease, color 0.3s ease;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1040px; margin: 0 auto; padding: 0 1.25rem; }

/* HEADER / NAV */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { font-weight: 700; font-size: 1.15rem; color: var(--text); }
.brand:hover { text-decoration: none; color: var(--accent); }
.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 1.4rem;
}
.nav-links a { color: var(--muted); font-weight: 500; font-size: 0.95rem; }
.nav-links a:hover { color: var(--accent); text-decoration: none; }

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 34px; height: 34px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  width: 24px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: 0.3s;
}

/* HERO */
.hero {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #fff;
  padding: 4rem 1.25rem;
}
.hero-inner {
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 2.5rem;
  flex-wrap: wrap;
}
.hero-avatar {
  flex-shrink: 0;
  width: 150px; height: 150px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: 3px solid rgba(255, 255, 255, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: 2px;
}
.hero-text { flex: 1; min-width: 280px; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.8rem;
  opacity: 0.9;
  margin-bottom: 0.25rem;
}
.hero-text h1 { font-size: 2.75rem; line-height: 1.1; margin-bottom: 0.5rem; }
.tagline { font-size: 1.1rem; font-weight: 500; opacity: 0.95; margin-bottom: 1rem; }
.summary { max-width: 640px; opacity: 0.95; margin-bottom: 1.5rem; }

.hero-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.btn {
  display: inline-block;
  padding: 0.65rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary { background: #fff; color: var(--accent-dark); }
.btn-ghost { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,0.7); }

.hero-meta {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: 0.95rem;
}
.hero-meta a { color: #fff; text-decoration: underline; }

/* SECTIONS */
.section { padding: 3.5rem 0; border-bottom: 1px solid var(--border); }
.section:last-child { border-bottom: none; }
.section-title {
  font-size: 1.75rem;
  margin-bottom: 1.75rem;
  position: relative;
  padding-bottom: 0.5rem;
}
.section-title::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 48px; height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

/* SKILLS */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}
.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.skill-card h3 { font-size: 1.05rem; margin-bottom: 0.75rem; color: var(--accent-dark); }
html[data-theme="dark"] .skill-card h3 { color: var(--accent); }

.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tags li {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent-dark);
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
}
html[data-theme="dark"] .tags li { color: var(--accent); }
.tags.small li { font-size: 0.78rem; padding: 0.2rem 0.6rem; }

/* PROJECTS */
.filters { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 1.5rem; }
.filter-btn {
  padding: 0.45rem 1.1rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
}
.filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.filter-btn.is-active { background: var(--accent); color: #fff; border-color: var(--accent); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  display: flex;
  flex-direction: column;
}
.project-card:hover { transform: translateY(-4px); box-shadow: 0 10px 26px rgba(20,40,50,0.14); }
.project-card .tags.small { margin-bottom: 1rem; }
.repo-link {
  margin-top: auto;
  align-self: flex-start;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--accent-dark);
}
html[data-theme="dark"] .repo-link { color: var(--accent); }
.repo-link:hover { text-decoration: none; opacity: 0.8; }
.chip {
  display: inline-block;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  margin-bottom: 0.75rem;
}
html[data-theme="dark"] .chip { color: var(--accent); }
.project-card h3 { font-size: 1.15rem; margin-bottom: 0.5rem; }
.project-card p { color: var(--muted); font-size: 0.95rem; margin-bottom: 0.9rem; }

/* TIMELINE */
.timeline { position: relative; padding-left: 1.5rem; }
.timeline::before {
  content: "";
  position: absolute;
  left: 5px; top: 6px; bottom: 6px;
  width: 2px;
  background: var(--border);
}
.timeline-item { position: relative; padding-bottom: 2rem; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -1.5rem; top: 6px;
  width: 12px; height: 12px;
  background: var(--accent);
  border: 2px solid var(--surface);
  border-radius: 50%;
}
.timeline-head {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: baseline;
}
.timeline-head h3 { font-size: 1.1rem; }
.timeline-date { color: var(--muted); font-size: 0.85rem; font-weight: 500; white-space: nowrap; }
.timeline-org { color: var(--accent-dark); font-size: 0.9rem; font-weight: 500; margin-bottom: 0.5rem; }
html[data-theme="dark"] .timeline-org { color: var(--accent); }
.timeline-item ul { padding-left: 1.1rem; color: var(--muted); font-size: 0.94rem; }
.timeline-item li { margin-bottom: 0.35rem; }

/* EDUCATION */
.edu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}
.edu-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.edu-card h3 { font-size: 1.05rem; margin-bottom: 0.35rem; }
.edu-org { color: var(--muted); font-size: 0.92rem; margin-bottom: 0.5rem; }
.edu-date { color: var(--accent-dark); font-size: 0.82rem; font-weight: 600; }
html[data-theme="dark"] .edu-date { color: var(--accent); }

/* PUBLICATIONS */
.pub-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
}
.pub-card h3 { font-size: 1.05rem; margin-bottom: 0.6rem; color: var(--accent-dark); }
html[data-theme="dark"] .pub-card h3 { color: var(--accent); }

/* CONTACT */
.contact-lead { color: var(--muted); max-width: 640px; margin-bottom: 1.5rem; }
.contact-grid { display: flex; flex-wrap: wrap; gap: 1rem; }
.contact-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1.25rem;
  color: var(--text);
  font-weight: 500;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.contact-item:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--accent); color: var(--accent); }

/* FOOTER */
.site-footer {
  text-align: center;
  padding: 2rem 1.25rem;
  color: var(--muted);
  font-size: 0.9rem;
}

/* RESPONSIVE */
@media (max-width: 760px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.25rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding-top: 0; padding-bottom: 0;
  }
  .nav-links.open { max-height: 420px; padding-top: 1rem; padding-bottom: 1rem; }
  .nav-links li { width: 100%; }
  .hero-text h1 { font-size: 2.1rem; }
  .hero { padding: 3rem 1.25rem; text-align: center; }
  .hero-inner { justify-content: center; }
  .hero-actions, .hero-meta { justify-content: center; }
}

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