/* Report kit (Nov 28): every page reads like a Caeliai technical report.
   Taken from /research/is-rag-still-worth-it: a small report line, the title between two rules,
   a contents list, a # link on each section heading, and a citation at the end.
   Loaded last on every page. Pairs with /assets/js/report.js. */

:root { --report-rule: var(--ink, #1a1a1a); }

.markdown-reader { max-width: var(--col); margin-inline: auto; }
.markdown-reader header p { color: var(--muted); font-size: .9rem; }
.markdown-reader pre {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font: inherit;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* The report line above the title. Older pages call it the publication kicker. */
html body main .report-line,
.report-line,
.publication-kicker,
.study-hero__copy > .publication-kicker,
.hero__copy > .publication-kicker {
  margin: 0 0 .9rem !important;
  font-family: var(--serif, var(--serif-l)) !important;
  font-size: .75rem !important;
  font-weight: 400 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  color: var(--muted, var(--muted-l, #6b6b6b)) !important;
}

/* The title between two rules */
h1.ruled,
main h1.plain-hero-title {
  border-top: 2px solid var(--report-rule) !important;
  border-bottom: 1px solid var(--report-rule) !important;
  padding: 1rem 0 1.1rem !important;
  margin-top: 0 !important;
  max-width: var(--col, 34rem);
}
h1.ruled.mono-title { padding: .9rem 0 1rem !important; }

/* Byline and meta lines under the title */
.byline, .publication-meta, .paper-meta, .article-byline, .method-line {
  font-size: .8rem !important;
  color: var(--muted, var(--muted-l, #6b6b6b)) !important;
}

/* A # link on every section heading, shown on hover or focus */
h2 .anchor {
  margin-left: .4rem;
  font-size: .8em;
  font-weight: 400;
  color: var(--muted, #6b6b6b);
  text-decoration: none;
  opacity: 0;
  transition: opacity .2s;
}
h2:hover .anchor, h2 .anchor:focus { opacity: 1; }
@media (hover: none) { h2 .anchor { opacity: .45; } }
[id] { scroll-margin-top: 1.5rem; }

/* Contents */
.contents {
  max-width: var(--col, 34rem);
  margin: 2.5rem 0;
  padding: 1rem 0;
  border-top: 1px solid var(--rule, #e6e6e6);
  border-bottom: 1px solid var(--rule, #e6e6e6);
}
.contents .contents-h { font-size: .8rem; font-weight: 600; margin: 0 0 .5rem; font-family: inherit; }
.contents ol { margin: 0; padding-left: 1.2rem; columns: 2; column-gap: 2rem; font-size: .85rem; line-height: 1.7; }
.contents li { break-inside: avoid; }
.contents a { color: var(--ink-2, #333) !important; text-decoration: none !important; border: 0 !important; background: none !important; }
.contents a:hover { color: var(--ink, #1a1a1a); text-decoration: underline; }
@media (max-width: 640px) { .contents ol { columns: 1; } }

/* Cite this */
.cite-block { max-width: var(--col, 34rem); margin: 3.4rem 0 0; padding-top: 1rem; border-top: 1px solid var(--rule, #e6e6e6); }
.cite-block h2 { font-size: 1rem !important; margin: 0 0 .4rem !important; }
.cite { font-size: .85rem; color: var(--ink-2, #333); margin: 0; }

/* Figures: "Figure N." in the caption is set in the text weight, the rest muted */
figcaption, .figure-caption, .article-figure__caption { color: var(--muted, #6b6b6b); }
figcaption b, figcaption strong { color: var(--ink, #1a1a1a); font-weight: 600; }

/* ---------- Home: the front page of the report ---------- */
.home-hara > .report-line { margin-top: 4rem !important; }
.home-hara h1.mono-title.ruled { margin-top: 0; font-size: 2.2rem; }
.home-hara .section-h { margin: 4.5rem 0 0; font-size: 1.3rem; font-weight: 600; }
.home-hara .section-h + .projects-hara, .home-hara .section-h + .shelves { margin-top: 1.6rem !important; }

/* Projects are numbered figures */
.projects-hara { counter-reset: fig; }
.projects-hara > li { counter-increment: fig; }
.projects-hara > li > h2::before,
.projects-hara > li > h2.dot::before {
  content: "Figure " counter(fig) ".";
  display: block !important;
  width: auto; height: auto; background: none; border-radius: 0; margin-right: 0; vertical-align: baseline;
  margin-bottom: .15rem;
  font-family: var(--serif);
  font-size: .75rem;
  font-weight: 400;
  color: var(--muted, #6b6b6b);
}

/* Writing: topic, question, subject, rows (numbered I, II, III like the canon) */
.shelves { counter-reset: grp; }
.shelf-group { counter-increment: grp; margin-top: 3rem; }
.shelf-group:first-child { margin-top: 0; }
.shelves > .shelf-group > h2 {
  font-family: var(--display, 'Bodoni Moda', Didot, Georgia, serif) !important;
  font-weight: 500 !important;
  font-size: 1.5rem !important;
  line-height: 1.15;
  color: var(--ink, #1a1a1a) !important;
}
.shelves > .shelf-group > h2::before {
  content: counter(grp, upper-roman);
  display: block;
  margin-bottom: .25rem;
  font-family: var(--serif);
  font-size: .75rem;
  letter-spacing: .08em;
  color: var(--muted, #6b6b6b);
}
.shelves .q { font-size: .9rem !important; color: var(--muted, #6b6b6b) !important; margin-top: .2rem !important; }
.shelf { display: block !important; margin-top: 1.1rem !important; }
.shelf h3 {
  margin: 0 0 .3rem !important;
  padding-bottom: .4rem;
  border-bottom: 1px solid var(--rule, #e6e6e6);
  font-size: .85rem !important;
  font-weight: 600 !important;
  color: var(--ink, #1a1a1a) !important;
}
.shelf li { grid-template-columns: 6rem 4.2rem 1fr !important; padding: .4rem 0 !important; border-bottom: 1px solid color-mix(in srgb, var(--rule, #e6e6e6) 60%, transparent); }
@media (max-width: 720px) {
  .shelf li { grid-template-columns: 5.6rem 1fr !important; }
  .home-hara > .report-line { margin-top: 1.2rem !important; }
  .home-hara .section-h { margin-top: 3.2rem; }
}

/* ======================================================================
   Report layout v2 (Nov 28), after Chroma's technical reports and
   Thinking Machines' Connectionism posts:
   - a centered title block: mark, report line, heavy rule, title, thin rule, subtitle, byline
   - on wide screens three columns: contents rail left, text centered, notes right
   - figures in white panels with centered captions
   ====================================================================== */

/* Centered title block */
@media (min-width: 720px) {
  .report-line, .publication-kicker, html body main .report-line { text-align: center; max-width: none !important; margin-left: auto !important; margin-right: auto !important; }
  h1.ruled, main h1.plain-hero-title {
    text-align: center;
    max-width: 44rem !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 1.6rem 0 1.7rem !important;
    border-top-width: 3px !important;
  }
  h1.ruled.mono-title { justify-content: center; }
  main > .subtitle, main > .byline, .home-hara > .subtitle, .home-hara > .byline,
  .study-hero__copy > .publication-meta, .study-hero__copy > .method-line,
  .paper-hero__copy > .paper-meta, .study-hero__copy > .article-byline, .study-hero__copy > .inline-meta {
    text-align: center;
    margin-left: auto !important;
    margin-right: auto !important;
    max-width: 40rem !important;
    justify-content: center;
  }
  /* Older pages: the hero column holds the title block, so let it span and center */
  .study-hero__copy, .paper-hero__copy, .hero__copy { width: min(100%, 46rem) !important; max-width: 46rem !important; margin-left: auto !important; margin-right: auto !important; }
  .study-hero__copy > p, .paper-hero__copy > p, .hero__copy > p, .hero__copy .lede-block { margin-left: auto !important; margin-right: auto !important; }
}
.report-mark { display: block; width: 1.4rem; height: 1.4rem; margin: 0 auto .5rem; color: var(--ink, #1a1a1a); }
.report-mark path { fill: none; stroke: currentColor; stroke-width: 36; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 719px) { .report-mark { margin-left: 0; } }

/* Figures sit in white panels; the caption is centered under the drawing */
main figure, .rf, .article-figure {
  background: var(--card, #fff);
  border: 1px solid color-mix(in srgb, var(--rule, #e6e6e6) 80%, transparent);
  border-radius: 8px;
  padding: 1.3rem 1.5rem 1.1rem !important;
}
main figure figcaption, .rf figcaption, .article-figure figcaption { text-align: center; max-width: 38rem; margin-left: auto; margin-right: auto; }
main figure figure { background: none; border: 0; padding: 0 !important; }

/* Three columns on wide screens */
.toc-rail { display: none; }
@media (min-width: 1240px) {
  .page { max-width: calc(var(--col, 34rem) + 2 * var(--margin, 13rem) + 7rem); }
  .page > main:not(.home-hara),
  .page > .dispatch { max-width: var(--col, 34rem); margin-left: auto; margin-right: auto; }
  .page > main:not(.home-hara) > *:not(.with-note) { margin-left: auto; margin-right: auto; }
  html body.site-shell, html body.page-editorial { --page-max: var(--content-max); }
  html body .lab-chrome { max-width: calc(var(--col, 34rem) + 2 * var(--margin, 13rem) + 7rem + 3rem); }
  .has-rail .contents { display: none; }
  .toc-rail {
    display: block;
    position: fixed;
    left: max(1rem, calc(50% - var(--col, 34rem) / 2 - 2.8rem - 12rem));
    width: min(12rem, calc((100vw - var(--col, 34rem)) / 2 - 3rem));
    max-height: calc(100vh - 8rem);
    overflow: auto;
    font-size: .72rem;
    line-height: 1.35;
    z-index: 2;
  }
  .toc-rail > ol { list-style: none; margin: 0; padding: 0; }
  .toc-rail li { position: relative; margin: 0; }
  .toc-rail > ol > li { padding: .32rem 0 .32rem 1.1rem; }
  .toc-rail a { color: var(--muted, #6b6b6b) !important; text-decoration: none !important; border: 0 !important; background: none !important; transition: color .2s; }
  .toc-rail a:hover, .toc-rail a.in { color: var(--ink, #1a1a1a) !important; }
  .toc-rail a.on { color: var(--ink, #1a1a1a) !important; font-weight: 600; }
  .toc-rail .tw { position: absolute; left: 0; top: .28rem; width: 1rem; padding: 0; border: 0; background: none; font: inherit; font-size: .9rem; line-height: 1.2; color: var(--muted, #6b6b6b); cursor: pointer; transition: transform .2s, color .2s; }
  .toc-rail .tw:hover { color: var(--ink, #1a1a1a); }
  .toc-rail li.open > .tw { transform: rotate(90deg); }
  .toc-rail li > ol { list-style: none; margin: 0; padding: 0 0 0 .8rem; border-left: 1px solid var(--rule, #e6e6e6); display: none; }
  .toc-rail li.open > ol { display: block; margin-top: .35rem; }
  .toc-rail li > ol > li { padding: .22rem 0; }
}

/* ---------- Home, v2 ---------- */
.home-hara .abstract { max-width: 38rem; margin: 2.2rem auto 0; font-size: 1rem; line-height: 1.6; color: var(--ink-2, #333); }
@media (min-width: 720px) {
  .home-hara .abstract { text-align: left; }
  .home-hara { max-width: 52rem; margin: 0 auto; }
  .home-hara .section-h { text-align: left; }
}
.projects-hara { max-width: none !important; gap: 1.4rem !important; }
.projects-hara > li {
  background: var(--card, #fff);
  border: 1px solid color-mix(in srgb, var(--rule, #e6e6e6) 80%, transparent);
  border-radius: 8px;
  padding: 1.3rem 1.4rem 1.2rem;
}
@media (hover: hover) { .projects-hara > li:hover { transform: none; border-color: var(--rule-strong, #cfcfcf); } }
.home-hara .shelves { max-width: 52rem; }

/* Phones: a smaller title block */
@media (max-width: 719px) {
  h1.ruled, main h1.plain-hero-title { font-size: 2rem !important; line-height: 1.12 !important; padding: 1rem 0 1.1rem !important; }
  main > .subtitle { font-size: 1.1rem !important; line-height: 1.35; }
  .report-mark { margin-bottom: .3rem; }
  main figure, .rf, .article-figure { padding: 1rem 1rem .9rem !important; }
}

/* Data drawings (data-art.js): the opening figure of a study, and the small looping mark on home */
figure.data-art { max-width: 44rem !important; margin: 2.4rem auto 2.6rem !important; }
.data-art-canvas { display: block; width: 100%; }
figure.data-art figcaption { margin-top: 1rem; }
.data-art-mark { margin: 0 0 .9rem; min-height: 40px; }
.data-art-section { padding-top: 0 !important; }

/* Data drawings v2 (Rust/WebAssembly renderer): labels sit over the canvas in HTML */
.art-stage { position: relative; width: 100%; overflow: hidden; }
.art-stage canvas { display: block; }
.art-labels { position: absolute; inset: 0; pointer-events: none; }
.art-label { position: absolute; font-size: 12px; line-height: 1.3; color: var(--muted, #6b6b6b); white-space: nowrap; }
.art-label b { display: block; font-weight: 600; color: var(--ink, #1a1a1a); }
.art-label span { font-variant-numeric: tabular-nums; }
.art-label--src { text-align: left; }
.art-label--gate { transform: translateX(-50%); text-align: center; }
.art-label--gate { color: var(--ink, #1a1a1a); font-weight: 600; }
.art-stage--small { height: 64px; }
@media (max-width: 560px) { .art-label { font-size: 10.5px; white-space: normal; } }

/* Titles: the rules span the title column, whatever the title's length */
@media (min-width: 720px) { h1.ruled, main h1.plain-hero-title { width: 100%; } }

/* Research index (Nov 28): each paper is a white panel with its small data drawing */
.ref-list { display: grid !important; gap: 1rem; }
.ref-row, .page-editorial .ref-row, .page-editorial .ref-row--featured {
  display: grid !important;
  grid-template-columns: 2.4rem minmax(0, 1fr) !important;
  gap: .3rem 1rem !important;
  margin: 0 !important;
  padding: 1.2rem 1.4rem 1.1rem !important;
  background: var(--card, #fff) !important;
  border: 1px solid color-mix(in srgb, var(--rule, #e6e6e6) 80%, transparent) !important;
  border-radius: 8px;
}
.ref-row:hover, .ref-row:focus-within { background: #fff !important; border-color: #cfcfca !important; }
.ref-row__index { grid-row: 1 / span 2; padding-top: .15rem; }
.ref-row__body h3, .page-editorial .ref-row__body h3, .page-editorial .ref-row--featured .ref-row__body h3 {
  font-family: 'Bodoni Moda', Didot, Georgia, serif !important;
  font-weight: 500 !important;
  font-size: 1.3rem !important;
  line-height: 1.2 !important;
  margin: .35rem 0 .45rem !important;
  max-width: none !important;
}
.ref-row__body p { font-size: .88rem !important; line-height: 1.55 !important; color: var(--ink-2, #333) !important; max-width: 40rem !important; }
.ref-row__links { grid-column: 2; font-size: .85rem; }
.ref-row .data-art-mark { margin: 0 0 .7rem; }
.ref-group-label { margin-top: 2.4rem !important; }
@media (max-width: 640px) { .ref-row, .page-editorial .ref-row { grid-template-columns: 1fr !important; } .ref-row__index { grid-row: auto; } .ref-row__links { grid-column: 1; } }

/* Writing, flat (Nov 28): topic, then date and title. No kinds, no question lines. */
.shelves-flat .shelf-group > h2::before { content: none !important; }
.shelves-flat ul { list-style: none; margin: .7rem 0 0; padding: 0; }
.shelves-flat li { display: grid; grid-template-columns: 5.5rem 1fr; gap: .8rem; padding: .4rem 0; font-size: .92rem; line-height: 1.45; border-bottom: 1px solid color-mix(in srgb, var(--rule, #e6e6e6) 60%, transparent); }
.shelves-flat time { color: var(--muted, #6b6b6b); font-size: .8rem; padding-top: .12rem; font-variant-numeric: tabular-nums; }
.shelves-flat a { color: var(--ink, #1a1a1a); text-decoration: underline; text-decoration-color: #cfcfcf; text-underline-offset: .15em; }
.shelves-flat a:hover { text-decoration-color: var(--ink, #1a1a1a); }

/* Home, v3 (Nov 28): name, one line, two clickable projects */
.home-id { margin: 4.5rem 0 0; }
.home-id h1 { display: flex; align-items: center; gap: .6rem; margin: 0; font-size: 2.4rem !important; text-align: left; border: 0 !important; padding: 0 !important; }
.home-mark { width: 2.1rem; height: 2.1rem; flex: none; fill: none; stroke: currentColor; stroke-width: 34; stroke-linecap: round; stroke-linejoin: round; }
.home-id .who { margin: .5rem 0 0; font-size: 1rem; color: var(--muted, #6b6b6b); }
.proj-cards { list-style: none; margin: 1.6rem 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.proj-cards > li { margin: 0; }
.proj-cards a { display: flex; flex-direction: column; gap: .35rem; height: 100%; box-sizing: border-box; padding: 1.2rem 1.3rem 1.1rem; background: var(--card, #fff); border: 1px solid color-mix(in srgb, var(--rule, #e6e6e6) 80%, transparent); border-radius: 8px; color: var(--ink, #1a1a1a); text-decoration: none !important; transition: border-color .2s, transform .2s; }
.proj-cards a:hover { border-color: var(--ink, #1a1a1a); transform: translateY(-2px); }
.proj-cards .data-art-mark { display: block; margin: 0 0 .6rem; }
.proj-name { font-family: var(--display, serif); font-size: 1.35rem; line-height: 1.2; }
.proj-what { font-size: .92rem; line-height: 1.45; color: var(--ink-2, #333); }
.proj-go { margin-top: auto; padding-top: .5rem; font-size: .8rem; color: var(--muted, #6b6b6b); }
.proj-cards a:hover .proj-go { color: var(--ink, #1a1a1a); }
@media (max-width: 640px) { .proj-cards { grid-template-columns: 1fr; } .home-id { margin-top: 2rem; } }

/* About, short (Nov 28) */
h1.about-h { margin-top: 4.5rem; border: 0 !important; padding: 0 !important; text-align: left !important; }
.about-short { margin-top: 1.6rem !important; }
.about-short p { margin: 0 0 .9rem; }
.about-links { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; margin-top: 1.4rem !important; font-size: .9rem; }
.shelves-flat .shelf-group > h2 { font-size: 1.35rem !important; margin: 0 !important; }
.shelves-flat .shelf-group { margin-top: 2.2rem; }
.shelves-flat .shelf-group:first-child { margin-top: 0; }
.proj-img { display: block; width: 100%; height: auto; aspect-ratio: 720 / 504; object-fit: cover; border-radius: 4px; margin: 0 0 .7rem; }
.proj-num { font-size: .8rem; line-height: 1.45; color: var(--muted, #6b6b6b); }
.proj-num b { color: var(--ink, #1a1a1a); font-weight: 600; }
.shelves-flat .q { margin: .15rem 0 0 !important; font-size: .9rem !important; color: var(--muted, #6b6b6b) !important; }
.proj-img { aspect-ratio: 16 / 8; object-position: center 8%; }
.proj-cards .sa .data-art-mark { aspect-ratio: 16 / 8; display: flex !important; align-items: center; justify-content: center; background: #fafaf8; border-radius: 4px; margin-bottom: .7rem; overflow: hidden; padding: 1.4rem 1.6rem; box-sizing: border-box; }

/* ArchiveAgent lineage (Nov 28) */
.lineage { list-style: none; margin: 1.2rem 0 0; padding: 0; max-width: var(--col, 34rem); border-left: 1px solid var(--rule, #e6e6e6); }
.lineage li { position: relative; display: grid; grid-template-columns: 5.5rem 1fr; gap: .8rem; padding: 0 0 1.1rem 1.1rem; font-size: .92rem; line-height: 1.45; }
.lineage li::before { content: ""; position: absolute; left: -.3rem; top: .4rem; width: .55rem; height: .55rem; border-radius: 50%; background: #c4c4c4; }
.lineage li.now::before { background: var(--good, #5fb883); }
.lineage time { color: var(--muted, #6b6b6b); font-size: .8rem; padding-top: .1rem; }
.lineage a { font-weight: 600; }
.lineage span { display: block; color: var(--ink-2, #333); }
@media (max-width: 640px) { .lineage li { grid-template-columns: 1fr; gap: .1rem; } }

/* ArchiveAgent card: the Runway Test as the picture; bars grow in order (motion.js) */
.aa-frame { display: flex; align-items: center; aspect-ratio: 16 / 8; box-sizing: border-box; padding: .6rem 1.1rem; overflow: hidden; margin: 0 0 .7rem; background: #fafaf8; border-radius: 4px; }
.aa-bars { width: 100%; font-size: .68rem !important; }
.aa-bars li { grid-template-columns: 6.6rem 1fr 2.6rem !important; padding: 0 !important; line-height: 1.3; }
.aa-bars i { height: .42rem !important; }
.aa-bars li.lo i { background: var(--bad, #ff3e3e) !important; }
.motion .aa-bars i { transition-duration: 1.3s !important; transition-delay: calc(.2s + var(--j, 0) * .14s) !important; }

/* ---------- Paper title block v3 (Nov 28), after Thinking Machines' Connectionism posts:
   title, author, date, the opening animation, then the paper. No report line, no mark,
   no heavy rules, no back links. ---------- */
.report-line, .report-mark, .back-link, .study-hero .publication-kicker,
.study-hero .button-row .button--ghost[href="/"] { display: none !important; }
main h1, main h1.ruled { border: 0 !important; padding: 0 !important; }
main:not(.home-hara) > h1 { margin-top: 4.5rem !important; text-align: center; }
@media (max-width: 560px) {
  main[data-kind="paper"] > h1 { font-size: clamp(1.75rem, 8.5vw, 2.5rem); }
}
main:not(.home-hara) > .subtitle { text-align: center; font-family: inherit !important; font-size: 1.02rem !important; line-height: 1.5; color: var(--ink-2, #333); max-width: 34rem; margin: .9rem auto 0 !important; }
main:not(.home-hara) > .byline { text-align: center; margin: 1.1rem auto 0 !important; font-size: .92rem; color: var(--ink, #1a1a1a); }
main .dateline { text-align: center; margin: .25rem auto 0 !important; font-size: .86rem; color: var(--muted, #6b6b6b); }
html body main h1.plain-hero-title, html body main h1.ruled { border-top: 0 !important; border-bottom: 0 !important; padding: 0 !important; }
.study-hero .method-line { font-size: .86rem !important; color: var(--muted, #6b6b6b) !important; }
.study-hero .publication-meta { font-size: .92rem !important; }

/* Contents rail on the left; notes that add to the paper always sit in the right margin */

/* Plain paper body for rewritten notes (Nov 28) */
.paper-plain { max-width: var(--col, 34rem); margin: 0 auto; }
.paper-plain section { margin-top: 2.6rem; }
.paper-plain blockquote { margin: 1rem 0 1.2rem; padding-left: 1rem; border-left: 2px solid var(--rule, #e6e6e6); color: var(--ink-2, #333); }
.paper-plain .fstack { display: flex; gap: 2px; height: .7rem; }
.paper-plain .fstack i { display: block; height: 100%; background: #e3e3e3; }
.paper-plain .fkey { display: flex; flex-wrap: wrap; gap: .3rem 1rem; align-items: center; margin: .7rem 0 0; font-size: .8rem; color: var(--ink-2, #333); }
.paper-plain .fkey .k { display: inline-block; width: .6rem; height: .6rem; border-radius: 2px; background: #e3e3e3; margin-right: -.6rem; }
.paper-plain .fkey .k.good { background: var(--good, #5fb883); }
.paper-plain .fkey .k.bad { background: var(--bad, #ff3e3e); }
.paper-plain .sources { font-size: .85rem; color: var(--muted, #6b6b6b); }
.plates-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .45rem;
}
.plates.c4 .plates-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.plates.c1 .plates-row { grid-template-columns: 1fr; }
.plates img {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: contain;
  background: var(--paper, #f7f7f3);
}
.plates.c1 img { aspect-ratio: auto; max-height: 22rem; }
.paper-plain figure table.data { margin: 0; }
.paper-plain figure table.data td:first-child { white-space: normal; }
@media (max-width: 560px) {
  .plates.c4 .plates-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .paper-plain figure table.data { font-size: .8rem; }
  .paper-plain figure table.data :is(th, td) { padding-inline-end: .45rem; }
}

/* Judge fixes (Nov 28) */
/* Green marks results only, never links: underline links in grey, ink on hover */
.publication-contents a { background: none !important; text-decoration: underline !important; text-decoration-color: #c4c4c4 !important; text-underline-offset: .15em; }
.ref-row__body h3 a:hover, .bench-app .query-title:hover, .bench-app .explain-answer { text-decoration-color: var(--ink, #1a1a1a) !important; text-decoration-thickness: 1px !important; }
/* One heading face: section heads in the display serif everywhere */
main h2, .home-hara .section-h, .ex-about h2 { font-family: var(--display, serif) !important; font-weight: 500 !important; letter-spacing: 0; }
main section h2 { font-size: 1.45rem; }
.home-hara .section-h { font-size: 1.6rem !important; }
/* Small chart text stays readable on phones */
@media (max-width: 640px) { .aa-bars { font-size: .78rem !important; } .aa-bars li { grid-template-columns: 6.4rem 1fr 2.8rem !important; } .aa-frame { aspect-ratio: auto; } }

/* Opening animation (paper-rules.md): frameless, centered under the date */
main figure.opening { background: none !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; margin: 2.4rem auto 1.4rem !important; max-width: var(--col, 34rem); text-align: center; }
figure.opening .opening-plot { position: relative; }
.opening-plot img { display: block; width: 100%; height: auto; }
.opening-layer { position: absolute; inset: 0; opacity: 0; transition: opacity .35s ease; }
.opening[data-stage="retrieved"] .opening-retrieved,
.opening[data-stage="kept"] .opening-kept { opacity: 1; }
figure.opening .opening-step { margin: 0 0 .6rem !important; font-size: .8rem; color: var(--muted, #6b6b6b); min-height: 1.2em; text-align: center; max-width: none; }
figure.opening figcaption { margin-top: .8rem; font-size: .8rem; color: var(--muted, #6b6b6b); }
@media (prefers-reduced-motion: reduce) { .opening-layer { transition: none; } }

/* Key findings: one numbered list, worded the same way on every paper */
ol.findings { max-width: var(--col, 34rem); margin: .4rem 0 0; padding-left: 1.4rem; counter-reset: finding; }
ol.findings li {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 12.5rem;
  gap: 1.2rem;
  align-items: center;
  padding: .55rem 0 .7rem .2rem;
  margin: 0;
  line-height: 1.5;
  border-bottom: 1px solid color-mix(in srgb, var(--rule, #e6e6e6) 70%, transparent);
  counter-increment: finding;
}
ol.findings li::before {
  content: counter(finding) "." / "";
  position: absolute;
  inset: .68rem auto auto -1.15rem;
  color: var(--muted, #6b6b6b);
  font-size: .85rem;
  font-variant-numeric: tabular-nums;
}

/* Key findings with a small chart each (paper-rules.md): text left, chart right */
.kf-chart { display: flex; flex-direction: column; gap: .18rem; font-size: .68rem; color: var(--ink-2, #333); }
.kf-row { display: grid; grid-template-columns: 4.6rem 1fr 2.9rem; gap: .4rem; align-items: center; }
.kf-l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted, #6b6b6b); }
.kf-t { display: block; height: .42rem; }
.kf-t i { display: block; height: 100%; background: #e3e3e3; border-radius: 0 2px 2px 0; transform-origin: left; }
.kf-row.hl .kf-t i { background: var(--good, #5fb883); }
.kf-row.lo .kf-t i { background: var(--bad, #ff3e3e); }
.kf-chart--signed .kf-t { position: relative; }
.kf-chart--signed .kf-t::after {
  content: "";
  position: absolute;
  top: -.12rem;
  bottom: -.12rem;
  left: 50%;
  border-left: 1px solid var(--rule, #e6e6e6);
}
.kf-chart--signed .kf-t i { position: absolute; left: 50%; }
.kf-chart--signed .lo .kf-t i { left: auto; right: 50%; border-radius: 2px 0 0 2px; transform-origin: right; }
.kf-row.hl .kf-l, .kf-row.hl .kf-v { color: var(--ink, #1a1a1a); font-weight: 600; }
.kf-v { text-align: right; font-variant-numeric: tabular-nums; }
.kf-u { margin-top: .1rem; color: var(--muted, #6b6b6b); font-size: .64rem; }
.motion ol.findings .kf-t i { transform: scaleX(0); transition: transform 1s cubic-bezier(.2,.7,.2,1) calc(.1s + var(--j, 0) * .08s); }
.motion ol.findings.grown .kf-t i { transform: none; }
@media (max-width: 640px) { ol.findings li { grid-template-columns: 1fr; gap: .5rem; } }
.toc-rail { visibility: hidden; opacity: 0; pointer-events: none; transition: opacity .35s ease; }
.toc-rail.show { visibility: visible; opacity: 1; pointer-events: auto; }

/* Neutral chart colours. The lighter grey keeps secondary groups distinct. */
:root { --neutral: #737373; --neutral-light: #b8b8b8; }
.bars li:not(.hl):not(.lo) .f,
.fbars li:not(.hl):not(.lo) i,
.kf-row:not(.hl):not(.lo) .kf-t i,
.fstack i:not(.good):not(.bad),
.paper-plain .fstack i:not(.good):not(.bad),
.df-seg,
.lf-dot:not(.good):not(.bad),
.lineage li:not(.now)::before { background: var(--neutral) !important; }
.funnel span[style*="#c4c4c4"] { background: var(--neutral) !important; }
.funnel span[style*="#e3e3e3"] { background: var(--neutral-light) !important; }
.key i[style*="#c4c4c4"] { background: var(--neutral) !important; }
.key i[style*="#e3e3e3"] { background: var(--neutral-light) !important; }
.ex-kind:not(.s0)::before { background: var(--neutral) !important; }

/* RAG opener: a star chart. Faint stars are documents, 20 light up, 5 join into a green constellation. */
figure.opening[data-scene="sky"] .opening-plot { padding: 10px; border: 1px solid var(--rule, rgba(26,26,26,.18)); background: #f3f2ec; border-radius: 2px; }
figure.opening[data-scene="sky"] .opening-plot::before { content: ''; position: absolute; inset: 4px; border: 1px solid rgba(26, 26, 26, .08); pointer-events: none; }
.opening-sky { display: block; width: 100%; height: auto; }
.opening-sky .sky-grid path { fill: none; stroke: rgba(26, 26, 26, .055); stroke-width: 1; }
.opening-sky .sky-field circle { fill: #8f8c82; }
.opening-sky .sky-field .s1 { opacity: .28; }
.opening-sky .sky-field .s2 { opacity: .45; }
.opening-sky .sky-field .s3 { opacity: .55; }
.opening-sky .sky-found circle { fill: #b9b6ac; transform-box: fill-box; transform-origin: center; transform: scale(.35); transition: fill .6s ease, transform .6s cubic-bezier(.3, 1.3, .5, 1); transition-delay: calc(var(--n) * 50ms); }
.opening-sky .sky-links line { stroke: #5fb883; stroke-width: 1.3; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; opacity: .85; transition: stroke-dashoffset .8s ease; transition-delay: calc(.4s + var(--k) * 160ms); }
.opening-sky .sky-halo circle { fill: none; stroke: #5fb883; stroke-width: 1; opacity: 0; transform-box: fill-box; transform-origin: center; transform: scale(.4); transition: opacity .7s ease, transform .9s cubic-bezier(.2, .8, .2, 1); transition-delay: calc(var(--k) * 90ms); }
.opening:is([data-stage="retrieved"], [data-stage="kept"]) .sky-found circle { fill: #2a2a2a; transform: scale(1); }
.opening[data-stage="kept"] .sky-found circle:not(.kept) { fill: #f3f2ec; stroke: #5d5b55; stroke-width: 1.2; transform: scale(.85); transition-delay: 0s; }
.opening[data-stage="kept"] .sky-found circle.kept { fill: #4fae76; transform: scale(1.25); transition-delay: calc(var(--n) * 20ms); }
.opening[data-stage="kept"] .sky-halo circle { opacity: .35; transform: scale(1); }
.opening[data-stage="kept"] .sky-links line { stroke-dashoffset: 0; }
@media (prefers-reduced-motion: reduce) { .opening-sky * { transition: none !important; } }

/* Field Study 01 opener: a three-strand necklace, one bead per brand mention; green beads linked to the brand's own store. */
.opening-necklace { display: block; width: 100%; height: auto; overflow: visible; }
.opening-necklace .nk-thread { fill: none; stroke: #b8b2a2; stroke-width: 1; opacity: .7; }
.opening-necklace .nk-clasp { fill: none; stroke: #a39d8c; stroke-width: 2; stroke-linecap: round; }
.opening-necklace .nk-pearl { fill: url(#nk-pearl); stroke: rgba(80, 74, 60, .18); stroke-width: .6; }
.opening-necklace .nk-jade { fill: url(#nk-jade); stroke: rgba(30, 90, 55, .25); stroke-width: .6; opacity: 0; transition: opacity .6s ease; transition-delay: calc(var(--t) * .9s); }
.opening-necklace .nk-beads > g { transform-box: fill-box; transform-origin: center; transition: opacity .4s ease, transform .5s cubic-bezier(.3, 1.4, .5, 1); transition-delay: calc(var(--t) * 1.2s); }
.opening[data-scene="necklace"][data-stage="documents"] .nk-beads > g { opacity: 0; transform: translateY(-14px) scale(.6); }
.opening[data-scene="necklace"][data-stage="kept"] .nk-jade { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .opening-necklace * { transition: none !important; } }

/* Openers drawn per paper (docs/openers). Each sits frameless under the date and plays once. */
:is(.opening-tags, .opening-lights, .opening-metro) { display: block; width: 100%; height: auto; overflow: visible; }
.opening-lights { overflow: hidden; }

/* Shopify note: price tags, green mark for the brand's own store, red and turned for another seller */
.opening-tags .tg-rail { stroke: #a39d8c; stroke-width: 2; stroke-linecap: round; }
.opening-tags .tg-hook { fill: none; stroke: #a39d8c; stroke-width: 1.6; stroke-linecap: round; }
.opening-tags .tg-string { stroke: #b8b2a2; stroke-width: .8; }
.opening-tags .tg-body { fill: #fdfcf8; stroke: #c9c4b6; stroke-width: 1; }
.opening-tags .tg-hole { fill: #f3f2ec; stroke: #c9c4b6; stroke-width: .8; }
.opening-tags .tg-line { fill: #dedad0; }
.opening-tags .tg-mark { fill: #dedad0; transition: fill .5s ease; transition-delay: calc(var(--n) * 25ms); }
.opening-tags .tg-swing { transform-box: view-box; transform-origin: 0 0; transform: rotate(var(--r)); transition: transform 1.2s cubic-bezier(.3, 1.6, .4, 1); transition-delay: calc(var(--n) * 25ms); }
.opening-tags .tg { transition: opacity .5s ease, transform .6s cubic-bezier(.3, 1.3, .5, 1); transition-delay: calc(var(--n) * 22ms); }
.opening[data-scene="tags"][data-stage="documents"] .tg { opacity: 0; transform: translateY(-18px); }
.opening[data-scene="tags"]:not([data-stage="kept"]) .tg-swing { transform: rotate(0deg); }
.opening[data-scene="tags"][data-stage="kept"] .tg-mark { fill: #5fb883; }
.opening[data-scene="tags"][data-stage="kept"] .bad .tg-mark { fill: #ff3e3e; }
.opening[data-scene="tags"][data-stage="kept"] .bad .tg-body { fill: #f6f4ee; }

/* Surfaces note: two lighthouses sweep in; products in a beam light green */
.opening-lights .lh-field rect { fill: #d6d3ca; transition: fill .6s ease; transition-delay: calc(.2s + var(--k) * 12ms); }
.opening[data-scene="lights"][data-stage="kept"] .lh-field rect.on { fill: #5fb883; }
.opening-lights .lh-beam { transition: transform 1.6s cubic-bezier(.4, 0, .2, 1), opacity .8s ease; }
.opening[data-scene="lights"][data-stage="documents"] .lh-beam { opacity: 0; transform: rotate(var(--from)); }
.opening-lights .lh-shore { fill: none; stroke: #c9c4b6; stroke-width: 1.2; }
.opening-lights .lh-tower path, .opening-lights .lh-tower rect { fill: #fdfcf8; stroke: #8f8a7c; stroke-width: 1.3; stroke-linejoin: round; }
.opening-lights .lh-tower line { stroke: #c9c4b6; stroke-width: 1.2; }
.opening-lights .lh-lamp { fill: #5fb883; }

/* Genesis 03: metro map, line widths to scale */
.opening-metro .mt-grid line { stroke: rgba(26, 26, 26, .04); }
.opening-metro .mt-line { fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; transition: stroke-dashoffset 1.3s cubic-bezier(.5, 0, .2, 1); transition-delay: calc(var(--k) * 180ms); }
.opening-metro .mt-own { stroke: #5fb883; }
.opening-metro .mt-other { stroke: #2a2a2c; }
.opening-metro .mt-none { stroke: #cfccc3; }
.opening-metro .mt-hub { fill: #fdfcf8; stroke: #1a1a1a; stroke-width: 2.4; }
.opening-metro .mt-stop { fill: #fdfcf8; stroke-width: 2; transition: opacity .4s ease; transition-delay: calc(1s + var(--k) * 180ms); }
.opening-metro .mt-s-own { stroke: #3f9e66; } .opening-metro .mt-s-other { stroke: #2a2a2c; } .opening-metro .mt-s-none { stroke: #b5b2a8; }
.opening-metro .mt-end { transition: opacity .4s ease; transition-delay: calc(1.2s + var(--k) * 180ms); }
.opening-metro .mt-e-own { fill: #fdfcf8; stroke: #3f9e66; stroke-width: 3; }
.opening-metro .mt-e-other { fill: #fdfcf8; stroke: #2a2a2c; stroke-width: 3; }
.opening-metro .mt-dead { stroke: #8f8c82; stroke-width: 4; stroke-linecap: round; }
.opening[data-scene="metro"][data-stage="documents"] .mt-line { stroke-dashoffset: 1; }
.opening[data-scene="metro"]:not([data-stage="kept"]) :is(.mt-stop, .mt-end) { opacity: 0; }

@media (prefers-reduced-motion: reduce) { :is(.opening-tags, .opening-lights, .opening-metro) * { transition: none !important; } }
