:root {
  --bg: #050816;
  --bg-alt: #0b1020;
  --bg-elevated: #111827;
  --text: #e5e7eb;
  --text-muted: #9ca3af;
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.15);
  --border-subtle: #1f2937;
  --card-radius: 18px;
  --shadow-soft: 0 18px 40px rgba(15, 23, 42, 0.55);
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --transition-fast: 180ms ease-out;
}

/* Light theme variables, toggled via .theme-light on body */
body.theme-light {
  --bg: #f3f4f6;
  --bg-alt: #ffffff;
  --bg-elevated: #ffffff;
  --text: #111827;
  --text-muted: #6b7280;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.1);
  --border-subtle: #e5e7eb;
  --shadow-soft: 0 8px 24px rgba(148, 163, 184, 0.45);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  background: radial-gradient(circle at top left, #0f172a 0, var(--bg) 40%, #020617 100%);
  color: var(--text);
}

/* Smooth transitions when toggling theme */
body,
.site-header,
.section,
.hero,
.card,
.btn,
.main-nav {
  transition: background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  background: var(--bg-elevated);
  color: var(--accent);
  padding: 0.75rem 1rem;
  z-index: 1000;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
  border-radius: 999px;
}

/* Layout */
.container {
  width: min(1120px, 100% - 2.5rem);
  margin: 0 auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(to bottom, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.85));
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 0;
}

/* Brand */
.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: radial-gradient(circle at top left, var(--accent), #4f46e5);
  color: #0b1020;
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: 0 6px 16px rgba(56, 189, 248, 0.7);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-weight: 600;
  letter-spacing: 0.02em;
}

.brand-role {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Navigation */
.main-nav ul {
  display: flex;
  align-items: center;
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.main-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--text-muted);
  position: relative;
}

.main-nav a::after {
  content: "";
  position: absolute;
  inset: auto 0 -0.25rem;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #4f46e5);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 140ms ease-out;
}

.main-nav a:hover,
.main-nav a:focus-visible {
  color: var(--text);
  background: rgba(15, 23, 42, 0.6);
}
.main-nav a:hover::after,
.main-nav a:focus-visible::after {
  transform: scaleX(1);
}

/* Theme toggle */
.theme-toggle {
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.65);
  border-radius: 999px;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.theme-toggle:hover {
  border-color: var(--accent);
}
.theme-icon {
  pointer-events: none;
}

/* Hamburger menu for mobile */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 0.18rem;
  background: transparent;
  border: none;
  cursor: pointer;
}
.menu-bar {
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: var(--text);
}

/* Hero */
.hero {
  padding: 4.5rem 0 2.5rem;
}

.hero-inner {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.hero-text {
  max-width: 700px;
}

.hero-eyebrow {
  font-size: 0.9rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.6rem;
}

.hero h1 {
  font-size: clamp(2rem, 3vw + 1rem, 2.8rem);
  line-height: 1.15;
  margin: 0 0 1rem;
}

.hero-summary {
  margin: 0 0 1.4rem;
  color: var(--text-muted);
  font-size: 0.98rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.93rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn.primary {
  background: linear-gradient(135deg, var(--accent), #4f46e5);
  color: #f9fafb;
  box-shadow: 0 14px 32px rgba(37, 99, 235, 0.6);
}
.btn.primary:hover {
  box-shadow: 0 18px 40px rgba(37, 99, 235, 0.7);
}
.btn.secondary {
  background: transparent;
  color: var(--accent);
  border-color: rgba(148, 163, 184, 0.6);
}
.btn.secondary:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* Hero meta */
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.hero-meta a {
  color: inherit;
  text-decoration: none;
}
.hero-meta a:hover {
  color: var(--accent);
}

/* Sections */
.section {
  padding: 3rem 0;
  background: transparent;
}
.section.alt {
  background: linear-gradient(to bottom, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.92));
}
.section-inner {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.section-header h2 {
  font-size: 1.4rem;
  margin: 0 0 0.4rem;
}
.section-header p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* About */
.about-body p {
  margin-top: 0;
  line-height: 1.6;
  color: var(--text-muted);
}

/* Chips */
.chip-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.chip {
  padding: 0.4rem 0.75rem;
  font-size: 0.83rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-muted);
}

/* Timeline */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
}
.timeline-item {
  padding: 1.3rem 1.3rem 1.2rem;
  border-radius: var(--card-radius);
  border: 1px solid var(--border-subtle);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.98));
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}
.timeline-item::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(56, 189, 248, 0.14), transparent 55%);
  opacity: 0.8;
  pointer-events: none;
}
.timeline-item h3 {
  margin: 0 0 0.2rem;
  font-size: 1.05rem;
}
.timeline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.9rem;
  font-size: 0.83rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.timeline-company {
  font-weight: 500;
}
.timeline-item ul {
  margin: 0.3rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.timeline-item li + li {
  margin-top: 0.25rem;
}

/* Cards */
.card {
  border-radius: var(--card-radius);
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow-soft);
}

/* Education */
.education-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.2rem;
}
.edu-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Certifications */
.cert-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.2rem;
}
.cert-list h3 {
  margin-top: 0;
  margin-bottom: 0.4rem;
}
.cert-list p {
  margin: 0;
  color: var(--text-muted);
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.2rem;
}
.contact-card h3 {
  margin-top: 0;
}
.contact-list {
  list-style: none;
  margin: 0.2rem 0 0.6rem;
  padding: 0;
  font-size: 0.9rem;
}
.contact-list li {
  display: flex;
  flex-direction: column;
  margin-bottom: 0.4rem;
}
.contact-list span:first-child {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.contact-list a {
  color: var(--accent);
  text-decoration: none;
}
.contact-list a:hover {
  text-decoration: underline;
}
.contact-note {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 1rem 0 1.5rem;
  background: rgba(15, 23, 42, 0.96);
}
.footer-inner {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }

  .main-nav {
    position: absolute;
    inset-inline: 0;
    top: 100%;
    background: rgba(15, 23, 42, 0.98);
    border-bottom: 1px solid var(--border-subtle);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 150ms ease-out, transform 150ms ease-out, visibility 150ms ease-out;
  }

  .main-nav.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .main-nav ul {
    flex-direction: column;
    align-items: stretch;
    padding: 0.5rem 1.25rem 0.75rem;
  }

  .main-nav a,
  .theme-toggle {
    justify-content: flex-start;
    width: 100%;
  }

  .hero {
    padding-top: 3.5rem;
  }
}