:root {
  --bg: #17140f;
  --bg-elev: #211c16;
  --text: #f2ead9;
  --muted: #a89b84;
  --accent: #6ea8fe;
  --border: #362f22;
  --radius: 14px;
  --nav-bg: #4b4b4d;
  --nav-bg-elev: #5a5a5c;
  --nav-text: #f4f4f4;
  --nav-text-muted: #cfcfcf;
  --nav-border: #616163;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f7f8fa;
    --bg-elev: #ffffff;
    --text: #14171c;
    --muted: #5b6472;
    --accent: #2f6fed;
    --border: #e6e8eb;
  }
}
:root[data-theme="dark"] {
  --bg: #17140f;
  --bg-elev: #211c16;
  --text: #f2ead9;
  --muted: #a89b84;
  --accent: #6ea8fe;
  --border: #362f22;
}
:root[data-theme="light"] {
  --bg: #f7f8fa;
  --bg-elev: #ffffff;
  --text: #14171c;
  --muted: #5b6472;
  --accent: #2f6fed;
  --border: #e6e8eb;
}
* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.topnav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--nav-border);
}
.topnav-bar {
  max-width: 780px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.topnav-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.nav-toggle,
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--nav-border);
  background: transparent;
  color: var(--nav-text);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.nav-toggle:hover,
.theme-toggle:hover { background: var(--nav-bg-elev); }
.topnav .brand {
  color: var(--nav-text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}
.nav-menu {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--nav-border);
}
.nav-menu[hidden] { display: none; }
.nav-menu a {
  color: var(--nav-text);
  text-decoration: none;
  font-size: 1rem;
  padding: 16px 20px;
  max-width: 780px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
  border-bottom: 1px solid var(--nav-border);
}
.nav-menu a:hover { background: var(--nav-bg-elev); color: var(--accent); }
section[id], header[id] {
  scroll-margin-top: 76px;
}
.wrap {
  max-width: 780px;
  margin: 0 auto;
  padding: 40px 20px 96px;
}
header.hero {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 44px;
}
.avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: #0b0d10;
}
h1 {
  font-size: 1.9rem;
  margin: 0;
  letter-spacing: -0.02em;
}
.role-line {
  color: var(--text);
  font-size: 1.05rem;
  margin: 2px 0 0;
}
.location-line {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 2px 0 0;
}
.tagline {
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.55;
  margin: 8px 0 0;
  max-width: 62ch;
}
section {
  margin-bottom: 44px;
}
h2 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 18px;
}
p.body {
  line-height: 1.65;
  color: var(--text);
  max-width: 64ch;
  margin: 0;
}

.entry {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 0;
  border-top: 1px solid var(--border);
}
.entry:first-of-type { border-top: none; padding-top: 0; }
.entry-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.entry-title {
  font-size: 1.02rem;
  font-weight: 600;
  margin: 0;
}
.entry-title a { color: inherit; text-decoration: none; }
.entry-title a:hover { color: var(--accent); }
.entry-org { color: var(--accent); font-weight: 500; }
.entry-dates {
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.entry ul {
  margin: 4px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.entry ul li::marker { color: var(--accent); }

.skill-group {
  margin-bottom: 14px;
}
.skill-group:last-child { margin-bottom: 0; }
.skill-group-label {
  font-size: 0.82rem;
  color: var(--text);
  font-weight: 600;
  margin: 0 0 8px;
}
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag {
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--muted);
}

.cert-list, .edu-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.cert-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.92rem;
  flex-wrap: wrap;
}
.cert-date { color: var(--muted); font-size: 0.82rem; white-space: nowrap; }

.edu-item h3 {
  margin: 0 0 2px;
  font-size: 0.98rem;
}
.edu-item .entry-dates { display: block; margin-bottom: 4px; }
.edu-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  text-decoration: none;
  font-size: 0.92rem;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.links a:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}
.note {
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--muted);
}
footer {
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
  padding-top: 24px;
}

/* Project case-study pages */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.88rem;
  margin-bottom: 28px;
}
.back-link:hover { color: var(--accent); }
.project-role {
  display: inline-block;
  font-size: 0.78rem;
  color: var(--accent);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  border-radius: 999px;
  padding: 4px 12px;
  margin-bottom: 10px;
  width: fit-content;
}
.callout {
  border: 1px solid var(--border);
  background: var(--bg-elev);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.callout p { margin: 0; }
.decision {
  padding: 16px 0;
  border-top: 1px solid var(--border);
}
.decision:first-of-type { border-top: none; padding-top: 0; }
.decision h3 {
  font-size: 0.98rem;
  margin: 0 0 6px;
}
.decision p {
  margin: 0;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.6;
}
