/* Fonts are self-hosted (SIL Open Font License, texts in /fonts/), so nothing loads from other origins. */
@font-face { font-family: "Geist"; src: url("/fonts/geist-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist"; src: url("/fonts/geist-latin-wght-italic.woff2") format("woff2"); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/fonts/geist-mono-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  /* print-like colours: ink on warm paper, with slate and terracotta kept for the graphics */
  --paper: #f4f1ea;
  --surface: #fbf9f4;
  --ink: #1c1b18;
  --muted: #5e5b54;
  --faint: #9c978c;
  --rule: rgba(28, 27, 24, 0.14);
  --blue: #2f4b6e;
  --sand: #e8dcc2;
  --orange: #b4532f;
  --lamp: #e0a33a;    /* the lit window in the house icon */
  --band: #1c1b18;    /* the dark research panel */
  --deep: #1c1b18;    /* filled surfaces with light text (a picked answer, a result box) */
  --on-deep: #d8d4ca; /* secondary text on --deep */
  --on-ink: var(--sand); /* accents on an ink-coloured background */
  /* names book.js reads for the order book strip */
  --bg: var(--paper);
  --accent: var(--blue);
  --ask: var(--orange);
  --display: "Geist", "Helvetica Neue", Arial, system-ui, sans-serif;
  --sans: "Geist", "Helvetica Neue", Arial, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --measure: 46rem;
  --wide: 84rem;
  color-scheme: light;
}

/* Dark theme. It follows the system setting unless the visitor picked a theme with the
   switch in the navigation, which theme.js restores from localStorage. */
:root[data-theme="dark"] {
  --paper: #121315; --surface: #1a1b1e; --ink: #ebe7de; --muted: #a39f95; --faint: #6e6a62;
  --rule: rgba(235, 231, 222, 0.14); --blue: #8ea6c6; --orange: #d4805c; --band: #1d1e22; --on-ink: #26394f; --deep: #34322d; --lamp: #f2c46b;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #121315; --surface: #1a1b1e; --ink: #ebe7de; --muted: #a39f95; --faint: #6e6a62;
    --rule: rgba(235, 231, 222, 0.14); --blue: #8ea6c6; --orange: #d4805c; --band: #1d1e22; --on-ink: #26394f; --deep: #34322d; --lamp: #f2c46b;
    color-scheme: dark;
  }
}

[hidden] { display: none !important; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; font-size: 93.75%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.1875rem;
  line-height: 1.55;
  font-optical-sizing: auto;
  overflow-x: hidden;
}

.wrap { max-width: var(--measure); margin-inline: auto; padding-inline: 1.5rem; }
.wide { max-width: var(--wide); margin-inline: auto; padding-inline: clamp(1.25rem, 4vw, 3rem); }

a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
::selection { background: var(--sand); color: #0f0f10; }

.skip { position: absolute; left: -999px; top: 0.5rem; z-index: 10; background: var(--sand); color: #0f0f10; padding: 0.4rem 0.7rem; }
.skip:focus { left: 0.5rem; }

.mono, time, .label, .when { font-family: var(--mono); }

/* ---------- Navigation */
.nav {
  position: relative;
  z-index: 5;
  display: flex; /* the house, the links and the theme switch on one row; the links wrap among themselves */
  justify-content: flex-start;
  align-items: flex-start;
  gap: 0.5rem 0.75rem;
  padding-block: 1.5rem 1rem;
  font-size: 1rem;
}
/* every item in the menu is a box with a thin edge, so the items read as separate buttons */
.mark, .nav ul a {
  display: inline-flex;
  align-items: center;
  border: 1px solid color-mix(in srgb, var(--ink) 30%, transparent);
  border-radius: 3px;
  background: color-mix(in srgb, var(--paper) 85%, transparent);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.mark:hover, .nav ul a:hover { border-color: var(--ink); }
.nav ul a[aria-current="page"] { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.nav ul { flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.nav ul a { padding: 0.3rem 0.7rem; line-height: 1.3; }

/* home: a line-drawn house with smoke from the chimney and a light in the window */
.mark { flex: none; height: calc(1.3em + 0.6rem + 2px); padding: 0 0.5rem; } /* as tall as a link box */
.mark svg { width: 1.55rem; height: 1.68rem; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.mark .lamp { fill: var(--lamp); stroke-width: 1.2; animation: lamp 9s linear infinite; }
.mark .smoke circle { stroke-width: 1; opacity: 0; transform-box: fill-box; transform-origin: center; animation: smoke 3.6s ease-out infinite; }
.mark .smoke circle:nth-child(2) { animation-delay: 1.2s; }
.mark .smoke circle:nth-child(3) { animation-delay: 2.4s; }
@keyframes smoke {
  0% { opacity: 0; transform: translate(0, 0) scale(0.6); }
  15% { opacity: 0.85; }
  100% { opacity: 0; transform: translate(1.6px, -4.5px) scale(1.5); }
}
/* mostly lit, with a soft flicker; now and then the light goes off for a moment and back on */
@keyframes lamp {
  0%, 100% { fill-opacity: 1; }
  20% { fill-opacity: 0.8; }
  24% { fill-opacity: 1; }
  45% { fill-opacity: 0.9; }
  62% { fill-opacity: 1; }
  64%, 74% { fill-opacity: 0; }
  76% { fill-opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .mark .lamp, .mark .smoke circle { animation: none; }
  .mark .smoke circle:first-child { opacity: 0.6; transform: translate(0.5px, -1.5px); }
}

.theme-toggle { display: inline-grid; flex: none; margin-left: auto; place-items: center; width: 1.9rem; height: 1.9rem; padding: 0; border: 0; background: none; color: var(--ink); cursor: pointer; }
/* a half-filled circle: the filled half is the current theme's ink */
.theme-toggle span { width: 0.9rem; height: 0.9rem; border: 1px solid currentColor; border-radius: 50%; background: linear-gradient(90deg, currentColor 50%, transparent 50%); }

/* ---------- Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.05rem;
  border: 1px solid var(--ink);
  border-radius: 3px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn.solid { background: var(--ink); color: var(--paper); }
.btn.solid:hover { background: transparent; color: var(--ink); }
.btns { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 0; padding: 0; list-style: none; }

/* ---------- Home hero */
.hero { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(2rem, 6vw, 5rem); align-items: end; padding-block: clamp(3rem, 8vw, 6rem) clamp(2.5rem, 6vw, 4rem); }
/* statistical pictures behind the menu and the name, taking turns, from the top of the page to the first rule */
.hero-field {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  margin-inline: auto;
  width: calc(min(var(--wide), 100%) - 2 * clamp(1.25rem, 4vw, 3rem)); /* the content width, like the rules */
  height: 36rem; /* site.js sets it to end at the rule above the first section */
  pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}
.hero > .hero-text { position: relative; z-index: 1; }
@media (max-width: 44rem) { .hero-field { opacity: 0.7; } }
.giant { margin: 0; font-family: var(--display); font-weight: 600; font-size: clamp(2.75rem, 7vw, 5.5rem); line-height: 1; letter-spacing: -0.01em; }
.lede { max-width: 38rem; margin: 1.5rem 0 0; font-size: clamp(1.2rem, 1.9vw, 1.45rem); line-height: 1.45; }

/* ---------- Section heads */
.section { padding-block: clamp(2.5rem, 5vw, 4rem); }
.kicker { margin: 0 0 1.75rem; padding-top: 0.75rem; border-top: 1px solid var(--ink); font-family: var(--display); font-weight: 600; font-size: clamp(1.6rem, 2.6vw, 2.1rem); line-height: 1.15; letter-spacing: -0.01em; }

/* ---------- Animated illustrations (viz.js) */
.viz-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
/* each graphic is a card with its own edge */
.viz-card { position: relative; margin: 0; padding: 1rem 1rem 1.1rem; border: 1px solid var(--rule); border-radius: 10px; background: var(--surface); transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.25s ease; }
.viz-card canvas { display: block; width: 100%; height: 12rem; }
/* a card that turns over lifts when under the pointer, and the rest of the page blurs a little
   behind it; the thesis card only keeps its edge */
.flip-card:hover, .flip-card:focus-within { transform: translateY(-4px) scale(1.012); }
body::after { content: ""; position: fixed; inset: 0; z-index: 40; pointer-events: none; opacity: 0; transition: opacity 0.3s ease; background: color-mix(in srgb, var(--paper) 22%, transparent); -webkit-backdrop-filter: blur(2.5px); backdrop-filter: blur(2.5px); }
@media (hover: hover) {
  body:has(.flip-card:hover)::after { opacity: 1; }
  .flip-card:hover { z-index: 41; }
}
@media (prefers-reduced-motion: reduce) { .viz-card { transition: none; } .flip-card:hover, .flip-card:focus-within { transform: none; } }

/* cards that turn over: the graphic on the front, what it is and where it is used on the back.
   The edge and background move from the card to its two faces. Without JavaScript the back
   simply follows the front. */
.flip-card { padding: 0; border: 0; background: none; cursor: pointer; }
.flip-card .viz-face { padding: 1rem 1rem 1.1rem; border: 1px solid var(--rule); border-radius: 10px; background: var(--surface); transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.flip-card:hover .viz-face, .flip-card:focus-within .viz-face { border-color: color-mix(in srgb, var(--ink) 60%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 22%, transparent), 0 20px 44px -18px rgba(0, 0, 0, 0.6); }
.flip-card:has(.viz-flip:focus-visible) .viz-face { outline: 2px solid var(--ink); outline-offset: 3px; }
.flip-card figcaption { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.flip-hint { flex: none; color: var(--muted); font-family: var(--mono); font-size: 0.75rem; transition: color 0.2s ease; }
.flip-card:hover .flip-hint { color: var(--ink); }
.viz-back { margin-top: 0.75rem; }
.viz-back h4 { margin: 0 0 0.6rem; }
.viz-back p { color: var(--ink); }
.viz-back .viz-use { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--rule); color: var(--muted); }
.viz-back .flip-hint { display: none; }
.viz-flip { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.js .flip-card { perspective: 1600px; }
.js .flip-card .viz-face { backface-visibility: hidden; -webkit-backface-visibility: hidden; transition: transform 0.65s cubic-bezier(0.2, 0.7, 0.2, 1), border-color 0.2s ease, box-shadow 0.2s ease; }
.js .viz-back { position: absolute; inset: 0; margin: 0; display: flex; flex-direction: column; overflow-y: auto; transform: rotateY(-180deg); }
.js .viz-back .flip-hint { display: block; margin-top: auto; padding-top: 0.75rem; }
.js .flip-card.flipped .viz-front { transform: rotateY(180deg); }
.js .flip-card.flipped .viz-back { transform: rotateY(0deg); }
@media (prefers-reduced-motion: reduce) { .js .flip-card .viz-face { transition: none; } }
.viz-card h4 { margin: 0.75rem 0 0; font-family: var(--display); font-weight: 600; font-size: 1.2rem; }
.viz-card p { margin: 0; color: var(--muted); font-size: 0.9375rem; line-height: 1.5; }
@media (max-width: 48rem) { .viz-cards { grid-template-columns: 1fr; } }

/* Field boxes: each opens its own panel of graphics. Without JavaScript every panel shows. */
.topics { display: none; flex-wrap: wrap; gap: 0.5rem 1.75rem; }
.js .topics { display: flex; }
.topic { display: inline-flex; align-items: baseline; gap: 0.45rem; padding: 0.2rem 0; border: 0; border-bottom: 1px solid transparent; background: none; color: var(--muted); font: inherit; font-size: 1.15rem; cursor: pointer; }
.topic:hover { color: var(--ink); }
/* a plus that turns into a minus while the field is open */
.topic::after { content: "+"; font-family: var(--mono); font-size: 0.9rem; }
.topic[aria-expanded="true"] { border-bottom-color: var(--ink); color: var(--ink); }
.topic[aria-expanded="true"]::after { content: "\2212"; }
.js .topic-panel { margin-top: 1.75rem; }
.topic-title { margin: 0 0 1rem; font-family: var(--display); font-weight: 600; font-size: 1.4rem; }
.topic-panel + .topic-panel { margin-top: 2.5rem; }
.js .topic-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- The fraud game (/why-me/) */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.problem:last-of-type { padding-bottom: clamp(3rem, 7vw, 5rem); }
.problem > .wrap { margin-bottom: 1.5rem; }
.problem > .wrap p { margin: 0 0 1rem; }

/* ---------- Two lies and one truth (/who-dis/) */
.truths { padding-bottom: clamp(3rem, 7vw, 5rem); }
.ttl-meta { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; margin: 0 0 0.5rem; font-size: 1rem; color: var(--muted); }
.inner h2.ttl-ask { margin-bottom: 1.25rem; }
.ttl-options { display: grid; gap: 0.75rem; }
.ttl-option { position: relative; display: flex; align-items: flex-start; gap: 1rem; width: 100%; padding: 1.1rem 1.25rem; border: 1.5px solid var(--rule); border-radius: 3px; background: var(--surface); color: var(--ink); font: inherit; font-size: 1.0625rem; line-height: 1.45; text-align: left; cursor: pointer; transition: border-color 0.15s, background 0.15s, color 0.15s, opacity 0.2s; }
.ttl-option:hover:not(:disabled) { border-color: var(--ink); }
.ttl-option:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.ttl-option:disabled { cursor: default; }
.ttl-letter { flex: none; width: 1.75rem; height: 1.75rem; display: grid; place-items: center; border: 1.5px solid var(--rule); border-radius: 50%; font-family: var(--mono); font-size: 0.8125rem; }
.ttl-text { flex: 1; padding-top: 0.1rem; }
.ttl-reveal { margin-top: 1.5rem; }
.ttl-option:disabled:not(.locked) { opacity: 0.55; }
.ttl-option.locked { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.ttl-option.locked .ttl-letter { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.ttl-review { display: grid; gap: 0.9rem; max-width: 46rem; margin: 1.5rem 0 1.75rem; padding: 0; list-style: none; }
.ttl-review li { display: grid; gap: 0.15rem; padding-top: 0.9rem; border-top: 1px solid rgba(255, 255, 255, 0.25); }
.ttl-review-topic { font-family: var(--mono); font-size: 0.75rem; color: var(--on-deep); }
.ttl-review .is-right .ttl-review-topic { color: var(--sand); }
.ttl-review-truth { font-family: var(--display); font-weight: 600; }
.ttl-review-pick, .ttl-review-story { font-size: 0.9375rem; color: var(--on-deep); }
.ttl-end a { color: inherit; }
.ttl-empty { color: var(--muted); }

/* ---------- Data leader for a day (/why-me/) */
.dl-question { max-width: 46rem; margin: 0 0 1.25rem; font-family: var(--display); font-weight: 600; font-size: clamp(1.3rem, 2.2vw, 1.6rem); line-height: 1.3; }
/* the number first, what it counts underneath */
.dl-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: 1rem 1.25rem; max-width: 46rem; margin: 0 0 1.75rem; }
.dl-facts div { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 0.15rem; padding-top: 0.6rem; border-top: 1px solid var(--rule); }
.dl-facts dt { font-size: 0.875rem; line-height: 1.35; color: var(--muted); }
.dl-facts dd { margin: 0; font-family: var(--display); font-weight: 600; font-size: 1.45rem; line-height: 1.15; }
.dl-options { max-width: 46rem; margin-bottom: 1.25rem; }
.dl-decide:disabled { opacity: 0.4; cursor: default; }
.dl-reveal { max-width: 46rem; margin-top: 0.5rem; }
.dl-reveal:focus { outline: none; }
.dl-verdict { margin: 0 0 0.4rem; font-family: var(--display); font-weight: 600; font-size: 1.35rem; }
.dl-axis { margin: 0 0 0.9rem; color: var(--muted); font-size: 0.875rem; }
.dl-outcomes { display: grid; gap: 0.5rem; margin: 0 0 1.25rem; padding: 0; list-style: none; }
.dl-row { display: grid; grid-template-columns: 11.5rem 1fr 4.5rem; gap: 1rem; align-items: center; padding: 0.55rem 0.75rem; border: 1px solid var(--rule); border-radius: 8px; background: var(--surface); }
.dl-row.chosen { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.dl-row-name { font-family: var(--mono); font-size: 0.8125rem; }
.dl-row.best .dl-row-name { color: var(--blue); }
.dl-track { position: relative; height: 0.9rem; }
.dl-zero { position: absolute; top: -0.25rem; bottom: -0.25rem; width: 1px; background: var(--muted); }
.dl-range { position: absolute; top: 0.2rem; height: 0.5rem; border-radius: 3px; opacity: 0.55; }
.dl-range.pos { background: var(--blue); }
.dl-range.neg { background: var(--orange); }
.dl-dot { position: absolute; top: 50%; width: 0.7rem; height: 0.7rem; border-radius: 50%; background: var(--ink); transform: translate(-50%, -50%); }
.dl-row-v { font-family: var(--mono); font-size: 0.875rem; text-align: right; }
.dl-why { margin: 0 0 1.5rem; padding: 0.9rem 1.1rem; border-left: 3px solid var(--ink); background: var(--surface); line-height: 1.55; }
@media (max-width: 34rem) { .dl-row { grid-template-columns: 1fr 4.5rem; } .dl-track { grid-column: 1 / -1; grid-row: 2; } }
.g-mode { color: var(--ink); font-weight: 500; }
.game-end { margin-top: 2rem; padding: clamp(1.25rem, 3vw, 2rem); border-radius: 3px; background: var(--deep); color: #fff; }
.game-end:focus { outline: none; }
.game-end p { max-width: 46rem; margin: 0 0 1rem; }
.g-big { font-family: var(--display); font-weight: 600; font-size: clamp(1.5rem, 3vw, 2.25rem); line-height: 1.1; letter-spacing: -0.01em; }
.game-end .btns { margin-top: 1.5rem; }
.game-end .btn { border-color: #fff; color: #fff; }
.game-end .btn:hover { background: #fff; color: #0f0f10; }
.game-end .btn.solid { background: var(--sand); border-color: var(--sand); color: #0f0f10; }
.g-compare { display: grid; gap: 0.6rem; max-width: 40rem; margin: 0 0 1.25rem; }
.g-cmp { display: grid; grid-template-columns: 8.5rem 1fr 3.5rem; gap: 0.75rem; align-items: center; font-family: var(--mono); font-size: 0.8125rem; }
.g-cmp strong { text-align: right; font-weight: 500; }
.g-cmp-track { height: 0.8rem; border-radius: 3px; background: rgba(255, 255, 255, 0.2); overflow: hidden; }
.g-cmp-bar { display: block; height: 100%; background: var(--sand); }

/* ---------- Patent */
.patent { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }
.patent-title { margin: 0 0 0.5rem; font-family: var(--display); font-weight: 600; font-size: clamp(1.4rem, 2.4vw, 1.85rem); line-height: 1.2; }
.patent-meta { margin: 0 0 1rem; font-size: 1rem; font-style: italic; color: var(--muted); }
.patent p { max-width: 36rem; }
.patent .viz-card canvas { height: 15rem; }
@media (max-width: 56rem) { .patent { grid-template-columns: 1fr; } }

/* ---------- Work list */
.jobs { margin: 0; padding: 0; list-style: none; }
.job + .job { border-top: 1px solid var(--rule); }
.job > a { display: grid; grid-template-columns: 11rem 1fr; gap: 0.15rem 1.5rem; padding: 1.1rem 0; color: var(--ink); text-decoration: none; }
.job .co { grid-column: 2; font-family: var(--display); font-weight: 600; font-size: 1.4rem; line-height: 1.2; }
.job > a:hover .co { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
.job .meta { grid-column: 1; grid-row: 1 / span 2; padding-top: 0.35rem; color: var(--muted); font-size: 0.9375rem; }
.job .meta .title { display: block; color: var(--ink); font-style: italic; }
.job .desc { grid-column: 2; max-width: 40rem; color: var(--muted); }
@media (max-width: 40rem) {
  .job > a { grid-template-columns: 1fr; }
  .job .meta { grid-column: 1; grid-row: auto; padding-top: 0; }
  .job .co, .job .desc { grid-column: 1; }
}
.after-list { margin-top: 1.5rem; }

/* ---------- Research on the home page */
.research-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.big-q { margin: 0 0 1.25rem; font-family: var(--display); font-style: italic; font-weight: 400; font-size: clamp(1.45rem, 2.6vw, 2rem); line-height: 1.25; }
/* the research graphic on the home page sits on a card like the others, without the hover */
.tape { margin: 0; padding: 1rem 1rem 0.9rem; border: 1px solid var(--rule); border-radius: 10px; background: var(--surface); }
.tape canvas { display: block; width: 100%; height: clamp(18rem, 30vw, 23rem); }
@media (max-width: 34rem) { .tape canvas { height: 21rem; } }
.tape figcaption .key > span { white-space: nowrap; }
.tape figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 1rem; padding-top: 0.75rem; color: var(--muted); font-size: 0.875rem; }
.tape-wide { margin: 0 0 1.5rem; }
.tape-wide canvas { height: 22rem; }
@media (max-width: 34rem) { .tape-wide canvas { height: 24rem; } }
.key { display: inline-flex; gap: 1rem; }
.key span::before { content: ""; display: inline-block; width: 0.6rem; height: 0.6rem; margin-right: 0.4rem; border-radius: 2px; vertical-align: -0.05em; }
.key .bid::before { background: var(--accent); }
.key .ask::before { background: var(--ask); }
.key .mid::before { height: 2px; vertical-align: 0.2em; background: var(--ink); }
@media (max-width: 56rem) { .research-grid { grid-template-columns: 1fr; } }

/* ---------- Education */
.cards { margin: 0; padding: 0; list-style: none; }
.cards li { display: grid; grid-template-columns: 11rem 1fr; column-gap: 1.5rem; padding: 1.1rem 0; }
.cards li + li { border-top: 1px solid var(--rule); }
.cards li > * { grid-column: 2; }
.cards .yrs { grid-column: 1; grid-row: 1 / span 3; padding-top: 0.3rem; color: var(--muted); font-size: 0.9375rem; }
.cards h3 { margin: 0; font-family: var(--display); font-weight: 600; font-size: 1.4rem; line-height: 1.2; }
.cards .where { margin: 0 0 0.35rem; font-style: italic; color: var(--muted); }
.cards .num { grid-column: 1; grid-row: 1 / span 2; padding-top: 0.3rem; color: var(--muted); font-size: 0.9375rem; }
.cards.steps li { grid-template-columns: 3rem 1fr; }
.cards.steps h3 { margin-bottom: 0.35rem; }
.cards p { margin: 0; max-width: 40rem; }
@media (max-width: 40rem) { .cards li, .cards.steps li { grid-template-columns: 1fr; } .cards li > *, .cards .yrs { grid-column: 1; grid-row: auto; } }

/* ---------- Contact */
.shout { margin: 0 0 1.5rem; font-family: var(--display); font-weight: 600; font-size: clamp(2.5rem, 6vw, 4rem); line-height: 1.05; letter-spacing: -0.01em; }
.contact-block { padding-block: clamp(2rem, 4vw, 3rem); }
.contact-block .kicker { margin-bottom: 1rem; }
.contact-lede { max-width: 40rem; margin: 0; font-size: 1.1875rem; line-height: 1.5; }
/* email, LinkedIn, place and languages on one row under the lede, each after its icon */
.contact-list { display: flex; flex-wrap: wrap; gap: 0.6rem 2rem; margin: 1rem 0 0; padding: 0; list-style: none; font-size: 1rem; }
.contact-list li { display: inline-flex; align-items: center; gap: 0.5rem; }
.contact-list .icon { flex: none; width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.contact-list .flags { display: inline-flex; gap: 0.4rem; }
.contact-list .flag { display: block; height: 0.95rem; width: auto; border-radius: 2px; box-shadow: 0 0 0 1px var(--rule); }

/* ---------- Footer */
.footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem 1rem; margin-top: 2rem; padding-block: 1.25rem 2.5rem; background: linear-gradient(var(--ink), var(--ink)) top / calc(100% - 2 * clamp(1.25rem, 4vw, 3rem)) 1px no-repeat; color: var(--muted); font-size: 0.9375rem; }
.footer p { margin: 0; }

@media (prefers-reduced-motion: reduce) { .btn { transition: none; } }

/* ======================================================================
   Inner pages: CV and research
   ====================================================================== */
.page-head { padding-block: clamp(2.5rem, 6vw, 4.5rem) 0; }
.page-head .eyebrow { margin: 0 0 0.5rem; font-style: italic; color: var(--muted); }
.page-head h1 { margin: 0; font-family: var(--display); font-weight: 600; font-size: clamp(2.4rem, 5vw, 3.75rem); line-height: 1.05; letter-spacing: -0.01em; }
.page-head .subtitle { max-width: 40rem; margin: 0.9rem 0 0; font-size: clamp(1.15rem, 1.6vw, 1.3rem); line-height: 1.45; color: var(--muted); }
.page-head .btns { margin-top: 1.5rem; }
/* the CV header: the portrait on the right, beside the name */
.cv-head-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: clamp(1.5rem, 4vw, 3rem); }
.cv-head-grid > :not(.cv-photo) { grid-column: 1; }
.cv-photo { grid-column: 2; grid-row: 1 / span 6; align-self: start; display: block; width: clamp(7rem, 14vw, 10rem); height: auto; aspect-ratio: 2 / 3; object-fit: cover; filter: grayscale(1) contrast(1.05); border-radius: 14px; }
@media (max-width: 34rem) { .cv-head-grid { grid-template-columns: 1fr; } .cv-photo { grid-column: 1; grid-row: auto; width: 7rem; margin-bottom: 1.25rem; } }

.inner { padding-block: clamp(2.5rem, 6vw, 4.5rem) 0; }
.inner h2 { margin: 0 0 1.25rem; padding-top: 0.6rem; border-top: 1px solid var(--ink); font-family: var(--display); font-weight: 600; font-size: clamp(1.45rem, 2.4vw, 1.8rem); line-height: 1.15; }

.prose p { margin: 0 0 1rem; }
.lead { font-size: 1.1875rem; }

.figures { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem 2rem; margin: 1.75rem 0 0; padding: 0; list-style: none; }
.figures li { padding: 0.75rem 0 0; border-top: 1px solid var(--rule); }
.figures strong { display: block; font-family: var(--display); font-weight: 600; font-size: 1.25rem; line-height: 1.2; }
.figures li > span { display: block; margin-top: 0.25rem; color: var(--muted); font-size: 1rem; line-height: 1.45; }
@media (max-width: 34rem) { .figures { grid-template-columns: 1fr; } }
.cv .entry .role { color: var(--muted); }

/* Experience timeline: dates | rail with dots | content */
.entry { display: grid; grid-template-columns: 7.5rem 1fr; gap: 0 1.25rem; }
.entry > .when { margin: 0; padding-top: 0.45rem; color: var(--muted); font-size: 0.8125rem; line-height: 1.7; }
.entry > .when time { display: block; }
.entry > div { position: relative; padding: 0 0 2.25rem; }
.entry:last-child > div { padding-bottom: 0.5rem; }
.entry > div > * { margin: 0; }
.entry > div > * + * { margin-top: 0.65rem; }
.entry h3 { font-family: var(--display); font-weight: 600; font-size: 1.5rem; line-height: 1.2; }
.entry .role { font-style: italic; line-height: 1.45; color: var(--muted); }
.entry .context { color: var(--muted); font-size: 0.9375rem; }
.entry ul { padding-left: 1.15rem; }
.entry li + li { margin-top: 0.45rem; }
.entry li::marker { content: "–  "; color: var(--faint); }
.entry.plain > div { padding-bottom: 1.25rem; }
.entry.plain > .when { padding-top: 0.2rem; font-family: var(--sans); font-size: 1rem; font-style: italic; color: var(--ink); }
@media (max-width: 34rem) {
  .entry { grid-template-columns: 1fr; }
  .entry > .when { padding: 0 0 0.3rem; }
  .entry > .when time { display: inline; }
  .entry > .when time + time::before { content: " · "; }
}

.tags { margin: 0; padding: 0; list-style: none; }
.tags li { display: inline; margin: 0; }
.tags li + li::before { content: ", "; }
.entry .tags { padding-left: 0; }
.entry .tags li + li { margin-top: 0; }
.entry .tags li::marker { content: none; }

.inner-foot { margin-top: clamp(3rem, 7vw, 5rem); }

.notfound { padding-block: 4rem 6rem; }

.notfound .btns { margin-top: 2rem; }

.print-only { display: none; }

/* ---------- Print (the CV page): a clean A4 CV */
@page { size: A4; margin: 14mm 16mm 15mm; }
@media print {
  html { font-size: 100%; }
  :root:not([data-print]) { --paper: #fff; --surface: #fff; --ink: #111; --muted: #555; --faint: #999; --rule: #ddd; --blue: #2f4b6e; color-scheme: light; }
  body { font-size: 9.5pt; line-height: 1.45; }
  .wrap, .wide { max-width: none; padding: 0; }
  .nav, .skip, .footer, .no-print, .tape, .inner-foot, .viz-cards { display: none !important; }
  .page-head { margin: 0; padding: 0 0 2mm; border-radius: 0; background: none; color: #111; }
  .page-head::after { display: none; }
  .page-head .eyebrow { display: none; }
  .page-head h1 { font-size: 26pt; }
  .page-head .subtitle.mono { font-size: 8.5pt; }
  .cv-photo { width: 26mm; border-radius: 3mm; }
  .page-head .subtitle { margin-top: 2mm; font-size: 10.5pt; }
  .print-only { display: block !important; }
  .inner { padding-block: 3mm 0; }
  .inner h2 { margin-bottom: 3mm; padding-top: 1.5mm; font-size: 14pt; break-after: avoid; }
  .figures { grid-template-columns: repeat(4, 1fr); gap: 2mm; margin-top: 3mm; }
  .figures li { padding: 1.5mm 0 0; break-inside: avoid; color: #111 !important; border-color: #ccc !important; }
  .figures li > span { color: #555 !important; }
  .figures strong { font-size: 11pt; }
  .figures li > span { font-size: 8pt; }
  /* floats instead of grid, so a long entry can continue on the next page */
  .entry { display: flow-root; }
  .entry > .when { float: left; width: 27mm; padding-top: 1mm; font-size: 7.5pt; }
  .entry > .when time { white-space: nowrap; }
  .entry > div { margin-left: 30mm; padding: 0 0 4mm; }
  .entry h3 { font-size: 13pt; break-after: avoid; }
  .entry .role { color: #111; font-size: 8pt; break-after: avoid; }
  .entry .context { font-size: 9pt; }
  .entry li, .entry p { break-inside: avoid; }
  .entry li + li { margin-top: 1mm; }
  .entry > div > * + * { margin-top: 1.2mm; }
  .tags li { font-size: 9pt; }
  a { text-decoration: none; }
}
