/* ---------------------------------------------------------------------------
   Design tokens adapted from the gloed.nl Webflow design system.
   White theme only.
   --------------------------------------------------------------------------- */

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

@font-face {
  font-family: "Inter";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/InterVariable-Italic.woff2") format("woff2");
}

:root {
  /* colour */
  --white: #ffffff;
  --black: #000000;
  --beige: #f8f7f3;
  --grey-100: #dddddd;
  --grey-200: #b6b6b6;
  --grey-300: #6b6b6b;
  --grey-400: #474747;
  --grey-900: #0a0a0a;

  /* fixed spacing scale */
  --s-0125: 0.125rem;
  --s-025: 0.25rem;
  --s-05: 0.5rem;
  --s-075: 0.75rem;
  --s-1: 1rem;
  --s-1125: 1.125rem;
  --s-125: 1.25rem;
  --s-15: 1.5rem;
  --s-175: 1.75rem;
  --s-2: 2rem;
  --s-225: 2.25rem;
  --s-25: 2.5rem;
  --s-275: 2.75rem;
  --s-3: 3rem;
  --s-35: 3.5rem;
  --s-4: 4rem;
  --s-45: 4.5rem;
  --s-5: 5rem;
  --s-55: 5.5rem;
  --s-6: 6rem;
  --s-8: 8rem;
  --s-10: 10rem;

  /* section rhythm */
  --section-xs: var(--s-4);
  --section-s: var(--s-6);
  --section-m: var(--s-55);
  --section-l: var(--s-10);

  /* typography */
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --track-tight: -0.02em;

  /* layout */
  --container: 75rem;
  --gutter: var(--s-15);
}

/* --------------------------------------------------------------------------- */

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

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

body {
  margin: 0;
  background: var(--white);
  color: var(--black);
  font-family: var(--font);
  font-size: 1.0625rem;
  font-weight: var(--fw-regular);
  line-height: 1.55;
  font-feature-settings: "cv05" 1, "ss03" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  text-decoration-color: var(--grey-200);
  transition: text-decoration-color 0.15s ease, color 0.15s ease;
}

a:hover {
  text-decoration-color: var(--black);
}

a:focus-visible {
  outline: 2px solid var(--black);
  outline-offset: 3px;
  text-decoration-color: transparent;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: var(--fw-medium);
  letter-spacing: var(--track-tight);
  text-wrap: balance;
}

p {
  margin: 0 0 var(--s-1);
  max-width: 42em;
}

p:last-child {
  margin-bottom: 0;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* --------------------------------------------------------------------------- */

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

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: var(--s-15);
  top: var(--s-15);
  z-index: 10;
  background: var(--white);
  padding: var(--s-05) var(--s-075);
  border: 1px solid var(--black);
}

/* --- masthead ------------------------------------------------------------- */

.masthead {
  border-bottom: 1px solid var(--grey-100);
}

.masthead__inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-15);
  padding-block: var(--s-125);
  flex-wrap: wrap;
}

.masthead__name {
  font-size: 1.0625rem;
  font-weight: var(--fw-medium);
  letter-spacing: var(--track-tight);
  text-decoration: none;
}

.masthead__nav {
  display: flex;
  gap: var(--s-15);
  font-size: 0.9375rem;
}

.masthead__nav a[aria-current="page"] {
  text-decoration-color: var(--black);
}

/* --- hero ----------------------------------------------------------------- */

.hero {
  padding-block: var(--section-s) var(--section-xs);
}

.hero h1 {
  font-size: clamp(2.5rem, 7.5vw, 6rem);
  line-height: 1;
}

.hero__role {
  margin-top: var(--s-15);
  max-width: 34em;
  font-size: clamp(1.125rem, 2vw, 1.5rem);
  font-weight: var(--fw-regular);
  line-height: 1.3;
  letter-spacing: var(--track-tight);
  color: var(--grey-400);
}

.hero__lede {
  margin-top: var(--s-25);
  max-width: 40em;
  font-size: 1.125rem;
}

/* --- sections ------------------------------------------------------------- */

.section {
  padding-block: var(--section-xs);
  border-top: 1px solid var(--grey-100);
}

.section--last {
  padding-bottom: var(--section-s);
}

.section__label {
  font-size: 0.8125rem;
  font-weight: var(--fw-medium);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--grey-300);
  margin-bottom: var(--s-2);
}

.section__title {
  font-size: clamp(1.75rem, 3.5vw, 3rem);
  line-height: 1.05;
  margin-bottom: var(--s-25);
}

/* two-column label / body layout */
.split {
  display: grid;
  grid-template-columns: 14rem minmax(0, 1fr);
  gap: var(--s-25);
}

/* --- rows ----------------------------------------------------------------- */

.rows > li {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  gap: var(--s-15);
  padding-block: var(--s-15);
  border-top: 1px solid var(--grey-100);
}

.rows > li:first-child {
  border-top: 0;
  padding-top: 0;
}

.rows__when {
  font-variant-numeric: tabular-nums;
  color: var(--grey-300);
  font-size: 0.9375rem;
  padding-top: 0.15em;
}

.rows__what strong {
  font-weight: var(--fw-medium);
}

.rows__where {
  display: block;
  color: var(--grey-300);
  font-size: 0.9375rem;
  margin-top: var(--s-025);
}

/* plain bulletless list with hairlines */
.list > li {
  padding-block: var(--s-1);
  border-top: 1px solid var(--grey-100);
}

.list > li:first-child {
  border-top: 0;
  padding-top: 0;
}

/* --- figures -------------------------------------------------------------- */

.figures {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-35) var(--s-25);
}

.fig {
  margin: 0;
}

.fig__frame {
  background: var(--beige);
  padding: var(--s-15);
}

.figures .fig__frame {
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
}

.figures .fig__frame img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  object-fit: contain;
}

.prose .fig__frame img {
  width: 100%;
}

.fig figcaption {
  margin-top: var(--s-1);
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--grey-400);
}

.fig cite {
  display: block;
  margin-top: var(--s-05);
  font-style: normal;
  font-size: 0.875rem;
  color: var(--grey-300);
}

/* --- publications --------------------------------------------------------- */

main {
  counter-reset: pub;
}

.pubs > li {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  gap: var(--s-1);
  padding-block: var(--s-15);
  border-top: 1px solid var(--grey-100);
}

.pubs > li:first-child {
  border-top: 0;
  padding-top: 0;
}

.pubs > li::before {
  counter-increment: pub;
  content: counter(pub, decimal-leading-zero);
  font-variant-numeric: tabular-nums;
  color: var(--grey-200);
  font-size: 0.9375rem;
  padding-top: 0.2em;
}

.pub__title {
  display: block;
  font-weight: var(--fw-medium);
}

.pub__meta {
  display: block;
  color: var(--grey-300);
  font-size: 0.9375rem;
  margin-top: var(--s-025);
}

.pub__authors {
  display: block;
  font-size: 0.9375rem;
  color: var(--grey-400);
  margin-top: var(--s-025);
}

.self {
  font-weight: var(--fw-semibold);
  color: var(--black);
}

.year {
  font-size: 0.8125rem;
  font-weight: var(--fw-medium);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--grey-300);
  margin: var(--s-3) 0 var(--s-15);
}

.year:first-of-type {
  margin-top: 0;
}

/* --- notes ---------------------------------------------------------------- */

.notes > li {
  padding-block: var(--s-2);
  border-top: 1px solid var(--grey-100);
}

.notes > li:first-child {
  border-top: 0;
  padding-top: 0;
}

.note__date {
  display: block;
  font-size: 0.875rem;
  color: var(--grey-300);
  font-variant-numeric: tabular-nums;
  margin-bottom: var(--s-05);
}

.note__title {
  font-size: clamp(1.375rem, 2.5vw, 2rem);
  line-height: 1.1;
}

.note__title a {
  text-decoration-color: transparent;
}

.note__title a:hover {
  text-decoration-color: var(--black);
}

.note__excerpt {
  margin-top: var(--s-075);
  color: var(--grey-400);
}

/* long-form article body */
.prose {
  max-width: 40em;
}

.prose h2 {
  font-size: 1.5rem;
  line-height: 1.2;
  margin: var(--s-25) 0 var(--s-075);
}

.prose p {
  margin-bottom: var(--s-125);
}

.prose ul {
  margin: 0 0 var(--s-125);
  padding-left: var(--s-125);
  list-style: none;
}

.prose ul li {
  position: relative;
  margin-bottom: var(--s-05);
}

.prose ul li::before {
  content: "—";
  position: absolute;
  left: calc(var(--s-125) * -1);
  color: var(--grey-200);
}

.prose figure {
  margin: var(--s-25) 0;
  max-width: none;
}

.prose figcaption {
  margin-top: var(--s-1);
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--grey-400);
}

.prose cite {
  display: block;
  margin-top: var(--s-05);
  font-style: normal;
  font-size: 0.875rem;
  color: var(--grey-300);
}

.prose .note__date {
  margin-bottom: var(--s-1);
}

.more {
  margin-top: var(--s-15);
}

.hero .note__date {
  margin-bottom: var(--s-1);
}

/* --- project blocks ------------------------------------------------------- */

.projects > li {
  border-top: 1px solid var(--grey-100);
  padding-block: var(--s-25);
}

.projects > li:first-child {
  border-top: 0;
  padding-top: 0;
}

.project {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: var(--s-25);
  align-items: start;
}

.project__fig {
  display: block;
  background: var(--beige);
  padding: var(--s-125);
  text-decoration: none;
  transition: outline-color 0.15s ease;
  outline: 1px solid transparent;
  outline-offset: 0;
}

.project__fig img {
  width: 100%;
}

/* Used when the source article is not openly licensed, so no figure may be
   reproduced. Structural formulae are facts, not the publisher's artwork. */

.project__fig:hover,
.project__fig:focus-visible {
  outline-color: var(--black);
}

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

.project__title {
  font-size: 1.25rem;
  font-weight: var(--fw-medium);
  line-height: 1.25;
  margin-bottom: var(--s-05);
}

.project__what {
  font-size: 1rem;
  color: var(--grey-400);
  margin-bottom: var(--s-1);
}

.project__links {
  margin-top: var(--s-1);
  font-size: 0.9375rem;
  display: flex;
  gap: var(--s-125);
  flex-wrap: wrap;
}

.credit {
  display: block;
  margin-top: var(--s-05);
  font-size: 0.8125rem;
  color: var(--grey-300);
}

/* --- figure lightbox ------------------------------------------------------ */

/* CSS-only: the panel is revealed by :target, so the page still ships no
   JavaScript and the strict CSP needs no exception. Backdrop and close link
   both point back to the project anchor, so dismissing restores scroll. */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
}

.lightbox:target {
  display: grid;
  place-items: center;
  padding: var(--s-2) var(--s-15);
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.72);
  text-decoration: none;
}

.lightbox__panel {
  position: relative;
  background: var(--white);
  max-width: min(94vw, 68rem);
  max-height: 92vh;
  overflow: auto;
  padding: var(--s-25) var(--s-2) var(--s-2);
}

.lightbox__panel img {
  width: 100%;
  height: auto;
}

.lightbox__close {
  position: absolute;
  top: var(--s-075);
  right: var(--s-1);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--grey-300);
  text-decoration: none;
}

.lightbox__close:hover {
  color: var(--black);
}

.lightbox__cap {
  margin-top: var(--s-125);
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--grey-400);
  max-width: none;
}

.lightbox__cap cite {
  display: block;
  margin-top: var(--s-05);
  font-style: normal;
  font-size: 0.875rem;
  color: var(--grey-300);
}

/* --- code, stack, references ---------------------------------------------- */

pre {
  margin: var(--s-15) 0;
  padding: var(--s-125);
  background: var(--beige);
  overflow-x: auto;
  font-size: 0.8125rem;
  line-height: 1.55;
  max-width: none;
}

pre code {
  background: none;
  padding: 0;
  font-size: inherit;
  white-space: pre;
}

.stack {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: 0 var(--s-125);
  margin: var(--s-15) 0;
  font-size: 0.9375rem;
}

.stack dt {
  color: var(--grey-300);
  padding-block: var(--s-05);
  border-top: 1px solid var(--grey-100);
}

.stack dd {
  margin: 0;
  padding-block: var(--s-05);
  border-top: 1px solid var(--grey-100);
}

.refs {
  counter-reset: ref;
  font-size: 0.9375rem;
  margin-top: var(--s-1);
}

.refs > li {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  gap: var(--s-05);
  padding-block: var(--s-05);
  color: var(--grey-400);
}

.refs > li::before {
  counter-increment: ref;
  content: "[" counter(ref) "]";
  color: var(--grey-200);
  font-variant-numeric: tabular-nums;
}

/* --- charts --------------------------------------------------------------- */

/* Inline SVG so the marks inherit the page typeface and the CSP needs no
   exception. One ink for every bar: a single series, identity carried by the
   row label, never by hue. */

.chart {
  width: 100%;
  height: auto;
  display: block;
  margin: var(--s-25) 0 var(--s-1);
  overflow: visible;
}

.chart__bar {
  fill: var(--grey-700);
}

.chart__dot {
  fill: var(--grey-700);
}

.chart__range {
  stroke: var(--grey-700);
  stroke-width: 10;
  stroke-linecap: round;
}

.chart__rule {
  stroke: var(--grey-200);
  stroke-width: 1;
}

.chart__tick {
  fill: var(--grey-300);
  font-size: 11px;
  font-family: var(--font);
  font-variant-numeric: tabular-nums;
}

.chart__axis {
  stroke: var(--grey-100);
  stroke-width: 1;
}

.chart__label {
  fill: var(--grey-400);
  font-size: 12px;
  font-family: var(--font);
}

.chart__value {
  fill: var(--black);
  font-size: 12px;
  font-weight: var(--fw-medium);
  font-family: var(--font);
  font-variant-numeric: tabular-nums;
}

.chart__group {
  fill: var(--grey-300);
  font-size: 11px;
  font-family: var(--font);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Compact variants for charts sitting in a narrow project column. */
.chart__label--sm {
  font-size: 11px;
}

.chart__value--sm {
  font-size: 11px;
}

/* --- tables --------------------------------------------------------------- */

.table-wrap {
  overflow-x: auto;
  margin: var(--s-25) 0;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 34rem;
  font-size: 0.9375rem;
}

caption {
  caption-side: bottom;
  text-align: left;
  padding-top: var(--s-075);
  font-size: 0.875rem;
  color: var(--grey-300);
  line-height: 1.45;
}

th,
td {
  text-align: left;
  padding: var(--s-05) var(--s-075) var(--s-05) 0;
  border-bottom: 1px solid var(--grey-100);
  vertical-align: top;
}

thead th {
  font-weight: var(--fw-medium);
  color: var(--grey-300);
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom-color: var(--grey-200);
}

td.num,
th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  padding-right: 0;
}

/* --- post furniture ------------------------------------------------------- */

.prose h3 {
  font-size: 1.125rem;
  font-weight: var(--fw-medium);
  margin: var(--s-2) 0 var(--s-05);
}

.prose code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.875em;
  background: var(--beige);
  padding: 0.1em 0.35em;
}

.prose .lede {
  font-size: 1.1875rem;
  line-height: 1.45;
  color: var(--grey-400);
  margin-bottom: var(--s-2);
}

.prose blockquote {
  margin: var(--s-2) 0;
  padding-left: var(--s-125);
  border-left: 1px solid var(--grey-200);
  color: var(--grey-400);
}

.status {
  display: inline-block;
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--grey-300);
  border: 1px solid var(--grey-100);
  padding: 0.2em 0.6em;
  margin-bottom: var(--s-1);
}

.note__tag {
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--grey-300);
  margin-left: var(--s-075);
}

/* --- CV ------------------------------------------------------------------- */

.cv__group {
  margin-bottom: var(--s-2);
}

.rows__what .cv__group {
  margin-top: var(--s-075);
  margin-bottom: 0;
}

.cv__group:last-child {
  margin-bottom: 0;
}

.cv__group h3 {
  font-size: 1.0625rem;
  font-weight: var(--fw-medium);
  margin-bottom: var(--s-075);
}

.cv__group ul li {
  position: relative;
  padding-left: var(--s-125);
  margin-bottom: var(--s-05);
  color: var(--grey-400);
}

.cv__group ul li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--grey-200);
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: var(--s-15);
}

.facts dt {
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--grey-300);
  margin-bottom: var(--s-025);
}

.facts dd {
  margin: 0;
}

/* --- contact -------------------------------------------------------------- */

.contact {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: var(--s-15);
}

.contact dt {
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--grey-300);
  margin-bottom: var(--s-025);
}

.contact dd {
  margin: 0;
}

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

.footer {
  border-top: 1px solid var(--grey-100);
  padding-block: var(--s-2) var(--s-25);
  font-size: 0.875rem;
  color: var(--grey-300);
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  gap: var(--s-15);
  flex-wrap: wrap;
}

.footer a {
  text-decoration-color: var(--grey-100);
}

/* --------------------------------------------------------------------------- */

@media (max-width: 60rem) {
  .split {
    grid-template-columns: 1fr;
    gap: var(--s-15);
  }

  .figures {
    grid-template-columns: 1fr;
  }

  .project {
    grid-template-columns: 1fr;
    gap: var(--s-15);
  }

  .stack {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .stack dd {
    border-top: 0;
    padding-top: 0;
    padding-bottom: var(--s-075);
  }
}

@media (max-width: 40rem) {
  :root {
    --gutter: var(--s-125);
  }

  .rows > li,
  .pubs > li {
    grid-template-columns: 1fr;
    gap: var(--s-025);
  }

  .pubs > li::before {
    padding-top: 0;
  }

  .masthead__inner {
    padding-block: var(--s-1);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
  }
}

@media print {
  .masthead,
  .footer,
  .skip {
    display: none;
  }

  body {
    font-size: 10pt;
  }

  .section {
    border-top: 0;
    padding-block: 0.5rem;
    break-inside: avoid;
  }

  a {
    text-decoration: none;
  }
}
