/* Resume site stylesheet (resume-engine). System fonts, one accent, light/dark follows the OS. */
:root {
  --bg: #ffffff;
  --bg-alt: #f5f7f9;
  --surface: #ffffff;
  --text: #14181f;
  --muted: #5a6472;
  --line: #e2e6eb;
  --accent: #0b6e6e;
  --accent-hover: #095959;
  --accent-ink: #ffffff;
  --accent-soft: #e3f1f1;
  --danger: #b42318;
  --ok: #0b6e3a;
  --radius: 10px;
  --maxw: 1080px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1216;
    --bg-alt: #151a20;
    --surface: #171c23;
    --text: #e8ebef;
    --muted: #9aa4b1;
    --line: #262d36;
    --accent: #3cc2b8;
    --accent-hover: #5fd3ca;
    --accent-ink: #06201e;
    --accent-soft: #12302e;
    --danger: #ff7b72;
    --ok: #4ade80;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(2.2rem, 5.5vw, 3.6rem); font-weight: 750; }
h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 650; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.narrow > * { max-width: 720px; }  /* narrow text, but left edge aligned with other sections */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 6px; z-index: 10; }
.skip:focus { left: 8px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .bar { height: 64px; }
.wordmark { color: var(--text); font-weight: 600; font-size: 1.1rem; letter-spacing: -0.01em; }
.wordmark:hover { color: var(--text); }
.wordmark b { color: var(--accent); font-weight: 700; }
nav { display: flex; align-items: center; gap: 22px; }
nav a { color: var(--muted); font-weight: 500; }
nav a:hover { color: var(--text); }
nav .btn-ghost, nav .btn-ghost:hover { color: var(--accent); font-weight: 600; text-decoration: none; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--accent-ink);
  border: 0; border-radius: 8px; padding: 12px 20px;
  font: 600 1rem/1 var(--font); cursor: pointer;
  transition: background .15s ease;
}
.btn:hover { background: var(--accent-hover); color: var(--accent-ink); }
.btn-small { padding: 8px 14px; font-size: .95rem; }
.btn-ghost { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.btn-ghost:hover { background: var(--accent-soft); color: var(--accent); }

/* Intro */
.intro { padding: clamp(56px, 10vw, 120px) 0 clamp(24px, 4vw, 48px); }
.headline { color: var(--accent); font-weight: 650; font-size: clamp(1.15rem, 2.2vw, 1.4rem); margin-top: -.2em; }
.lede { font-size: clamp(1.1rem, 2vw, 1.25rem); color: var(--muted); max-width: 40em; }
.facts { list-style: none; padding: 0; margin: 2em 0; display: flex; flex-wrap: wrap; gap: 16px 48px; }
.facts li { display: grid; }
.facts strong { font-size: 2.2rem; font-weight: 750; line-height: 1.1; letter-spacing: -0.02em; }
.facts span { color: var(--muted); font-size: .95rem; }
.links { display: flex; flex-wrap: wrap; gap: 10px; font-weight: 600; }
.links span { color: var(--line); }

/* Sections */
.section { padding: clamp(48px, 7vw, 88px) 0; }
.section.alt { background: var(--bg-alt); border-block: 1px solid var(--line); }
.section h2 { margin-bottom: .8em; }
.section-lede { color: var(--muted); margin-top: -.6em; }

/* Timeline: proportional bar of employers, built by resume.js */
.timeline { margin-bottom: 28px; }
.tl-track { display: flex; height: 40px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.tl-seg {
  all: unset; box-sizing: border-box; cursor: pointer;
  display: flex; align-items: center; justify-content: center; min-width: 6px;
  background: var(--accent-soft); color: var(--text);
  font-size: .8rem; font-weight: 600; white-space: nowrap; overflow: hidden;
  border-right: 2px solid var(--bg);
  transition: background .15s ease, color .15s ease, opacity .15s ease;
}
.tl-seg:last-child { border-right: 0; }
.tl-seg:hover, .tl-seg:focus-visible, .tl-seg.on { background: var(--accent); color: var(--accent-ink); }
.tl-seg:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.tl-seg.dim { opacity: .35; }
.tl-seg span { padding: 0 6px; overflow: hidden; text-overflow: ellipsis; }
.tl-years { display: flex; justify-content: space-between; color: var(--muted); font-size: .85rem; margin-top: 6px; }

/* Skill filter */
.filter { margin-bottom: 28px; }
.filter-label { font-weight: 600; font-size: .95rem; margin-bottom: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: 500 .9rem/1 var(--font); color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip .n { color: var(--muted); margin-left: 4px; }
.chip[aria-pressed="true"] .n { color: inherit; opacity: .75; }

/* Jobs */
.jobs { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.job {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 28px;
  scroll-margin-top: 84px; transition: opacity .2s ease, border-color .2s ease;
}
.job.dim { opacity: .35; }
.job.flash { border-color: var(--accent); }
.job-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px; }
.job h3, .job h4 { margin: 0; }
.job h4 { font-size: 1.02rem; font-weight: 650; }
.when { color: var(--muted); font-size: .95rem; margin: 0; }
.role { color: var(--muted); margin: 4px 0 0; }
.summary { color: var(--muted); margin: 8px 0 0; }
.position { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; padding: 0; list-style: none; }
.tags li { font-size: .8rem; color: var(--muted); background: var(--bg-alt); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; }
.tags li.hit { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
details { margin-top: 12px; }
summary { cursor: pointer; font-weight: 600; color: var(--accent); list-style: none; display: inline-flex; gap: 8px; align-items: baseline; }
summary::-webkit-details-marker { display: none; }
summary::before { content: "+"; display: inline-block; width: 1ch; font-weight: 700; }
details[open] summary::before { content: "−"; }
summary:hover { color: var(--accent-hover); }
details ul { margin: 12px 0 0; padding-left: 1.2em; }
details li { margin-bottom: .45em; }
details li::marker { color: var(--accent); }
.no-match { color: var(--muted); margin-top: 16px; }

/* Patents & skills */
.patents { list-style: none; margin: 24px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 0 40px; }
.patents li { display: grid; align-content: start; grid-template-columns: auto 1fr; gap: 2px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.patents a { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pt-year { color: var(--muted); font-size: .9rem; justify-self: end; }
.pt-title { grid-column: 1 / -1; color: var(--muted); font-size: .95rem; line-height: 1.45; }
@media (max-width: 560px) { .patents { grid-template-columns: 1fr; } }
@media print {
  .patents { display: block; margin-top: 6pt; }
  .patents li { display: block; padding: 1.5pt 0; border: 0; font-size: 9pt; break-inside: avoid; }
  .patents a { font-weight: 600; }
  .pt-year { color: var(--muted); margin: 0 4pt; font-size: 9pt; }
  .pt-year::before { content: "("; } .pt-year::after { content: ")"; }
  .pt-title { font-size: 9pt; color: var(--text); }
}
.skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px 32px; margin: 0; }
.skills dt { font-weight: 650; margin-bottom: 4px; }
.skills dd { margin: 0; color: var(--muted); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .95rem; }
.site-footer .bar { padding-block: 28px; }
.site-footer p { margin: 0; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }

@media (max-width: 560px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  nav { gap: 14px; }
  nav a:not(.btn) { display: none; }
  .job { padding: 20px; }
  .facts { gap: 16px 32px; }
  .tl-seg span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* Print: a plain, complete resume — everything expanded, no chrome. */
@media print {
  :root { --bg: #fff; --bg-alt: #fff; --surface: #fff; --text: #000; --muted: #333; --line: #bbb; --accent: #0b6e6e; }
  body { font-size: 10.5pt; line-height: 1.45; }
  .site-header, .site-footer, .skip, .filter, .timeline, .links, .no-match { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  .intro { padding: 0 0 8pt; }
  h1 { font-size: 24pt; }
  .facts { margin: 8pt 0; }
  .facts strong { font-size: 15pt; }
  .section { padding: 10pt 0; border: 0 !important; }
  .section h2 { font-size: 14pt; margin-bottom: 6pt; border-bottom: 1px solid var(--line); padding-bottom: 2pt; }
  .jobs { gap: 8pt; }
  .job { border: 0; padding: 0; opacity: 1 !important; }
  /* Never strand a heading from what follows it; let long roles flow across pages. */
  .section h2, .job-head, .role, .summary, details h5, .facts { break-after: avoid; }
  details li, .patents li, .skills > div, .edu { break-inside: avoid; }
  details ul { break-before: avoid; }
  .skills { grid-template-columns: repeat(3, 1fr); gap: 6pt 18pt; font-size: 9.5pt; }
  .skills dt { margin-bottom: 1pt; }
  .tags { display: none; }
  details > summary { display: none; }
  details > ul { margin-top: 4pt; }
  a { color: var(--text); }
}
@page { margin: 14mm 16mm; }
.job h3 a { color: inherit; }
.job h3 a:hover { color: var(--accent); }
details h5 { margin: 14px 0 0; font-size: .8rem; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
details h5 + ul { margin-top: 6px; }
.position { scroll-margin-top: 84px; transition: opacity .2s ease; }
.position.flash { border-top-color: var(--accent); }
.tl-seg.same-co { border-right-width: 1px; }
.position.dim { opacity: .35; }

/* Generated-page additions */
.where { color: var(--muted); font-size: .95rem; margin-top: -.4em; }
.lede + .lede { margin-top: -.4em; }
.role-headline { color: var(--muted); margin: 12px 0 0; font-weight: 600; }
.pt-cites { white-space: nowrap; }
.pt-note { color: var(--muted); font-size: .85rem; margin: 16px 0 0; }
.edu { margin: 0 0 .4em; }
.edu-notes { color: var(--muted); margin: 0 0 1em; }
code { font: .9em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--bg-alt); border: 1px solid var(--line); border-radius: 4px; padding: 0 .3em; }
@media print {
  .where { margin: 0 0 4pt; font-size: 9.5pt; }
  .pt-note { font-size: 8.5pt; margin-top: 4pt; }
  code { border: 0; padding: 0; background: none; }
}
