/* ==========================================================================
   Fonts (self-hosted, SIL Open Font License)
   ========================================================================== */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("assets/fonts/inter-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("assets/fonts/inter-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("assets/fonts/source-serif-4-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("assets/fonts/source-serif-4-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
  src: url("assets/fonts/source-serif-4-latin-wght-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
  src: url("assets/fonts/source-serif-4-latin-ext-wght-italic.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ==========================================================================
   Tokens
   ========================================================================== */

:root {
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --surface: #ffffff;
  --text: #15181e;
  --text-2: #3a404a;
  --muted: #687080;
  --border: #e4e7ec;
  --border-strong: #cfd4dc;
  --accent: #1d4c9c;
  --accent-hover: #143a7a;
  --accent-soft: #ebf1fb;
  --accent-ring: rgba(29, 76, 156, .28);
  --gold: #946200;
  --gold-soft: #fbf3e0;
  --green: #11724a;
  --green-soft: #e4f4ec;
  --venue: #1d4c9c;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px -8px rgba(16, 24, 40, .12);
  --shadow-lg: 0 2px 4px rgba(16, 24, 40, .04), 0 24px 48px -16px rgba(16, 24, 40, .22);

  --serif: "Source Serif 4", "Iowan Old Style", Charter, Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  --radius: 12px;
  --radius-sm: 8px;
  --nav-h: 64px;
  --container: 1120px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1015;
    --bg-soft: #12161d;
    --surface: #151a22;
    --text: #e7e9ed;
    --text-2: #c2c8d0;
    --muted: #8c95a2;
    --border: #232a34;
    --border-strong: #333c48;
    --accent: #85abf7;
    --accent-hover: #abc5fa;
    --accent-soft: #172339;
    --accent-ring: rgba(133, 171, 247, .35);
    --gold: #e3b65a;
    --gold-soft: #2a2312;
    --green: #5fd19e;
    --green-soft: #12291f;
    --venue: #2f62c4;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -8px rgba(0, 0, 0, .5);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, .3), 0 24px 48px -16px rgba(0, 0, 0, .65);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0d1015;
  --bg-soft: #12161d;
  --surface: #151a22;
  --text: #e7e9ed;
  --text-2: #c2c8d0;
  --muted: #8c95a2;
  --border: #232a34;
  --border-strong: #333c48;
  --accent: #85abf7;
  --accent-hover: #abc5fa;
  --accent-soft: #172339;
  --accent-ring: rgba(133, 171, 247, .35);
  --gold: #e3b65a;
  --gold-soft: #2a2312;
  --green: #5fd19e;
  --green-soft: #12291f;
  --venue: #2f62c4;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -8px rgba(0, 0, 0, .5);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, .3), 0 24px 48px -16px rgba(0, 0, 0, .65);
  color-scheme: dark;
}

/* ==========================================================================
   Base
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color .15s ease;
}
a:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

h1, h2, h3, h4 { margin: 0; color: var(--text); }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
address { font-style: normal; }
img { display: block; max-width: 100%; height: auto; }

svg { width: 1em; height: 1em; flex: none; }

[hidden] { display: none !important; }

.skip {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 100;
  padding: 8px 14px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 600;
}
.skip:focus { top: 12px; color: #fff; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
}

/* ==========================================================================
   Navigation
   ========================================================================== */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.nav.is-scrolled {
  border-bottom-color: var(--border);
}

.nav-inner {
  height: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: -.01em;
  white-space: nowrap;
}
.brand:hover { color: var(--text); text-decoration: none; }
.brand-mark {
  width: 30px;
  height: 19px;
  color: var(--accent);
}

.nav-links {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 2px;
}
.nav-links a {
  position: relative;
  padding: 6px 11px;
  border-radius: 8px;
  color: var(--text-2);
  font-size: .9rem;
  font-weight: 500;
  transition: color .15s ease, background-color .15s ease;
}
.nav-links a:hover {
  color: var(--text);
  background: var(--bg-soft);
  text-decoration: none;
}
.nav-links a[aria-current="true"] {
  color: var(--accent);
}
.nav-links a[aria-current="true"]::after {
  content: "";
  position: absolute;
  left: 11px;
  right: 11px;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.nav-tools { display: flex; align-items: center; gap: 4px; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background-color .15s ease;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.icon-btn svg { width: 18px; height: 18px; grid-area: 1 / 1; }

/* Show the icon of the theme you would switch to */
.i-sun { display: none; }
:root[data-theme="dark"] .i-sun { display: block; }
:root[data-theme="dark"] .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: block; }
  :root:not([data-theme="light"]) .i-moon { display: none; }
}

.nav-menu { display: none; }
.nav-menu .i-close { display: none; }
.nav-menu[aria-expanded="true"] .i-open { display: none; }
.nav-menu[aria-expanded="true"] .i-close { display: block; }

/* ==========================================================================
   Hero / About
   ========================================================================== */

.hero {
  position: relative;
  isolation: isolate;
  padding: 72px 0 88px;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 72px;
  align-items: start;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

h1 {
  margin-top: 14px;
  font-family: var(--serif);
  font-size: clamp(2.6rem, 5vw, 3.6rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -.025em;
  font-optical-sizing: auto;
}

.tagline {
  margin-top: 14px;
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 500;
}

.bio {
  margin-top: 32px;
  max-width: 64ch;
  color: var(--text-2);
  font-size: 1.05rem;
  line-height: 1.75;
}
.bio p + p { margin-top: 1em; }
.bio em { font-style: normal; color: var(--text); font-weight: 550; }

.social {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: .9rem;
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.chip-link svg { width: 16px; height: 16px; color: var(--muted); }
.chip-link .c-orcid { color: #a6ce39; }
.chip-link:hover {
  color: var(--text);
  text-decoration: none;
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.hero-aside { position: relative; }

.portrait {
  margin: 0;
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: var(--bg-soft);
  box-shadow: var(--shadow-lg);
  aspect-ratio: 4 / 5;
}
.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 22%;
}

.contact-card {
  margin-top: 20px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: .9rem;
  line-height: 1.55;
}
.contact-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 12px;
  color: var(--text-2);
}
.contact-row + .contact-row {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.contact-row > svg { width: 16px; height: 16px; margin-top: 3px; color: var(--muted); }

.emails li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.emails li + li { margin-top: 4px; }
.emails .email { color: var(--accent); font-variant-numeric: tabular-nums; }
.emails .email:hover { color: var(--accent-hover); }
.emails .at { color: var(--muted); font-size: .85em; padding: 0 .15em; }
.email-kind {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* Research interests */

.subhead {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 64px 0 20px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.subhead::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.interests {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.interests li {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 24px 24px 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.interests li:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
/* The current focus spans the full width and reads at bio size */
.interests li:first-child {
  grid-column: 1 / -1;
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}
.interest-index {
  display: block;
  color: var(--accent);
  font-family: var(--serif);
  font-size: .95rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.interests h3 {
  margin-top: 10px;
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -.01em;
}
.interests p {
  margin-top: 8px;
  color: var(--text-2);
  font-size: 1rem;
  line-height: 1.65;
}
.interests li:first-child h3 { font-size: 1.6rem; }
/* Paper link sits at the bottom, so links line up across cards of different length */
.interests .interest-ref {
  margin-top: auto;
  padding-top: 14px;
  font-size: .9rem;
  font-weight: 600;
  text-align: left;
}
.interests li:first-child p { font-size: 1.05rem; line-height: 1.75; }

/* Running text is justified; hyphenation keeps the gaps small.
   News stays ragged: its items are one line on desktop and their linked titles cannot hyphenate */
.bio p,
.interests p,
.tool p:not(.tool-tagline),
.panel p {
  text-align: justify;
  -webkit-hyphens: auto;
  hyphens: auto;
}
/* Narrow columns cannot absorb the gaps: set them ragged-right, without hyphens */
@media (max-width: 700px) {
  .bio p,
  .interests p,
  .tool p:not(.tool-tagline),
  .panel p {
    text-align: left;
    -webkit-hyphens: manual;
    hyphens: manual;
  }
}

/* News */

.news {
  border-left: 1px solid var(--border-strong);
  margin-left: 6px;
}
.news li {
  position: relative;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 20px;
  padding: 0 0 18px 28px;
}
.news li:last-child { padding-bottom: 0; }
.news li::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 7px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}
.news li:first-child::before { background: var(--accent); }
.news time {
  color: var(--muted);
  font-size: .85rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
}
.news p { color: var(--text-2); }
.news em { font-family: var(--serif); font-size: 1.03em; }
.news strong { color: var(--text); font-weight: 600; }

/* ==========================================================================
   Sections
   ========================================================================== */

.section {
  padding: 88px 0;
}
.section + .section { border-top: 1px solid var(--border); }
.section:nth-of-type(even) { background: var(--bg-soft); }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 36px;
}
.section-head h2 {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.2;
}
.section-head p {
  color: var(--muted);
  font-size: .92rem;
}

.section-head + .subhead { margin-top: 0; }

/* Publications */

.pubs { display: grid; gap: 16px; }
.pubs + .subhead, .entries + .subhead { margin-top: 56px; }

.pub {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 24px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.pub:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.pub:target { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }

/* Theses: plain rows on the same grid as the papers, so the papers carry the section */
.pubs-plain { gap: 0; }
.pubs-plain .pub {
  padding: 20px 24px;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: none;
}
.pubs-plain .pub:hover { box-shadow: none; }
.pubs-plain .badge {
  height: auto;
  padding-top: 2px;
  background: none;
  color: var(--text-2);
}
.pubs-plain .badge-year { color: var(--muted); opacity: 1; }

.badge {
  align-self: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 64px;
  border-radius: var(--radius-sm);
  background: var(--venue);
  color: #fff;
  text-align: center;
  line-height: 1.1;
}
/* script.js shrinks a long venue name until it fits the badge */
.badge-name { font-size: .95rem; font-weight: 700; letter-spacing: .04em; white-space: nowrap; }
.badge-year { margin-top: 3px; font-size: .75rem; font-weight: 500; opacity: .85; font-variant-numeric: tabular-nums; }

.pub-title {
  font-family: var(--serif);
  font-size: 1.22rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -.01em;
}
.pub-title a { color: var(--text); }
.pub-title a:hover { color: var(--accent); }

.pub-authors { margin-top: 6px; color: var(--text-2); font-size: .95rem; }
.pub-authors .me {
  color: var(--text);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: .22em;
}
.pub-venue { margin-top: 4px; color: var(--muted); font-size: .9rem; }
.pub-venue em { font-family: var(--serif); font-size: 1.03em; color: var(--text-2); }

.pub-awards { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.award {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--gold);
  font-size: .78rem;
  font-weight: 600;
}
.award svg { width: 13px; height: 13px; }

.pub-actions {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text-2);
  font: inherit;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .01em;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background-color .15s ease;
}
.btn svg { width: 14px; height: 14px; color: var(--muted); transition: color .15s ease; }
.btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
}
.btn:hover svg { color: var(--accent); }
.btn[aria-expanded="true"] {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}
.btn[aria-expanded="true"] svg { color: var(--accent); }
.no-js .btn[data-panel] { display: none; }

.panel {
  position: relative;
  margin-top: 14px;
  padding: 16px 18px;
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--bg-soft);
  color: var(--text-2);
  font-size: .92rem;
  line-height: 1.7;
  animation: panel-in .2s ease;
}
@keyframes panel-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}
.panel-code { padding-right: 96px; }
.panel pre {
  margin: 0;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: .8rem;
  line-height: 1.6;
  color: var(--text);
  white-space: pre;
}
.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-2);
  font: inherit;
  font-size: .75rem;
  font-weight: 600;
  cursor: pointer;
}
.copy-btn:hover { color: var(--accent); border-color: var(--accent); }
.copy-btn svg { width: 13px; height: 13px; }
.copy-btn .i-check { display: none; }
.copy-btn.is-copied { color: var(--green); border-color: var(--green); }
.copy-btn.is-copied .i-copy { display: none; }
.copy-btn.is-copied .i-check { display: block; }

/* Software */

.software {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.tool {
  display: flex;
  flex-direction: column;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.tool:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.tool-featured { grid-column: 1 / -1; }
.tool-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.tool h3 {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -.01em;
}
.tool-featured h3 { font-size: 1.6rem; }
.tool h3 a { color: var(--text); }
.tool h3 a:hover { color: var(--accent); }
.role {
  padding: 2px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 600;
  white-space: nowrap;
}
.tool-tagline {
  margin-top: 4px;
  color: var(--accent);
  font-size: .88rem;
  font-weight: 600;
}
.tool p:not(.tool-tagline) {
  margin-top: 12px;
  color: var(--text-2);
  font-size: .94rem;
}
.tool-foot {
  margin-top: auto;
  padding-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.tech { display: flex; flex-wrap: wrap; gap: 6px; }
.tech li {
  padding: 2px 9px;
  border-radius: 6px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-family: var(--mono);
  font-size: .74rem;
}
.tool-links { display: flex; flex-wrap: wrap; gap: 16px; }
.tool-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .86rem;
  font-weight: 600;
}
.tool-links svg { width: 15px; height: 15px; }

/* Teaching & Service */

.entries li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.entries h4 {
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  line-height: 1.45;
}
.entries p { margin-top: 2px; color: var(--muted); font-size: .9rem; line-height: 1.5; }
.entries h4 a { color: var(--text); }
.entries h4 a:hover { color: var(--accent); }
.entry-date {
  flex: none;
  color: var(--muted);
  font-size: .85rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  color: var(--muted);
  font-size: .85rem;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-links { display: flex; align-items: center; gap: 6px; }
.footer-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border-radius: 8px;
  color: var(--muted);
}
.footer-links a:hover { color: var(--text); background: var(--bg-soft); text-decoration: none; }
.footer-links svg { width: 17px; height: 17px; }
.to-top { font-weight: 600; font-size: .82rem; }
.to-top svg { width: 14px !important; height: 14px !important; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1040px) {
  .nav-links a { padding: 6px 8px; }
  .nav-links a[aria-current="true"]::after { left: 8px; right: 8px; }
}

@media (max-width: 1000px) {
  .js .nav-menu { display: inline-grid; }
  .js .nav-links {
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    margin: 0;
    padding: 8px 16px 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    display: none;
  }
  .js .nav-links.is-open { display: flex; }
  .js .nav-links a { padding: 10px 12px; font-size: 1rem; }
  .js .nav-links a[aria-current="true"] { background: var(--accent-soft); }
  .js .nav-links a[aria-current="true"]::after { display: none; }
  .js .nav-tools { margin-left: auto; }

  .no-js .nav { height: auto; position: static; }
  .no-js .nav-inner { flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; }
  .no-js .nav-links { flex-wrap: wrap; margin-left: 0; width: 100%; }

  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
  }
  .hero-aside {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 24px;
    align-items: end;
  }
  .contact-card { margin-top: 0; }

  .interests { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 680px) {
  .container, .nav-inner { padding-left: 16px; padding-right: 16px; }

  .hero { padding: 32px 0 56px; }
  .hero-grid { gap: 28px; }
  .hero-aside { display: contents; }
  .portrait { order: -1; width: 112px; border-radius: 12px; box-shadow: var(--shadow); }
  .contact-card { padding: 14px 16px; font-size: .88rem; line-height: 1.5; }
  .contact-row { grid-template-columns: 14px minmax(0, 1fr); gap: 10px; }
  .contact-row + .contact-row { margin-top: 8px; padding-top: 8px; }
  .contact-row > svg { width: 14px; height: 14px; }

  h1 { margin-top: 10px; }
  .bio { font-size: 1rem; }
  .subhead { margin-top: 48px; }
  .interests li { padding: 20px 20px 22px; }
  .interests li:first-child h3 { font-size: 1.35rem; }
  .interests li:first-child p { font-size: 1rem; }
  .news li { grid-template-columns: minmax(0, 1fr); gap: 2px; padding-left: 22px; }

  .section { padding: 56px 0; }
  .section-head { flex-direction: column; gap: 4px; margin-bottom: 24px; }
  .section-head h2 { font-size: 1.65rem; }

  .pub { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 18px; }
  .badge {
    flex-direction: row;
    justify-self: start;
    gap: 6px;
    height: auto;
    padding: 4px 10px;
    border-radius: 6px;
  }
  .badge-name { font-size: .78rem; }
  .badge-year { margin-top: 0; font-size: .72rem; }
  .pub-title { font-size: 1.1rem; }
  .pubs-plain .pub { padding: 18px 0; }
  .pubs-plain .badge { padding: 0; }
  .panel-code { padding-right: 18px; padding-top: 48px; }

  .software { grid-template-columns: minmax(0, 1fr); }
  .tool { padding: 20px; }
  .tool-featured h3 { font-size: 1.35rem; }

  .entries li { flex-direction: column; gap: 4px; }
}

/* ==========================================================================
   Site styles: the page uses the one named in <html data-style="...">
   ========================================================================== */

/* Shared by the hard-edged styles */
:root:is([data-style="editorial"], [data-style="blueprint"], [data-style="swiss"], [data-style="terminal"]) :is(
  .chip-link, .btn, .icon-btn, .portrait, .contact-card, .pub, .tool, .interests li, .badge,
  .award, .role, .tech li, .copy-btn, .panel, .nav-links a, .footer-links a
) { border-radius: 0; }
:root:is([data-style="manuscript"], [data-style="editorial"], [data-style="blueprint"], [data-style="swiss"], [data-style="terminal"]) .chip-link:hover { transform: none; }

/* --------------------------------------------------------------------------
   Manuscript: typeset like a paper, serif throughout, rules instead of boxes
   -------------------------------------------------------------------------- */

:root[data-style="manuscript"] {
  --sans: var(--serif);
  --bg: #fbf8f1;
  --bg-soft: #f4efe3;
  --surface: #fbf8f1;
  --text: #1d1b16;
  --text-2: #39352d;
  --muted: #776f5f;
  --border: #e3dccb;
  --border-strong: #c9bfa8;
  --accent: #8c1c13;
  --accent-hover: #6b130c;
  --accent-soft: #f4e2db;
  --accent-ring: rgba(140, 28, 19, .25);
  --gold: #7a5a12;
  --gold-soft: #f1e7cf;
  --venue: #8c1c13;
  --shadow: none;
  --shadow-lg: 0 18px 40px -20px rgba(60, 40, 10, .35);
  --radius: 2px;
  --radius-sm: 2px;
}
@media (prefers-color-scheme: dark) {
  :root[data-style="manuscript"]:not([data-theme="light"]) {
    --bg: #191713; --bg-soft: #1f1c17; --surface: #191713;
    --text: #ece5d5; --text-2: #cdc4b1; --muted: #988f7b;
    --border: #332f27; --border-strong: #4b453a;
    --accent: #e3907f; --accent-hover: #f0b3a6; --accent-soft: #3a231d; --accent-ring: rgba(227, 144, 127, .35);
    --gold: #e0bf72; --gold-soft: #2b2516; --venue: #9a3227;
    --shadow-lg: 0 18px 40px -20px rgba(0, 0, 0, .7);
  }
}
:root[data-style="manuscript"][data-theme="dark"] {
  --bg: #191713; --bg-soft: #1f1c17; --surface: #191713;
  --text: #ece5d5; --text-2: #cdc4b1; --muted: #988f7b;
  --border: #332f27; --border-strong: #4b453a;
  --accent: #e3907f; --accent-hover: #f0b3a6; --accent-soft: #3a231d; --accent-ring: rgba(227, 144, 127, .35);
  --gold: #e0bf72; --gold-soft: #2b2516; --venue: #9a3227;
  --shadow-lg: 0 18px 40px -20px rgba(0, 0, 0, .7);
}
:root[data-style="manuscript"] body { font-size: 17px; line-height: 1.7; font-feature-settings: normal; }
:root[data-style="manuscript"] h1 { font-style: italic; font-weight: 500; letter-spacing: -.01em; }
:root[data-style="manuscript"] .section-head h2 { font-weight: 500; }
:root[data-style="manuscript"] :is(.subhead, .eyebrow) {
  font-family: var(--serif);
  font-size: 1.02rem;
  font-weight: 600;
  font-variant: small-caps;
  text-transform: lowercase;
  letter-spacing: .06em;
}
:root[data-style="manuscript"] .subhead { color: var(--text-2); }
:root[data-style="manuscript"] :is(.pub, .tool, .interests li) {
  padding-left: 0;
  padding-right: 0;
  border: 0;
  border-top: 1px solid var(--border-strong);
  border-radius: 0;
  background: none;
  box-shadow: none;
}
:root[data-style="manuscript"] .interests li:first-child { border-top: 2px solid var(--accent); }
:root[data-style="manuscript"] :is(.interests, .software) { gap: 8px 40px; }
:root[data-style="manuscript"] .contact-card {
  padding: 14px 0 0;
  border: 0;
  border-top: 1px solid var(--border-strong);
  border-radius: 0;
  background: none;
}
:root[data-style="manuscript"] .portrait { border-radius: 2px; }
:root[data-style="manuscript"] .portrait img { filter: sepia(.18); }
:root[data-style="manuscript"] .chip-link { background: none; box-shadow: none; border-radius: 2px; border-color: var(--border-strong); }

/* --------------------------------------------------------------------------
   Editorial: Manuscript's serif text and paper, Swiss bold structure and red
   -------------------------------------------------------------------------- */

:root[data-style="editorial"] {
  --bg: #faf8f3;
  --bg-soft: #f2efe6;
  --surface: #faf8f3;
  --text: #111111;
  --text-2: #2b2a27;
  --muted: #6b675e;
  --border: #bfb7a6;
  --border-strong: #111111;
  --accent: #c8201a;
  --accent-hover: #9e1812;
  --accent-soft: #fbe6e3;
  --accent-ring: rgba(200, 32, 26, .28);
  --gold: #111111;
  --gold-soft: transparent;
  --venue: #111111;
  --shadow: none;
  --shadow-lg: 0 18px 40px -20px rgba(0, 0, 0, .3);
  --radius: 0;
  --radius-sm: 0;
}
@media (prefers-color-scheme: dark) {
  :root[data-style="editorial"]:not([data-theme="light"]) {
    --bg: #121110; --bg-soft: #181715; --surface: #121110;
    --text: #f2efe8; --text-2: #d9d5cb; --muted: #9a958a;
    --border: #4a463f; --border-strong: #f2efe8;
    --accent: #ff5a4a; --accent-hover: #ff8a7e; --accent-soft: #2c1411; --accent-ring: rgba(255, 90, 74, .35);
    --gold: #f2efe8; --venue: #f2efe8;
    --shadow-lg: 0 18px 40px -20px rgba(0, 0, 0, .7);
  }
}
:root[data-style="editorial"][data-theme="dark"] {
  --bg: #121110; --bg-soft: #181715; --surface: #121110;
  --text: #f2efe8; --text-2: #d9d5cb; --muted: #9a958a;
  --border: #4a463f; --border-strong: #f2efe8;
  --accent: #ff5a4a; --accent-hover: #ff8a7e; --accent-soft: #2c1411; --accent-ring: rgba(255, 90, 74, .35);
  --gold: #f2efe8; --venue: #f2efe8;
  --shadow-lg: 0 18px 40px -20px rgba(0, 0, 0, .7);
}
:root[data-style="editorial"] { --quiet: color-mix(in srgb, var(--text-2) 50%, var(--muted)); }
/* Reading text is serif; labels, buttons and navigation stay in the sans */
:root[data-style="editorial"] body { font-family: var(--serif); font-size: 17px; line-height: 1.7; font-feature-settings: normal; }
:root[data-style="editorial"] :is(
  .nav, .chip-link, .btn, .copy-btn, .badge, .award, .role, .tech li, .tool-links,
  .interest-index, .interest-ref, .entry-date, .news time, .subhead, .eyebrow, .email-kind, .footer
) { font-family: var(--sans); }
:root[data-style="editorial"] .brand { font-family: var(--serif); font-weight: 800; }
:root[data-style="editorial"] h1 {
  font-size: clamp(3rem, 7vw, 5.25rem);
  font-weight: 800;
  line-height: .95;
  letter-spacing: -.035em;
}
:root[data-style="editorial"] .section-head h2 { font-size: 2.6rem; font-weight: 800; letter-spacing: -.03em; }
:root[data-style="editorial"] :is(.pub-title, .tool h3, .interests h3) { font-weight: 700; }
:root[data-style="editorial"] .tagline { color: var(--quiet); font-family: var(--serif); font-style: italic; font-size: 1.15rem; }
:root[data-style="editorial"] .subhead { color: var(--text); font-weight: 800; letter-spacing: .14em; }
:root[data-style="editorial"] .subhead::after { height: 2px; background: var(--border-strong); }
:root[data-style="editorial"] :is(.pub, .tool, .interests li) {
  padding-left: 0;
  padding-right: 0;
  border: 0;
  border-top: 1px solid var(--border);
  background: none;
  box-shadow: none;
}
/* Heavy rules mark headings, hairlines separate items. Software has no subheading,
   so its first card carries the heavy rule instead */
:root[data-style="editorial"] .software > .tool:first-child { border-top: 2px solid var(--border-strong); }
:root[data-style="editorial"] .interests li:first-child { border-top: 0; padding-top: 4px; }
/* The heading rule already separates the first item, so it drops its own rule */
:root[data-style="editorial"] .pubs > .pub:first-child { border-top: 0; padding-top: 4px; }
:root[data-style="editorial"] :is(.interests, .software) { gap: 12px 40px; }
:root[data-style="editorial"] .contact-card {
  padding: 14px 0 0;
  border: 0;
  border-top: 2px solid var(--border-strong);
  background: none;
}
:root[data-style="editorial"] .pubs:not(.pubs-plain) .badge {
  background: transparent;
  border: 2px solid var(--venue);
  color: var(--venue);
}
:root[data-style="editorial"] .chip-link { border: 1.5px solid var(--border-strong); background: none; font-weight: 600; box-shadow: none; }
:root[data-style="editorial"] .chip-link:hover { background: var(--text); color: var(--bg); }
:root[data-style="editorial"] .chip-link:hover svg { color: inherit; }
/* A dark outlined box means "clickable"; labels that only inform are plain text */
:root[data-style="editorial"] .btn { border-color: var(--border-strong); color: var(--text); }
:root[data-style="editorial"] .btn svg { color: var(--text-2); }
:root[data-style="editorial"] .btn:hover { background: var(--text); border-color: var(--text); color: var(--bg); }
:root[data-style="editorial"] .btn:hover svg { color: inherit; }
:root[data-style="editorial"] .award { padding: 0; background: none; color: var(--text-2); }
:root[data-style="editorial"] .award svg { color: var(--accent); }
:root[data-style="editorial"] .pub-awards { gap: 4px 16px; }
:root[data-style="editorial"] .role {
  padding: 0;
  border: 0;
  color: var(--quiet);
  font-size: .7rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}
:root[data-style="editorial"] .section-head p { color: var(--quiet); }
:root[data-style="editorial"] .tech { gap: 6px; }
:root[data-style="editorial"] .tech li { padding: 0; border: 0; background: none; color: var(--quiet); font-size: .8rem; font-weight: 500; }
:root[data-style="editorial"] .tech li + li::before { content: "·"; margin-right: 6px; }
/* Links inside running text keep the text colour; red stays for the few accents */
:root[data-style="editorial"] :is(.bio, .tool p:not(.tool-tagline), .news p, .section-head p) a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 55%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
}
:root[data-style="editorial"] :is(.bio, .tool p:not(.tool-tagline), .news p, .section-head p) a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}
:root[data-style="editorial"] .tool-tagline {
  color: var(--quiet);
  font-size: 1rem;
  font-style: italic;
  font-weight: 450;
}

/* --------------------------------------------------------------------------
   Blueprint: engineering drawing, monospace headings on grid paper
   -------------------------------------------------------------------------- */

:root[data-style="blueprint"] {
  --serif: var(--mono);
  --bg: #f4f8fd;
  --bg-soft: #eaf1fa;
  --surface: #ffffff;
  --text: #0d2340;
  --text-2: #2b4569;
  --muted: #5b7193;
  --border: #c8d7ea;
  --border-strong: #8fadd2;
  --accent: #0b5cad;
  --accent-hover: #08467f;
  --accent-soft: #e1edfa;
  --accent-ring: rgba(11, 92, 173, .25);
  --venue: #0b5cad;
  --grid: rgba(11, 92, 173, .07);
  --shadow: none;
  --shadow-lg: none;
  --radius: 0;
  --radius-sm: 0;
}
@media (prefers-color-scheme: dark) {
  :root[data-style="blueprint"]:not([data-theme="light"]) {
    --bg: #0a2342; --bg-soft: #0d2a4f; --surface: #0d2a4f;
    --text: #e8f0fa; --text-2: #bcd0e8; --muted: #86a1c4;
    --border: #1f4a7a; --border-strong: #3f73aa;
    --accent: #8fd0ff; --accent-hover: #b9e2ff; --accent-soft: #123a66; --accent-ring: rgba(143, 208, 255, .35);
    --gold: #f0c674; --gold-soft: #1c3550; --green: #7ee0b0; --green-soft: #123a33;
    --venue: #8fd0ff; --grid: rgba(143, 208, 255, .08);
  }
}
:root[data-style="blueprint"][data-theme="dark"] {
  --bg: #0a2342; --bg-soft: #0d2a4f; --surface: #0d2a4f;
  --text: #e8f0fa; --text-2: #bcd0e8; --muted: #86a1c4;
  --border: #1f4a7a; --border-strong: #3f73aa;
  --accent: #8fd0ff; --accent-hover: #b9e2ff; --accent-soft: #123a66; --accent-ring: rgba(143, 208, 255, .35);
  --gold: #f0c674; --gold-soft: #1c3550; --green: #7ee0b0; --green-soft: #123a33;
  --venue: #8fd0ff; --grid: rgba(143, 208, 255, .08);
}
:root[data-style="blueprint"] body {
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
}
:root[data-style="blueprint"] .section:nth-of-type(even) { background: transparent; }
:root[data-style="blueprint"] :is(h1, .section-head h2) { font-weight: 600; letter-spacing: -.03em; }
:root[data-style="blueprint"] :is(.subhead, .eyebrow) { font-family: var(--mono); letter-spacing: .04em; }
:root[data-style="blueprint"] .subhead::after { height: 0; background: none; border-top: 1px dashed var(--border-strong); }
:root[data-style="blueprint"] :is(.pubs:not(.pubs-plain) .pub, .tool, .interests li, .contact-card) {
  border-color: var(--border-strong);
  box-shadow: none;
}
:root[data-style="blueprint"] .interests li:first-child { border: 1.5px solid var(--accent); }
:root[data-style="blueprint"] .pubs:not(.pubs-plain) .badge {
  background: transparent;
  border: 1.5px solid var(--venue);
  color: var(--venue);
}
:root[data-style="blueprint"] .portrait { border: 1.5px solid var(--border-strong); }

/* --------------------------------------------------------------------------
   Swiss: bold sans type, black and red, hard edges
   -------------------------------------------------------------------------- */

:root[data-style="swiss"] {
  --serif: var(--sans);
  --bg: #ffffff;
  --bg-soft: #f3f3f3;
  --surface: #ffffff;
  --text: #0a0a0a;
  --text-2: #1f1f1f;
  --muted: #5c5c5c;
  --border: #dadada;
  --border-strong: #0a0a0a;
  --accent: #d92519;
  --accent-hover: #ad1b11;
  --accent-soft: #fde9e7;
  --accent-ring: rgba(217, 37, 25, .3);
  --gold: #0a0a0a;
  --gold-soft: #f3f3f3;
  --venue: #0a0a0a;
  --shadow: none;
  --shadow-lg: none;
  --radius: 0;
  --radius-sm: 0;
}
@media (prefers-color-scheme: dark) {
  :root[data-style="swiss"]:not([data-theme="light"]) {
    --bg: #0a0a0a; --bg-soft: #141414; --surface: #0a0a0a;
    --text: #f5f5f5; --text-2: #e0e0e0; --muted: #9e9e9e;
    --border: #2b2b2b; --border-strong: #f5f5f5;
    --accent: #ff4636; --accent-hover: #ff7a6e; --accent-soft: #2b100d; --accent-ring: rgba(255, 70, 54, .35);
    --gold: #f5f5f5; --gold-soft: #1c1c1c; --venue: #f5f5f5;
  }
}
:root[data-style="swiss"][data-theme="dark"] {
  --bg: #0a0a0a; --bg-soft: #141414; --surface: #0a0a0a;
  --text: #f5f5f5; --text-2: #e0e0e0; --muted: #9e9e9e;
  --border: #2b2b2b; --border-strong: #f5f5f5;
  --accent: #ff4636; --accent-hover: #ff7a6e; --accent-soft: #2b100d; --accent-ring: rgba(255, 70, 54, .35);
  --gold: #f5f5f5; --gold-soft: #1c1c1c; --venue: #f5f5f5;
}
:root[data-style="swiss"] h1 {
  font-size: clamp(3rem, 7vw, 5.25rem);
  font-weight: 800;
  line-height: .95;
  letter-spacing: -.045em;
}
:root[data-style="swiss"] .section-head h2 { font-size: 2.6rem; font-weight: 800; letter-spacing: -.035em; }
:root[data-style="swiss"] :is(.pub-title, .tool h3, .interests h3, .brand) { font-weight: 700; letter-spacing: -.02em; }
:root[data-style="swiss"] .subhead { color: var(--text); font-weight: 800; letter-spacing: .14em; }
:root[data-style="swiss"] .subhead::after { height: 2px; background: var(--border-strong); }
:root[data-style="swiss"] :is(.pubs:not(.pubs-plain) .pub, .tool, .interests li, .contact-card) {
  border: 2px solid var(--border-strong);
  box-shadow: none;
}
:root[data-style="swiss"] :is(.pubs:not(.pubs-plain) .pub, .tool, .interests li):hover { border-color: var(--accent); }
:root[data-style="swiss"] .interests li:first-child { border-color: var(--accent); }
:root[data-style="swiss"] .badge { color: var(--bg); }
:root[data-style="swiss"] .pubs-plain .badge { color: var(--text-2); }
:root[data-style="swiss"] .chip-link { border: 2px solid var(--border-strong); font-weight: 700; box-shadow: none; }
:root[data-style="swiss"] .chip-link:hover { background: var(--text); color: var(--bg); }
:root[data-style="swiss"] .chip-link:hover svg { color: inherit; }
:root[data-style="swiss"] .award { border: 1px solid var(--border-strong); }
:root[data-style="swiss"] .portrait img { filter: grayscale(1) contrast(1.05); }

/* --------------------------------------------------------------------------
   Terminal: monospace throughout, like a shell session
   -------------------------------------------------------------------------- */

:root[data-style="terminal"] {
  --sans: var(--mono);
  --serif: var(--mono);
  --bg: #f6f6ef;
  --bg-soft: #ededE3;
  --surface: #fbfbf6;
  --text: #1b1d18;
  --text-2: #33362f;
  --muted: #6c7066;
  --border: #d6d6c8;
  --border-strong: #a9aa98;
  --accent: #0b7a3b;
  --accent-hover: #075a2b;
  --accent-soft: #e2f1e6;
  --accent-ring: rgba(11, 122, 59, .3);
  --gold: #8a5a00;
  --gold-soft: #f4ead2;
  --venue: #0b7a3b;
  --shadow: none;
  --shadow-lg: none;
  --radius: 0;
  --radius-sm: 0;
}
@media (prefers-color-scheme: dark) {
  :root[data-style="terminal"]:not([data-theme="light"]) {
    --bg: #0b0e0b; --bg-soft: #0f130f; --surface: #0f130f;
    --text: #d4ecd4; --text-2: #a9cba9; --muted: #6f8d6f;
    --border: #1e2b1e; --border-strong: #345034;
    --accent: #5df29a; --accent-hover: #9bf7c0; --accent-soft: #102a19; --accent-ring: rgba(93, 242, 154, .3);
    --gold: #e8c167; --gold-soft: #262112; --green: #5df29a; --green-soft: #102a19;
    --venue: #1b6e3d;
  }
}
:root[data-style="terminal"][data-theme="dark"] {
  --bg: #0b0e0b; --bg-soft: #0f130f; --surface: #0f130f;
  --text: #d4ecd4; --text-2: #a9cba9; --muted: #6f8d6f;
  --border: #1e2b1e; --border-strong: #345034;
  --accent: #5df29a; --accent-hover: #9bf7c0; --accent-soft: #102a19; --accent-ring: rgba(93, 242, 154, .3);
  --gold: #e8c167; --gold-soft: #262112; --green: #5df29a; --green-soft: #102a19;
  --venue: #1b6e3d;
}
:root[data-style="terminal"] body { font-size: 15px; line-height: 1.7; font-feature-settings: normal; }
:root[data-style="terminal"] h1 { font-size: clamp(2rem, 4.2vw, 2.9rem); letter-spacing: -.02em; }
:root[data-style="terminal"] h1::after {
  content: "_";
  margin-left: .05em;
  color: var(--accent);
  animation: cursor-blink 1.1s steps(1) infinite;
}
@keyframes cursor-blink { 50% { opacity: 0; } }
:root[data-style="terminal"] .section-head h2 { font-size: 1.6rem; letter-spacing: -.01em; }
:root[data-style="terminal"] .section-head h2::before { content: "# "; color: var(--accent); }
:root[data-style="terminal"] .subhead { text-transform: lowercase; letter-spacing: 0; font-size: .85rem; }
:root[data-style="terminal"] .subhead::before { content: "//"; color: var(--accent); }
:root[data-style="terminal"] .eyebrow { text-transform: none; letter-spacing: 0; font-size: .85rem; }
:root[data-style="terminal"] .eyebrow::before { content: "$"; width: auto; height: auto; background: none; }
:root[data-style="terminal"] :is(.pubs:not(.pubs-plain) .pub, .tool, .interests li, .contact-card, .chip-link) {
  border-style: dashed;
  border-color: var(--border-strong);
  box-shadow: none;
}
:root[data-style="terminal"] .interests li:first-child { border-style: solid; border-color: var(--accent); }

@media (max-width: 680px) {
  :root:is([data-style="swiss"], [data-style="editorial"]) .section-head h2 { font-size: 2rem; }
  /* Monospace cannot tighten letters, so justified narrow columns leave wide gaps */
  :root[data-style="terminal"] :is(.bio p, .interests p, .tool p, .panel p) { text-align: left; }
}

/* ==========================================================================
   Print
   ========================================================================== */

@media print {
  .nav, .skip, .pub-actions, .copy-btn, .footer-links { display: none !important; }
  .section, .hero { padding: 24px 0; background: none !important; }
  .pub, .tool, .interests li { box-shadow: none; break-inside: avoid; }
  a { color: inherit; }
}
