/* ==========================================================================
   Engineering logs: tokens
   Scale: perfect fourth (1.333) from a 17px base.
   ========================================================================== */
:root {
  interpolate-size: allow-keywords;

  --font-ui: "Schibsted Grotesk", system-ui, sans-serif;
  --font-read: "Newsreader", Georgia, serif;
  --font-code: "JetBrains Mono", ui-monospace, monospace;

  --step--1: 0.8rem;     /* 12.8 */
  --step-0: 1rem;        /* 17   */
  --step-1: 1.333rem;
  --step-2: 1.777rem;
  --step-3: 2.369rem;
  --step-4: 3.157rem;
  --step-hero: clamp(3rem, 2rem + 6vw, 7.5rem);
  --step-year: clamp(2.6rem, 1rem + 4.2vw, 5rem);

  --gutter: clamp(1rem, 4vw, 3rem);
  --measure: 40rem;
  --year-col: clamp(11rem, 22vw, 19rem);

  --ease-out: cubic-bezier(.2, .8, .2, 1);

  /* high-contrast monochrome noise tile for the film grain */
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncR type='linear' slope='2.2' intercept='-.6'/%3E%3CfeFuncG type='linear' slope='2.2' intercept='-.6'/%3E%3CfeFuncB type='linear' slope='2.2' intercept='-.6'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --glow-grain-opacity: .55;
  --glow-grain-blend: overlay;

  /* dark (default) */
  --bg: #07070D;
  --surface: rgb(255 255 255 / .035);
  --surface-strong: rgb(255 255 255 / .06);
  --ink: #ECEAF4;
  --ink-soft: #B9B5CA;
  --muted: #A29DB8;
  --line: rgb(236 234 244 / .12);
  --line-strong: rgb(236 234 244 / .28);
  --accent: #F2A25C;
  --accent-ink: #1A0F05;
  --ember: #F2A25C;
  --rose: #D2577A;
  --violet: #7E6BD0;
  --aurora-opacity: .72;
  --hl-ink: #16141F;
  --grain-opacity: .07;
  --grain-blend: overlay;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #EDECF3;
    --surface: rgb(255 255 255 / .55);
    --surface-strong: rgb(255 255 255 / .8);
    --ink: #16141F;
    --ink-soft: #3E3A4F;
    --muted: #625D74;
    --line: rgb(22 20 31 / .12);
    --line-strong: rgb(22 20 31 / .3);
    --accent: #A84A0E;
    --accent-ink: #FFF7EF;
    --ember: #F7904A;
    --rose: #EC5F8C;
    --violet: #8A6FF0;
    --aurora-opacity: .95;
    --grain-opacity: .1;
  --glow-grain-opacity: .4;
    --grain-blend: soft-light;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #EDECF3;
  --surface: rgb(255 255 255 / .55);
  --surface-strong: rgb(255 255 255 / .8);
  --ink: #16141F;
  --ink-soft: #3E3A4F;
  --muted: #625D74;
  --line: rgb(22 20 31 / .12);
  --line-strong: rgb(22 20 31 / .3);
  --accent: #A84A0E;
  --accent-ink: #FFF7EF;
  --ember: #F7904A;
  --rose: #EC5F8C;
  --violet: #8A6FF0;
  --aurora-opacity: .95;
  --grain-opacity: .1;
  --glow-grain-opacity: .4;
  --grain-blend: soft-light;
  color-scheme: light;
}

/* ==========================================================================
   Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; font-size: 106.25%; /* 17px */ }
body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--step-0);
  line-height: 1.55;
  font-feature-settings: "ss01", "tnum" 0;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .4s, color .4s;
}
a { color: inherit; }
img { max-width: 100%; height: auto; display: block; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--accent); color: var(--accent-ink); }

.skip {
  position: absolute; left: var(--gutter); top: -4rem; z-index: 10;
  background: var(--ink); color: var(--bg); padding: .5rem .9rem; border-radius: 6px;
}
.skip:focus { top: 1rem; }

/* ==========================================================================
   Atmosphere: aurora glow + grain (after the UM GitLab login)
   ========================================================================== */
/* The glow is sized to the content container (82rem), not the viewport,
   so it stays a focused bloom on ultra-wide screens. */
.aurora {
  position: fixed; bottom: 0; left: 50%; z-index: -2;
  width: min(82rem, 100vw); height: 70vh;
  transform: translateX(-50%);
  pointer-events: none; opacity: var(--aurora-opacity);
  transition: opacity .8s var(--ease-out);
}
.aurora__glow { position: absolute; inset: 0; filter: blur(70px) saturate(1.1); }
.aurora span { position: absolute; border-radius: 50%; }
.aurora__ember {
  width: 55%; height: 60%; left: 12%; bottom: -22%;
  background: radial-gradient(closest-side, var(--ember), transparent);
  animation: drift-a 26s ease-in-out infinite alternate;
}
.aurora__rose {
  width: 46%; height: 52%; left: 32%; bottom: -24%;
  background: radial-gradient(closest-side, var(--rose), transparent);
  opacity: .85;
  animation: drift-b 32s ease-in-out infinite alternate;
}
.aurora__violet {
  width: 44%; height: 68%; left: 50%; bottom: -20%;
  background: radial-gradient(closest-side, var(--violet), transparent);
  opacity: .8;
  animation: drift-a 38s ease-in-out infinite alternate-reverse;
}
@keyframes drift-a { to { transform: translate3d(5%, -6%, 0) scale(1.08); } }
@keyframes drift-b { to { transform: translate3d(-6%, -8%, 0) scale(.94); } }

/* Coarse film grain living inside the glow, like the UM GitLab login.
   It sits outside the blurred layer so it stays crisp. */
.aurora::after {
  content: ""; position: absolute; inset: 0;
  background-image: var(--noise);
  background-size: 180px;
  opacity: var(--glow-grain-opacity);
  mix-blend-mode: var(--glow-grain-blend);
  /* grain only where the glow is: no visible box edges */
  mask-image: radial-gradient(ellipse 48% 75% at 50% 100%, #000 20%, transparent 100%);
}

body[data-view="article"] .aurora { opacity: calc(var(--aurora-opacity) * .45); }

/* A fainter grain over the whole page */
.grain {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  opacity: var(--grain-opacity); mix-blend-mode: var(--grain-blend);
  background-image: var(--noise);
  background-size: 180px;
}

/* ==========================================================================
   Header / footer
   ========================================================================== */
.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.25rem var(--gutter);
  max-width: 82rem; width: 100%; margin-inline: auto;
}
.brand {
  display: inline-flex; align-items: baseline; gap: .6rem;
  text-decoration: none; font-weight: 700; letter-spacing: -.01em;
}
.brand__mark {
  width: 1.4rem; height: 1.4rem; align-self: center;
  fill: none; stroke: var(--accent); stroke-width: 1.8;
}
.brand__mark circle:first-child { fill: var(--accent); }
.brand__sub { font-weight: 400; color: var(--muted); }
.site-nav { display: flex; align-items: center; gap: 1.25rem; }
.site-nav a {
  text-decoration: none; color: var(--ink-soft);
  font-size: .94rem;
}
.site-nav a:hover { color: var(--ink); }
.theme-toggle {
  display: grid; place-items: center;
  width: 2.25rem; height: 2.25rem; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--line); cursor: pointer;
}
.theme-toggle:hover { border-color: var(--line-strong); }
.theme-toggle svg { width: 1.05rem; height: 1.05rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.icon-moon { display: none; }
:root[data-resolved-theme="light"] .icon-sun { display: none; }
:root[data-resolved-theme="light"] .icon-moon { display: block; }

main { flex: 1; width: 100%; max-width: 82rem; margin-inline: auto; padding: 0 var(--gutter); }
main:focus { outline: none; }
.loading { color: var(--muted); padding: 6rem 0; }

.site-footer {
  max-width: 82rem; width: 100%; margin: 6rem auto 0;
  padding: 2rem var(--gutter) 2.5rem;
  color: var(--muted); font-size: var(--step--1);
}
.site-footer p { max-width: 38rem; margin: 0; }

/* ==========================================================================
   Home: intro
   ========================================================================== */
.intro {
  padding: clamp(3rem, 10vh, 7rem) 0 clamp(2.5rem, 7vh, 5rem);
  display: grid; gap: 1.75rem;
}
.intro h1 {
  margin: 0; font-size: var(--step-hero);
  font-weight: 800; line-height: .92; letter-spacing: -.045em;
  max-width: 11ch;
}
.intro__lede {
  margin: 0; max-width: 34rem;
  font-size: var(--step-1); line-height: 1.45; color: var(--ink-soft);
  text-wrap: pretty;
}
.intro__count { margin: 0; color: var(--muted); font-size: .94rem; font-variant-numeric: tabular-nums; }

/* toolbar: project filter + expand all */
.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem;
  padding-block: 1rem; margin-bottom: 1rem;
  border-top: 1px solid var(--line);
}
.filters { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; padding: 0; border: 0; }
.filters legend {
  float: left; margin-right: .6rem; padding: .35rem 0;
  color: var(--muted); font-size: .9rem;
}
.chip {
  padding: .35rem .8rem; border-radius: 999px;
  border: 1px solid var(--line); background: transparent;
  color: var(--ink-soft); font-size: .88rem; cursor: pointer;
  transition: border-color .2s, background-color .2s, color .2s;
}
.chip:hover { border-color: var(--line-strong); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.text-button {
  background: none; border: 0; padding: .35rem 0; cursor: pointer;
  color: var(--ink-soft); font-size: .9rem;
  text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: .25em;
}
.text-button:hover { color: var(--ink); text-decoration-color: var(--accent); }

/* ==========================================================================
   Timeline
   ========================================================================== */
.timeline { display: grid; gap: clamp(1.25rem, 4vh, 2.5rem); }

.year {
  display: grid;
  grid-template-columns: var(--year-col) 1fr;
  align-items: start;
}
.year__label {
  position: sticky; top: 1.5rem;
  margin: 0; padding-top: .1rem;
  font-size: var(--step-year); font-weight: 800;
  line-height: .85; letter-spacing: -.01em;
  font-variant-numeric: tabular-nums;
  /* Outline only. The stroke is painted under a background-coloured fill, so the
     overlapping contours of the variable font don't show as seams inside letters.
     Half the stroke is hidden by the fill, hence the doubled width. */
  color: var(--bg);
  -webkit-text-stroke: 2.5px var(--ink);
  paint-order: stroke fill;
}

.entries {
  list-style: none; margin: 0; padding: 0 0 0 2rem;
  position: relative;
}
/* the rail */
.entries::before {
  content: ""; position: absolute; left: .45rem; top: .6rem; bottom: .6rem;
  width: 1px; background: linear-gradient(to bottom, var(--line-strong), var(--line) 80%, transparent);
}

.entry { position: relative; }
.entry + .entry { border-top: 1px solid var(--line); }
/* node on the rail */
.entry::before {
  content: ""; position: absolute; left: calc(-2rem + .45rem - 4.5px); top: 1.55rem;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--bg); border: 1.5px solid var(--line-strong);
  transition: background-color .3s, border-color .3s, box-shadow .3s;
}
.entry:has(details[open])::before { background: var(--ink-soft); border-color: var(--ink-soft); }
.entry:hover::before, .entry:focus-within::before {
  background: var(--accent); border-color: var(--accent);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 20%, transparent);
}

.entry summary {
  list-style: none; cursor: pointer;
  display: grid; grid-template-columns: 5.5rem 1fr auto; column-gap: 1.25rem; row-gap: .2rem;
  align-items: baseline;
  padding: 1.1rem 0;
}
.entry summary::-webkit-details-marker { display: none; }
.entry summary:focus-visible { outline-offset: 0; }

.entry__date {
  color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.entry__head { display: grid; gap: .2rem; min-width: 0; }
.entry__project { color: var(--muted); font-size: .88rem; }
.entry__title {
  margin: 0; font-size: var(--step-1); font-weight: 600;
  line-height: 1.25; letter-spacing: -.015em; text-wrap: balance;
  transition: color .2s;
}
.entry summary:hover:not(:has(.entry__toggle:hover)) .entry__title { color: var(--accent); }
/* The title link opens the log. Its ::after stretches over the whole row, so
   clicking anywhere that highlights the title opens it too; only the + toggle
   (stacked above) still collapses. */
.entry summary { position: relative; }
.entry__title a { text-decoration: none; }
.entry__title a::after { content: ""; position: absolute; inset: 0; }
.entry__toggle { position: relative; z-index: 1; }

.entry__toggle {
  width: 1.9rem; height: 1.9rem; border-radius: 50%; align-self: center;
  display: grid; place-items: center;
  border: 1px solid var(--line); color: var(--ink-soft);
  transition: transform .35s var(--ease-out), border-color .2s;
}
.entry__toggle svg { width: .85rem; height: .85rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
details[open] .entry__toggle { transform: rotate(45deg); border-color: var(--line-strong); }

/* animated open/close where supported */
.entry details::details-content {
  block-size: 0; overflow: clip;
  transition: block-size .4s var(--ease-out), content-visibility .4s allow-discrete;
}
.entry details[open]::details-content { block-size: auto; }

.entry__body {
  margin-left: calc(5.5rem + 1.25rem);
  padding: 0 0 1.6rem;
  display: grid; grid-template-columns: minmax(0, var(--measure)) 1fr;
  column-gap: 2rem; row-gap: .6rem;
}
.entry__desc, .entry__meta { grid-column: 1; }
.entry__body .read-link {
  grid-column: 2; grid-row: 1 / span 2;
  justify-self: end; align-self: end; white-space: nowrap;
}
.entry__desc {
  margin: 0; font-family: var(--font-read); font-size: 1.12rem; line-height: 1.6;
  color: var(--ink-soft); text-wrap: pretty;
}
.entry__meta { margin: 0; color: var(--muted); font-size: .88rem; }
.read-link {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .55rem 1rem; border-radius: 999px;
  background: var(--ink); color: var(--bg);
  text-decoration: none; font-weight: 600; font-size: .92rem;
  transition: background-color .2s, color .2s;
}
.read-link:hover { background: var(--accent); color: var(--accent-ink); }

.empty { color: var(--muted); padding: 3rem 0; }

/* ==========================================================================
   Article
   ========================================================================== */
.article { padding-top: clamp(2rem, 6vh, 4rem); }
.back {
  display: inline-block; margin-bottom: clamp(2rem, 6vh, 3.5rem);
  color: var(--ink-soft); text-decoration: none; font-size: .94rem;
}
.back:hover { color: var(--accent); }

.article__layout {
  display: grid;
  grid-template-columns: var(--year-col) minmax(0, var(--measure));
  column-gap: 2rem;
}
.article__aside { grid-row: span 2; }
.article__aside dl {
  position: sticky; top: 1.5rem;
  margin: 0; display: grid; gap: 1rem;
  font-size: .9rem;
}
.article__aside dt { color: var(--muted); }
.article__aside dd { margin: .1rem 0 0; color: var(--ink); font-variant-numeric: tabular-nums; }
.article__aside dd a { text-decoration-color: var(--line-strong); text-underline-offset: .2em; }
.article__aside dd a:hover { color: var(--accent); }

.article__header { margin-bottom: 2.5rem; }
.article__title {
  margin: 0 0 1.25rem;
  font-size: clamp(2.2rem, 1.4rem + 3.2vw, 4rem);
  font-weight: 800; line-height: 1; letter-spacing: -.035em; text-wrap: balance;
}
.article__desc {
  margin: 0; font-size: var(--step-1); line-height: 1.45; color: var(--ink-soft); text-wrap: pretty;
}

.prose { font-family: var(--font-read); font-size: 1.2rem; line-height: 1.7; }
.prose > * { margin: 0; }
.prose > * + * { margin-top: 1.15em; }
.prose h2 {
  font-family: var(--font-ui); font-size: var(--step-2); font-weight: 700;
  line-height: 1.15; letter-spacing: -.02em; margin-top: 2.2em;
}
.prose h2 + * { margin-top: .7em; }
.prose p { text-wrap: pretty; }
.prose ul { padding-left: 1.2em; }
.prose li + li { margin-top: .4em; }
.prose li::marker { color: var(--accent); }
.prose code {
  font-family: var(--font-code); font-size: .8em;
  padding: .1em .35em; border-radius: 4px; background: var(--surface-strong);
}
.prose pre {
  font-family: var(--font-code); font-size: .82rem; line-height: 1.65;
  padding: 1.1rem 1.25rem; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--line);
  overflow-x: auto; backdrop-filter: blur(8px);
}
.prose pre code { padding: 0; background: none; font-size: inherit; }
.prose blockquote {
  margin-inline: 0; padding: .2em 0 .2em 1.1em;
  border-left: 2px solid var(--accent);
  font-size: 1.45rem; line-height: 1.4; font-style: italic; color: var(--ink);
}
.prose .note {
  font-family: var(--font-ui); font-size: 1rem; line-height: 1.55;
  padding: 1rem 1.2rem; border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.prose .table {
  overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
}
.prose table {
  width: 100%; border-collapse: collapse;
  font-family: var(--font-ui); font-size: .9rem; line-height: 1.45; font-variant-numeric: tabular-nums;
}
.prose th, .prose td { padding: .6rem .9rem; text-align: left; vertical-align: top; }
.prose th { font-weight: 600; color: var(--ink); border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.prose td + td, .prose th + th { text-align: right; }
.prose tbody tr + tr td { border-top: 1px solid var(--line); }
.prose figure img { border-radius: 10px; }
.prose figcaption { font-family: var(--font-ui); font-size: .85rem; color: var(--muted); margin-top: .5rem; }

.article__pager {
  grid-column: 2;
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
  margin-top: 4rem; padding-top: 1.5rem; border-top: 1px solid var(--line);
}
.pager-link { text-decoration: none; display: grid; gap: .2rem; }
.pager-link span { color: var(--muted); font-size: .88rem; }
.pager-link strong { font-weight: 600; line-height: 1.3; }
.pager-link:hover strong { color: var(--accent); }
.pager-link--next { text-align: right; grid-column: 2; }

/* ==========================================================================
   Small screens
   ========================================================================== */
@media (max-width: 760px) {
  .brand__sub { display: none; }
  .year { grid-template-columns: 1fr; }
  .year__label { position: static; margin-bottom: 1rem; }
  .entries { padding-left: 1.5rem; }
  .entries::before { left: .3rem; }
  .entry::before { left: calc(-1.5rem + .3rem - 4.5px); }
  .entry summary { grid-template-columns: 1fr auto; }
  .entry__date { grid-column: 1; }
  .entry__head { grid-column: 1; }
  .entry__toggle { grid-column: 2; grid-row: 1 / span 2; }
  .entry__body { margin-left: 0; grid-template-columns: minmax(0, 1fr); }
  .entry__body .read-link { grid-column: 1; grid-row: auto; justify-self: start; margin-top: .4rem; }

  .article__layout { grid-template-columns: minmax(0, 1fr); }
  .article__aside { grid-row: auto; order: 2; margin-bottom: 2rem; }
  .article__aside dl { position: static; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); }
  .article__header { order: 1; }
  .prose { order: 3; font-size: 1.1rem; }
  .article__pager { grid-column: 1; order: 4; grid-template-columns: 1fr; }
  .pager-link--next { grid-column: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ==========================================================================
   Highlight: ==word== in titles / prose
   ========================================================================== */
.highlight {
  /* the aurora itself, with a touch of grain: ties the mark to the page
     instead of reading as a flat colour block */
  background-image: var(--noise),
    linear-gradient(100deg, var(--ember), var(--rose) 55%, var(--violet));
  background-size: 140px, 100% 100%;
  background-blend-mode: soft-light, normal;
  color: var(--hl-ink);
  padding: 0 .12em;
  margin: 0 -.02em;
  /* keeps the block intact on every line if a highlight wraps */
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.entry summary:hover .entry__title .highlight { color: var(--hl-ink); }
.prose .highlight, .entry__desc .highlight, .article__desc .highlight {
  padding: 0 .2em; border-radius: 2px;
  background: color-mix(in srgb, var(--ember) 40%, transparent);
  color: inherit;
}

/* ==========================================================================
   Language switch
   ========================================================================== */
.lang-switch {
  display: inline-flex; padding: 3px; gap: 2px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
}
.site-nav .lang-switch a {
  display: grid; place-items: center;
  min-width: 2.1rem; height: 1.75rem; padding: 0 .55rem; border-radius: 999px;
  font-size: .8rem; font-weight: 600; letter-spacing: .02em;
  color: var(--muted);
  transition: color .2s, background-color .2s;
}
.site-nav .lang-switch a:hover { color: var(--ink); }
.site-nav .lang-switch a[aria-current="true"] { background: var(--ink); color: var(--bg); }

/* Longer French month labels (JUIN26, AOÛT26...) step down to keep the column */
.year__label[data-long] { font-size: calc(var(--step-year) * .84); }

/* Shown on a French page whose log only exists in English */
.lang-note {
  margin: 0 0 1.5rem; padding: .6rem .9rem; border-radius: 8px;
  border: 1px dashed var(--line-strong);
  color: var(--ink-soft); font-size: .9rem;
}
.entry__lang { font-style: italic; }

@media (max-width: 760px) {
  .site-nav { gap: .6rem; }
  .site-nav > a[data-i18n="portfolio"] { display: none; }
}

/* ==========================================================================
   Blocks from Versos: smaller headings, numbered lists, rules, video
   ========================================================================== */
.prose h3 {
  font-family: var(--font-ui); font-size: var(--step-1); font-weight: 650;
  line-height: 1.2; letter-spacing: -.01em; margin-top: 1.8em;
}
.prose h3 + * { margin-top: .5em; }
.prose ol { padding-left: 1.4em; }
.prose ol li::marker { font-family: var(--font-ui); font-size: .85em; font-weight: 600; }
.prose strong { font-weight: 600; color: var(--ink); }
.prose s { color: var(--muted); }
.prose hr {
  border: 0; height: 1px; margin-block: 2.4em;
  background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
}
.prose .video iframe {
  display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 10px;
  background: var(--surface-strong);
}

/* ==========================================================================
   Audio player: narration under the article header, and audio blocks
   ========================================================================== */
.player {
  --p: 0%;
  --track: color-mix(in srgb, var(--ink) 16%, var(--bg));
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "play label rate"
    "play seek  time";
  column-gap: 1rem; row-gap: .35rem; align-items: center;
  margin-top: 2rem; padding: .85rem 1.1rem .85rem .85rem;
  border: 1px solid var(--line); border-radius: 18px;
  background: var(--surface); backdrop-filter: blur(10px);
  font-family: var(--font-ui);
}
.player audio { display: none; }

.player__play {
  grid-area: play;
  width: 3.1rem; height: 3.1rem; border: 0; border-radius: 50%; padding: 0;
  display: grid; place-items: center; cursor: pointer;
  color: var(--hl-ink);
  /* same grainy aurora as the highlights */
  background-image: var(--noise), linear-gradient(135deg, var(--ember), var(--rose) 55%, var(--violet));
  background-size: 140px, 100% 100%;
  background-blend-mode: soft-light, normal;
  transition: transform .25s var(--ease-out), box-shadow .25s;
}
.player__play svg { width: 1.05rem; height: 1.05rem; fill: currentColor; }
.player__play:hover { transform: scale(1.06); box-shadow: 0 0 0 6px color-mix(in srgb, var(--rose) 18%, transparent); }
.player__play:active { transform: scale(.95); }
.player__play:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.player[data-playing="true"] .player__play { box-shadow: 0 0 0 6px color-mix(in srgb, var(--rose) 22%, transparent); }

.player__label {
  grid-area: label; margin: 0;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .75rem;
  font-size: .95rem; font-weight: 600; line-height: 1.3;
}
.player__note { font-size: .8rem; font-weight: 400; color: var(--muted); }

.player__rate {
  grid-area: rate; justify-self: end;
  min-width: 3.1rem; height: 1.7rem; padding: 0 .55rem; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--ink-soft);
  font: inherit; font-size: .78rem; font-weight: 600; font-variant-numeric: tabular-nums;
  cursor: pointer; transition: color .2s, border-color .2s;
}
.player__rate:hover { color: var(--ink); border-color: var(--line-strong); }
.player__rate:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.player__time {
  grid-area: time; justify-self: end;
  font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap;
}

/* The track shows the whole gradient; the unplayed part is covered from --p on. */
.player__seek {
  grid-area: seek;
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 1.4rem; margin: 0; background: transparent; cursor: pointer;
}
.player__seek::-webkit-slider-runnable-track {
  height: 4px; border-radius: 4px;
  background: linear-gradient(90deg, transparent var(--p), var(--track) var(--p)),
              linear-gradient(90deg, var(--ember), var(--rose) 55%, var(--violet));
}
.player__seek::-moz-range-track {
  height: 4px; border-radius: 4px;
  background: linear-gradient(90deg, transparent var(--p), var(--track) var(--p)),
              linear-gradient(90deg, var(--ember), var(--rose) 55%, var(--violet));
}
.player__seek::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px; margin-top: -5px; border: 0; border-radius: 50%;
  background: var(--ink); transition: transform .15s;
}
.player__seek::-moz-range-thumb {
  width: 14px; height: 14px; border: 0; border-radius: 50%; background: var(--ink);
}
.player__seek:hover::-webkit-slider-thumb { transform: scale(1.2); }
.player__seek:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.player__seek:disabled { cursor: default; opacity: .5; }

.player[data-error] .player__play { filter: grayscale(1); opacity: .5; cursor: default; transform: none; }

.player__transcript {
  grid-column: 1 / -1; margin-top: .5rem; padding-top: .6rem; border-top: 1px solid var(--line);
  font-size: .9rem;
}
.player__transcript summary { cursor: pointer; color: var(--ink-soft); font-weight: 500; width: fit-content; }
.player__transcript summary:hover { color: var(--ink); }
.player__transcript p {
  margin: .7rem 0 0; font-family: var(--font-read); font-size: 1.02rem; line-height: 1.6;
  color: var(--ink-soft); max-height: 18rem; overflow: auto;
}

/* Audio inside a log: same controls, quieter frame */
.prose .player--inline { margin-top: 1.15em; padding: .6rem .9rem .6rem .6rem; border-radius: 14px; }
.player--inline .player__play { width: 2.5rem; height: 2.5rem; }
.player--inline .player__label { font-size: .88rem; font-weight: 500; color: var(--ink-soft); }

@media (max-width: 520px) {
  .player { column-gap: .75rem; padding-right: .85rem; }
  .player__time { font-size: .72rem; }
}
