:root {
  --bg: #ffffff;
  --bg-alt: #f4f6fb;
  --text: #16192b;
  --text-muted: #55596e;
  --border: #e4e7f0;
  --accent: #0b5fff;
  --accent-dark: #0842b8;
  --accent-soft: #eaf1ff;
  --card-bg: #ffffff;
  --header-bg: rgba(255, 255, 255, 0.85);
  --radius: 12px;
  --max-width: 1080px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1220;
    --bg-alt: #151933;
    --text: #eef0fb;
    --text-muted: #a7abc7;
    --border: #262b4a;
    --accent: #5b8dff;
    --accent-dark: #7fa4ff;
    --accent-soft: #1b2450;
    --card-bg: #171c38;
    --header-bg: rgba(15, 18, 32, 0.85);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

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

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.logo {
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text);
}
.logo span { color: var(--accent); }

.nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
}
.nav a:hover { color: var(--text); }

.nav-cta {
  background: var(--accent);
  color: #fff !important;
  padding: 8px 16px;
  border-radius: 8px;
}
.nav-cta:hover { background: var(--accent-dark); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text);
  border-radius: 2px;
}

/* Hero */
.hero {
  padding: 96px 0 64px;
  background: radial-gradient(circle at 20% 20%, var(--accent-soft), transparent 60%);
}

.eyebrow {
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.85rem;
  margin: 0 0 12px;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin: 0 0 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.hero-lede {
  max-width: 640px;
  color: var(--text-muted);
  font-size: 1.1rem;
  margin: 0 0 32px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 32px;
}

.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--accent);
  color: #fff !important;
}
.btn-primary:hover { background: var(--accent-dark); }
.btn-ghost {
  background: transparent;
  color: var(--text) !important;
  border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent) !important; }

.hero-badges {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0;
  margin: 0;
}
.hero-badges li {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--card-bg);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 999px;
}

/* Sections */
.section { padding: 72px 0; }
.section-alt { background: var(--bg-alt); }

.section-title {
  font-size: 1.6rem;
  font-weight: 800;
  margin: 0 0 32px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.section-title span {
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.section-intro {
  color: var(--text-muted);
  margin: -16px 0 32px;
  max-width: 640px;
}

.section-note {
  margin-top: 28px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* About */
.about-grid {
  display: grid;
  gap: 20px;
  max-width: 760px;
}
.about-grid p { margin: 0; color: var(--text-muted); }

/* Timeline */
.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  border-left: 2px solid var(--border);
}
.timeline-item {
  position: relative;
  padding: 0 0 36px 28px;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg-alt);
}
.timeline-date {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}
.timeline-body h3 {
  margin: 4px 0 2px;
  font-size: 1.1rem;
}
.timeline-org {
  margin: 0 0 8px;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}
.timeline-body p:last-child {
  margin: 0;
  color: var(--text-muted);
}

/* Skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.skill-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.skill-card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}
.skill-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* Certifications */
.highlight-badge {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 28px;
}
.highlight-badge strong { color: var(--accent-dark); }
.highlight-badge span { color: var(--text-muted); font-size: 0.9rem; }

.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.cert-item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.cert-item h4 {
  margin: 0 0 4px;
  font-size: 0.95rem;
}
.cert-item span {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Projects */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}
.project-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.project-card--placeholder {
  border-style: dashed;
}
.project-card h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}
.project-field {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 8px;
}
.project-card-link {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.88rem;
  font-weight: 600;
}

/* Project detail pages */
.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 24px 0 0;
}
.breadcrumb a { color: var(--accent); }
.project-detail-hero { padding: 24px 0 0; }
.project-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 28px 0;
}
.project-meta-item {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.project-meta-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 4px;
}
.project-body h3 {
  margin: 32px 0 8px;
  font-size: 1.15rem;
}
.project-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 20px 0 8px;
}
.project-gallery img {
  width: 100%;
  display: block;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  object-fit: cover;
  aspect-ratio: 4 / 3;
}
.project-gallery-empty {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.back-to-projects { margin-top: 40px; }

.solution-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin: 24px 0 8px;
}
.solution-cards .card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.solution-cards .card h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
  color: var(--accent);
}
.solution-cards .card .card-meta {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0 0 12px;
}
.solution-cards .card p {
  font-size: 0.92rem;
  margin: 0 0 10px;
}
.solution-cards .card p:last-child {
  margin: 0;
}

.project-card p:last-child {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* Community */
.community-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
  max-width: 640px;
}
.community-list li {
  position: relative;
  padding-left: 22px;
  color: var(--text-muted);
}
.community-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.contact-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.contact-item:hover { border-color: var(--accent); }
.contact-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.contact-value {
  font-weight: 600;
  color: var(--text);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
}
.footer-inner p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
}

/* Responsive nav */
@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .nav {
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 8px 24px 16px;
    display: none;
  }
  .nav.open { display: flex; }
  .nav a {
    width: 100%;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
  }
  .nav-cta {
    margin-top: 8px;
    text-align: center;
  }
  .hero { padding: 72px 0 48px; }
}
