/* ============================================================
   PARI WHITE PAPERS: reading + print stylesheet
   ============================================================ */
:root {
  --paper: #fbf7f0;
  --ink: #1f2733;
  --muted: #5b6472;
  --faint: #8a93a1;
  --line: #e3ddd2;
  --accent: #2a78d6; /* overridden per paper */
  --serif: "Fraunces", Georgia, serif;
  --body: Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.06rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Top nav (screen only) ---------- */
.paper-nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.8rem clamp(1rem, 4vw, 2.5rem);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase;
}
.paper-nav a { color: var(--muted); text-decoration: none; transition: color 0.2s; white-space: nowrap; }
/* on a phone the three items can't share one row; the middle label is decorative
   (the cover repeats it immediately below) so it goes rather than wrapping the bar */
@media (max-width: 520px) {
  .paper-nav > span:not(.nav-actions) { display: none; }
}
.paper-nav a:hover { color: var(--accent); }
.paper-nav .nav-actions { display: inline-flex; align-items: center; gap: 0.6rem; }
.paper-nav .pdf-btn {
  border: 1.5px solid var(--line); border-radius: 99px;
  padding: 0.5em 1.3em; color: var(--muted); font-weight: 500;
}
.paper-nav .pdf-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Listen (audio dock) ---------- */
/* Solid, and captioned with the runtime: the narration is the offer most
   readers do not know exists, so it takes the emphasis and the PDF gives it up. */
.paper-nav .listen-btn {
  border: 1.5px solid var(--accent); border-radius: 99px;
  padding: 0.5em 1.15em; background: var(--accent); color: #fff; font-weight: 500;
  display: inline-flex; align-items: center; gap: 0.5em;
}
.paper-nav .listen-btn:hover { color: #fff; filter: brightness(1.1); }
.paper-nav .listen-btn svg { width: 0.85em; height: 0.85em; fill: currentColor; }
.paper-nav .listen-btn b { font-weight: 400; opacity: 0.85; }
/* the pill is unhidden by player.js, so a browser that cannot play the file
   never advertises one */
@media (max-width: 700px) {
  /* the word stays: it is what a reader has to see. The runtime is what goes */
  .paper-nav .listen-btn b { display: none; }
}
@media (max-width: 430px) {
  .paper-nav .pdf-btn__long { display: none; }
  .paper-nav .pdf-btn { padding: 0.5em 1em; }
}

.audio-dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding: 0.7rem clamp(1rem, 4vw, 2.5rem);
  padding-bottom: max(0.7rem, env(safe-area-inset-bottom));
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em;
  color: var(--muted);
}
.audio-dock[hidden] { display: none; }
.audio-dock__inner {
  max-width: 940px; margin: 0 auto;
  display: flex; align-items: center; gap: clamp(0.5rem, 2vw, 1rem);
}
.audio-btn {
  flex: none; background: none; border: 0; cursor: pointer; color: var(--muted);
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.35em; border-radius: 99px; transition: color 0.2s;
}
.audio-btn:hover { color: var(--accent); }
.audio-btn svg { width: 1.25em; height: 1.25em; fill: currentColor; }
.audio-btn b { font-weight: 400; font-size: 0.62rem; letter-spacing: 0.02em; }
.audio-btn--play b { display: none; }
.audio-btn--play {
  width: 2.4rem; height: 2.4rem; padding: 0;
  background: var(--accent); color: #fff;
}
.audio-btn--play:hover { color: #fff; filter: brightness(1.08); }
.audio-btn--play svg { width: 0.9rem; height: 0.9rem; }
.audio-btn--play .pause, .audio-dock[data-playing] .audio-btn--play .play { display: none; }
.audio-dock[data-playing] .audio-btn--play .pause { display: block; }

.audio-seek {
  flex: 1 1 auto; min-width: 3rem; height: 1.1rem;
  -webkit-appearance: none; appearance: none; background: none; cursor: pointer;
}
.audio-seek::-webkit-slider-runnable-track {
  height: 3px; border-radius: 3px;
  background: linear-gradient(to right, var(--accent) var(--pct, 0%), var(--line) var(--pct, 0%));
}
.audio-seek::-moz-range-track {
  height: 3px; border-radius: 3px;
  background: linear-gradient(to right, var(--accent) var(--pct, 0%), var(--line) var(--pct, 0%));
}
.audio-seek::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 11px; height: 11px; margin-top: -4px;
  border: 0; border-radius: 99px; background: var(--accent);
}
.audio-seek::-moz-range-thumb { width: 11px; height: 11px; border: 0; border-radius: 99px; background: var(--accent); }
.audio-seek:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.audio-time { flex: none; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--faint); }
.audio-time b { color: var(--ink); font-weight: 400; }
.audio-rate { min-width: 3.1em; }
.audio-chapters { position: relative; flex: none; }
.audio-chapters #audio-chapter-now {
  display: inline-block; max-width: 12ch; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom;
}
.audio-chapters__list {
  position: absolute; bottom: calc(100% + 0.7rem); right: 0;
  min-width: 15rem; max-width: min(22rem, 80vw);
  max-height: min(20rem, 50vh); overflow-y: auto;
  list-style: none; margin: 0; padding: 0.4rem;
  background: var(--paper); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 8px 28px rgba(31, 39, 51, 0.14);
}
.audio-chapters__list[hidden] { display: none; }
.audio-chapters__list button {
  display: block; width: 100%; text-align: left;
  background: none; border: 0; cursor: pointer; color: var(--muted);
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.04em;
  line-height: 1.5; padding: 0.5em 0.7em; border-radius: 5px;
}
.audio-chapters__list button:hover { background: var(--line); color: var(--ink); }
.audio-chapters__list li[data-current] button { color: var(--accent); }
.audio-tag {
  flex: none; border: 1px solid var(--line); border-radius: 99px;
  padding: 0.25em 0.7em; color: var(--faint);
  font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase;
}
.audio-dock:not([data-sample]) .audio-tag { display: none; }
/* the footer would otherwise sit under the docked bar */
body.has-audio-dock .paper-footer { padding-bottom: 6rem; }

/* on a phone the row is play / seek / time only; the rest would crowd it out */
@media (max-width: 620px) {
  .audio-dock .audio-tag, .audio-dock #audio-back, .audio-dock #audio-fwd { display: none; }
  .audio-chapters #audio-chapter-now { max-width: 6ch; }
  /* a 15rem popover anchored to a mid-bar button runs off a phone screen, so
     here it spans the dock instead: static parent hands positioning to .audio-dock */
  .audio-chapters { position: static; }
  .audio-chapters__list {
    left: 0.6rem; right: 0.6rem; bottom: calc(100% + 0.5rem);
    min-width: 0; max-width: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .audio-btn, .paper-nav .listen-btn { transition: none; }
}

/* ---------- Start-here band: video teaser + the narration offer ---------- */
.paper-intro {
  background: color-mix(in srgb, var(--accent) 6%, var(--paper));
  border-bottom: 1px solid var(--line);
  padding: clamp(2rem, 5vw, 3.2rem) clamp(1.2rem, 5vw, 2rem);
}
/* the article's measure, not a wider one: past 1240px the contents rail is
   fixed to the left of that column and anything wider runs underneath it */
.paper-intro__inner { max-width: 760px; margin: 0 auto; }
.intro-band__kicker {
  display: flex; align-items: center; gap: 0.55em;
  margin: 0 0 0.8rem;
  font-family: var(--mono); font-size: 0.7rem;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--accent);
}
.intro-band__kicker svg { width: 0.95em; height: 0.95em; fill: currentColor; flex: none; }
.intro-band__h {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(1.22rem, 2.6vw, 1.55rem); line-height: 1.25;
  margin: 0 0 0.5rem;
}
.intro-band__note { margin: 0.9rem 0 0; font-size: 0.95rem; line-height: 1.6; color: var(--muted); }

/* Facade: the poster ships with the page and the YouTube iframe is only
   fetched once a reader actually asks for it. Without JS the same element is
   still a working link to the video. */
.video {
  position: relative; aspect-ratio: 16 / 9; margin-top: 0.9rem;
  border-radius: 10px; overflow: hidden; background: #10151d;
  box-shadow: 0 14px 40px rgba(31, 39, 51, 0.16);
}
.video iframe, .video__frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video__frame { display: block; cursor: pointer; }
.video__frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.video__play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: clamp(3.4rem, 9vw, 4.4rem); height: clamp(3.4rem, 9vw, 4.4rem);
  display: flex; align-items: center; justify-content: center;
  border-radius: 99px; background: var(--accent); color: #fff;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease, filter 0.2s ease;
}
.video__play svg { width: 38%; height: 38%; fill: currentColor; margin-left: 8%; }
.video__frame:hover .video__play { transform: translate(-50%, -50%) scale(1.07); filter: brightness(1.1); }
.video__frame:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.video__len {
  position: absolute; right: 0.6rem; bottom: 0.6rem;
  padding: 0.25em 0.6em; border-radius: 4px;
  background: rgba(16, 21, 29, 0.82); color: #eef2f7;
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.06em;
}
.video__url { display: none; }  /* the printed paper cannot show the player */

/* Placeholder for a paper whose intro has not been recorded yet. It holds the
   slot at a fraction of the height, so a pending video does not open a
   400px well above the offer that is actually ready. */
.video-soon {
  display: flex; align-items: center; gap: 1rem;
  margin-top: 0.9rem; padding: 1rem 1.15rem;
  border: 1px dashed color-mix(in srgb, var(--accent) 40%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 4%, transparent);
}
.video-soon__mark {
  display: flex; align-items: center; justify-content: center; flex: none;
  width: 2.4rem; height: 2.4rem; border-radius: 99px;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
}
.video-soon__mark svg { width: 36%; height: 36%; fill: currentColor; margin-left: 8%; }
.video-soon__text { margin: 0; font-size: 0.92rem; line-height: 1.55; color: var(--muted); }

.listen-card {
  margin-top: clamp(1.5rem, 3.5vw, 2.2rem);
  display: grid; grid-template-columns: 1fr; gap: 1.2rem;
  border: 1.5px solid color-mix(in srgb, var(--accent) 45%, var(--line));
  border-radius: 12px; background: var(--paper);
  padding: clamp(1.2rem, 3vw, 1.7rem);
  box-shadow: 0 6px 22px rgba(31, 39, 51, 0.07);
}
.listen-card[hidden] { display: none; }
@media (min-width: 640px) {
  .listen-card { grid-template-columns: minmax(0, 1fr) auto; gap: 1.8rem; align-items: center; }
  .listen-card__note { text-align: center; }
}
.listen-card__cta { flex: none; }
.listen-card__btn {
  display: inline-flex; align-items: center; gap: 0.6em;
  padding: 0.8em 1.5em; border: 0; border-radius: 99px; cursor: pointer;
  background: var(--accent); color: #fff;
  font-family: var(--mono); font-size: 0.72rem;
  letter-spacing: 0.12em; text-transform: uppercase;
  transition: filter 0.2s ease, transform 0.2s ease;
}
.listen-card__btn svg { width: 0.95em; height: 0.95em; fill: currentColor; }
.listen-card__btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.listen-card__note {
  margin: 0.7rem 0 0;
  font-family: var(--mono); font-size: 0.62rem;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint);
}

/* One quiet reminder, shown once per reader per paper, after they have read
   far enough to know whether they want to sit through the rest. */
.listen-nudge {
  position: fixed; z-index: 55;
  right: clamp(0.8rem, 3vw, 1.6rem); bottom: clamp(0.8rem, 3vw, 1.6rem);
  max-width: min(21rem, calc(100vw - 1.6rem));
  display: flex; align-items: flex-start; gap: 0.8rem;
  padding: 0.9rem 1rem; border-radius: 10px;
  background: #10151d; color: #eef2f7;
  box-shadow: 0 14px 38px rgba(16, 21, 29, 0.34);
  font-family: "Space Grotesk", Helvetica, Arial, sans-serif;
  font-size: 0.85rem; line-height: 1.45;
  animation: nudge-in 0.35s ease both;
}
@keyframes nudge-in { from { opacity: 0; transform: translateY(0.7rem); } to { opacity: 1; transform: none; } }
.listen-nudge__icon { flex: none; color: var(--accent); margin-top: 0.1rem; }
.listen-nudge__icon svg { width: 1.25rem; height: 1.25rem; fill: currentColor; display: block; }
.listen-nudge__body { min-width: 0; }
.listen-nudge b { display: block; font-weight: 500; }
.listen-nudge__sub { display: block; margin-top: 0.15rem; color: #b9c2cf; }
.listen-nudge__go {
  display: block; margin-top: 0.6rem; padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--accent); font: inherit; font-weight: 500;
  border-bottom: 1px solid currentColor;
}
.listen-nudge__x {
  flex: none; margin: -0.25rem -0.3rem 0 0; padding: 0.3rem;
  border: 0; background: none; cursor: pointer; color: #8b95a5;
  font: inherit; line-height: 1;
}
.listen-nudge__x:hover { color: #eef2f7; }
@media (prefers-reduced-motion: reduce) {
  .listen-nudge { animation: none; }
  .video__play, .listen-card__btn { transition: none; }
}

/* ---------- Contents ---------- */
.toc {
  max-width: 760px; margin: 0 auto;
  padding: 1.8rem clamp(1.2rem, 5vw, 2rem) 0;
  font-family: "Space Grotesk", Helvetica, Arial, sans-serif;
}
.toc summary {
  cursor: pointer; color: var(--muted);
  font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase;
}
.toc summary::marker { color: var(--faint); }
.toc ol { list-style: none; margin: 0.9rem 0 0; padding: 0; }
.toc li { margin: 0 0 0.5em; font-size: 0.85rem; line-height: 1.4; }
.toc a { color: var(--muted); text-decoration: none; border-bottom: none; transition: color 0.2s; }
.toc a:hover { color: var(--accent); }
.toc a[aria-current="true"] { color: var(--accent); font-weight: 500; }

/* Wide screens: the contents become a fixed rail beside the column. */
@media (min-width: 1240px) {
  .toc {
    position: fixed; z-index: 10;
    top: 5.4rem; left: max(1.2rem, calc(50vw - 626px));
    width: 190px; max-width: none; margin: 0; padding: 0;
    max-height: calc(100vh - 8rem); overflow-y: auto;
    transition: opacity 0.25s ease;
  }
  /* stays out of the way while the cover is on screen */
  .toc[data-over-cover="true"] { opacity: 0; pointer-events: none; }
  .toc summary { list-style: none; pointer-events: none; }
  .toc summary::-webkit-details-marker { display: none; }
  .toc li { font-size: 0.78rem; }
  .toc::-webkit-scrollbar { width: 0; }
}

/* ---------- Cover ---------- */
.cover {
  background: #10151d;
  color: #eef2f7;
  padding: clamp(3.5rem, 9vh, 6rem) clamp(1.2rem, 6vw, 4rem);
}
.cover__inner { max-width: 860px; margin: 0 auto; }
.cover__kicker {
  font-family: var(--mono); font-size: 0.78rem;
  letter-spacing: 0.4em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 2rem;
}
.cover h1 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  line-height: 1.08; margin-bottom: 1.2rem;
}
.cover__sub {
  font-family: var(--body); font-style: italic;
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  color: #b9c2cf; max-width: 660px; line-height: 1.55;
}
.cover__meta {
  margin-top: 2.6rem; padding-top: 1.6rem;
  border-top: 1px solid rgba(238, 242, 247, 0.18);
  display: flex; flex-wrap: wrap; gap: 2.5rem;
  font-family: var(--mono); font-size: 0.78rem; line-height: 1.7;
}
.cover__meta b { display: block; color: #eef2f7; font-weight: 500; }
.cover__meta span { color: #8b95a5; }

/* ---------- Article ---------- */
article {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(2.5rem, 6vh, 4.5rem) clamp(1.2rem, 5vw, 2rem) 4rem;
}
article h2 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(1.6rem, 3.6vw, 2.2rem); line-height: 1.2;
  margin: 2.8em 0 0.8em;
  padding-top: 1.2em;
  border-top: 1px solid var(--line);
}
article h2:first-child { margin-top: 0; border-top: none; padding-top: 0; }
article h2, article h3 { scroll-margin-top: 5.5rem; }
article h3 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(1.2rem, 2.6vw, 1.5rem);
  margin: 2.2em 0 0.6em;
}
article p { margin: 0 0 1.15em; }
article p strong { color: var(--ink); }
article a { color: var(--accent); text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); }
article a:hover { border-bottom-color: var(--accent); }
article ul, article ol { margin: 0 0 1.15em 1.4em; }
article li { margin-bottom: 0.45em; }
article blockquote {
  margin: 1.8em 0; padding: 0.2em 0 0.2em 1.4em;
  border-left: 3px solid var(--accent);
  font-style: italic; color: var(--muted);
  font-size: 1.08em;
}
article hr { border: none; border-top: 1px solid var(--line); margin: 3em 0; }
article code { font-family: var(--mono); font-size: 0.88em; background: rgba(31,39,51,0.06); padding: 0.1em 0.35em; border-radius: 4px; }

/* Tables */
article table {
  width: 100%; border-collapse: collapse;
  margin: 1.8em 0; font-size: 0.88rem;
  font-family: "Space Grotesk", Helvetica, Arial, sans-serif;
  line-height: 1.45;
}
article th {
  text-align: left; font-weight: 600;
  font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted);
  border-bottom: 2px solid var(--ink);
  padding: 0.5em 0.7em;
}
article td { border-bottom: 1px solid var(--line); padding: 0.6em 0.7em; vertical-align: top; }
article tr:hover td { background: rgba(31,39,51,0.025); }
.table-scroll { overflow-x: auto; }

/* Below the phone breakpoint a 3-5 column table either fragments into one-word
   lines or clips off-screen, so each row reflows into a labelled block. */
@media (max-width: 640px) {
  .table-scroll { overflow-x: visible; }
  article thead {
    position: absolute; width: 1px; height: 1px;
    margin: -1px; padding: 0; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
  article table { margin: 1.6em 0; }
  article tbody, article tr, article td { display: block; width: 100%; }
  article tr { border-bottom: 1px solid var(--line); padding: 0.9em 0; }
  article tr:hover td { background: none; }
  article td { border: 0; padding: 0.2em 0; }
  article td:first-child {
    font-weight: 600; color: var(--ink);
    font-size: 1.02em; margin-bottom: 0.4em;
  }
  /* a left gutter rather than grid/flex: the cell keeps normal inline flow, so
     footnote markers and links stay in the sentence instead of becoming
     separate layout items */
  article td:not(:first-child) {
    position: relative; padding-left: 7.8em; min-height: 1.5em;
  }
  article td:not(:first-child)::before {
    content: attr(data-label);
    position: absolute; left: 0; top: 0.3em; width: 7.2em;
    font-size: 0.63rem; letter-spacing: 0.07em; text-transform: uppercase;
    color: var(--faint); line-height: 1.4;
  }
}

/* Figures */
figure.wp-fig {
  margin: 2.4em calc((min(860px, 96vw) - 100%) / -2);
  max-width: min(860px, 96vw);
}
figure.wp-fig img { display: block; width: 100%; height: auto; }
/* the drawing always fits the column, so nothing reads as cut off; on a phone its
   labels are too small to read at that size, so the figure links to the SVG itself
   where the browser's own pinch-zoom takes over */
.wp-fig__zoom { display: block; position: relative; border-bottom: none !important; }
figure.wp-fig picture, .md-img picture { display: block; }
.md-img img { width: 100%; height: auto; }
@media (max-width: 640px) {
  /* the hint lives in the caption, not over the drawing, so it hides nothing */
  .md-img::after {
    content: "⤢ Tap the figure to enlarge";
    display: block; margin-top: 0.5em;
    font-family: var(--mono); font-size: 0.6rem;
    letter-spacing: 0.09em; text-transform: uppercase;
    color: var(--faint);
  }
  figure.wp-fig figcaption::before {
    content: "⤢ Tap the figure to enlarge";
    display: block; margin-bottom: 0.5em;
    font-family: var(--mono); font-size: 0.6rem;
    letter-spacing: 0.09em; text-transform: uppercase;
    color: var(--faint);
  }
}
figure.wp-fig figcaption {
  font-family: "Space Grotesk", Helvetica, Arial, sans-serif;
  font-size: 0.8rem; color: var(--muted); line-height: 1.5;
  padding: 0.7em 1rem 0;
  border-top: 1px solid var(--line);
  margin: 0.4em 1rem 0;
}
figure.wp-fig figcaption b { color: var(--ink); }

/* Footnotes */
.footnote { margin-top: 3rem; font-size: 0.85rem; color: var(--muted); }
.footnote hr { margin: 2em 0 1.5em; }
.footnote ol { margin-left: 1.2em; }
.footnote li { margin-bottom: 0.6em; scroll-margin-top: 5.5rem; }
/* source URLs sit in the footnote text as plain strings; without this they
   push the whole page sideways on a phone */
.footnote li, .footnote li p { overflow-wrap: break-word; }
.footnote li p { margin: 0; }
sup { font-size: 0.72em; }
sup a { border-bottom: none !important; font-family: var(--mono); }

/* Numbered references (papers that cite [n] rather than footnotes) */
a.cite {
  font-family: var(--mono); font-size: 0.68em;
  vertical-align: super; line-height: 0;
  border-bottom: none !important; padding: 0; letter-spacing: -0.02em;
}
.refs { margin-top: 0.4rem; font-size: 0.85rem; color: var(--muted); }
.refs p { margin: 0 0 0.7em; padding-left: 2.8em; text-indent: -2.8em; line-height: 1.6; }
.refs .ref-n { font-family: var(--mono); color: var(--ink); }
.refs a { word-break: break-word; }
.refs p { scroll-margin-top: 5.5rem; }
.refs p:target { background: color-mix(in srgb, var(--accent) 12%, transparent); }
/* papers whose reference list is grouped by subject carry a bold heading
   between runs of entries; it sits outside the hanging indent */
.refs p.ref-group {
  padding-left: 0; text-indent: 0; margin: 1.6em 0 0.8em;
  font-family: var(--mono); font-size: 0.82rem; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink);
}
.refs p.ref-group:first-child { margin-top: 0; }
.refs p.ref-group strong { font-weight: 500; }

/* Abstract / exec summary emphasis */
article > p:first-of-type { font-size: 1.14em; }

/* End-of-paper attribution */
.paper-attribution {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-family: "Space Grotesk", Helvetica, Arial, sans-serif;
  font-size: 0.8rem;
  font-style: italic;
  color: var(--muted);
  line-height: 1.7;
}

/* Footer */
.paper-footer {
  border-top: 1px solid var(--line);
  padding: 2rem clamp(1.2rem, 5vw, 2rem) 3rem;
  max-width: 760px; margin: 0 auto;
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em;
  color: var(--faint); line-height: 1.8;
}
.paper-footer a { color: var(--accent); text-decoration: none; }

/* ---------- Print ---------- */
@media print {
  @page { size: Letter; margin: 20mm 17mm; }
  body { background: #ffffff; font-size: 10.5pt; }
  .paper-nav { display: none; }
  .audio-dock { display: none; }
  /* the printed paper cannot play anything, but it can still say where the
     video is, so the band collapses to one line and prints the URL */
  .video, .listen-card, .listen-nudge, .intro-band__h { display: none; }
  /* a video that does not exist yet has no URL to print, so the whole
     pending slot goes rather than leaving a stranded kicker */
  .intro-video--soon { display: none; }
  .paper-intro { background: none; border: 0; padding: 4mm 0 0; break-inside: avoid; }
  .paper-intro__inner { display: block; max-width: 100%; }
  .intro-band__kicker { color: var(--muted); margin-bottom: 0.2rem; }
  .intro-band__note { margin: 0; font-size: 9.5pt; }
  .video__url { display: block; margin: 0; font-family: var(--mono); font-size: 9pt; }
  .cover {
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
    min-height: 45vh;
  }
  article { max-width: 100%; padding: 8mm 0 0; }
  .toc {
    position: static; width: 100%; max-width: 100%; max-height: none;
    margin: 0; padding: 0; overflow: visible;
    break-before: page; break-after: page; break-inside: avoid;
  }
  .toc summary { list-style: none; font-size: 8.5pt; }
  .toc li { font-size: 10.5pt; margin-bottom: 0.62em; }
  .toc a { color: var(--ink); border-bottom: none; }
  article h2 { break-after: avoid; }
  figure.wp-fig { margin: 1.6em 0; max-width: 100%; break-inside: avoid; }
  figure.wp-fig figcaption::before, .md-img::after { display: none; }
  article table { break-inside: auto; font-size: 8pt; }
  article tr { break-inside: avoid; }
  article a { color: var(--ink); border-bottom: none; }
  .footnote a { color: var(--muted); word-break: break-all; }
  .refs a { color: var(--muted); word-break: break-all; }
  .refs { break-before: page; }
  .paper-attribution { break-inside: avoid; }
  .paper-footer { padding: 6mm 0 0; }
}
