:root {
  --bg: #ffffff;
  --bg-subtle: #f6f7fb;
  --bg-card: #ffffff;
  --text: #1a1d29;
  --text-muted: #5b6272;
  --accent: #2f5fdb;
  --accent-dark: #1e40af;
  --accent-soft: #eaf0ff;
  --border: #e5e7eb;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
  --radius: 12px;
  --max-width: 880px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161f;
    --bg-subtle: #1b1e2a;
    --bg-card: #1b1e2a;
    --text: #eceef3;
    --text-muted: #9aa0b4;
    --accent: #7c9dfc;
    --accent-dark: #a9c0ff;
    --accent-soft: #202847;
    --border: #2b2f40;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

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

img { max-width: 100%; display: block; }

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

/* Header / nav */
header.site-header {
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  z-index: 10;
}

.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.nav-name {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}

nav.site-nav {
  display: flex;
  gap: 24px;
  font-size: 0.95rem;
}

nav.site-nav a { color: var(--text-muted); font-weight: 500; }
nav.site-nav a:hover { color: var(--accent); text-decoration: none; }

/* Hero */
.hero {
  padding: 56px 0 40px;
}

.hero-inner {
  display: flex;
  gap: 32px;
  align-items: center;
}

.hero-photo {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: var(--shadow);
}

.hero-text h1 {
  margin: 0 0 6px;
  font-size: 1.9rem;
}

.hero-headline {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin: 0 0 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
}

.badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
}

.hero-actions {
  margin-top: 18px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.92rem;
}

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

.btn-secondary {
  background: var(--bg-subtle);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--accent); text-decoration: none; }

/* Sections */
section { padding: 36px 0; border-top: 1px solid var(--border); }
section:first-of-type { border-top: none; }

h2.section-title {
  font-size: 1.3rem;
  margin: 0 0 20px;
}

.about-text { color: var(--text-muted); max-width: 68ch; }

/* Cards / project grid */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card h3 { margin: 0; font-size: 1.05rem; }
.card .card-meta { color: var(--text-muted); font-size: 0.82rem; }
.card p { margin: 0; color: var(--text-muted); font-size: 0.92rem; flex-grow: 1; }
.card .card-link { font-weight: 600; font-size: 0.88rem; }

/* Tags */
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.78rem;
  padding: 3px 10px;
  border-radius: 999px;
}

/* Timeline entries (education / experience / volunteering) */
.entry { margin-bottom: 18px; }
.entry:last-child { margin-bottom: 0; }
.entry-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.entry-title { font-weight: 700; }
.entry-sub { font-style: italic; color: var(--text-muted); font-size: 0.92rem; }
.entry-meta { color: var(--text-muted); font-size: 0.88rem; white-space: nowrap; }
.entry p { margin: 6px 0 0; color: var(--text-muted); font-size: 0.92rem; }

/* Skills groups */
.skill-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.skill-group h3 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin: 0 0 10px; }

/* Project detail page */
.breadcrumb { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 16px; }
.project-header h1 { margin: 0 0 6px; font-size: 1.6rem; }
.project-header .card-meta { margin-bottom: 16px; }
.project-links { display: flex; gap: 12px; margin: 18px 0; flex-wrap: wrap; }
.project-body p { color: var(--text-muted); }
.project-body h2 { font-size: 1.05rem; margin: 24px 0 8px; }
.trade-offs {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-top: 20px;
}
.trade-offs h2 { margin-top: 0; }

/* Footer */
footer.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0 48px;
  color: var(--text-muted);
  font-size: 0.88rem;
}
.footer-links { display: flex; gap: 16px; margin-bottom: 10px; flex-wrap: wrap; }

@media (max-width: 640px) {
  .hero-inner { flex-direction: column; text-align: center; }
  .entry-row { flex-direction: column; gap: 2px; }
  .nav-row { flex-direction: column; gap: 10px; align-items: flex-start; }
}
