:root {
  --bg: #faf9f6;
  --surface: #f1efe9;
  --surface-2: #e9e6de;
  --ink: #1b1c19;
  --muted: #6b6c62;
  --accent: #2f6f5e;
  --accent-warm: #b97a3d;
  --accent-ink: #f4f8f6;
  --line: #ddd9cf;
  --font-display: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14161a;
    --surface: #1b1e22;
    --surface-2: #24272c;
    --ink: #f1efe9;
    --muted: #9a9d95;
    --accent: #59b39a;
    --accent-warm: #e0a868;
    --accent-ink: #0d1613;
    --line: #2b2e32;
  }
}

:root[data-theme="dark"] {
  --bg: #14161a;
  --surface: #1b1e22;
  --surface-2: #24272c;
  --ink: #f1efe9;
  --muted: #9a9d95;
  --accent: #59b39a;
  --accent-warm: #e0a868;
  --accent-ink: #0d1613;
  --line: #2b2e32;
}

* { box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  margin: 0;
}

.toolbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem clamp(1.25rem, 5vw, 2.5rem);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.toolbar a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.86rem;
}

.toolbar a:hover { color: var(--ink); }

.toolbar button {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
  cursor: pointer;
}

.sheet {
  max-width: 780px;
  margin: 0 auto;
  padding: clamp(1.5rem, 5vw, 3rem) clamp(1.25rem, 5vw, 2.5rem) 4rem;
}

.cv-header {
  margin-bottom: 2rem;
}

.cv-header h1 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2rem, 5vw, 2.75rem);
  margin: 0 0 0.3rem;
  letter-spacing: -0.01em;
}

.cv-header .title {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--accent);
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  margin: 0 0 1rem;
}

.contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
}

.contact-row a { color: inherit; text-decoration: none; }
.contact-row a:hover { color: var(--accent); }

.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin: 1.75rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.stat-row div { min-width: 6rem; }

.stat-row dt {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.stat-row dd {
  margin: 0.15rem 0 0;
  font-size: 0.76rem;
  color: var(--muted);
}

section.cv-section {
  margin-top: 2.25rem;
}

.cv-section h2 {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
}

.cv-summary p { color: var(--ink); max-width: none; }

.entry { margin-bottom: 1.5rem; }
.entry:last-child { margin-bottom: 0; }

.entry-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}

.entry-role {
  font-weight: 600;
  font-size: 0.98rem;
}

.entry-org { color: var(--accent); font-weight: 500; }

.entry-meta {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--muted);
  white-space: nowrap;
}

.entry ul {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.entry ul li { margin-bottom: 0.35rem; }
.entry ul li:last-child { margin-bottom: 0; }
.entry ul li strong { color: var(--ink); }

.entry p.entry-desc {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  max-width: none;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem 2rem;
}

.edu-entry, .cert-entry { margin-bottom: 1rem; }
.edu-entry:last-child, .cert-entry:last-child { margin-bottom: 0; }

.edu-what { font-weight: 600; font-size: 0.92rem; }
.edu-where { color: var(--muted); font-size: 0.86rem; }
.edu-when { font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); }

.skill-group { margin-bottom: 0.9rem; }
.skill-group:last-child { margin-bottom: 0; }

.skill-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-bottom: 0.35rem;
}

.skill-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.skill-tag {
  font-size: 0.8rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
}

footer.cv-footer {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
}

@media (max-width: 640px) {
  .grid-2 { grid-template-columns: 1fr; }
  .entry-meta { white-space: normal; }
}

@media print {
  .toolbar { display: none; }
  body { background: #fff; color: #111; font-size: 12.5px; }
  .sheet { max-width: none; padding: 0 0.4in; }
  a { color: inherit; text-decoration: none; }
  .cv-header .title, .entry-org, .cv-section h2, .stat-row dt { color: #2f6f5e !important; }
  section.cv-section { break-inside: avoid-page; }
  .entry { break-inside: avoid-page; }
}
