:root {
  --bg: #ffffff;
  --fg: #1c1c1c;
  --muted: #5f6368;
  --rule: #e3e3e3;
  --accent: #1a4f8b;
  --maxw: 760px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141517;
    --fg: #e8e8e8;
    --muted: #a0a4aa;
    --rule: #2e3034;
    --accent: #8ab4f8;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header {
  position: sticky; top: 0; z-index: 1;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
}
.site-header nav {
  max-width: var(--maxw); margin: 0 auto; padding: 10px 16px;
  display: flex; gap: 18px; overflow-x: auto; white-space: nowrap;
  font-size: 14px;
}
.site-header nav a { color: var(--muted); }
.site-header nav a:hover { color: var(--fg); text-decoration: none; }

main { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
section { padding-top: 24px; scroll-margin-top: 48px; }

.intro { display: flex; gap: 28px; align-items: center; padding-top: 48px; }
.intro img { width: 160px; height: 160px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
h1 { font-size: 34px; line-height: 1.2; margin: 0 0 6px; font-weight: 650; }
.headline { margin: 0 0 12px; color: var(--muted); }
.links { margin: 0; display: flex; flex-wrap: wrap; gap: 16px; font-weight: 500; }

.bio p { margin: 0 0 12px; }

h2 {
  font-size: 13px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); font-weight: 600;
  margin: 12px 0 14px; padding-bottom: 6px; border-bottom: 1px solid var(--rule);
}

.entries { list-style: none; margin: 0; padding: 0; }
.entries > li { margin-bottom: 18px; }
.entries.compact > li { margin-bottom: 6px; }
.entries p { margin: 0; }
.title { font-weight: 600; }
.meta { color: var(--muted); font-size: 15px; }
.row { display: flex; justify-content: space-between; gap: 16px; }
.date { color: var(--muted); font-size: 15px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bullets { margin: 6px 0 0; padding-left: 20px; font-size: 15px; }
.bullets li { margin-bottom: 2px; }

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

@media (max-width: 600px) {
  .intro { flex-direction: column; align-items: flex-start; gap: 16px; padding-top: 32px; }
  .intro img { width: 112px; height: 112px; }
  h1 { font-size: 28px; }
  .row { flex-direction: column; gap: 0; }
}

/* Subsections, CV header, skills */
h3 { font-size: 17px; margin: 22px 0 10px; font-weight: 600; }
h2 + h3 { margin-top: 4px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--rule); margin: 12px 0 14px; }
.section-head h2 { border: 0; margin: 0; }
.button {
  font-size: 14px; font-weight: 500; padding: 4px 12px; margin-bottom: 6px;
  border: 1px solid var(--accent); border-radius: 6px; white-space: nowrap;
}
.button:hover { background: var(--accent); color: var(--bg); text-decoration: none; }
#industry > p, #contact > p { margin: 0 0 10px; }
.skills { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0; font-size: 15px; }
.skills dt { font-weight: 600; }
.skills dd { margin: 0; }
@media (max-width: 600px) { .skills { grid-template-columns: 1fr; } .skills dd { margin-bottom: 6px; } }
.print-contact { display: none; }

/* Print = the CV PDF */
@media print {
  @page { size: A4; margin: 14mm 16mm; }
  :root { --bg: #fff; --fg: #111; --muted: #444; --rule: #bbb; --accent: #111; }
  body { font-size: 10pt; line-height: 1.35; }
  .site-header, .screen-only, .bio, .intro img, .links, .headline { display: none !important; }
  main { max-width: none; padding: 0; display: flex; flex-direction: column; }
  #about { order: 0; } #cv { order: 1; } #research { order: 2; }
  section { padding-top: 6px; }
  .intro { padding-top: 0; display: block; }
  h1 { font-size: 20pt; margin: 0; }
  .print-contact { display: block; margin: 2px 0 0; color: var(--muted); }
  h2 { font-size: 9pt; margin: 8px 0 6px; padding-bottom: 2px; }
  .section-head { margin: 8px 0 6px; } .section-head h2 { margin: 0; padding-bottom: 2px; }
  h3 { font-size: 10.5pt; margin: 10px 0 4px; text-transform: uppercase; letter-spacing: .04em; }
  #cv .section-head { display: none; }
  #research h2 { display: none; }
  .meta, .date, .bullets, .skills { font-size: 9.5pt; }
  .entries > li { margin-bottom: 7px; break-inside: avoid; }
  .entries.compact > li { margin-bottom: 1px; }
  .bullets { margin-top: 2px; } .bullets li { margin-bottom: 0; }
  .row { flex-direction: row !important; }
  h3 { break-after: avoid; }
  a { color: inherit; }
}
