/* Styles for the "modern" layout. Plain CSS, no build step. */

/* Typefaces are hosted with the site (both under the SIL Open Font License). */
@font-face { font-family: "Bricolage Grotesque"; src: url("../fonts/bricolage-grotesque-latin-wght-normal.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("../fonts/source-sans-3-latin-wght-normal.woff2") format("woff2"); font-weight: 200 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("../fonts/source-sans-3-latin-wght-italic.woff2") format("woff2"); font-weight: 200 900; font-style: italic; font-display: swap; }

:root {
  --bg: #f5f7f8;
  --surface: #ffffff;
  --ink: #17212b;
  --muted: #55636f;
  --line: #d9e0e4;
  --accent: #0b6f6a;
  --mark: #f0b429;
  --mark-ink: #3a2a00;
  --seg: #c9d6da;
  --seg-ink: #24323c;
  --display: "Bricolage Grotesque", "Source Sans 3", system-ui, sans-serif;
  --body: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #10161c;
    --surface: #18212a;
    --ink: #e7ecef;
    --muted: #9dabb6;
    --line: #2b3742;
    --accent: #5cc8c0;
    --mark: #f2c14e;
    --mark-ink: #2b1f00;
    --seg: #2f3d49;
    --seg-ink: #dbe3e8;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #10161c;
  --surface: #18212a;
  --ink: #e7ecef;
  --muted: #9dabb6;
  --line: #2b3742;
  --accent: #5cc8c0;
  --mark: #f2c14e;
  --mark-ink: #2b1f00;
  --seg: #2f3d49;
  --seg-ink: #dbe3e8;
  color-scheme: dark;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.125rem;
  line-height: 1.6;
}

h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }

.wrap { width: min(100% - 2rem, 66rem); margin-inline: auto; }

.skip { position: absolute; left: -999px; top: 0; background: var(--surface); padding: 0.5rem 0.9rem; z-index: 20; }
.skip:focus { left: 0.5rem; top: 0.5rem; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 10; background: var(--bg); border-bottom: 1px solid var(--line); }
.topbar-in { display: flex; align-items: center; gap: 1.25rem; min-height: 3.5rem; }
.brand { font-family: var(--display); font-weight: 700; color: var(--ink); text-decoration: none; white-space: nowrap; }
.topbar nav { margin-left: auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.topbar nav::-webkit-scrollbar { display: none; }
.topbar ul { display: flex; gap: 1.35rem; white-space: nowrap; }
.topbar nav a { color: var(--muted); text-decoration: none; font-size: 1rem; display: block; padding: 0.9rem 0; }
.topbar nav a:hover { color: var(--ink); }
.theme { flex: none; display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.theme:hover { color: var(--ink); border-color: var(--muted); }
.theme .i-sun { display: none; }
:root[data-theme="dark"] .theme .i-sun { display: block; }
:root[data-theme="dark"] .theme .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme .i-sun { display: block; }
  :root:not([data-theme="light"]) .theme .i-moon { display: none; }
}

/* Hero */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) 15rem; gap: 3.5rem; align-items: start; padding-top: 4.5rem; }
.hero h1 { font-family: var(--display); font-weight: 700; font-size: clamp(2.6rem, 7vw, 4.5rem); line-height: 1; letter-spacing: -0.03em; }
.hero .role { font-size: 1.3rem; line-height: 1.35; color: var(--muted); margin-top: 0.9rem; }
.hero-text > p:not(.role) { max-width: 38em; margin-top: 1.15rem; }
.contact { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; margin-top: 1.6rem; }
.contact a { font-weight: 600; }
.portrait { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 10px; margin-top: 0.5rem; }

/* Sections: heading in a left column, content on the right */
.sec { display: grid; grid-template-columns: 13rem minmax(0, 1fr); gap: 2rem 2.5rem; padding-top: 3rem; margin-top: 3.5rem; border-top: 1px solid var(--line); }
.sec > h2 { font-family: var(--display); font-weight: 700; font-size: 1.5rem; line-height: 1.15; letter-spacing: -0.015em; position: sticky; top: 5rem; align-self: start; }
.sec-body { max-width: 46rem; }
.sec-body > * + * { margin-top: 1.25rem; }
h3 { font-size: 1.125rem; font-weight: 600; line-height: 1.35; }
h3.sub { font-size: 1rem; color: var(--muted); margin-top: 2.25rem; }
h3.sub:first-child { margin-top: 0; }
h3.sub + * { margin-top: 0.6rem; }
.lede, .aside, .dim { color: var(--muted); }
.when { color: var(--muted); font-size: 1rem; font-variant-numeric: tabular-nums; }

/* News */
.news li { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: 1rem; padding: 0.45rem 0; }
.more summary { cursor: pointer; color: var(--accent); font-weight: 600; width: fit-content; }
.more[open] summary { margin-bottom: 0.5rem; }

/* Publications */
.pubs > li { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: 1rem; padding: 1.1rem 0; border-top: 1px solid var(--line); scroll-margin-top: 5rem; }
.pubs > li:first-child { border-top: 0; padding-top: 0; }
.pubs > li:target h3 { background: color-mix(in srgb, var(--mark) 45%, transparent); box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--mark) 45%, transparent); border-radius: 2px; width: fit-content; }
.venue { line-height: 1.3; }
.venue strong { display: block; color: var(--accent); font-weight: 600; }
.venue span { color: var(--muted); font-size: 0.95rem; }
.authors { color: var(--muted); margin-top: 0.15rem; }
.authors strong { color: var(--ink); font-weight: 600; }
.links { display: flex; flex-wrap: wrap; gap: 0.2rem 1.1rem; margin-top: 0.35rem; font-size: 1rem; }
.links .note { color: var(--muted); }

/* Experience and education rows */
.rows > li { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: 1rem; padding: 1.1rem 0; border-top: 1px solid var(--line); }
.rows > li:first-child { border-top: 0; padding-top: 0; }
.rows .when { line-height: 1.35; padding-top: 0.15rem; }
.org { color: var(--muted); }
.rows div > p:not(.org), .rows .plain { margin-top: 0.4rem; }

/* Lists */
.list li, .plain li { position: relative; padding-left: 1.1rem; }
.list li + li { margin-top: 0.5rem; }
.list li::before, .plain li::before { content: ""; position: absolute; left: 0; top: 0.68em; width: 0.4rem; height: 2px; background: var(--muted); }

.courses { width: 100%; border-collapse: collapse; font-size: 1rem; }
.courses th { text-align: left; font-weight: 600; color: var(--muted); padding: 0 1rem 0.4rem 0; border-bottom: 1px solid var(--line); }
.courses td { padding: 0.5rem 1rem 0.5rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.courses td:nth-child(2) { white-space: nowrap; color: var(--muted); }
.courses th:last-child, .courses td:last-child { padding-right: 0; }

.pairs { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 0.5rem 1rem; }
.pairs dt { color: var(--muted); }

main > .sec:first-child { border-top: 0; margin-top: 0; padding-top: 4rem; }

/* Footer */
.foot { margin-top: 5rem; border-top: 1px solid var(--line); }
.foot-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; padding: 1.5rem 0 2.5rem; color: var(--muted); font-size: 1rem; }

/* Narrow screens */
@media (max-width: 52rem) {
  .hero { grid-template-columns: 1fr; gap: 1.75rem; padding-top: 2.5rem; }
  .portrait { order: -1; width: 8.5rem; margin-top: 0; }
  .sec { grid-template-columns: 1fr; gap: 1.25rem; padding-top: 2.25rem; margin-top: 2.5rem; }
  .sec > h2 { position: static; }
  }

@media (max-width: 34rem) {
  body { font-size: 1.0625rem; }
  .topbar-in { gap: 0.9rem; }
  .topbar ul { gap: 1.1rem; }
  .news li, .pubs > li, .rows > li { grid-template-columns: 1fr; gap: 0.15rem; }
  .venue strong { display: inline; }
  .pairs { grid-template-columns: 1fr; gap: 0.1rem; }
  .pairs dd + dt { margin-top: 0.6rem; }
  .courses thead { display: none; }
  .courses tr { display: block; padding: 0.55rem 0; border-bottom: 1px solid var(--line); }
  .courses td { display: block; padding: 0; border: 0; }
  .courses td:first-child { font-weight: 600; }
  .courses td:last-child { color: var(--muted); }
}

@media print {
  .topbar, .theme, .more summary, .skip { display: none; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .sec { margin-top: 1.5rem; padding-top: 1rem; }
}

