/* ==========================================================================
   Swiss grid, two inks (alpine blue, fir green), one typeface.
   Change the look from the tokens below.
   ========================================================================== */

@font-face {
  font-family: "Inter Tight";
  src: url("../fonts/InterTight-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter Tight";
  src: url("../fonts/InterTight-latin-wght-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: light;

  --ink: #0c2438;
  --ink-soft: #45606f;
  --rule: #c7d5db;
  --page: #ffffff;
  --wash: #edf4f5;

  --blue: #0d4f94;
  --blue-deep: #0a2e50;
  --green: #1c6b51;
  --green-wash: #e2efe8;

  --margin: clamp(20px, 3.2vw, 48px);
  --gutter: clamp(12px, 1.7vw, 24px);
  --col: calc((100% - 2 * var(--margin) - 11 * var(--gutter)) / 12);

  --font: "Inter Tight", "Neue Haas Grotesk Text", "Helvetica Neue", Helvetica, Arial, sans-serif;

  --t-small: 0.8125rem;
  --t-body: 1.0625rem;
  --t-lead: clamp(1.25rem, 1.7vw, 1.5rem);
  --t-h3: clamp(1.25rem, 1.7vw, 1.5rem);
  --t-h2: clamp(1.875rem, 3.9vw, 3.75rem);
  --t-title: clamp(3.25rem, 9.5vw, 9.5rem);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--t-body);
  line-height: 1.5;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }

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

a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.link {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color 0.15s;
}
.link:hover { color: var(--green); }

.skip {
  position: absolute;
  left: var(--margin);
  top: -60px;
  z-index: 20;
  padding: 8px 12px;
  background: var(--blue-deep);
  color: #fff;
}
.skip:focus { top: 8px; }

.num { font-variant-numeric: tabular-nums; }

/* -------------------------------------------------------------- the grid */

.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  padding-inline: var(--margin);
}

.section {
  position: relative;
  padding-block: clamp(32px, 3.6vw, 56px) clamp(48px, 5vw, 80px);
}
.section::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--margin);
  right: var(--margin);
  height: 1px;
  background: var(--rule);
}
/* A map graticule cross where the rule meets the content column. */
.section::after {
  content: "";
  position: absolute;
  top: -6px;
  left: calc(var(--margin) + 2 * (var(--col) + var(--gutter)));
  width: 11px;
  height: 11px;
  background:
    linear-gradient(var(--blue), var(--blue)) center / 100% 1px no-repeat,
    linear-gradient(var(--blue), var(--blue)) center / 1px 100% no-repeat,
    var(--page);
}
.section--flush::before, .section--flush::after { display: none; }

.side { grid-column: 1 / span 2; }
.main { grid-column: 3 / -1; }
.main--text { grid-column: 3 / span 7; }

@media (max-width: 760px) {
  .side, .main, .main--text { grid-column: 1 / -1; }
  .side { margin-bottom: 20px; }
  .section::after { display: none; }
}




/* -------------------------------------------------------- the paper header */

.ridge {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  height: clamp(250px, 36vh, 340px);
  background: #e7f0f3;
}
.ridge--home { height: clamp(360px, 74vh, 820px); }
/* Small viewport units keep the canvas steady as a phone's address bar slides away. */
@supports (height: 1svh) {
  .ridge { height: clamp(250px, 36svh, 340px); }
  .ridge--home { height: clamp(360px, 74svh, 820px); }
}

.ridge canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

/* Static fallback when WebGL2 or JavaScript is unavailable. */
.ridge.no-gl, html:not(.js) .ridge {
  background: #e7f0f3 url("../img/mountains-fallback.svg") center bottom / cover no-repeat;
}
.ridge.no-gl canvas, html:not(.js) .ridge canvas { display: none; }

.nav {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px 24px;
  flex-wrap: wrap;
  padding: 16px var(--margin);
  font-size: 0.9375rem;
}
.nav__home {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  align-self: center;
}
.nav__links {
  display: flex;
  flex-wrap: wrap;
  gap: 2px clamp(14px, 2vw, 28px);
}
.nav__links a {
  padding-block: 2px;
  border-bottom: 1px solid transparent;
}
.nav__links a:hover { color: var(--blue); border-bottom-color: currentColor; }
.nav__links a[aria-current] { color: var(--blue); font-weight: 600; border-bottom: 2px solid var(--blue); }

/* After dark the sky turns blue, so the navigation turns white. */
.is-night .nav { color: #fff; }
.is-night .nav__links a:hover,
.is-night .nav__links a[aria-current] { color: #fff; border-bottom-color: #fff; }

@media (max-width: 600px) {
  .nav { padding-block: 8px; }
  .nav__home { padding-block: 9px; }
  .nav__links a { display: inline-block; padding: 9px 2px; }
  .rows__links a, .footer li a { display: inline-block; padding-block: 5px; }
  .footer__nav li + li, .footer__out li + li { margin-top: 0; }
}

/* Page title on inner pages: below the band, on the grid. */
.page-head {
  padding-block: clamp(24px, 3vw, 40px) clamp(36px, 5vw, 72px);
}
.page-head__title {
  grid-column: 1 / -1;
  font-size: var(--t-title);
  line-height: 0.95;
  letter-spacing: -0.04em;
  margin-left: -0.04em;
  color: var(--blue-deep);
}
.page-head--post .page-head__title {
  grid-column: 1 / span 10;
  font-size: clamp(2.25rem, 5.6vw, 5.5rem);
  line-height: 1.02;
  letter-spacing: -0.032em;
  margin-left: -0.02em;
}
.page-head__lede {
  grid-column: 3 / span 7;
  margin-top: clamp(20px, 2.6vw, 36px);
  font-size: var(--t-lead);
  line-height: 1.3;
  letter-spacing: -0.01em;
}
@media (max-width: 760px) {
  .page-head__lede { grid-column: 1 / -1; }
}

/* --------------------------------------------------------------- type sets */

.after-statement { margin-top: clamp(20px, 2.4vw, 32px); }

.h3 {
  font-size: var(--t-h3);
  line-height: 1.2;
  letter-spacing: -0.015em;
  font-weight: 500;
}

.text > * + * { margin-top: 1em; }
.text { max-width: 40em; }
.muted { color: var(--ink-soft); }
.small { font-size: var(--t-small); line-height: 1.45; }

/* Panel: a flat block of colour, as on a poster. */
.panel {
  background: var(--blue-deep);
  color: #fff;
  padding-block: clamp(28px, 3.4vw, 48px);
}
.panel--green { background: var(--green); }
/* Numbered columns */
.cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px var(--gutter);
}
.cols__n {
  display: block;
  font-size: var(--t-small);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--green);
  margin-bottom: 28px;
}
.cols .h3 { margin-bottom: 10px; }
@media (max-width: 900px) {
  .cols { grid-template-columns: minmax(0, 1fr); }
  .cols__n { margin-bottom: 10px; }
}

/* Tabular rows: a date or key on the left, an entry on the right. */
.rows > li, .rows > div {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  column-gap: var(--gutter);
  padding-block: 14px 16px;
  border-top: 1px solid var(--rule);
}
/* The section rule already sits above the first row, so its label lines up. */
.rows > li:first-child, .rows > div:first-child { border-top: 0; padding-top: 0; }
.rows--links > li:first-child a { padding-top: 0; }
.rows > li:last-child, .rows > div:last-child { border-bottom: 1px solid var(--rule); }
.rows__key {
  grid-column: 1 / span 2;
  font-size: var(--t-small);
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
}
.rows__val { grid-column: 3 / -1; }
.rows__val > * + * { margin-top: 4px; }
.rows__title { font-weight: 500; }
a.rows__title:hover, .rows__title a:hover { color: var(--blue); }
.rows__links {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 14px;
  font-size: var(--t-small);
}
@media (max-width: 600px) {
  .rows__key { grid-column: 1 / -1; margin-bottom: 2px; }
  .rows__val { grid-column: 1 / -1; }
}

/* Whole-row link for blog lists */
.rows--links > li { padding: 0; display: block; }
.rows--links a {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  column-gap: var(--gutter);
  padding-block: 14px 16px;
  transition: color 0.15s, padding-left 0.25s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.rows--links a:hover { color: var(--blue); }
.rows__time {
  grid-column: 8 / -1;
  text-align: right;
  font-size: var(--t-small);
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
}
.rows--links .rows__val { grid-column: 3 / span 5; }
@media (max-width: 600px) {
  .rows--links .rows__val { grid-column: 1 / -1; }
  .rows__time { grid-column: 1 / -1; text-align: left; }
}

.group + .group { margin-top: clamp(40px, 5vw, 64px); }
.group__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
}

/* Project entries */
.project + .project { margin-top: clamp(36px, 4vw, 56px); }
.project .h3 { margin-bottom: 10px; }
.project__meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px var(--gutter);
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
  font-size: var(--t-small);
}
.project__meta dt { font-weight: 600; }
.project__meta dd { color: var(--ink-soft); }
@media (max-width: 600px) {
  .project__meta { grid-template-columns: minmax(0, 1fr); }
}

/* Contact */
.email {
  display: inline-block;
  font-size: clamp(1.625rem, 5.4vw, 5rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 500;
  color: var(--blue);
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-decoration-thickness: 0.04em;
  text-underline-offset: 0.12em;
  transition: color 0.15s;
}
.email:hover { color: var(--green); }

.button {
  display: inline-block;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 9px 14px;
  background: var(--blue);
  color: #fff;
  border: 0;
  cursor: pointer;
  transition: background-color 0.15s;
}
.button:hover { background: var(--green); }
.page-head__lede .button { display: table; margin-top: 16px; }

/* -------------------------------------------------------------- blog posts */

.prose { max-width: 40em; }
.prose > * + * { margin-top: 1em; }
.prose h2 {
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-top: 2em;
  color: var(--blue-deep);
}
.prose h3 { font-size: 1.1875rem; line-height: 1.25; font-weight: 600; margin-top: 1.6em; }
.prose a { color: var(--blue); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
.prose a:hover { color: var(--green); }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose ul { list-style: square; }
.prose ol { list-style: decimal; }
.prose li + li { margin-top: 0.35em; }
.prose li::marker { color: var(--green); }
.prose blockquote {
  border-left: 3px solid var(--green);
  padding-left: 18px;
  font-size: var(--t-lead);
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.prose code {
  font-family: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
  font-size: 0.875em;
  background: var(--wash);
  padding: 0.1em 0.3em;
}
.prose pre {
  background: var(--wash);
  padding: 16px 18px;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.5;
}
.prose pre code { background: none; padding: 0; }
.prose figure { margin-block: 2em; }
.prose figcaption { margin-top: 8px; font-size: var(--t-small); color: var(--ink-soft); }
.figure-slot {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 7;
  background: var(--wash);
  color: var(--ink-soft);
  font-size: var(--t-small);
}
.prose sup a { text-decoration: none; font-variant-numeric: tabular-nums; padding-inline: 1px; }
.footnotes {
  margin-top: 3em;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
  font-size: var(--t-small);
  color: var(--ink-soft);
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  font-size: var(--t-small);
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
}
.post-meta > div + div { margin-top: 0; }

/* ------------------------------------------------------------------ footer */

.footer {
  position: relative;
  overflow: hidden;
  background: var(--blue-deep) url("../img/contours.svg") right -8vw top -14vw / max(900px, 72vw) auto no-repeat;
  color: #fff;
  font-size: 0.9375rem;
  padding-block: clamp(36px, 4.4vw, 60px);
}
.footer a { transition: opacity 0.15s; }
.footer a:hover { text-decoration: underline; text-underline-offset: 0.18em; }
.footer__name {
  grid-column: 1 / span 3;
  font-weight: 600;
}
.footer__nav { grid-column: 4 / span 3; }
.footer__out { grid-column: 7 / span 3; }
.footer__nav li + li, .footer__out li + li { margin-top: 2px; }
@media (max-width: 760px) {
  .footer__name { grid-column: 1 / -1; margin-bottom: 20px; }
  .footer__nav { grid-column: 1 / span 6; }
  .footer__out { grid-column: 7 / -1; }
}

/* ------------------------------------------------------------------- print */

@media print {
  .ridge, .footer, .no-print, .skip { display: none !important; }
  .section::before, .section::after { display: none; }
  body { font-size: 10.5pt; line-height: 1.35; }
  .print-name { display: block !important; font-size: 26pt; font-weight: 500; letter-spacing: -0.03em; }
  .page-head { padding-block: 0 8pt; }
  .page-head:has(.print-name) .page-head__title { display: none; }
  .page-head__lede { grid-column: 1 / -1; margin: 0; }
  .section { padding-block: 8pt; break-inside: avoid-page; }
  .grid { padding-inline: 0; }
  .rows > li, .rows > div { padding-block: 3pt; break-inside: avoid; }
  a { color: inherit !important; text-decoration: none !important; }
}
.print-name { display: none; }

/* ---------------------------------------------------------------- home page */

.lead {
  font-size: var(--t-lead);
  line-height: 1.3;
  letter-spacing: -0.01em;
}
#about, #research, #publications { scroll-margin-top: 16px; }

/* ----------------------------------------------------------- section headings */

.label {
  align-self: start;
  font-size: clamp(1.375rem, 1.9vw, 1.75rem);
  line-height: 1.1;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--blue-deep);
}
.panel .label { color: inherit; }

/* The heading column needs a little more room on tablets. */
@media (min-width: 761px) and (max-width: 1100px) {
  .side { grid-column: 1 / span 3; }
  .main { grid-column: 4 / -1; }
  .main--text { grid-column: 4 / span 8; }
  .page-head__lede { grid-column: 4 / span 8; }
  .section::after { left: calc(var(--margin) + 3 * (var(--col) + var(--gutter))); }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media print {
  .label { font-size: 11pt; font-weight: 600; }
}
