:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --text: #1b1d21;
  --muted: #646a73;
  --border: #e3e4e1;
  --accent: #c2410c;
  --accent-soft: #fdeee6;
  --chip-bg: #eef0f2;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 16px rgba(0, 0, 0, .04);
  --radius: 10px;
  --max: 920px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111317; --surface: #181b20; --text: #e7e9ec; --muted: #9aa1ab;
    --border: #2a2e35; --accent: #fb923c; --accent-soft: #2b1d14; --chip-bg: #23272e;
    --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111317; --surface: #181b20; --text: #e7e9ec; --muted: #9aa1ab;
  --border: #2a2e35; --accent: #fb923c; --accent-soft: #2b1d14; --chip-bg: #23272e;
  --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); font-weight: 400; }

/* ---------- Nav ---------- */
.topnav {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topnav-inner {
  max-width: var(--max); margin: 0 auto; padding: 0 16px;
  height: 56px; display: flex; align-items: center; gap: 24px;
}
.brand { font-weight: 700; color: var(--text); white-space: nowrap; }
.navlinks { display: flex; gap: 20px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.navlinks a { color: var(--muted); font-size: 14px; font-weight: 500; white-space: nowrap; }
.navlinks a:hover, .navlinks a.active { color: var(--text); text-decoration: none; }
.navlinks a.active { box-shadow: inset 0 -2px 0 var(--accent); }
.nav-actions { display: flex; gap: 6px; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 16px;
}
.icon-btn:hover { border-color: var(--muted); }

/* ---------- Layout ---------- */
main { max-width: var(--max); margin: 0 auto; padding: 0 16px; }
.hero { padding: 72px 0 40px; }
.eyebrow {
  font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 13px;
  color: var(--accent); margin: 0 0 8px; letter-spacing: .02em;
}
.hero h1 { font-size: clamp(36px, 7vw, 56px); line-height: 1.05; margin: 0 0 20px; letter-spacing: -.02em; }
.summary { font-size: 18px; color: var(--muted); max-width: 70ch; margin: 0 0 20px; }
.contact { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 15px; }
.contact .dot { color: var(--border); }
.chips, .tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips { margin-top: 24px; }
.chips li {
  background: var(--accent-soft); color: var(--accent);
  padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 600;
}
.tags li { background: var(--chip-bg); padding: 3px 10px; border-radius: 6px; font-size: 13px; }

.section { padding: 40px 0; border-top: 1px solid var(--border); }
.section h2 {
  font-size: 13px; text-transform: uppercase; letter-spacing: .12em;
  color: var(--muted); margin: 0 0 24px; font-weight: 600;
}
h3 { margin: 0; font-size: 18px; }

/* ---------- Experience ---------- */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 24px; }
.job {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
}
.job-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.role { margin: 2px 0 0; font-weight: 500; }
.dates { margin: 0; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bullets { margin: 8px 0 0; padding-left: 20px; }
.bullets li { margin: 6px 0; }
.bullets li::marker { color: var(--accent); }

.clients { margin-top: 16px; }
.clients-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.clients-label { margin: 0; font-weight: 600; font-size: 14px; }
.link-btn { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; font-size: 14px; padding: 0; }
.client { border-top: 1px solid var(--border); }
.client summary {
  cursor: pointer; padding: 12px 0; font-weight: 600; list-style: none;
  display: flex; justify-content: space-between; gap: 12px;
}
.client summary::-webkit-details-marker { display: none; }
.client summary::before { content: "▸"; color: var(--accent); margin-right: 8px; transition: transform .15s; display: inline-block; }
.client[open] summary::before { transform: rotate(90deg); }
.client summary > span:first-child { flex: 1; }
.client .bullets { margin: 0 0 12px; }

/* ---------- Skills ---------- */
.skills-filter input {
  width: 100%; max-width: 320px; margin-bottom: 20px; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit;
}
.skill-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; align-items: start; }
.skill-group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.skill-group h3 { font-size: 14px; margin-bottom: 10px; }

/* ---------- Projects / lists ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.card p { color: var(--muted); margin: 8px 0 12px; }
.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.plain-list li { display: flex; justify-content: space-between; gap: 16px; }

.footer {
  max-width: var(--max); margin: 0 auto; padding: 32px 16px 48px;
  color: var(--muted); font-size: 14px; border-top: 1px solid var(--border);
}

[hidden] { display: none !important; }

@media (max-width: 640px) {
  .navlinks { display: none; }
  .topnav-inner { justify-content: space-between; }
  .hero { padding-top: 48px; }
  .job { padding: 18px; }
}

/* ---------- Print ---------- */
@media print {
  :root { --bg: #fff; --surface: #fff; --text: #000; --muted: #444; --border: #ccc; --shadow: none; }
  .topnav, .skills-filter, .link-btn, .footer { display: none !important; }
  body { font-size: 11pt; }
  .hero { padding: 0 0 12px; }
  .section { padding: 14px 0; }
  .job { border: 0; padding: 0; break-inside: avoid-page; }
  .client summary::before { content: ""; margin: 0; }
  .chips li, .tags li { border: 1px solid #ccc; background: none; color: #000; }
}
