/* ============================================================
   EB Garamond and IBM Plex Sans: self-hosted, so no request ever
   leaves this site.
   Files live in fonts/ ; replace them together if you ever update.
   ============================================================ */

@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/eb-garamond-v33-latin-regular.woff2') format('woff2');
}
@font-face {
  font-family: 'EB Garamond';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/eb-garamond-v33-latin-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/eb-garamond-v33-latin-500.woff2') format('woff2');
}
@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/eb-garamond-v33-latin-600.woff2') format('woff2');
}

@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/ibm-plex-sans-v23-latin-regular.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/ibm-plex-sans-v23-latin-600.woff2') format('woff2');
}

/* ============================================================
   bastiaancnossen.com stylesheet
   Palette, type scale and layout live here. Nothing else needed.
   ============================================================ */

:root {
  --paper: #FAFAF7;
  --ink: #191C24;
  --muted: #5C6272;
  --faint: #8B8F9C;
  --rule: #DEDED6;
  --accent: #2E4372;
  --accent-soft: #6B7EA8;

  --measure: 68ch;
  --rail: 15.5rem;

  --font-body: "EB Garamond", Georgia, "Times New Roman", serif;
  --font-ui: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* Dark mode: only the tokens are redefined. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #101219;
    --ink: #E5E3DC;
    --muted: #9CA1AE;
    --faint: #767B88;
    --rule: #272B35;
    --accent: #9DB6E6;
    --accent-soft: #6E82AC;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 19px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: oldstyle-nums;
}

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

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--paper); color: var(--ink);
  padding: 0.6rem 1rem; z-index: 20;
  font-family: var(--font-ui); font-size: 0.85rem;
}
.skip:focus { left: 0.5rem; top: 0.5rem; }

.label {
  font-family: var(--font-ui);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  font-variant-numeric: normal;
}

/* ---------------------------------------------- shell + sidebar */

.shell {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  max-width: 78rem;
  margin: 0 auto;
}

.rail {
  position: sticky; top: 0; align-self: start; height: 100vh;
  padding: 4.5rem 2rem 2rem 2.25rem;
  display: flex; flex-direction: column; gap: 2.25rem;
  border-right: 1px solid var(--rule);
}
.rail .who { display: flex; flex-direction: column; gap: 0.15rem; }
.rail .name {
  font-size: 1.45rem; font-weight: 600; line-height: 1.15;
  letter-spacing: -0.005em; text-decoration: none;
}
.rail .role { font-size: 0.95rem; color: var(--muted); font-style: italic; }

.rail nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.1rem; }
.rail nav a {
  display: block; padding: 0.22rem 0; text-decoration: none;
  font-size: 1.02rem; color: var(--muted);
  border-bottom: 1px solid transparent; width: fit-content;
}
.rail nav a:hover { color: var(--ink); border-bottom-color: var(--accent-soft); }
.rail nav a[aria-current="page"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }

.rail .contact {
  margin-top: auto;
  display: flex; flex-direction: column; gap: 0.5rem;
  font-size: 0.9rem; color: var(--muted);
}
.rail .contact div { line-height: 1.4; }

/* ---------------------------------------------- main column */

main { padding: 4.5rem 3rem 3rem 3.5rem; min-width: 0; max-width: calc(var(--measure) + 6.5rem); }

h1 {
  font-size: 2.1rem; font-weight: 600; line-height: 1.16;
  margin: 0.4rem 0 1.6rem; letter-spacing: -0.01em; text-wrap: balance;
}
h2 { font-size: 1.32rem; font-weight: 600; margin: 3rem 0 1rem; letter-spacing: -0.005em; }
h3 { font-size: 1.08rem; font-weight: 600; margin: 0 0 0.25rem; }
p { margin: 0 0 1.1rem; }
.lede { font-size: 1.1rem; }
.note { color: var(--muted); font-size: 0.95rem; font-style: italic; }

.plainlist { padding-left: 1.1rem; margin: 0 0 1.1rem; }
.plainlist li { margin-bottom: 0.25rem; }

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

.topics {
  display: flex; flex-wrap: wrap; gap: 0.4rem 0.5rem;
  margin: 0.9rem 0 0; padding: 0; list-style: none;
}
.topics li {
  font-size: 0.92rem; color: var(--muted);
  border: 1px solid var(--rule); border-radius: 1rem; padding: 0.1rem 0.7rem;
}

.facts {
  display: flex; flex-direction: column; gap: 0.55rem;
  margin: 2rem 0 0; padding-top: 1.4rem; border-top: 1px solid var(--rule);
}
.fact { display: grid; grid-template-columns: 8.5rem 1fr; gap: 1rem; align-items: baseline; }
.fact > span:first-child {
  font-family: var(--font-ui); font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint);
}

/* ---------------------------------------------- papers
   Numbering counts DOWN from --start, so the newest paper carries
   the highest number. Set --start to (number of items + 1) on the <ol>. */

ol.papers {
  list-style: none; margin: 0; padding: 0;
  counter-reset: p var(--start, 0);
  display: flex; flex-direction: column;
}
ol.papers li {
  counter-increment: p -1;
  display: grid; grid-template-columns: 2.1rem 1fr; gap: 0.9rem;
  padding: 1.05rem 0; border-top: 1px solid var(--rule);
}
ol.papers li:last-child { border-bottom: 1px solid var(--rule); }
ol.papers li::before {
  content: counter(p) ".";
  font-family: var(--font-ui); font-size: 0.78rem; color: var(--faint);
  font-variant-numeric: tabular-nums; padding-top: 0.42rem;
}

.ttl {
  font-size: 1.06rem; font-weight: 600; line-height: 1.32;
  display: block; margin-bottom: 0.16rem; text-wrap: balance;
}
.authors { color: var(--muted); font-size: 0.98rem; }
.authors em { font-style: normal; color: var(--ink); }
.meta {
  margin-top: 0.22rem; font-size: 0.93rem; color: var(--faint);
  display: flex; flex-wrap: wrap; gap: 0.55rem; align-items: baseline;
}
.meta .venue { font-style: italic; color: var(--muted); }
.meta a.arx {
  font-family: var(--font-ui); font-size: 0.72rem; letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums; text-decoration: none; color: var(--accent);
  border: 1px solid var(--rule); border-radius: 3px; padding: 0.05rem 0.4rem;
}
.meta a.arx:hover { border-color: var(--accent); }

/* ---------------------------------------------- entry lists (teaching, talks, notes) */

.entries { display: flex; flex-direction: column; }
.entry {
  display: grid; grid-template-columns: 9.5rem 1fr; gap: 1.2rem;
  padding: 0.95rem 0; border-top: 1px solid var(--rule);
}
.entry:last-child { border-bottom: 1px solid var(--rule); }
.entry .when {
  font-family: var(--font-ui); font-size: 0.74rem; letter-spacing: 0.05em;
  color: var(--faint); text-transform: uppercase; padding-top: 0.3rem;
  font-variant-numeric: tabular-nums;
}
.entry .what strong { font-weight: 600; }
.entry .what .sub { display: block; color: var(--muted); font-size: 0.96rem; margin-top: 0.1rem; }

/* ---------------------------------------------- books */

.book { padding: 1.15rem 0; border-top: 1px solid var(--rule); }
.book:last-of-type { border-bottom: 1px solid var(--rule); }
.book p { margin: 0; color: var(--muted); font-size: 0.98rem; }
.book .status { margin-top: 0.35rem; }

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

.foot {
  margin-top: 4.5rem; padding-top: 1.2rem;
  border-top: 1px solid var(--rule);
  font-size: 0.85rem; color: var(--faint);
}
.foot p { margin: 0; }

/* ---------------------------------------------- responsive */

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .rail {
    position: static; height: auto;
    border-right: none; border-bottom: 1px solid var(--rule);
    padding: 2.5rem 1.5rem 1.5rem; gap: 1.4rem;
  }
  .rail .contact { margin-top: 0; }
  .rail nav ul { flex-direction: row; flex-wrap: wrap; gap: 0.15rem 1.1rem; }
  main { padding: 2.25rem 1.5rem 3rem; max-width: none; }
  h1 { font-size: 1.8rem; }
  .fact { grid-template-columns: 1fr; gap: 0.1rem; }
  .entry { grid-template-columns: 1fr; gap: 0.15rem; }
  .entry .when { padding-top: 0; }
}

@media print {
  .rail nav, .skip, .foot { display: none; }
  .shell { display: block; max-width: none; }
  main { padding: 0; }
  body { background: #fff; color: #000; font-size: 11pt; }
}
