:root {
  --basil-primary: #2c5f8d;
  --basil-accent: #e88c30;
  --basil-warmup: #f0b27a;
  --basil-adaptive: #5b9bd5;
  --basil-text: #1f2937;
  --basil-muted: #6b7280;
  --basil-border: #e5e7eb;
}

html, body {
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--basil-text);
  font-size: 17px;
  line-height: 1.6;
}

code, pre, .citation-block {
  font-family: 'Source Code Pro', Menlo, monospace;
  font-size: 0.92em;
}

a { color: var(--basil-primary); }
a:hover { color: var(--basil-accent); }

/* Hero */
.hero.is-light { background-color: #f7f9fc; padding-top: 2rem; }
.conference-badge {
  display: inline-block;
  background: var(--basil-primary);
  color: #fff;
  padding: 0.25rem 0.9rem;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}
.paper-title {
  font-weight: 700;
  line-height: 1.25;
  max-width: 900px;
  margin: 0 auto 1rem auto;
}
.paper-title .subtitle-title {
  display: block;
  font-size: 1.6rem;
  color: var(--basil-muted);
  font-weight: 400;
  margin-top: 0.4rem;
}
.authors { font-size: 1.05rem; margin-bottom: 0.3rem; }
.authors sup { color: var(--basil-accent); }
.affiliations { color: var(--basil-muted); margin-bottom: 1.6rem; }
.affiliations sup { color: var(--basil-accent); }
.action-buttons {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.action-buttons .button { border-radius: 999px; padding-left: 1.2rem; padding-right: 1.2rem; }

/* MNIST feature-importance demo */
.mnist-demo { text-align: center; }
.mnist-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.6rem;
  max-width: 900px;
  margin: 0 auto;
}
@media (max-width: 640px) {
  .mnist-grid { grid-template-columns: repeat(5, 1fr); gap: 0.3rem; }
}
.digit-cell {
  position: relative;
  background: #fff;
  border: 1px solid var(--basil-border);
  border-radius: 8px;
  padding: 0.4rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.digit-cell img {
  width: 100%;
  display: block;
  image-rendering: pixelated;
  border-radius: 4px;
}
.digit-label {
  position: absolute;
  top: 0.3rem;
  left: 0.3rem;
  background: rgba(255,255,255,0.92);
  color: var(--basil-primary);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.05rem 0.4rem;
  border-radius: 4px;
  font-family: 'Source Code Pro', monospace;
}
.mnist-demo figcaption {
  max-width: 760px;
  margin: 1rem auto 0 auto;
  color: var(--basil-muted);
  font-size: 0.95rem;
}

/* TL;DR */
.tldr-section { background: #fffbf2; border-top: 1px solid var(--basil-border); border-bottom: 1px solid var(--basil-border); padding-top: 2.2rem; padding-bottom: 2.2rem; }
.tldr { font-size: 1.3rem; text-align: center; max-width: 820px; margin: 0 auto; font-weight: 400; }

/* Feature cards */
.feature-cards { margin-top: 1.5rem; }
.feature-card {
  background: #fff;
  border: 1px solid var(--basil-border);
  border-radius: 12px;
  padding: 1.8rem 1.5rem;
  text-align: center;
  height: 100%;
}
.feature-icon { font-size: 2rem; color: var(--basil-primary); margin-bottom: 0.8rem; }

/* Method */
.method-figure { text-align: center; margin: 1rem 0 1.5rem; }
.method-figure img { max-width: 640px; width: 100%; }
.method-figure figcaption { color: var(--basil-muted); font-size: 0.95rem; max-width: 760px; margin: 0.6rem auto 0; }
.math-display { text-align: center; margin: 1.4rem 0; }

/* Explorer */
.explorer-intro { text-align: center; color: var(--basil-muted); max-width: 700px; margin: 0 auto 2rem; }
.explorer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.4rem;
}
@media (max-width: 1024px) {
  .explorer-grid { grid-template-columns: 1fr; }
}
.explorer-panel {
  background: #fff;
  border: 1px solid var(--basil-border);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.explorer-panel header { margin-bottom: 1rem; }
.panel-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.2rem; }
.panel-subtitle { color: var(--basil-muted); font-size: 0.9rem; margin: 0; }
.prior-line { font-size: 0.85rem; color: var(--basil-text); background: #fff8ed; border-left: 3px solid var(--basil-accent); padding: 0.4rem 0.7rem; margin: 0.4rem 0 0.8rem; border-radius: 0 4px 4px 0; }
.prior-line code { background: transparent; padding: 0; color: var(--basil-primary); }
.slider-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.6rem;
  margin: 0.6rem 0;
}
.slider-row label { font-weight: 700; font-size: 0.9rem; }
.slider-row output { font-family: 'Source Code Pro', monospace; text-align: right; color: var(--basil-primary); font-weight: 500; }
.slider-row input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--basil-warmup), var(--basil-adaptive));
  outline: none;
}
.slider-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--basil-primary);
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.slider-row input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--basil-primary); cursor: pointer; border: 2px solid #fff;
}
.readouts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.5rem; margin: 0.7rem 0; }
.readouts > div { background: #f5f7fa; border-radius: 6px; padding: 0.5rem 0.7rem; }
.readout-label { display: block; font-size: 0.78rem; color: var(--basil-muted); }
.readout-value { font-family: 'Source Code Pro', monospace; font-weight: 500; color: var(--basil-primary); }
.chips { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.chip {
  background: #eef2f7; border: 1px solid var(--basil-border);
  border-radius: 999px; padding: 0.25rem 0.7rem; font-size: 0.8rem; cursor: pointer;
  color: var(--basil-text);
}
.chip:hover { background: var(--basil-primary); color: #fff; border-color: var(--basil-primary); }
.panel-note, .panel-fallback, .panel-caption { font-size: 0.85rem; color: var(--basil-muted); margin-top: auto; }
.panel-caption { color: var(--basil-text); font-weight: 500; }
.chart { width: 100%; height: 200px; }

/* Warmup timeline */
.warmup-timeline {
  display: flex;
  width: 100%;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--basil-border);
  margin-bottom: 0.6rem;
}
.warmup-timeline .seg {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: #fff;
  text-align: center;
  transition: width 0.08s linear;
  overflow: hidden;
  padding: 0 0.5rem;
}
.seg-warmup { background: var(--basil-warmup); color: #5d3a14; }
.seg-adaptive { background: var(--basil-adaptive); }
.seg-label { font-weight: 700; font-size: 0.95rem; letter-spacing: 0.03em; }
.seg-sub { font-size: 0.68rem; opacity: 0.85; line-height: 1.15; }

/* Results tabs */
.tab-panel { display: none; padding-top: 1rem; }
.tab-panel.is-active { display: block; }
.result-metric { font-size: 1.05rem; margin-bottom: 1rem; }
.tab-panel figure { text-align: center; }
.tab-panel figure img { max-width: 720px; width: 100%; border: 1px solid var(--basil-border); border-radius: 6px; }

.chest-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  max-width: 720px;
  margin: 0 auto;
}
@media (max-width: 640px) {
  .chest-pair { grid-template-columns: 1fr; }
}
.chest-cell { text-align: center; }
.chest-cell img { width: 100%; image-rendering: pixelated; }
.chest-label {
  display: block;
  font-size: 0.9rem;
  color: var(--basil-muted);
  margin-top: 0.4rem;
}

/* Citation */
.citation-block {
  position: relative;
  background: #1f2937;
  color: #f9fafb;
  border-radius: 8px;
  padding: 1.5rem;
  overflow-x: auto;
}
.citation-block pre {
  background: transparent;
  color: inherit;
  padding: 0;
  margin: 0;
  font-size: 0.88rem;
  white-space: pre-wrap;
}
.copy-button {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
}

/* Footer */
.footer { background: #f7f9fc; }
.footer .ack { font-size: 0.92rem; color: var(--basil-muted); max-width: 760px; margin: 0 auto 0.8rem; }
.footer .credit { font-size: 0.85rem; color: var(--basil-muted); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .warmup-timeline .seg { transition: none; }
}
