/* =========================================================
   BRP case study — pilot direction
   "Bookpile × university-press catalog × independent web zine."
   Page-scoped. Does not touch styles.css or other pages.
   Intelligent, useful, slightly raw, quietly stylish.
   ========================================================= */

:root {
  color-scheme: light;

  --paper:       #f9f4ea;
  --paper-deep:  #efe9d9;
  --paper-card:  #fcf8ef;
  --ink:         #14130f;
  --ink-2:       #2a2620;
  --muted:       #5a5447;
  --muted-2:     #8a8170;
  --rule:        #1a1814;
  --rule-soft:   #d8d0bb;
  --rule-hair:   #e6dfca;
  --accent:      #0a4d3c;
  --accent-deep: #06382b;
  --focus:       #0a4d3c;

  --serif: "Newsreader", "Spectral", ui-serif, Georgia, "Hoefler Text", serif;
  --mono:  "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --t-tiny:   11px;
  --t-meta:   12.5px;
  --t-caption:13px;
  --t-body-sm:15px;
  --t-body:   17px;
  --t-lead:   19px;
  --t-deck:   clamp(19px, 1.8vw, 23px);
  --t-h3:     clamp(20px, 1.9vw, 24px);
  --t-h2:     clamp(28px, 3.2vw, 40px);
  --t-h1:     clamp(36px, 5vw, 62px);

  --measure:  640px;     /* prose column */
  --margin-w: 240px;     /* sidenote column */
  --margin-gap: 56px;
  --page-max: 1160px;
  --pad-x:    32px;

  --ease-settle: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-strong: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-xs: 180ms;
  --dur-sm: 320ms;
  --dur-md: 520ms;
  --dur-lg: 780ms;
}

/* ---------- reset-ish ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--t-body);
  line-height: 1.62;
  font-feature-settings: "liga", "kern";
  text-rendering: optimizeLegibility;
  counter-reset: fig chapter;
}

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

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

::selection { background: var(--accent); color: var(--paper); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 8px 14px;
  font-family: var(--mono);
  font-size: var(--t-meta);
  z-index: 100;
}
.skip-link:focus { left: 12px; top: 12px; }

.page {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 var(--pad-x);
}

/* ---------- masthead ---------- */
.masthead {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 50;
}
.masthead-inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 14px var(--pad-x);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px 24px;
  flex-wrap: wrap;
}
.masthead-name {
  text-decoration: none;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.018em;
  color: var(--ink);
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  white-space: nowrap;
}
.masthead-name .wordmark { display: inline-block; }
.masthead-name .role {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Helvetica Neue", Arial, sans-serif;
  font-size: 12px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  white-space: nowrap;
}
.masthead-name .role .sep {
  color: var(--rule-soft);
  margin-right: 6px;
  font-family: var(--serif);
  font-size: 16px;
}
.masthead-nav {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Helvetica Neue", Arial, sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.masthead-nav a {
  font-family: inherit;
  color: var(--ink);
  text-decoration: none;
  position: relative;
}
.masthead-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -3px;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-sm) var(--ease-settle);
}
.masthead-nav a:hover::after { transform: scaleX(1); }
@media (prefers-reduced-motion: reduce) {
  .masthead-nav a::after { transition: none; }
}

/* ---------- catalog header (cover) ---------- */
.catalog {
  padding: 64px 0 48px;
  border-bottom: 1px solid var(--rule);
}
.catalog-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 0;
  font-family: var(--mono);
  font-size: var(--t-meta);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin: 0 0 36px;
}
.catalog-meta .stamp {
  border: 1px solid var(--ink);
  padding: 4px 10px;
  margin-right: 16px;
  background: var(--paper-card);
}
.catalog-meta .dim { color: var(--muted); }
.catalog-meta .backlink {
  margin-left: auto;
  text-decoration: none;
  border-bottom: 1px solid var(--rule-soft);
}
.catalog-meta .backlink:hover { border-bottom-color: var(--ink); }

.catalog-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: 48px;
  align-items: start;
}

.catalog h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: var(--t-h1);
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0 0 24px;
  text-wrap: balance;
}
.catalog h1 em {
  font-style: italic;
  color: var(--accent);
}
.catalog .lede {
  font-size: var(--t-lead);
  line-height: 1.6;
  max-width: 58ch;
  margin: 0;
  color: var(--ink-2);
}

/* contents — TOC like a book's front matter */
.toc {
  border: 1px solid var(--rule);
  background: var(--paper-card);
  padding: 22px 24px 26px;
  box-shadow: 8px 8px 0 0 var(--paper-deep);
}
.toc-label {
  font-family: var(--mono);
  font-size: var(--t-tiny);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  display: block;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule-soft);
}
.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
}
.toc li + li { margin-top: 9px; }
.toc a {
  display: flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
  font-size: var(--t-body-sm);
  line-height: 1.4;
}
.toc a .n {
  font-family: var(--mono);
  font-size: var(--t-tiny);
  color: var(--accent);
  flex: none;
}
.toc a .dots {
  flex: 1;
  border-bottom: 1px dotted var(--rule-soft);
  transform: translateY(-4px);
  min-width: 16px;
}
.toc a .pg {
  font-family: var(--mono);
  font-size: var(--t-tiny);
  color: var(--muted);
  flex: none;
}
.toc a:hover .t { color: var(--accent); }

/* ---------- hero figure ---------- */
.cs-hero {
  margin: 56px auto 0;
  padding: 0;
}
.cs-hero .frame {
  border: 1px solid var(--ink);
  background: var(--paper-card);
  padding: 14px;
  box-shadow: 12px 12px 0 0 var(--paper-deep);
}
.cs-hero img { border: 1px solid var(--rule-hair); }

/* figure numbering — every figcaption gets "fig. NN" */
figure { margin: 0; }
figcaption {
  font-family: var(--mono);
  font-size: var(--t-caption);
  line-height: 1.55;
  color: var(--muted);
  margin-top: 12px;
}
figcaption::before {
  counter-increment: fig;
  content: "fig. " counter(fig, decimal-leading-zero) " \00B7  ";
  color: var(--accent);
  letter-spacing: 0.04em;
}

/* ---------- spec table (at a glance) ---------- */
.spec {
  border-bottom: 1px solid var(--rule);
  padding: 40px 0 44px;
}
.spec-label {
  font-family: var(--mono);
  font-size: var(--t-tiny);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin: 0 0 18px;
}
.spec dl {
  margin: 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  border-top: 1px solid var(--rule);
}
.spec dt, .spec dd {
  padding: 12px 0;
  border-bottom: 1px solid var(--rule-hair);
  margin: 0;
}
.spec dt {
  font-family: var(--mono);
  font-size: var(--t-meta);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  padding-right: 40px;
  white-space: nowrap;
}
.spec dd {
  font-size: var(--t-body-sm);
  line-height: 1.55;
  max-width: 70ch;
}

/* ---------- chapters ---------- */
.chapter {
  padding: 72px 0 56px;
  border-bottom: 1px solid var(--rule);
}
.chapter-head {
  display: flex;
  align-items: baseline;
  gap: 24px;
  margin-bottom: 12px;
}
.chapter-head .num {
  counter-increment: chapter;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(40px, 5vw, 64px);
  line-height: 1;
  color: var(--accent);
  flex: none;
}
.chapter-head .num::before { content: counter(chapter, decimal-leading-zero); }
.chapter-head h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: var(--t-h2);
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
}
.chapter-deck {
  font-style: italic;
  font-size: var(--t-deck);
  line-height: 1.45;
  color: var(--muted);
  margin: 0 0 40px;
  max-width: 52ch;
}

/* prose + marginalia (Tufte-style sidenotes) */
.chapter-body { position: relative; }
.chapter, .colophon { scroll-margin-top: 76px; }
.prose {
  max-width: var(--measure);
  display: flow-root; /* contain floated sidenotes so figures never collide */
}
.prose p { margin: 0 0 1.3em; }
.prose h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: var(--t-h3);
  line-height: 1.25;
  margin: 1.9em 0 0.7em;
}
.prose strong { font-weight: 600; }
.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

@media (min-width: 1100px) {
  .chapter-body { padding-right: calc(var(--margin-w) + var(--margin-gap)); }
  /* figures and filmstrips bleed back across the margin column */
  .chapter-body > .fig,
  .chapter-body > .fig-pair,
  .chapter-body > .filmstrip,
  .chapter-body > .filmstrip-hint {
    margin-right: calc(-1 * (var(--margin-w) + var(--margin-gap)));
  }
  .note {
    float: right;
    clear: right;
    width: var(--margin-w);
    margin-right: calc(-1 * (var(--margin-w) + var(--margin-gap)));
    margin-top: 4px;
    margin-bottom: 24px;
  }
}

/* margin note — the scholarly apparatus.
   Serif italic = commentary; mono stays for labels/captions/specs. */
.note {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  border-top: 1px solid var(--rule);
  padding-top: 10px;
}
.note .note-label { font-family: var(--mono); font-style: normal; }
.note .note-label {
  display: inline-block;
  font-size: var(--t-tiny);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink);
  margin-bottom: 6px;
}

/* iteration note — the "revised after feedback" stamp */
.note.iteration {
  border-top: 2px solid var(--accent);
  color: var(--ink-2);
}
.note.iteration .note-label {
  color: var(--accent);
}
.note.iteration .note-label::before {
  content: "↻\2002";
  letter-spacing: 0;
}

@media (max-width: 1099px) {
  .note {
    margin: 28px 0;
    max-width: var(--measure);
    background: var(--paper-card);
    border: 1px solid var(--rule-soft);
    border-top: 1px solid var(--rule);
    padding: 14px 16px;
  }
  .note.iteration { border-top: 2px solid var(--accent); }
}

/* pullquote */
.pullquote {
  margin: 44px 0;
  max-width: var(--measure);
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 28px;
}
.pullquote p {
  font-family: var(--serif);
  font-style: italic;
  font-size: var(--t-deck);
  line-height: 1.5;
  margin: 0 0 12px;
}
.pullquote cite {
  font-family: var(--mono);
  font-style: normal;
  font-size: var(--t-caption);
  color: var(--muted);
}

/* ---------- figures inside chapters ---------- */
.fig { margin: 44px 0; }
.fig .frame, .fig > img {
  border: 1px solid var(--ink);
  background: var(--paper-card);
}
.fig .frame { padding: 10px; box-shadow: 8px 8px 0 0 var(--paper-deep); }
.fig .frame img { border: 1px solid var(--rule-hair); }

.fig-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin: 44px 0;
}
.fig-pair .fig { margin: 0; }
@media (max-width: 800px) {
  .fig-pair { grid-template-columns: 1fr; }
}

/* filmstrip — contact-sheet scroll */
.filmstrip {
  margin: 44px 0 8px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(260px, 320px);
  gap: 20px;
  overflow-x: auto;
  padding-bottom: 18px;
  scroll-snap-type: x proximity;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding-top: 20px;
}
.filmstrip .fig {
  margin: 0;
  scroll-snap-align: start;
}
.filmstrip img {
  border: 1px solid var(--rule-soft);
  background: var(--paper-card);
  aspect-ratio: 2400 / 1710;   /* frame 6 is taller — normalize the contact sheet */
  object-fit: contain;          /* never crop a UI screenshot */
  object-position: top;
}
.filmstrip figcaption { margin-top: 8px; }
.filmstrip-hint {
  font-family: var(--mono);
  font-size: var(--t-tiny);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin: 10px 0 0;
}

/* ---------- colophon (sign-off) ---------- */
.colophon { padding: 72px 0 64px; }
.colophon .kicker {
  font-family: var(--mono);
  font-size: var(--t-tiny);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  display: block;
  margin-bottom: 18px;
}
.colophon h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: var(--t-h2);
  line-height: 1.15;
  margin: 0 0 22px;
  max-width: 26ch;
  text-wrap: balance;
}
.colophon h2 em { font-style: italic; color: var(--accent); }
.colophon .body p {
  max-width: var(--measure);
  margin: 0 0 1.3em;
}

.colophon .stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin: 40px 0;
}
.colophon .stat { padding: 22px 24px 24px 0; }
.colophon .stat + .stat { border-left: 1px solid var(--rule-hair); padding-left: 24px; }
.colophon .stat .v {
  font-family: var(--serif);
  font-size: clamp(30px, 3.4vw, 44px);
  line-height: 1;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.colophon .stat .l {
  font-family: var(--mono);
  font-size: var(--t-caption);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 0;
}
@media (max-width: 700px) {
  .colophon .stats { grid-template-columns: 1fr; }
  .colophon .stat + .stat { border-left: 0; border-top: 1px solid var(--rule-hair); padding-left: 0; }
}

.colophon .next {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}
.colophon .next .end {
  font-family: var(--mono);
  font-size: var(--t-tiny);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}
.colophon .next a {
  font-family: var(--serif);
  font-style: italic;
  font-size: var(--t-lead);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 2px;
}
.colophon .next a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- footer ---------- */
.footer {
  background: var(--ink);
  color: var(--paper);
}
.footer-inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 48px var(--pad-x) 40px;
}
.footer-row {
  display: flex;
  align-items: baseline;
  gap: 16px 48px;
  flex-wrap: wrap;
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(249, 244, 234, 0.25);
}
.footer-row .label {
  font-family: var(--mono);
  font-size: var(--t-tiny);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: rgba(249, 244, 234, 0.6);
}
.footer-row a {
  font-family: var(--serif);
  font-size: var(--t-lead);
  color: var(--paper);
  text-decoration: none;
  border-bottom: 1px solid rgba(249, 244, 234, 0.4);
}
.footer-row a:hover { border-bottom-color: var(--paper); }
.footer-foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 22px;
  font-family: var(--mono);
  font-size: var(--t-tiny);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(249, 244, 234, 0.55);
}
.footer-foot a { color: rgba(249, 244, 234, 0.8); text-decoration: none; border-bottom: 1px solid rgba(249,244,234,0.3); }

/* ---------- motion ----------
   Hidden state is gated on .js (set in <head>) so the page is
   fully visible with JavaScript disabled. */
.reveal { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    opacity: 0;
    transform: translateY(16px);
    transition:
      opacity var(--dur-lg) var(--ease-strong),
      transform var(--dur-lg) var(--ease-strong);
    will-change: opacity, transform;
  }
  .js .reveal.is-visible {
    opacity: 1;
    transform: none;
    will-change: auto;
  }
}

/* cross-document view transition — keep the homepage thumb → hero morph */
@view-transition { navigation: auto; }
@supports (view-transition-name: none) {
  .vt-brp { view-transition-name: cs-anchor-brp; }
  .vt-ml { view-transition-name: cs-anchor-ml; }
  .vt-amex { view-transition-name: cs-anchor-amex; }
}
::view-transition-group(*) {
  animation-duration: var(--dur-md);
  animation-timing-function: var(--ease-strong);
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*) { animation: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .catalog-grid { grid-template-columns: 1fr; gap: 36px; }
  .toc { box-shadow: 6px 6px 0 0 var(--paper-deep); }
}
@media (max-width: 700px) {
  :root { --pad-x: 20px; }
  .catalog { padding: 44px 0 36px; }
  .chapter { padding: 52px 0 40px; }
  .chapter-head { gap: 16px; }
  .spec dl { grid-template-columns: 1fr; }
  .spec dt { border-bottom: 0; padding-bottom: 2px; padding-top: 14px; }
  .spec dd { padding-top: 2px; }
  .catalog-meta .backlink { margin-left: 0; flex-basis: 100%; }
}

/* ---------- gap analysis table (catalog-native) ---------- */
.gap-analysis { margin: 40px 0 8px; }
.gap-scroll { overflow-x: auto; border-top: 1px solid var(--rule); }
.gap-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--t-body-sm);
  min-width: 720px;
}
.gap-tbl col.c-fn  { width: 27%; }
.gap-tbl col.c-pri { width: 11%; }
.gap-tbl col.c-an, .gap-tbl col.c-bi, .gap-tbl col.c-no { width: 20%; }
.gap-tbl th {
  font-family: var(--mono);
  font-size: var(--t-tiny);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-align: left;
  font-weight: 500;
  padding: 12px 16px 10px 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: bottom;
}
.gap-tbl td {
  padding: 12px 16px 12px 0;
  border-bottom: 1px solid var(--rule-hair);
  vertical-align: top;
  line-height: 1.5;
}
.gap-tbl .gap-grp td {
  font-family: var(--mono);
  font-size: var(--t-tiny);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 600;
  color: var(--ink);
  background: var(--paper-deep);
  padding: 8px 12px;
  border-bottom: 1px solid var(--rule);
}
.gap-fn { display: block; font-weight: 600; color: var(--ink); }
.gap-fn-desc {
  display: block;
  margin-top: 3px;
  font-size: var(--t-meta);
  line-height: 1.45;
  color: var(--muted);
}
.gap-pri {
  display: inline-block;
  font-family: var(--mono);
  font-size: var(--t-tiny);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 8px;
  white-space: nowrap;
}
.gap-pri.v1  { background: var(--ink); color: var(--paper); }
.gap-pri.fut { border: 1px solid var(--muted-2); color: var(--muted); }
.gap-pri.oos { border: 1px dashed var(--rule-soft); color: var(--muted-2); }
.gap-pri.none { color: var(--rule-soft); }
.gap-cell b { font-weight: 600; color: var(--ink); }
.gap-dim { color: var(--rule-soft); }
.gap-q {
  font-style: italic;
  color: var(--accent);
  font-size: var(--t-body-sm);
}
.gap-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
  margin-top: 16px;
  font-family: var(--mono);
  font-size: var(--t-tiny);
  color: var(--muted);
}
.gap-legend .item { display: inline-flex; align-items: center; gap: 8px; }
.gap-legend .ital {
  font-family: var(--serif);
  font-style: italic;
  font-size: var(--t-caption);
  color: var(--muted);
}
.gap-after {
  font-family: var(--mono);
  font-size: var(--t-caption);
  line-height: 1.55;
  color: var(--muted);
  margin-top: 14px;
  max-width: 70ch;
}

/* ---------- floating contents rail (appears after the cover scrolls away) ---------- */
.toc-rail {
  position: fixed;
  top: 50%;
  right: 20px;
  transform: translateY(-50%);
  z-index: 60;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.toc-rail.is-visible { opacity: 1; visibility: visible; pointer-events: auto; }
.toc-rail ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.toc-rail li { text-align: right; }
.toc-rail a {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  text-decoration: none;
}
.toc-rail .n {
  font-family: var(--mono);
  font-size: var(--t-tiny);
  color: var(--muted-2);
  border-right: 2px solid var(--rule-soft);
  padding-right: 9px;
  flex: none;
}
.toc-rail .t {
  font-family: var(--mono);
  font-size: var(--t-meta);
  letter-spacing: 0.01em;
  color: var(--ink);
  white-space: nowrap;
  background: var(--paper-card);
  border: 1px solid var(--rule);
  padding: 4px 10px;
  opacity: 0;
  transform: translateX(8px);
  pointer-events: none;
}
.toc-rail a:hover .t,
.toc-rail a:focus-visible .t,
.toc-rail a.active .t { opacity: 1; transform: translateX(0); }
.toc-rail a:hover .n,
.toc-rail a:focus-visible .n,
.toc-rail a.active .n { color: var(--accent); border-right-color: var(--accent); }
/* only show the rail when there is real margin beside the content column */
@media (max-width: 1259px) { .toc-rail { display: none; } }
