:root {
  --bg: #ffffff;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-strong: #ffffff;
  --text: #1f1f1b;
  --muted: #5f6058;
  --accent: #8c1515;
  --accent-strong: #6d1111;
  --heading: #8c1515;
  --link: #8c1515;
  --line: rgba(0, 0, 0, 0.12);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.08);
  --bg-radial-1: rgba(15, 118, 110, 0.16);
  --bg-radial-2: rgba(180, 83, 9, 0.12);
  --bg-gradient-start: #ffffff;
  --bg-gradient-end: #ffffff;
  --lede: #2f302a;
  --preview-text: #3d3e37;
}

html[data-theme="dark"] {
  --bg: #141414;
  --surface: rgba(28, 28, 28, 0.9);
  --surface-strong: #1c1c1c;
  --text: #eeeeee;
  --muted: #999999;
  --accent: #c94040;
  --accent-strong: #c94040;
  --heading: #c94040;
  --link: #c94040;
  --line: rgba(255, 255, 255, 0.1);
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.4);
  --bg-radial-1: transparent;
  --bg-radial-2: transparent;
  --bg-gradient-start: #141414;
  --bg-gradient-end: #141414;
  --lede: #cccccc;
  --preview-text: #bbbbbb;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  color: var(--text);
  background:
    radial-gradient(circle at top left, var(--bg-radial-1), transparent 26%),
    radial-gradient(circle at top right, var(--bg-radial-2), transparent 24%),
    linear-gradient(
      180deg,
      var(--bg-gradient-start) 0%,
      var(--bg-gradient-end) 100%
    );
  line-height: 1.6;
}

a {
  color: var(--link);
}

.shell {
  width: min(1080px, calc(100% - 2rem));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 1rem 0;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

html[data-theme="dark"] .topbar {
  background: #1c1c1c;
}

html[data-theme="dark"] .topbar-logos img {
  mix-blend-mode: lighten;
}

.topbar .shell {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.brand {
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 1.1rem;
  font-weight: 700;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--heading);
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
  transition: opacity 200ms ease;
}

.brand:hover {
  opacity: 0.6;
}

.topbar-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3rem;
}

.topbar-logos a {
  display: block;
  transition: opacity 200ms ease;
}

.topbar-logos a:hover {
  opacity: 0.65;
}

.topbar-logos img {
  display: block;
  width: auto;
  object-fit: contain;
  opacity: 0.9;
}

.topbar-logos img.block-s {
  height: 48px;
}
.topbar-logos img.susig {
  height: 28px;
}
.topbar-logos img.stair {
  height: 64px;
}
.topbar-logos img.sail {
  height: 40px;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 1.75rem;
}

.theme-toggle {
  display: block;
}

.nav a,
.nav span {
  font-size: 1rem;
  color: var(--muted);
  text-decoration: none;
  line-height: 1;
  letter-spacing: 0.04em;
  transition: color 200ms ease;
}

.nav a:hover {
  color: var(--accent);
  transition: color 200ms ease;
}

.theme-toggle {
  appearance: none;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  display: block;
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 999px;
}

.theme-toggle-track {
  position: relative;
  display: block;
  width: 2.8rem;
  height: 1.5rem;
  background: rgba(0, 0, 0, 0.12);
  border-radius: 999px;
  transition: background 200ms ease;
}

html[data-theme="dark"] .theme-toggle-track {
  background: rgba(255, 255, 255, 0.18);
}

.theme-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: var(--text);
  transition: transform 200ms ease;
}

html[data-theme="dark"] .theme-toggle-thumb {
  transform: translateX(1.3rem);
}

.hero {
  padding: 4.5rem 0 3rem;
}

.hero-grid,
.post-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.9fr);
  gap: 2rem;
}

.eyebrow {
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: var(--accent);
  margin-bottom: 1rem;
}

h1,
h2,
h3 {
  line-height: 1.1;
  margin: 0 0 1rem;
  font-weight: 600;
  color: var(--heading);
}

h1 {
  font-size: clamp(2.2rem, 4vw, 4rem);
}

.post-title-long {
  font-size: clamp(1.6rem, 2.7vw, 2.35rem);
  max-width: 22ch;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.08;
}

.post-header {
  max-width: 1080px;
  margin: 0 auto 3rem;
  text-align: center;
}

.post-header .eyebrow,
.post-header .post-meta {
  text-align: center;
}

.post-header > .eyebrow,
.post-header > .post-title-long,
.post-header > .lede,
.post-header > .post-meta {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.post-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  justify-content: center;
}

.post-read-time {
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(19, 78, 74, 0.07);
}

.post-authors {
  margin: 0;
  color: var(--text);
  font-family: inherit;
  font-size: 1.04rem;
  line-height: 1.65;
}

.post-byline {
  display: grid;
  gap: 1rem;
  max-width: 760px;
  margin: 0 auto 1.35rem;
  text-align: center;
}

.post-affiliation-mark {
  margin: 0;
}

.post-affiliation-logos {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.85rem;
  align-items: center;
}

.post-affiliation-logos img {
  display: block;
  width: auto;
  height: 68px;
  margin: 0 auto;
  padding: 0.55rem 0.7rem;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

html:not([data-theme="dark"]) .post-affiliation-logos img {
  transform: scale(1.12);
  transform-origin: center;
}

.post-affiliation-logos img.stanford {
  height: 82px;
  max-width: 190px;
}

.post-affiliation-logos img.stair {
  max-width: 120px;
}

.post-affiliation-logos img.sail {
  max-width: 250px;
}

.post-byline .post-authors {
  text-align: center;
}

.post-header > .lede {
  text-align: left;
}

.post-authors-label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--accent-strong);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.post-authors-list {
  color: var(--text);
}

.post-header-figure {
  margin: 2.8rem auto 2.1rem;
}

.post-header-figure.intro-figure,
.interactive-demo.intro-demo {
  width: min(1080px, calc(100vw - 2rem));
  max-width: none;
  margin-left: 50%;
  margin-right: 0;
  transform: translateX(-50%);
}

.post-header-figure img {
  display: block;
  width: 100%;
  max-width: 840px;
  height: auto;
  margin: 0 auto;
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.interactive-demo {
  margin: 2.8rem auto 2.1rem;
  padding: 1.4rem;
  text-align: left;
  background: linear-gradient(
    145deg,
    rgba(255, 253, 248, 0.96),
    rgba(244, 250, 248, 0.96)
  );
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.interactive-demo-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1rem;
}

.interactive-demo-header > div:first-child {
  flex: 0 1 44rem;
  max-width: 44rem;
}

.interactive-demo-header h2,
.interactive-demo-header p {
  margin: 0;
}

.interactive-demo-header h2 {
  font-size: clamp(1.25rem, 2vw, 1.65rem);
}

.interactive-demo-header p {
  color: var(--muted);
  max-width: 48ch;
}

.interactive-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.1);
  color: var(--accent-strong);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.interactive-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.interactive-nav-controls {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.interactive-nav-button {
  appearance: none;
  border: 1px solid rgba(19, 78, 74, 0.2);
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  padding: 0.7rem 0.95rem;
  border-radius: 14px;
  font: inherit;
  cursor: pointer;
  transition:
    transform 120ms ease,
    border-color 120ms ease,
    background 120ms ease;
}

.interactive-nav-button:hover,
.interactive-nav-button:focus-visible {
  transform: translateY(-1px);
  border-color: var(--accent);
  outline: none;
}

.interactive-nav-status {
  color: var(--muted);
  font-size: 0.95rem;
}

.interactive-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 1rem;
}

.interactive-stack {
  display: grid;
  gap: 1rem;
}

.interactive-stage,
.interactive-candidate {
  padding: 1rem 1.05rem;
  border-radius: 18px;
  background: #0e1619;
  color: #edf3f4;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.interactive-stage.python-stage {
  background: #11161b;
}

.interactive-stage-label {
  display: inline-block;
  margin-bottom: 0.75rem;
  color: #9ed5c9;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.interactive-stage pre {
  margin: 0;
  overflow-x: auto;
}

.interactive-stage code {
  display: block;
  white-space: pre;
  font-family: "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.92rem;
  line-height: 1.6;
  background: transparent;
  padding: 0;
}

.interactive-candidate-grid,
.interactive-summary {
  display: grid;
  gap: 0.85rem;
}

.interactive-candidate-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(440px, 1fr);
  overflow-x: auto;
  overflow-y: hidden;
  align-items: stretch;
  padding-bottom: 0.35rem;
  scrollbar-gutter: stable;
}

.interactive-candidate {
  background: #0d1b1e;
  position: relative;
  min-width: 0;
}

.interactive-candidate-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.interactive-candidate-title {
  margin: 0;
  font-size: 1rem;
}

.interactive-candidate-title span:first-child {
  display: block;
  color: #9ed5c9;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.interactive-candidate-title span + span {
  display: block;
  color: #edf3f4;
  font-size: 1rem;
  letter-spacing: 0;
  text-transform: none;
}

.interactive-choice {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.interactive-choice.best {
  background: rgba(32, 129, 74, 0.18);
  color: #93e2b3;
}

.interactive-choice.other {
  background: rgba(255, 255, 255, 0.08);
  color: #cfd9dd;
}

.interactive-candidate-score {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.interactive-candidate-score span {
  color: #c7d3d7;
  font-size: 0.9rem;
}

.interactive-candidate-score strong {
  font-size: 1.15rem;
}

.interactive-candidate pre {
  margin: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 0.15rem;
}

.interactive-candidate code {
  display: block;
  min-width: max-content;
  white-space: pre;
  font-family: "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.92rem;
  line-height: 1.6;
  background: transparent;
  padding: 0;
}

.interactive-card {
  padding: 1rem 1.05rem;
  border-radius: 18px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
}

.interactive-card h3,
.interactive-card p {
  margin: 0;
}

.interactive-card h3 {
  font-size: 1rem;
  margin-bottom: 0.55rem;
}

.interactive-card p {
  color: var(--muted);
}

.interactive-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.7rem;
}

.interactive-summary-title {
  min-width: 0;
}

.interactive-summary-title .interactive-stage-label {
  margin-bottom: 0.2rem;
}

.interactive-summary-title strong {
  display: block;
  font-size: 1.35rem;
  line-height: 1.1;
}

.interactive-pill {
  flex: 0 0 auto;
  align-self: start;
}

.interactive-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.interactive-pill.good {
  background: rgba(32, 129, 74, 0.12);
  color: #1f6a40;
}

.interactive-pill.warn {
  background: rgba(180, 83, 9, 0.12);
  color: #9a4f0b;
}

.interactive-pill.bad {
  background: rgba(185, 28, 28, 0.12);
  color: #a12a2a;
}

.interactive-metrics {
  display: grid;
  gap: 0.55rem;
}

.interactive-metric {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--line);
  font-size: 0.95rem;
}

.interactive-metric:first-child {
  padding-top: 0;
  border-top: 0;
}

.interactive-note {
  margin-top: 0.9rem;
  font-size: 0.92rem;
  color: var(--muted);
}

.post-body {
  max-width: 1080px;
  margin: 0 auto;
}

h2 {
  font-size: clamp(1.42rem, 2.2vw, 1.95rem);
}

p {
  font-size: 1.08rem;
  margin: 0 0 1rem;
}

.lede {
  font-size: 1.24rem;
  color: var(--lede);
}

.panel,
.card,
.note,
.post-list a {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 22px;
}

.panel,
.note {
  padding: 1.4rem;
}

.cta-row {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.button {
  display: inline-block;
  padding: 0.9rem 1.2rem;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid var(--accent-strong);
}

.button.primary {
  background: var(--accent-strong);
  color: #f4f6f4;
}

.button.secondary {
  background: transparent;
}

.section {
  padding: 1.5rem 0 3rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.card {
  padding: 1.3rem;
}

.kicker {
  color: var(--muted);
  font-size: 0.95rem;
}

.post-list {
  display: grid;
  gap: 1rem;
}

.post-list a {
  display: block;
  padding: 1.2rem;
  text-decoration: none;
  color: inherit;
}

.post-meta {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.content {
  padding: 4.75rem 0 4rem;
}

.content section {
  margin-bottom: 2.25rem;
}

.content ul {
  padding-left: 1.2rem;
}

.code-block {
  margin: 1.25rem 0 1.5rem;
  padding: 1rem 1.15rem;
  border-radius: 16px;
  overflow-x: auto;
  box-shadow: var(--shadow);
}

.post-body > section > .code-block {
  width: min(840px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.code-block pre {
  margin: 0;
}

.code-block code {
  display: block;
  background: transparent;
  padding: 0;
  border-radius: 0;
  font-family: "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 1rem;
  line-height: 1.6;
  white-space: pre;
}

.code-block.python,
.code-block.lean {
  background: #f5f5f5;
  color: #1e2228;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.code-block .comment {
  color: #5a8a6a;
}

.code-block .keyword {
  color: #0057b8;
}

.code-block .type {
  color: #8a6000;
}

.code-block .string {
  color: #b34000;
}

.code-block .warning {
  color: #cc2222;
  font-weight: 700;
}

html[data-theme="dark"] .code-block.python {
  background: #101418;
  color: #eef2f3;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .code-block.lean {
  background: #0d1b1e;
  color: #e9f5f2;
  border: 1px solid rgba(95, 211, 186, 0.16);
}

html[data-theme="dark"] .code-block .comment {
  color: #7fbd98;
}
html[data-theme="dark"] .code-block .keyword {
  color: #8ad4ff;
}
html[data-theme="dark"] .code-block .type {
  color: #ffd580;
}
html[data-theme="dark"] .code-block .string {
  color: #ffb86c;
}
html[data-theme="dark"] .code-block .warning {
  color: #ff8e8e;
  font-weight: 700;
}

.callout {
  padding: 1rem 1.1rem;
  border-left: 4px solid var(--accent);
  background: rgba(15, 118, 110, 0.08);
  border-radius: 0 12px 12px 0;
}

.metric-flow {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 1.25rem 0 1.5rem;
}

.metric-card {
  padding: 1.1rem 1rem;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.metric-step {
  display: inline-block;
  margin-bottom: 0.6rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.12);
  color: var(--accent-strong);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.metric-card h3 {
  margin-bottom: 0.55rem;
  font-size: 1.12rem;
}

.metric-formula {
  margin: 1.25rem 0;
  padding: 1rem 1.1rem;
  border-radius: 18px;
  background: linear-gradient(
    135deg,
    rgba(15, 118, 110, 0.1),
    rgba(180, 83, 9, 0.08)
  );
  border: 1px solid var(--line);
}

.metric-formula strong {
  display: block;
  margin-bottom: 0.35rem;
}

.dataset-hover {
  margin: 1.25rem 0 1.5rem;
  padding: 1.15rem;
  border-radius: 22px;
  background: rgba(255, 252, 245, 0.92);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.dataset-hover-head {
  margin-bottom: 0.9rem;
}

.dataset-hover-head h3,
.dataset-hover-head p {
  margin: 0;
}

.dataset-hover-head h3 {
  font-size: 1.08rem;
  margin-bottom: 0.35rem;
}

.dataset-hover-head p {
  color: var(--muted);
}

.dataset-hover-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 1rem;
  align-items: start;
}

.dataset-hover-list {
  display: grid;
  gap: 0.7rem;
}

.dataset-hover-item {
  appearance: none;
  width: 100%;
  text-align: left;
  padding: 0.95rem 1rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  cursor: pointer;
  transition:
    transform 120ms ease,
    border-color 120ms ease,
    background 120ms ease;
}

.dataset-hover-item:hover,
.dataset-hover-item:focus-visible,
.dataset-hover-item.active {
  transform: translateY(-1px);
  border-color: rgba(15, 118, 110, 0.38);
  background: rgba(15, 118, 110, 0.08);
  outline: none;
}

.dataset-hover-item strong,
.dataset-hover-item span {
  display: block;
}

.dataset-hover-item strong {
  margin-bottom: 0.28rem;
  font-size: 1rem;
}

.dataset-hover-item span {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.dataset-hover-preview {
  padding: 1rem 1.05rem;
  border-radius: 18px;
  background: linear-gradient(
    145deg,
    rgba(15, 118, 110, 0.09),
    rgba(180, 83, 9, 0.08)
  );
  border: 1px solid var(--line);
}

.dataset-hover-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.dataset-hover-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.58rem;
  border-radius: 999px;
  background: rgba(19, 78, 74, 0.1);
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 600;
}

.dataset-hover-count {
  color: var(--muted);
  font-size: 0.92rem;
}

.dataset-hover-preview h4,
.dataset-hover-preview p {
  margin: 0;
}

.dataset-hover-preview h4 {
  font-size: 1.2rem;
  margin-bottom: 0.45rem;
}

.dataset-hover-preview p {
  color: var(--preview-text);
}

html[data-theme="dark"] .interactive-demo {
  background: linear-gradient(
    145deg,
    rgba(21, 27, 25, 0.96),
    rgba(18, 24, 22, 0.96)
  );
}

html[data-theme="dark"] .interactive-nav-button {
  background: rgba(27, 34, 31, 0.92);
  color: var(--text);
  border-color: rgba(240, 235, 226, 0.14);
}

html[data-theme="dark"] .interactive-nav-button:hover,
html[data-theme="dark"] .interactive-nav-button:focus-visible {
  background: rgba(37, 46, 42, 0.96);
}

html[data-theme="dark"] .interactive-card {
  background: #18201d;
}

html[data-theme="dark"] .interactive-card p,
html[data-theme="dark"] .interactive-note {
  color: #d2ccc2;
}

html[data-theme="dark"] .interactive-pill.good {
  background: rgba(74, 194, 134, 0.18);
  color: #b9f0cd;
}

html[data-theme="dark"] .interactive-pill.warn {
  background: rgba(216, 153, 63, 0.18);
  color: #f3d69d;
}

html[data-theme="dark"] .interactive-pill.bad {
  background: rgba(214, 88, 88, 0.2);
  color: #f0b1b1;
}

html[data-theme="dark"] .dataset-hover {
  background: rgba(22, 28, 26, 0.94);
}

html[data-theme="dark"] .dataset-hover-item {
  background: rgba(30, 37, 34, 0.92);
  color: var(--text);
}

html[data-theme="dark"] .dataset-hover-item:hover,
html[data-theme="dark"] .dataset-hover-item:focus-visible,
html[data-theme="dark"] .dataset-hover-item.active {
  background: rgba(35, 58, 53, 0.62);
  border-color: rgba(106, 208, 195, 0.34);
}

html[data-theme="dark"] .dataset-hover-preview {
  background: linear-gradient(
    145deg,
    rgba(26, 56, 52, 0.36),
    rgba(70, 49, 26, 0.26)
  );
}

html[data-theme="dark"] .dataset-hover-badge {
  background: rgba(163, 236, 227, 0.12);
  color: var(--accent-strong);
}

html[data-theme="dark"] .post-read-time {
  background: rgba(163, 236, 227, 0.08);
}

html[data-theme="dark"] .post-affiliation-logos img {
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.dataset-hover-preview .code-block {
  margin-bottom: 0.95rem;
}

.dataset-hover-note {
  color: var(--muted);
  font-size: 0.92rem;
}

.prompt-box {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border-radius: 16px;
  background: #fffaf0;
  border: 1px solid rgba(180, 83, 9, 0.18);
}

.citation-footer {
  max-width: 1080px;
  margin: 2.5rem auto 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.citation-footer h2 {
  margin-bottom: 0.45rem;
  font-size: 1.05rem;
}

.citation-footer p {
  color: var(--muted);
  font-size: 0.95rem;
}

.code-block.citation {
  margin: 0.9rem 0 0;
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
}

.code-block.citation code {
  font-size: 0.8rem;
  line-height: 1.45;
}

.results-table-wrap {
  margin: 1.25rem 0 1.5rem;
  overflow-x: auto;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.results-table th,
.results-table td {
  padding: 0.85rem 0.9rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.results-table th {
  background: rgba(15, 118, 110, 0.08);
  font-size: 0.92rem;
}

.results-table tbody tr:last-child td {
  border-bottom: 0;
}

.results-table .best {
  font-weight: 700;
  color: var(--accent-strong);
}

.figure-note {
  color: var(--muted);
  font-size: 0.95rem;
}

.footer {
  padding: 2rem 0 3rem;
  color: var(--muted);
  font-size: 0.95rem;
}

code {
  background: rgba(19, 78, 74, 0.08);
  padding: 0.08rem 0.3rem;
  border-radius: 0.35rem;
}

@media (max-width: 800px) {
  .hero-grid,
  .post-grid,
  .cards,
  .metric-flow,
  .dataset-hover-layout,
  .interactive-layout {
    grid-template-columns: 1fr;
  }

  .post-byline {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .interactive-demo-header,
  .interactive-nav,
  .interactive-summary-head,
  .interactive-metric {
    display: block;
  }

  .post-header-figure.intro-figure,
  .interactive-demo.intro-demo {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    transform: none;
  }

  .interactive-nav-controls {
    margin-top: 0.75rem;
  }

  .interactive-badge {
    margin-top: 0.75rem;
  }

  .post-authors {
    text-align: center;
  }

  .hero {
    padding-top: 3rem;
  }
}
