/* ===================================================================
   FONT FACES
   =================================================================== */

@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/plus-jakarta-sans-latin-700.woff2') format('woff2');
}

@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/geist-mono-latin-400-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/geist-mono-latin-600-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/geist-latin-400-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/geist-latin-500-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/geist-latin-600-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/geist-latin-700-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'ABC Diatype';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/abc-diatype/ABCDiatype-Regular-Trial.otf') format('opentype');
}

@font-face {
  font-family: 'ABC Diatype';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/abc-diatype/ABCDiatype-Medium-Trial.otf') format('opentype');
}

@font-face {
  font-family: 'ABC Diatype';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/abc-diatype/ABCDiatype-Bold-Trial.otf') format('opentype');
}

/* ===================================================================
   DESIGN TOKENS
   =================================================================== */

:root {
  /* Font stacks */
  --font-sans: 'Geist', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-mono-letter-spacing: 0.06em;

  /* Layout: page */
  --page-inset: clamp(28px, 6vw, 100px);
  --measure: min(62ch, 720px);
  --content-frame-max-width: calc(var(--measure) + (var(--page-inset) * 2));
  --article-frame-max-width: 1464px;

  /* Long-form blog layout (TOC rail + article column) */
  --blog-article-max-width: 750px;
  --blog-toc-width: 250px;
  --blog-column-gap: 32px;
  --blog-frame-max-width: calc(var(--blog-article-max-width) + ((var(--blog-toc-width) + var(--blog-column-gap)) * 2));
  --blog-article-padding-x: 8px;
  --blog-paper-max-width: 100%;

  /* Paper header */
  --blog-paper-wrap-padding: clamp(2rem, 5vw, 3rem) clamp(1rem, 4vw, 1.5rem) clamp(1.5rem, 4vw, 2.5rem);
  --blog-paper-header-margin-bottom: 1.5rem;
  --blog-paper-header-padding-bottom: 1.5rem;
  --blog-paper-title-font-size: 2.25rem;
  --blog-paper-title-font-size-600: 1.85rem;
  --blog-paper-title-font-size-480: 1.6rem;
  --blog-paper-title-font-weight: 700;
  --blog-paper-title-line-height: 1.2;
  --blog-paper-title-letter-spacing: -0.02em;
  --blog-paper-title-margin-bottom: 2rem;
  --blog-paper-authors-font-size: 14px;
  --blog-paper-authors-line-height: 2;
  --blog-paper-authors-margin-bottom: 0.5rem;
  --blog-paper-authors-sym-font-size: 10px;
  --blog-paper-meta-font-size: 11px;
  --blog-paper-meta-margin: 0.75rem 0 1.5rem;
}

/* --- Rust (default) — electric blue-teal palette --- */
:root[data-theme="rust"],
:root:not([data-theme]) {
  --bg: #FFFFFF;
  --surface-subtle: #FCFCFC;
  --bg-surface: #F5F5F6;
  --surface: #F5F5F6;
  --surface-alt: #EAEAEC;
  --border: #E2E2E5;
  --border-strong: #CFCFD3;

  --ink: #0A0A0A;
  --text: #18181B;
  --text-muted: #52525B;
  --text-subtle: #71717A;

  --accent-soft: #DCEFFB;
  --accent-light: #7DD3FC;
  --accent: #0EA5E9;
  --accent-hover: #0284C7;
  --accent-deep: #0369A1;

  --secondary-soft: #FFE6D5;
  --secondary-light: #FB923C;
  --secondary: #F97316;
  --secondary-deep: #C2410C;
  --secondary-darkest: #7C2D12;

  /* Tertiary — muted sage green · deliberately quiet so the bright accent
     blue protagonist can pop. NOT a brand color. Used in research charts
     for "verified family / historical" elements that should recede. */
  --tertiary: #5F8A78;
  --tertiary-soft: #E0E9E4;

  --structural: #2D2D30;
  --structural-soft: #A0A0A3;

  --card-featured: #ffffff;
  --on-accent: #ffffff;
  --shadow-hard: rgba(0, 0, 0, 0.10);
  --cta-link-fg: var(--text);
  --cta-link-fg-hover: var(--accent);
  --cta-pill-bg: var(--accent);
  --cta-pill-fg: var(--bg);
  --cta-pill-border: transparent;
  --cta-pill-radius: 4px;
  --cta-pill-pad: 6px;
  --cta-icon-badge-pad: 2px;
  --cta-icon-size: 20px;
  --cta-inline-gap: 12px;
  --cta-label-font-size: 18px;
  --cta-label-tracking: 1.08px;
  --cta-icon-badge-fg: var(--on-accent);
}

/* ===================================================================
   BASE RESET + GLOBALS — from prototype/theorem.html
   =================================================================== */

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

html {
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: var(--font-sans);
  background: var(--bg-surface);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main {
  flex: 1 0 auto;
}

body.blog-post {
  background: #ffffff;
  scroll-behavior: smooth;
}

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

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ===================================================================
   SITE HEADER — from prototype/theorem.html
   =================================================================== */

.site-header {
  background: transparent;
}

.site-header__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px var(--page-inset) 16px;
  min-height: 54px;
  box-sizing: border-box;
  width: 100%;
  max-width: var(--content-frame-max-width);
  margin-left: 0;
  margin-right: auto;
}

body.blog-post .site-header__inner {
  max-width: calc(var(--blog-frame-max-width) + 64px);
  margin-left: auto;
  margin-right: auto;
  padding-left: 32px;
  padding-right: 32px;
}

.site-header__logo {
  text-decoration: none;
  color: inherit;
}

a.site-header__logo:hover {
  text-decoration: none;
}

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

.site-header__wordmark {
  font-family: 'Plus Jakarta Sans', ui-sans-serif, system-ui, sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--text);
  line-height: 1;
}

.site-header__nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.site-header__nav a,
.site-header__nav a:hover {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: -0.15px;
  text-transform: none;
  color: var(--text-muted);
  text-decoration: none;
  line-height: 1.4;
}

.site-header__nav a[aria-current="page"] {
  color: var(--text);
}

.site-header__nav a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ===================================================================
   SHELL + MEASURE
   =================================================================== */

.shell {
  flex: 1 1 auto;
  padding: 40px var(--page-inset) 80px;
}

.measure {
  max-width: var(--measure);
}

.measure--content {
  margin-left: 0;
  margin-right: auto;
}

.measure--landing {
  margin-left: 0;
  margin-right: auto;
}

.blog-post-standard__header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.blog-post-standard__title {
  margin: 0 0 0.625rem;
  font-family: var(--font-sans);
  font-size: var(--blog-paper-title-font-size);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text);
}

.blog-post-standard__title code {
  font-family: var(--font-mono);
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: var(--font-mono-letter-spacing);
  line-height: inherit;
  color: inherit;
  background: none;
  padding: 0;
  border: none;
  border-radius: 0;
}

.blog-page--standard .paper-header {
  margin-bottom: 1.5rem;
}

.blog-layout--standard-no-toc {
  grid-template-columns: 1fr;
  column-gap: 0;
}

.blog-layout--standard-no-toc .blog-sheet {
  grid-column: 1;
}

.blog-post-standard__paper-header--no-toc {
  margin-left: 0;
  max-width: 100%;
}

.blog-sheet--standard > .prose {
  max-width: 750px;
  margin-left: 0;
  margin-right: auto;
}

@media (max-width: 600px) {
  .blog-post-standard__header {
    margin-bottom: 1.5rem;
  }
}

@media (max-width: 900px) {
  .blog-post-standard__title {
    font-size: var(--blog-paper-title-font-size-600);
  }
}

@media (max-width: 480px) {
  .blog-post-standard__title {
    font-size: var(--blog-paper-title-font-size-480);
  }
}

/* ===================================================================
   MISSION
   =================================================================== */

.mission {
  font-size: 16.5px;
  line-height: 1.6;
  color: var(--text);
  max-width: 60ch;
  margin: 0 0 16px;
  text-wrap: pretty;
}

/* ===================================================================
   RESEARCH — bar separator and list
   =================================================================== */

.research {
  position: relative;
  padding-left: 0;
  max-width: var(--measure);
}

.research-bar {
  display: flex;
  align-items: center;
  margin-left: 0;
  margin-bottom: 10px;
}

.research-bar__label {
  display: inline-block;
  padding: 7px 14px;
  background: var(--accent);
  color: #ffffff;
  border: 1.5px solid var(--ink);
  box-shadow: 3px 3px 0 0 var(--ink);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}

.research-bar__line {
  flex: 1;
  height: 1.5px;
  background: var(--ink);
  margin-left: -1px;
}

/* .roll is a layout wrapper — no styles needed */

.item {
  position: relative;
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px;
  gap: 24px;
  align-items: baseline;
  transition: opacity 160ms ease;
}

.item:last-child {
  border-bottom: none;
}

/* Dim sibling posts on hover — focus cue without a heavy hover state */
.roll:hover .item:not(:hover) {
  opacity: 0.5;
}


.item h2 {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0 0 5px;
  text-wrap: balance;
  transition: color 140ms ease;
}

.item:hover h2 {
  color: var(--accent-deep);
}

.item p {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 0;
  max-width: 58ch;
  text-wrap: pretty;
}

@media (max-width: 480px) {
  .item p {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
  }
}

.item time {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-subtle);
  text-align: right;
  padding-top: 4px;
}

/* Inline code inside item titles should keep the code font without the code pill. */
.item h2 code,
.item p code {
  font-family: var(--font-mono);
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: var(--font-mono-letter-spacing);
  line-height: inherit;
  color: inherit;
  background: none;
  padding: 0;
  border: none;
  border-radius: 0;
}

/* Whole-row clickable; `display: contents` preserves grid placement */
.item a.link {
  display: contents;
  color: inherit;
  text-decoration: none;
}

.item a.link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ===================================================================
   FOOTER
   =================================================================== */

.foot {
  margin-top: 96px;
  padding: 16px var(--page-inset) 24px;
}

.foot__frame {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  max-width: var(--measure);
  margin-left: 0;
  margin-right: auto;
}

body.blog-post .foot {
  padding-left: 0;
  padding-right: 0;
}

body.blog-post .foot__frame {
  max-width: calc(var(--blog-frame-max-width) + 64px);
  margin-left: auto;
  margin-right: auto;
  padding-left: 32px;
  padding-right: 32px;
  box-sizing: border-box;
}

.foot__tagline {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-subtle);
}

.foot__links {
  display: flex;
  gap: 18px;
  width: max-content;
  margin-left: auto;
  margin-right: 0;
  flex-shrink: 0;
}

.foot a {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-subtle);
  transition: color 140ms ease;
  text-decoration: none;
}

.foot a:hover {
  color: var(--ink);
  text-decoration: none;
}

.foot__icon-link {
  display: inline-flex;
  align-items: center;
  height: 1.45em;
}

.foot__icon-link svg {
  display: block;
  width: 13px;
  height: 13px;
}

/* Embed mode is used by the lf-lean iframe in the blog post. */
html.embed-mode,
body.embed-mode {
  margin: 0;
  padding: 0;
  overflow: hidden;
}

body.embed-mode .site-header,
body.embed-mode .foot {
  display: none;
}

@media (max-width: 600px) {
  .foot__frame {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .foot__links {
    margin-left: 0;
  }
}

@media (max-width: 480px) {
  body.blog-post .site-header__inner,
  body.blog-post .foot__frame {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* ===================================================================
   BLOG CARDS
   =================================================================== */

.blog-cards-page {
  padding: 2rem 0 0;
}

.blog-cards-page__title {
  font-size: 2rem;
  margin: 0 0 1.5rem;
  font-weight: 700;
}

.blog-card {
  display: block;
  background: var(--card-bg, var(--card-featured));
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 20px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.blog-card:hover {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.blog-card__head {
  margin-bottom: 10px;
}

.blog-card__head h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.35;
}

.blog-card__subhead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  column-gap: 16px;
  row-gap: 4px;
  margin: 0;
}

.blog-card__meta,
.blog-card__date {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.blog-card__meta {
  margin: 0;
  min-width: 0;
}

.blog-card__date {
  margin-left: auto;
  text-align: right;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.blog-card__description {
  margin: 12px 0 0;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
}

.blog-card h2 code,
.blog-card p code {
  font-family: var(--font-mono);
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: var(--font-mono-letter-spacing);
  line-height: inherit;
  color: inherit;
  background: none;
  padding: 0;
  border: none;
  border-radius: 0;
}

@media (max-width: 600px) {
  .blog-card__subhead {
    grid-template-columns: 1fr;
  }

  .blog-card__date {
    margin-left: 0;
    text-align: left;
  }
}

/* ===================================================================
   INLINE CODE INSIDE HEADINGS
   =================================================================== */

:is(h1, h2, h3, h4, h5, h6) code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  font-weight: inherit;
  letter-spacing: var(--font-mono-letter-spacing);
  line-height: inherit;
  color: inherit;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  border-radius: 0;
  vertical-align: baseline;
  white-space: nowrap;
}

/* ===================================================================
   BLOG POST ARTICLE + PAPER HEADER
   =================================================================== */

/* Outer wrapper: article header above TOC + body grid.
   Side padding is intentionally capped at 32px — the hero chart bleed
   (calc(100% + 12rem) / margin: -6rem) was calculated for a 32px gutter.
   Wider gutters shrink the content area and cause the chart to overflow. */
.blog-page {
  max-width: var(--blog-frame-max-width);
  margin: 0 auto;
  padding: 2rem 32px 80px;
}

@media (max-width: 480px) {
  .blog-page {
    padding-left: 16px;
    padding-right: 16px;
  }
}

.blog-layout {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, var(--blog-article-max-width)) minmax(0, 1fr);
  column-gap: 0;
  align-items: start;
}

/* Article header sits above the grid; aligned with body column */
.paper-header {
  max-width: var(--blog-article-max-width);
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 2rem;
  position: relative;
}

@media (max-width: 1199px) {
  .blog-layout {
    grid-template-columns: 1fr;
    column-gap: 0;
  }

  .paper-header {
    max-width: var(--blog-article-max-width);
  }
}

.blog-sheet {
  grid-column: 2;
  grid-row: 1;
  background: #ffffff;
  padding: 0;
  overflow: visible;
  min-width: 0;
}

@media (max-width: 1199px) {
  .blog-sheet {
    grid-column: 1;
    width: 100%;
    max-width: var(--blog-article-max-width);
    margin-left: auto;
    margin-right: auto;
  }
}

.blog-sheet > .prose,
.blog-sheet > section.references-block,
.blog-sheet > section.cite-as-block,
.blog-sheet > footer.authors-end-block {
  max-width: 750px;
  margin-left: auto;
  margin-right: auto;
}

.blog-sheet > .prose {
  overflow: visible;
}

/* Sticky table of contents — naked treatment.
   Plain muted text; ink + 600 weight on the active item. No rail, no
   markers, no heading label. The grid placement and responsive
   show/hide come from the blog layout — preserved here. */
.toc {
  grid-column: 1;
  grid-row: 1;
  position: sticky;
  top: 32px;
  width: min(var(--blog-toc-width), 100%);
  justify-self: end;
  margin-right: var(--blog-column-gap);
  display: none;
  z-index: 10;
  align-self: start;
}

@media (min-width: 1200px) {
  .toc {
    display: block;
  }
}

/* Defensive: hide any heading label even though the component no
   longer renders one. */
.toc > h2,
.toc > h3,
.toc__heading,
.toc > [data-toc-heading] {
  display: none;
}

.toc__list,
.toc ul,
.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc__list li,
.toc li {
  margin: 0;
  padding: 0;
}

.toc__list li::before,
.toc li::before {
  content: none;
}

.toc__list a,
.toc a {
  display: block;
  padding: 5px 0;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-subtle);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 0;
  transition: color 0.15s ease;
}

.toc__list a:hover,
.toc__list a:focus-visible,
.toc a:hover,
.toc a:focus-visible {
  color: var(--text);
}

.toc__list a.is-active,
.toc__list a[aria-current="true"],
.toc__list a[aria-current="location"],
.toc a.is-active,
.toc a[aria-current="true"],
.toc a[aria-current="location"] {
  color: var(--ink);
  font-weight: 600;
}

/* The .toc__text span is a passthrough — inherit everything from <a> */
.toc__text {
  font: inherit;
  color: inherit;
}

/* Nested H3-under-H2 list, if ever introduced — space only, no rail */
.toc ul ul,
.toc ol ol {
  padding-left: 12px;
}

.paper-header__title {
  font-family: var(--font-sans);
  font-size: var(--blog-paper-title-font-size);
  font-weight: var(--blog-paper-title-font-weight);
  letter-spacing: var(--blog-paper-title-letter-spacing);
  line-height: var(--blog-paper-title-line-height);
  margin: 0 0 0.625rem;
  color: var(--text);
  text-align: left;
}

.blog-page .paper-header__title {
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

/* Hero: symmetric 111px breakout each side vs 720px column = 942px total */
.paper-header__hero {
  width: calc(100% + 222px);
  margin-left: -111px;
  margin-right: -111px;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.paper-header__hero-chart {
  width: calc(100% + 222px);
  margin-left: -111px;
  margin-right: -111px;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.paper-header__hero img,
.paper-header__hero video {
  display: block;
  width: 100%;
  height: auto;
}

.paper-header__hero-chart .post-figure {
  margin: 0;
}

.paper-header__hero-chart {
  padding-bottom: 0;
  background: transparent;
  border: none;
}

.plotly-below-label {
  margin-top: -0.125rem;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

/* Mono letter-spacing for all hero chart text, except legend where it causes
   width clipping because Plotly measures widths without letter-spacing. */
.paper-header__hero-chart .plotly-container svg text,
.paper-header__hero-chart .plotly-container svg tspan {
  letter-spacing: 0.06em;
}
.paper-header__hero-chart .plotly-container svg .legend text,
.paper-header__hero-chart .plotly-container svg .legend tspan {
  letter-spacing: 0 !important;
}

@media (max-width: 1100px) {
  .paper-header__hero {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  .paper-header__hero-chart {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
}

@media (max-width: 600px) {
  .paper-header__hero-chart {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .paper-header__hero-chart .plotly-figure-inner,
  .paper-header__hero-chart .plotly-container {
    min-width: 700px;
  }
}

.paper-header__title code,
.blog-page .paper-header__title code {
  font-family: var(--font-mono);
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: var(--font-mono-letter-spacing);
  line-height: inherit;
  color: inherit;
  background: none;
  padding: 0;
  border: none;
  border-radius: 0;
}

@media (max-width: 900px) {
  .paper-header__title {
    font-size: var(--blog-paper-title-font-size-600);
  }
}

@media (max-width: 480px) {
  .paper-header__title {
    font-size: var(--blog-paper-title-font-size-480);
  }
}

.paper-header__authors {
  font-family: var(--font-sans);
  font-size: var(--blog-paper-authors-font-size);
  line-height: var(--blog-paper-authors-line-height);
  margin: 0 0 var(--blog-paper-authors-margin-bottom);
  color: var(--text-muted);
}

.paper-header__date {
  display: block;
  font-family: var(--font-sans);
  font-size: var(--blog-paper-meta-font-size);
  font-weight: 600;
  margin: var(--blog-paper-meta-margin);
  color: var(--text);
}

/* ===================================================================
   META ROW — Variant B · full mono eyebrow
   =================================================================== */

.byline-block {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 16px;
  margin: 0 0 0.75rem;
  padding: 10px 0;
  width: 100%;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
  line-height: 1.6;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.meta-authors {
  display: flex;
  gap: 10px;
  align-items: baseline;
  flex-wrap: wrap;
  color: var(--text);
}

.meta-author-names {
}

.meta-collab-link {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s;
}

.meta-collab-link:hover {
  color: var(--accent-hover);
}

.meta-collab-plain {
  color: var(--accent);
}

.meta-right {
  text-align: right;
  flex-shrink: 0;
}

.meta-date {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  margin-left: auto;
  text-align: right;
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .meta-row {
    flex-direction: column;
    gap: 16px;
  }
  .meta-right {
    text-align: left;
  }

  .byline-block {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .meta-date {
    margin-left: 0;
    width: 100%;
    text-align: left;
  }
}

/* Custom author block: date line in paper-style posts */
.prose .paper-meta {
  text-align: right;
}

.authors-end-block {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  margin-top: 3rem;
  font-family: var(--font-mono);
}

.authors-end-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.3);
  margin-bottom: 12px;
}

.authors-end-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.authors-end-list li {
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0.02em;
  color: var(--text);
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.authors-end-num {
  font-size: 10px;
  color: var(--accent);
  font-weight: 600;
  flex-shrink: 0;
  min-width: 16px;
  text-align: right;
}

.authors-end-name {
  font-weight: 400;
}

.authors-end-aff {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 400;
  margin-left: 4px;
}

.authors-end-custom .paper-meta {
  text-align: right;
}

.authors-end-custom .paper-affiliations {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 0.75rem;
}

/* ===================================================================
   REFERENCES
   =================================================================== */

.references-block {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  margin-top: 3rem;
}

.references-heading {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.3);
  margin: 0 0 12px;
  padding: 0;
  line-height: 1.4;
}

.references-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  font-family: var(--font-sans);
}

.references-list li {
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0.02em;
  color: var(--text);
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.references-list li.references-list__item {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  scroll-margin-top: 6rem;
  align-items: baseline;
}

.references-list__marker {
  font-family: var(--font-mono);
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 10px;
  text-align: right;
}

.references-list__body {
  display: block;
  color: var(--text);
  flex: 1;
}

.references-venue {
  color: var(--text-muted);
}

.references-list a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: rgba(0, 0, 0, 0.2);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s, color 0.15s;
}

.references-list a:hover {
  text-decoration-color: var(--accent);
  color: var(--accent);
}

.prose .citation-ref {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  vertical-align: super;
  white-space: nowrap;
  margin-left: 1px;
}

.prose .citation-ref a {
  color: var(--accent);
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}

.prose .citation-ref a:hover {
  opacity: 0.75;
}

.prose .citation-ref + .citation-ref {
  margin-left: 0.15em;
}

.prose .citation-ref--missing {
  color: var(--text-muted);
}

.prose sup a[href^="#fn:"],
.prose .footnote-ref {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  vertical-align: super;
  white-space: nowrap;
  margin-left: 1px;
  color: var(--accent);
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}

.prose sup a[href^="#fn:"]:hover,
.prose .footnote-ref:hover {
  opacity: 0.75;
}

.prose sup a[href^="#fn:"] + a[href^="#fn:"],
.prose .footnote-ref + .footnote-ref {
  margin-left: 0.15em;
}

.prose .sidenote .citation-ref a {
  color: var(--accent);
}

.prose .sidenote .citation-ref a:hover {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 2px;
}

.cite-as-block {
  margin-top: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.cite-as-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cite-as-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.cite-as-box {
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--border);
  background: transparent;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.55;
  color: var(--text);
}

.cite-as-box p {
  margin: 0;
}

.cite-as-box code {
  font-family: var(--font-mono);
  background: none;
  padding: 0;
  color: var(--text);
}

.cite-as-box em {
  font-style: italic;
}

.cite-as-box a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(14, 165, 233, 0.35);
}

.cite-as-box a:hover {
  text-decoration-color: var(--accent);
}

.prose .footnotes {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  margin-top: 3rem;
}

.prose .footnotes::before {
  content: 'Footnotes';
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.3);
  margin: 0 0 12px;
  line-height: 1.4;
}

.prose .footnotes hr {
  display: none;
}

.prose .footnotes ol {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: footnotes;
}

.prose .footnotes ol > li {
  counter-increment: footnotes;
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  scroll-margin-top: 6rem;
  padding: 0;
}

.prose .footnotes ol > li::before {
  content: counter(footnotes) ".";
  font-family: var(--font-mono);
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 10px;
  text-align: right;
  align-self: baseline;
}

.prose .footnotes ol > li > p {
  margin: 0;
}

.prose .footnotes ol > li > p + p {
  margin-top: 0.75rem;
}

.prose .footnotes a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: rgba(0, 0, 0, 0.2);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s, color 0.15s;
}

.prose .footnotes a:hover {
  text-decoration-color: var(--accent);
  color: var(--accent);
}

.prose .footnotes a.footnote-backref {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  margin-left: 0.25rem;
  white-space: nowrap;
}

.prose .footnotes a.footnote-backref:hover {
  color: var(--accent-hover);
}

/* ===================================================================
   PROSE
   =================================================================== */

.prose {
  display: block;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.625;
  color: var(--text);
  overflow: visible;
}

.prose > * + * {
  margin-top: 1.625em;
}

.prose hr {
  display: none;
}

/* Sidenotes */
.prose .sidenote-number,
.prose sup.sidenote-ref,
.prose a.sidenote-ref,
.prose label.sidenote-number,
.sidenote-number {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  vertical-align: super;
  color: var(--accent);
  cursor: pointer;
  display: inline;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
  margin-left: 1px;
}

.prose .sidenote-number:hover,
.prose a.sidenote-ref:hover,
.prose label.sidenote-number:hover {
  opacity: 0.75;
}

.prose .sidenote-ref + .sidenote-ref,
.prose sup.sidenote-ref + sup.sidenote-ref,
.prose a.sidenote-ref + a.sidenote-ref {
  margin-left: 0.15em;
}

.prose .sidenote + label.sidenote-number {
  margin-left: 0.15em;
}

.sidenote-toggle-input {
  display: none;
}

.sidenote {
  float: right;
  clear: right;
  margin-right: -282px;
  width: 250px;
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.4;
  color: var(--text);
  margin-top: 0.3rem;
  margin-bottom: 0.5rem;
}

.sidenote .sidenote-num {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
  margin-right: 3px;
  vertical-align: super;
  line-height: 0;
}

.sidenote a {
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.sidenote a:hover {
  color: var(--accent);
}

.prose p,
.prose li,
.prose ol,
.prose ul {
  overflow: visible;
}

@media (max-width: 1279px) {
  .sidenote {
    display: none;
    float: none;
    width: 95%;
    margin: 0.5rem 0 0.75rem 1rem;
    padding: 0.5rem 0 0.5rem 1rem;
    border-left: 1px solid var(--border);
    font-size: 11px;
    line-height: 1.5;
  }

  .sidenote-toggle-input:checked + .sidenote {
    display: block;
  }
}

.prose > p:last-of-type::after {
  content: '';
  display: inline-block;
  width: 0.55em;
  height: 0.55em;
  background: var(--accent);
  margin-left: 0.35em;
  vertical-align: baseline;
  position: relative;
  top: -0.05em;
}

.prose--hide-intro h2#introduction {
  height: 0;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

.prose :is(h1, h2, h3, h4, h5, h6) {
  font-family: var(--font-sans);
  color: var(--text);
}

.prose :is(h2, h3, h4) {
  margin-top: 1rem;
  margin-bottom: -0.75em;
}

.prose .post-figure + h2 {
  margin-top: 0.25rem;
}

.prose h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 1.25rem;
  margin-bottom: -0.75em;
}

.prose h2 {
  font-size: 1.25rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.prose h3 {
  font-size: 1.1rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.prose h4 {
  font-size: 1rem;
  font-weight: 600;
}

.prose > :is(h1, h2, h3, h4):first-child {
  margin-top: 0;
}

.prose p {
  margin-bottom: 0;
}

.prose.careers-page {
  font-size: 14px;
}

.prose a {
  color: var(--accent);
  text-decoration: none;
}

.prose a:hover {
  text-decoration: underline;
}

.prose :where(p, li, blockquote, figcaption, td, th, dd, dt) code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  letter-spacing: var(--font-mono-letter-spacing);
  background: rgba(0, 0, 0, 0.06);
  border: none;
  padding: 2px 5px;
  border-radius: 2px;
}

.prose :is(h1, h2, h3, h4, h5, h6) code {
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
  background: none;
  padding: 0;
  border: none;
  border-radius: 0;
  letter-spacing: inherit;
}

/* KaTeX overrides */
.katex .texttt,
.katex .mathtt {
  font-family: var(--font-mono) !important;
  font-size: 0.92em;
}

.prose .katex {
  font-size: 1em;
}

.prose .katex-display {
  margin: 1.25rem 0;
  font-size: 1.05em;
}

.prose blockquote {
  margin: 0;
  border-left: 3px solid var(--accent);
  padding-left: 1.25rem;
  color: var(--text-muted);
  font-style: italic;
}

.prose > blockquote:first-child {
  margin-top: 2.5rem;
}

.prose :is(ul, ol) {
  margin-bottom: 0;
  padding-left: 1.5rem;
}

.prose ol {
  padding-left: 1.75rem;
  list-style-position: outside;
}

.prose ol > li {
  padding-left: 0.25rem;
}

.prose ol > li::marker {
  font-family: var(--font-mono);
  font-size: 0.85em;
  font-weight: 600;
  color: var(--text-muted);
}

.prose ol > li > strong:first-child,
.prose ol > li > p > strong:first-child {
  font-size: 0.95em;
  font-weight: 650;
}

.prose li {
  margin-bottom: 0.4rem;
}

.prose img {
  max-width: 100%;
  height: auto;
  margin: 0;
}

.prose pre {
  overflow-x: auto;
  padding: 1rem;
  margin-bottom: 0;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.88rem;
  font-family: var(--font-mono);
}

.prose pre code {
  font-family: inherit;
  font-size: inherit;
  letter-spacing: inherit;
  background: transparent;
  border: none;
  padding: 0;
  border-radius: 0;
}

.plotly-container {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.plotly-loading {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.post-figure.plotly-figure .plotly-container,
.post-figure.plotly-figure .plotly-container div {
  font-family: var(--font-sans), ui-sans-serif, system-ui, sans-serif !important;
}

.post-figure.plotly-figure .plotly-container svg text,
.post-figure.plotly-figure .plotly-container svg tspan {
  font-family: var(--font-mono), ui-monospace, monospace !important;
  letter-spacing: var(--font-mono-letter-spacing) !important;
}

.post-figure.plotly-figure .plotly-container svg text.gtitle,
.post-figure.plotly-figure .plotly-container svg text.gtitle tspan,
.post-figure.plotly-figure .plotly-container svg text.xtitle,
.post-figure.plotly-figure .plotly-container svg text.xtitle tspan,
.post-figure.plotly-figure .plotly-container svg text.ytitle,
.post-figure.plotly-figure .plotly-container svg text.ytitle tspan,
.post-figure.plotly-figure .plotly-container svg .g-gtitle text,
.post-figure.plotly-figure .plotly-container svg .g-gtitle tspan,
.post-figure.plotly-figure .plotly-container svg .g-xtitle text,
.post-figure.plotly-figure .plotly-container svg .g-xtitle tspan,
.post-figure.plotly-figure .plotly-container svg .g-ytitle text,
.post-figure.plotly-figure .plotly-container svg .g-ytitle tspan {
  font-family: var(--font-sans), ui-sans-serif, system-ui, sans-serif !important;
  letter-spacing: 0 !important;
}

.post-figure.plotly-figure .plotly-container svg text.gtitle,
.post-figure.plotly-figure .plotly-container svg .g-gtitle text {
  font-weight: 700;
}

.post-figure.plotly-figure .plotly-container svg g.legend g.titletext text,
.post-figure.plotly-figure .plotly-container svg g.legend text.titletext {
  font-family: var(--font-sans), ui-sans-serif, system-ui, sans-serif !important;
  letter-spacing: 0 !important;
}

.post-figure.plotly-figure .plotly-container svg g.cbtitle text,
.post-figure.plotly-figure .plotly-container svg g.cbtitle tspan {
  font-family: var(--font-sans), ui-sans-serif, system-ui, sans-serif !important;
  letter-spacing: 0 !important;
}

.blog-layout .prose .post-figure.plotly-figure .plotly-container,
.blog-layout .prose .post-figure.plotly-figure .plotly-container div {
  font-family: var(--font-sans), ui-sans-serif, system-ui, sans-serif !important;
}

.blog-layout .prose .post-figure.plotly-figure .plotly-container svg text.gtitle,
.blog-layout .prose .post-figure.plotly-figure .plotly-container svg .g-gtitle text {
  font-weight: 700;
}

.blog-layout .prose .post-figure.plotly-figure .plotly-container svg text,
.blog-layout .prose .post-figure.plotly-figure .plotly-container svg tspan {
  font-family: var(--font-mono), ui-monospace, monospace !important;
  letter-spacing: var(--font-mono-letter-spacing) !important;
}

.blog-layout .prose .post-figure.plotly-figure .plotly-container svg text.gtitle,
.blog-layout .prose .post-figure.plotly-figure .plotly-container svg text.gtitle tspan,
.blog-layout .prose .post-figure.plotly-figure .plotly-container svg text.xtitle,
.blog-layout .prose .post-figure.plotly-figure .plotly-container svg text.xtitle tspan,
.blog-layout .prose .post-figure.plotly-figure .plotly-container svg text.ytitle,
.blog-layout .prose .post-figure.plotly-figure .plotly-container svg text.ytitle tspan,
.blog-layout .prose .post-figure.plotly-figure .plotly-container svg .g-gtitle text,
.blog-layout .prose .post-figure.plotly-figure .plotly-container svg .g-gtitle tspan,
.blog-layout .prose .post-figure.plotly-figure .plotly-container svg .g-xtitle text,
.blog-layout .prose .post-figure.plotly-figure .plotly-container svg .g-xtitle tspan,
.blog-layout .prose .post-figure.plotly-figure .plotly-container svg .g-ytitle text,
.blog-layout .prose .post-figure.plotly-figure .plotly-container svg .g-ytitle tspan {
  font-family: var(--font-sans), ui-sans-serif, system-ui, sans-serif !important;
  letter-spacing: 0 !important;
}

.blog-layout .prose .post-figure.plotly-figure .plotly-container svg g.legend g.titletext text,
.blog-layout .prose .post-figure.plotly-figure .plotly-container svg g.legend text.titletext {
  font-family: var(--font-sans), ui-sans-serif, system-ui, sans-serif !important;
  letter-spacing: 0 !important;
}

.blog-layout .prose .post-figure.plotly-figure .plotly-container svg g.cbtitle text,
.blog-layout .prose .post-figure.plotly-figure .plotly-container svg g.cbtitle tspan {
  font-family: var(--font-sans), ui-sans-serif, system-ui, sans-serif !important;
  letter-spacing: 0 !important;
}

@media (max-width: 600px) {
  .blog-layout .prose .post-figure.plotly-figure {
    width: calc(100vw - 32px);
    max-width: none;
    margin-left: calc(50% - 50vw + 16px);
    margin-right: calc(50% - 50vw + 16px);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .blog-layout .prose .post-figure.plotly-figure .plotly-figure-inner,
  .blog-layout .prose .post-figure.plotly-figure .plotly-container {
    min-width: 700px;
  }
}

main .blog-layout .prose .post-figure.plotly-figure .plotly-container svg text.gtitle,
main .blog-layout .prose .post-figure.plotly-figure .plotly-container svg text.gtitle tspan,
main .blog-layout .prose .post-figure.plotly-figure .plotly-container svg text.xtitle,
main .blog-layout .prose .post-figure.plotly-figure .plotly-container svg text.xtitle tspan,
main .blog-layout .prose .post-figure.plotly-figure .plotly-container svg text.ytitle,
main .blog-layout .prose .post-figure.plotly-figure .plotly-container svg text.ytitle tspan,
main .blog-layout .prose .post-figure.plotly-figure .plotly-container svg .g-gtitle text,
main .blog-layout .prose .post-figure.plotly-figure .plotly-container svg .g-gtitle tspan,
main .blog-layout .prose .post-figure.plotly-figure .plotly-container svg .g-xtitle text,
main .blog-layout .prose .post-figure.plotly-figure .plotly-container svg .g-xtitle tspan,
main .blog-layout .prose .post-figure.plotly-figure .plotly-container svg .g-ytitle text,
main .blog-layout .prose .post-figure.plotly-figure .plotly-container svg .g-ytitle tspan,
main .blog-layout .prose .post-figure.plotly-figure .plotly-container svg g.legend g.titletext text,
main .blog-layout .prose .post-figure.plotly-figure .plotly-container svg g.legend text.titletext,
main .blog-layout .prose .post-figure.plotly-figure .plotly-container svg g.cbtitle text,
main .blog-layout .prose .post-figure.plotly-figure .plotly-container svg g.cbtitle tspan {
  font-family: 'Geist', ui-sans-serif, system-ui, sans-serif !important;
  letter-spacing: 0 !important;
}

.explorer-embed {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  font-family: var(--font-sans), ui-sans-serif, system-ui, sans-serif;
}

.explorer-embed iframe {
  display: block;
  width: 100%;
  height: 900px;
  border: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.explorer-embed iframe.loaded {
  opacity: 1;
}

.hero-explorer-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-family: var(--font-sans), ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
  letter-spacing: 0;
  color: var(--text-muted);
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.explorer-embed iframe.loaded ~ .hero-explorer-placeholder {
  opacity: 0;
}

.skeleton-bar {
  width: 60%;
  height: 8px;
  border-radius: 4px;
  background: var(--border);
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.skeleton-bar:nth-child(3) {
  width: 40%;
}

@keyframes skeleton-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton-bar {
    animation: none;
    opacity: 0.7;
  }
}

.explorer-scroll-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  cursor: pointer;
  z-index: 2;
  font-family: var(--font-sans), ui-sans-serif, system-ui, sans-serif;
}

.explorer-scroll-overlay.active {
  pointer-events: none;
  opacity: 0;
}

.overlay-hint {
  font-family: var(--font-sans), ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--text);
  background: color-mix(in srgb, var(--card-featured) 92%, transparent);
  padding: 6px 14px;
  border-radius: 4px;
  border: 1px solid var(--border);
  opacity: 0;
  transition: opacity 0.3s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.explorer-embed iframe.loaded ~ .explorer-scroll-overlay .overlay-hint {
  opacity: 1;
}

@media (max-width: 900px) {
  .explorer-embed iframe {
    height: 600px;
  }
}

.prose figcaption {
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.55;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-muted);
  margin-top: 8px;
}

.plotly-custom-hover .hoverlayer .hovertext {
  display: none !important;
}

.plotly-custom-hover .hoverlayer .spike-line {
  display: none !important;
}

.plotly-custom-tooltip {
  position: fixed;
  z-index: 1000;
  background: var(--card-featured);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  line-height: 1.5;
  color: var(--text);
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  max-width: 300px;
}

/* ===================================================================
   FIGURES
   =================================================================== */

.prose figure.post-figure,
.prose .post-figure {
  position: relative;
  margin: 1.25rem 0 1rem;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
}

/* Wide figure breakout: symmetric ±111px, matching .paper-header__hero exactly.
   Left edge lands at same horizontal position as the hero card. TOC floats above. */
.figure-wide {
  margin: 1.25rem 0 1rem;
}

@media (min-width: 1200px) {
  .figure-wide {
    width: calc(100% + 222px);
    margin-left: -111px;
    margin-right: -111px;
  }
  .figure-wide .post-figure {
    margin: 0;
  }
}

.prose .post-figure > figcaption,
.prose .post-figure > .post-figure-caption,
.paper-header .post-figure > figcaption,
.paper-header__hero-caption,
.paper-header__hero + figcaption,
.paper-header__hero + .post-figure-caption {
  max-width: 750px;
  margin: 24px auto 0;
  padding-top: 0;
  text-align: left;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-muted);
  letter-spacing: 0;
}

.prose .post-figure > figcaption strong,
.prose .post-figure > .post-figure-caption strong,
.paper-header .post-figure > figcaption strong {
  color: var(--accent);
  font-weight: 600;
  margin-right: 4px;
}

/* ─── Slug opener: FIG. N · <regular prose continues> ─────
   Only the "FIG. N" fragment is mono-uppercase saffron.
   Everything after the separator inherits the caption's
   default sans body styling — no bold, no uppercase, no
   forced line break. Title phrase reads as inline prose.
   ──────────────────────────────────────────────── */

.prose .post-figure > figcaption .figure-num,
.prose .post-figure > .post-figure-caption .figure-num,
.paper-header .post-figure > figcaption .figure-num,
.paper-header__hero-caption .figure-num,
.paper-header__hero + figcaption .figure-num,
.paper-header__hero + .post-figure-caption .figure-num {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.paper-header .post-figure > figcaption code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  letter-spacing: var(--font-mono-letter-spacing);
  background: rgba(0, 0, 0, 0.06);
  border: none;
  padding: 2px 5px;
  border-radius: 2px;
}

.prose .post-figure img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  border: none;
  border-radius: 0;
}

.prose .post-figure .js-plotly-plot,
.prose .post-figure .plotly-graph-div,
.prose .post-figure .plotly-container,
.prose .post-figure .plotly-chart {
  width: 100% !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}

.prose .post-figure .explorer-embed {
  border: none;
  background: transparent;
  border-radius: 0;
}

.prose .post-figure .explorer-embed,
.prose .post-figure iframe {
  display: block;
  width: 100%;
  border: none;
  background: transparent;
  margin: 0;
}

.explorer-embed-figure .explorer-embed,
.explorer-embed-figure .explorer-scroll-overlay,
.explorer-embed-figure .hero-explorer-placeholder,
.explorer-embed-figure .hero-explorer-placeholder span,
.explorer-embed-figure .overlay-hint {
  font-family: var(--font-sans), ui-sans-serif, system-ui, sans-serif !important;
  letter-spacing: 0 !important;
}

.blog-layout .prose .explorer-embed-figure .overlay-hint {
  font-weight: 500;
  font-size: 13px;
}

.prose .post-figure svg {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
}

.prose .post-figure .rough-diagram {
  display: block;
  width: 100%;
  margin: 0 auto;
}

.prose .post-figure .rough-diagram svg {
  display: block;
  width: 100%;
  height: auto;
}

.prose .post-figure .rough-diagram--formula {
  max-width: 520px;
}

.prose .post-figure .svg-embed {
  display: block;
  width: 100%;
  margin: 0;
}

.prose .post-figure .svg-embed svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}

/* ─── Compact figure variant ───────────────────────
   Shrinks the SVG inside a figure to 75% of the body
   column while leaving the figure wrapper full-width.
   This keeps the figcaption at the standard prose
   width even when the chart itself is compact.
   ──────────────────────────────────────────────── */

.prose .post-figure.post-figure--compact .svg-embed {
  max-width: 75%;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 720px) {
  .prose .post-figure.post-figure--compact .svg-embed {
    max-width: 100%;
  }
}

/* ─── Wide figure variants ─────────────────────────
   Sits inside .prose. Body is 750 px max-width,
   left-aligned in a body slot that's wider. The wide
   figure breaks out symmetrically on both sides,
   matching the hero pattern: 96 px each side.
   ──────────────────────────────────────────────── */

@media (min-width: 1199px) {
  .prose .post-figure.fig-wide,
  .prose .fig-grid {
    width: calc(100% + 12rem);
    margin-left: -6rem;
    margin-right: -6rem;
    background: var(--card-featured);
  }

  .prose .post-figure.fig-wide--avoid-toc {
    width: calc(100% + 8rem);
    margin-left: 0;
    margin-right: -8rem;
  }

  .prose .fig-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 2rem;
    margin-bottom: 2rem;
  }

  .prose .fig-grid > figure,
  .prose .fig-grid > img {
    margin: 0;
    min-width: 0;
  }

  .prose .post-figure.fig-wide > img,
  .prose .post-figure.fig-wide > video,
  .prose .fig-grid img {
    display: block;
    width: 100%;
    height: auto;
  }

  /* Wide figure caption inherits from .post-figure > figcaption;
     no custom rule needed here. */
}

@media (max-width: 1198px) {
  .prose .post-figure.fig-wide,
  .prose .fig-grid {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    background: var(--card-featured);
  }

  .prose .fig-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .prose .fig-grid {
    grid-template-columns: 1fr;
  }
}

.blog-layout .prose .post-figure .svg-embed svg text,
.blog-layout .prose .post-figure .svg-embed svg tspan,
.blog-layout .prose .post-figure svg text,
.blog-layout .prose .post-figure svg tspan,
.prose .post-figure .svg-embed svg text,
.prose .post-figure .svg-embed svg tspan,
.prose .post-figure svg text,
.prose .post-figure svg tspan {
  font-family: 'Geist', ui-sans-serif, system-ui, sans-serif !important;
}

.blog-layout .prose .post-figure .svg-embed svg text.svg-diagram-mono,
.blog-layout .prose .post-figure .svg-embed svg tspan.svg-diagram-mono,
.blog-layout .prose .post-figure svg text.svg-diagram-mono,
.blog-layout .prose .post-figure svg tspan.svg-diagram-mono,
.prose .post-figure .svg-embed svg text.svg-diagram-mono,
.prose .post-figure .svg-embed svg tspan.svg-diagram-mono,
.prose .post-figure svg text.svg-diagram-mono,
.prose .post-figure svg tspan.svg-diagram-mono {
  font-family: var(--font-mono) !important;
  letter-spacing: var(--font-mono-letter-spacing) !important;
}

main .blog-layout .prose .post-figure .svg-embed svg text.svg-diagram-title,
main .blog-layout .prose .post-figure svg text.svg-diagram-title,
.blog-layout .prose .post-figure .svg-embed svg text.svg-diagram-title,
.blog-layout .prose .post-figure svg text.svg-diagram-title,
.prose .post-figure .svg-embed svg text.svg-diagram-title,
.prose .post-figure svg text.svg-diagram-title,
main .blog-layout .prose .post-figure .svg-embed svg text.svg-diagram-title tspan,
main .blog-layout .prose .post-figure svg text.svg-diagram-title tspan,
.blog-layout .prose .post-figure .svg-embed svg text.svg-diagram-title tspan,
.blog-layout .prose .post-figure svg text.svg-diagram-title tspan,
.prose .post-figure .svg-embed svg text.svg-diagram-title tspan,
.prose .post-figure svg text.svg-diagram-title tspan {
  font-family: 'Geist', ui-sans-serif, system-ui, sans-serif !important;
  font-weight: 600 !important;
  letter-spacing: -0.01em !important;
}

main .blog-layout .prose .post-figure .svg-embed svg text.svg-diagram-sans,
main .blog-layout .prose .post-figure svg text.svg-diagram-sans,
.blog-layout .prose .post-figure .svg-embed svg text.svg-diagram-sans,
.blog-layout .prose .post-figure svg text.svg-diagram-sans,
.prose .post-figure .svg-embed svg text.svg-diagram-sans,
.prose .post-figure svg text.svg-diagram-sans,
main .blog-layout .prose .post-figure .svg-embed svg text.svg-diagram-sans tspan,
main .blog-layout .prose .post-figure svg text.svg-diagram-sans tspan,
.blog-layout .prose .post-figure .svg-embed svg text.svg-diagram-sans tspan,
.blog-layout .prose .post-figure svg text.svg-diagram-sans tspan,
.prose .post-figure .svg-embed svg text.svg-diagram-sans tspan,
.prose .post-figure svg text.svg-diagram-sans tspan {
  font-family: 'Geist', ui-sans-serif, system-ui, sans-serif !important;
  letter-spacing: 0 !important;
}

main .blog-layout .prose .post-figure .svg-embed svg text.svg-diagram-caption,
main .blog-layout .prose .post-figure svg text.svg-diagram-caption,
.blog-layout .prose .post-figure .svg-embed svg text.svg-diagram-caption,
.blog-layout .prose .post-figure svg text.svg-diagram-caption,
.prose .post-figure .svg-embed svg text.svg-diagram-caption,
.prose .post-figure svg text.svg-diagram-caption,
main .blog-layout .prose .post-figure .svg-embed svg text.svg-diagram-caption tspan,
main .blog-layout .prose .post-figure svg text.svg-diagram-caption tspan,
.blog-layout .prose .post-figure .svg-embed svg text.svg-diagram-caption tspan,
.blog-layout .prose .post-figure svg text.svg-diagram-caption tspan,
.prose .post-figure .svg-embed svg text.svg-diagram-caption tspan,
.prose .post-figure svg text.svg-diagram-caption tspan {
  font-family: 'Geist', ui-sans-serif, system-ui, sans-serif !important;
  font-style: italic !important;
  letter-spacing: 0 !important;
}

.prose .prose-callout {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  color: var(--text);
}

.prose .prose-callout strong {
  font-weight: 650;
}

.prose .prose-callout a {
  color: var(--accent);
  text-decoration: none;
}

.prose .prose-callout a:hover {
  text-decoration: underline;
}
