:root {
  /* Dark theme is the default */
  color-scheme: dark;
  --accent: #60a5fa;
  --accent-dark: #93c5fd;
  --ink: #e2e8f0;
  --ink-soft: #94a3b8;
  --line: #27324a;
  --bg: #0b1220;
  --bg-soft: #141c2f;
  --header-bg: rgba(11, 18, 32, 0.88);
  --radius: 10px;
  --max-width: 860px;
}

:root[data-theme="light"] {
  color-scheme: light;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --ink: #0f172a;
  --ink-soft: #475569;
  --line: #e2e8f0;
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --header-bg: rgba(255, 255, 255, 0.92);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.15s ease, color 0.15s ease;
}

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

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

h1, h2, h3, h4 {
  line-height: 1.25;
  color: var(--ink);
}

/* Header / nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(6px);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.5rem;
}

.nav-brand {
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
}

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

.nav-links a {
  color: var(--ink-soft);
  font-size: 0.95rem;
}
.nav-links a:hover { color: var(--accent); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  cursor: pointer;
}
.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.theme-toggle svg {
  width: 16px;
  height: 16px;
}
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: none; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--ink);
}

/* Hero */
.hero {
  padding: 4rem 1.5rem 3rem;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  margin: 0 0 0.5rem;
}

.hero-title {
  color: var(--accent-dark);
  font-weight: 600;
  font-size: 1.1rem;
  margin: 0 0 0.35rem;
}

.hero-sub {
  color: var(--ink-soft);
  margin: 0 0 1.5rem;
  font-size: 0.95rem;
}

.hero-summary {
  max-width: 680px;
  margin: 0 auto 2rem;
  color: var(--ink-soft);
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
}

.btn {
  display: inline-block;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-dark); text-decoration: none; }

.btn-outline {
  background: transparent;
  color: var(--accent-dark);
  border-color: var(--line);
}
.btn-outline:hover { border-color: var(--accent); text-decoration: none; }

.contact-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 1.1rem;
  list-style: none;
  padding: 0;
  margin: 0 0 2.25rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  list-style: none;
  padding: 1.5rem 0 0;
  margin: 0 auto;
  border-top: 1px solid var(--line);
  max-width: 560px;
}

.stat-row li {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.stat-row strong {
  font-size: 1.4rem;
  color: var(--ink);
}

.stat-row span {
  font-size: 0.8rem;
  color: var(--ink-soft);
}

/* Sections */
.section {
  padding: 3rem 1.5rem;
  border-top: 1px solid var(--line);
}

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

/* Experience */
.job {
  margin-bottom: 2.25rem;
}
.job:last-child { margin-bottom: 0; }

.job-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.job-head h3 {
  font-size: 1.15rem;
  margin: 0;
}

.job-loc {
  font-weight: 400;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.job-dates {
  color: var(--ink-soft);
  font-size: 0.88rem;
  white-space: nowrap;
}

.role {
  padding-left: 1rem;
  border-left: 2px solid var(--line);
  margin-bottom: 1.25rem;
}
.role:last-child { margin-bottom: 0; }

.role h4 {
  font-size: 1rem;
  margin: 0 0 0.5rem;
}

.role-track {
  display: block;
  font-weight: 400;
  color: var(--ink-soft);
  font-size: 0.88rem;
  margin-top: 0.15rem;
}

.role ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--ink-soft);
}

.role li {
  margin-bottom: 0.5rem;
}
.role li:last-child { margin-bottom: 0; }

/* Skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.skill-card {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
}

.skill-card h3 {
  font-size: 1rem;
  margin: 0 0 0.75rem;
  color: var(--accent-dark);
}

.skill-card dl {
  margin: 0;
}

.skill-card dt {
  font-weight: 600;
  font-size: 0.85rem;
  margin-top: 0.6rem;
}
.skill-card dt:first-child { margin-top: 0; }

.skill-card dd {
  margin: 0.15rem 0 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

/* Certifications */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.cert-card {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
}

.cert-card h3 {
  font-size: 0.98rem;
  margin: 0 0 0.3rem;
}

.cert-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

/* Achievements */
.achievements-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.achievements-list li {
  padding-left: 1rem;
  border-left: 2px solid var(--accent);
  color: var(--ink-soft);
}

.achievements-list strong {
  color: var(--ink);
}

/* Education */
.edu-card {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
}

.edu-card h3 {
  font-size: 1.02rem;
  margin: 0 0 0.3rem;
}

.edu-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

/* Contact */
.contact-section {
  text-align: center;
}

.contact-section p {
  color: var(--ink-soft);
  max-width: 480px;
  margin: 0 auto 1.5rem;
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 2rem 1.5rem;
  color: var(--ink-soft);
  font-size: 0.85rem;
  border-top: 1px solid var(--line);
}

/* Responsive */
@media (max-width: 700px) {
  .skills-grid,
  .cert-grid {
    grid-template-columns: 1fr;
  }

  .stat-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 0;
    display: none;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links li {
    width: 100%;
  }

  .nav-links a {
    display: block;
    padding: 0.75rem 1.5rem;
  }

  .job-head {
    flex-direction: column;
    align-items: flex-start;
  }
}
