:root {
  --bg: #f7f7f4;
  --surface: #ffffff;
  --text: #16181d;
  --muted: #5d6370;
  --line: #e2e2dc;
  --accent: #0f7b5f;
  --accent-ink: #ffffff;
  --accent-soft: #e3f2ec;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 10px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101215;
    --surface: #171a1f;
    --text: #e8e9ec;
    --muted: #9aa0ab;
    --line: #2a2e35;
    --accent: #3ccf9f;
    --accent-ink: #0b1210;
    --accent-soft: #15302a;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px;
  background: var(--text); color: var(--bg); font-family: var(--mono); font-size: 13px; letter-spacing: .5px;
}
.brand-name { font-family: var(--mono); font-size: 14px; font-weight: 500; }
nav { display: flex; gap: 22px; }
nav a { color: var(--muted); font-size: 15px; }
nav a:hover { color: var(--text); text-decoration: none; }

/* Hero */
.hero { padding: 88px 24px 72px; display: grid; grid-template-columns: 1.15fr 1fr; gap: 56px; align-items: center; }
.hero > :not(.testlog) { grid-column: 1; }
.testlog { grid-column: 2; grid-row: 1 / span 4; }
.eyebrow { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; color: var(--muted); font-size: 15px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
h1 { font-size: clamp(40px, 6vw, 64px); line-height: 1.05; letter-spacing: -0.03em; margin: 0 0 20px; }
.lede { font-size: 19px; color: var(--muted); margin: 0 0 32px; max-width: 34em; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 11px 20px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font-weight: 600; font-size: 15px;
  transition: transform .15s ease, border-color .15s ease;
}
.btn:hover { text-decoration: none; border-color: var(--muted); transform: translateY(-1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { border-color: var(--accent); filter: brightness(1.05); }
.btn-lg { padding: 14px 26px; font-size: 16px; }

/* Test log card */
.testlog {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  font-family: var(--mono); font-size: 13px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 12px 32px -12px rgba(0,0,0,.12);
}
.testlog-head, .testlog-foot { display: flex; justify-content: space-between; padding: 12px 16px; color: var(--muted); }
.testlog-head { border-bottom: 1px solid var(--line); }
.testlog-foot { border-top: 1px solid var(--line); color: var(--accent); }
.testlog ol { list-style: none; margin: 0; padding: 8px 0; }
.testlog li { padding: 9px 16px; display: grid; grid-template-columns: auto 1fr; column-gap: 12px; line-height: 1.45; color: var(--text); }
.testlog li .muted { grid-column: 2; font-size: 12px; }
.tag { font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 4px; height: fit-content; margin-top: 1px; }
.tag.pass { background: var(--accent-soft); color: var(--accent); }

/* Sections */
.section { padding: 72px 24px; border-top: 1px solid var(--line); }
.section-title { display: flex; align-items: baseline; gap: 14px; font-size: 28px; letter-spacing: -0.02em; margin: 0 0 36px; }
.section-title span { font-family: var(--mono); font-size: 14px; color: var(--accent); font-weight: 500; }
.section-intro { color: var(--muted); margin: -20px 0 32px; }

.about-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 56px; }
.prose p { margin: 0 0 18px; }
.prose p:first-child { font-size: 19px; }
.skills h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 10px; font-weight: 600; }
.chips { list-style: none; padding: 0; margin: 0 0 24px; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { font-family: var(--mono); font-size: 13px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline > li { display: grid; grid-template-columns: 200px 1fr; gap: 32px; padding: 28px 0; border-bottom: 1px dashed var(--line); }
.timeline > li:first-child { padding-top: 0; }
.timeline > li:last-child { border-bottom: 0; }
.when { font-family: var(--mono); font-size: 14px; color: var(--muted); padding-top: 3px; }
.what h3 { margin: 0; font-size: 20px; letter-spacing: -0.01em; }
.at { color: var(--muted); font-weight: 500; }
.where { margin: 4px 0 12px; color: var(--muted); font-size: 15px; }
.what ul { margin: 0; padding-left: 18px; }
.what li { margin: 4px 0; }
.what li::marker { color: var(--accent); }

/* Project cards */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; transition: border-color .15s ease; }
.card:hover { border-color: var(--accent); }
.card-meta { font-family: var(--mono); font-size: 12px; color: var(--accent); margin: 0 0 8px; }
.card h3 { margin: 0 0 8px; font-size: 18px; letter-spacing: -0.01em; }
.card p:last-child { margin: 0; color: var(--muted); font-size: 15px; }
.archive-link { margin: 28px 0 0; font-weight: 600; }

/* Certifications */
.certs { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.certs li { display: grid; grid-template-columns: 64px 1fr auto; gap: 16px; padding: 14px 20px; border-bottom: 1px solid var(--line); align-items: baseline; }
.certs li:last-child { border-bottom: 0; }
.cert-year { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.cert-name { font-weight: 600; }
.cert-org { color: var(--muted); font-size: 14px; text-align: right; }

/* Contact */
.contact { text-align: left; }
.contact-lede { font-size: 19px; color: var(--muted); margin: -12px 0 28px; max-width: 36em; }

.footer { border-top: 1px solid var(--line); padding: 28px 0; font-size: 14px; }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; }

/* Responsive */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 56px; gap: 40px; }
  .hero > :not(.testlog), .testlog { grid-column: 1; grid-row: auto; }
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
  .cards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  nav { display: none; }
  .timeline > li { grid-template-columns: 1fr; gap: 6px; }
  .cards { grid-template-columns: 1fr; }
  .certs li { grid-template-columns: 52px 1fr; }
  .cert-org { grid-column: 2; text-align: left; margin-top: -10px; }
  .section { padding: 56px 24px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .card { transition: none; }
}

/* Project groups */
.group-title { display: flex; align-items: baseline; gap: 12px; font-size: 15px; text-transform: uppercase; letter-spacing: .08em; margin: 36px 0 14px; }
.group-title span { font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: 0; text-transform: none; font-weight: 500; }
.section-intro + .group-title { margin-top: 0; }
.cards-2 { grid-template-columns: repeat(2, 1fr); }
.card-wide { grid-column: span 3; }
.card-featured { border-left: 3px solid var(--accent); }
@media (max-width: 900px) { .card-wide { grid-column: span 2; } }
@media (max-width: 640px) { .cards-2 { grid-template-columns: 1fr; } .card-wide { grid-column: auto; } }

/* Linked cards */
.card-link { display: flex; flex-direction: column; color: inherit; }
.card-link:hover { text-decoration: none; }
.card-link p:not(.card-meta) { color: var(--muted); font-size: 15px; margin: 0 0 14px; }
.card-cta { margin-top: auto; font-weight: 600; font-size: 15px; color: var(--accent); }

/* Language switcher */
.lang { display: flex; gap: 2px; font-family: var(--mono); font-size: 13px; margin-left: 8px; }
.lang a { color: var(--muted); padding: 4px 7px; border-radius: 6px; }
.lang a:hover { color: var(--text); text-decoration: none; background: var(--surface); }
.lang a[aria-current="true"] { color: var(--text); background: var(--surface); border: 1px solid var(--line); }
@media (max-width: 640px) { .lang { margin-left: auto; } }
.topbar-inner nav { margin-left: auto; }
