/* ===== StreamMA project page styles =====
 * On top of Bulma 0.9.4 (loaded from CDN).
 */

:root {
  --stream-green: #2f9e6e;
  --stream-green-dark: #176c4d;
  --stream-green-soft: #e7f4ec;
  --serial-blue: #4f6f9a;
  --serial-blue-soft: #e3eaf3;
  --accent-amber: #d68a2b;
  --accent-red: #c0392b;
  --ink: #1f2937;
  --ink-soft: #4b5563;
  --paper: #ffffff;
  --paper-tint: #f7f9fb;
  --rule: #e5e7eb;
  --serif: 'Noto Serif', 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', Menlo, monospace;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ----- Hero ----- */
.hero-banner {
  padding: 4.5rem 1.5rem 2.5rem;
  text-align: center;
  background: linear-gradient(180deg, #fbfdfc 0%, #f1f7f4 100%);
  border-bottom: 1px solid var(--rule);
}
.hero-title {
  font-family: var(--sans);
  font-size: 3.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 0.4rem;
}
.hero-title .accent { color: var(--stream-green-dark); }
.hero-logo {
  width: 3rem;
  height: 3rem;
  vertical-align: -0.55rem;
  margin-right: 0.55rem;
  border-radius: 0.55rem;
  box-shadow: 0 2px 6px rgba(15, 60, 38, 0.18);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s ease;
}
.hero-title:hover .hero-logo,
.hero-logo:hover {
  transform: translateY(-3px) scale(1.08) rotate(-2deg);
  box-shadow: 0 8px 18px rgba(15, 60, 38, 0.32);
}
.hero-subtitle {
  font-family: var(--serif);
  font-size: 1.55rem;
  font-style: italic;
  color: var(--ink-soft);
  margin: 0 0 0.6rem;
}
.hero-highlight {
  display: inline-block;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 1px solid #f59e0b;
  border-radius: 999px;
  padding: 0.3rem 1.2rem;
  font-size: 0.95rem;
  color: #92400e;
  margin-bottom: 1.2rem;
}

/* ----- SimpleBench highlight ----- */
.simplebench-highlight {
  max-width: 480px;
  margin: 1.5rem auto 1rem;
  background: #fff;
  border: 2px solid #f59e0b;
  border-radius: 14px;
  padding: 1rem 1.4rem;
  box-shadow: 0 4px 16px rgba(245,158,11,0.1);
}
.sb-header {
  font-size: 1rem;
  font-weight: 700;
  color: #92400e;
  text-align: center;
  margin-bottom: 0.7rem;
}
.sb-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.sb-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  font-size: 0.85rem;
}
.sb-row.sb-ours {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  font-weight: 700;
}
.sb-rank {
  width: 1.8rem;
  text-align: center;
  flex-shrink: 0;
}
.sb-model {
  flex: 1;
}
.sb-score {
  font-weight: 700;
  color: var(--stream-green-dark);
}
.sb-row.sb-ours .sb-score {
  color: #92400e;
  font-size: 1rem;
}
.sb-note {
  margin-top: 0.5rem;
  font-size: 0.72rem;
  color: #9ca3af;
  text-align: center;
}
.sb-note a { color: #9ca3af; text-decoration: underline; }
.hero-slogan {
  display: inline-block;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--stream-green-dark);
  background: var(--stream-green-soft);
  border: 1px solid #b9dccb;
  padding: 0.55rem 1.2rem;
  border-radius: 999px;
  margin-bottom: 1.8rem;
}

/* author block */
.author-list {
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
}
.author-list a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px dashed transparent;
}
.author-list a:hover { border-bottom-color: var(--stream-green-dark); color: var(--stream-green-dark); }
.author-list sup { color: var(--accent-amber); font-weight: 700; }
.affiliation {
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin-bottom: 0.3rem;
}
.contact { font-size: 0.85rem; color: var(--ink-soft); margin-bottom: 1.6rem; }

/* link button group */
.link-buttons {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 0.8rem;
}
.link-buttons a.button {
  background: #1f2937;
  color: #fff;
  border: none;
  border-radius: 999px;
  font-weight: 600;
  padding: 0.55rem 1.1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: background 0.15s;
}
.link-buttons a.button:hover { background: var(--stream-green-dark); color: #fff; }
.link-buttons a.button .icon { font-size: 1rem; }

/* ----- Section scaffold ----- */
.section-block {
  max-width: 1080px;
  margin: 0 auto;
  padding: 3rem 1.5rem 2rem;
}
.section-title {
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 0.4rem;
  text-align: center;
}
.section-sub {
  font-size: 1rem;
  color: var(--ink-soft);
  text-align: center;
  margin-bottom: 1.8rem;
}
.divider-rule {
  height: 1px;
  background: var(--rule);
  max-width: 1080px;
  margin: 0 auto;
}

/* ----- TL;DR cards ----- */
.tldr-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.4rem 1.5rem 0;
}
.tldr-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 16px;
  padding: 1.4rem 1.2rem;
  text-align: center;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
  transition: transform 0.15s, box-shadow 0.15s;
}
.tldr-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(23,108,77,0.08); }
.tldr-num {
  font-family: var(--sans);
  font-size: 2.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--stream-green-dark);
  line-height: 1.05;
}
.tldr-num .unit { font-size: 1.4rem; color: var(--ink-soft); font-weight: 600; }
.tldr-label {
  margin-top: 0.4rem;
  font-size: 0.95rem;
  color: var(--ink-soft);
}
.tldr-foot { margin-top: 0.3rem; font-size: 0.75rem; color: #9ca3af; font-style: italic; white-space: nowrap; }
@media (max-width: 768px) {
  .tldr-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-title { font-size: 2.6rem; }
  .hero-subtitle { font-size: 1.2rem; }
  .hero-logo { width: 2.2rem; height: 2.2rem; vertical-align: -0.4rem; margin-right: 0.4rem; border-radius: 0.4rem; }
}

/* ----- Contributions box ----- */
.contributions-box {
  max-width: 780px;
  margin: 1.5rem auto 2rem;
  background: linear-gradient(135deg, #f0faf4 0%, #e8f5ee 100%);
  border: 1px solid #b9dccb;
  border-radius: 16px;
  padding: 1.4rem 1.8rem;
  box-shadow: 0 4px 20px rgba(47,158,110,0.06);
}
.contributions-heading {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--stream-green-dark);
  margin: 0 0 1rem;
  text-align: center;
}
.contributions-items {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.contrib-item {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  background: #fff;
  border: 1px solid #d4ead9;
  border-radius: 10px;
  padding: 0.8rem 1rem;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.15s;
  cursor: default;
}
.contrib-item:hover {
  transform: translateY(-3px);
  border-color: var(--stream-green-dark);
  box-shadow: 0 8px 22px rgba(47,158,110,0.18), 0 0 0 1px rgba(47,158,110,0.18);
}
.contrib-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}
.contrib-item strong {
  color: var(--ink);
}
.contrib-item div {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--ink-soft);
}
@media (max-width: 600px) {
  .contributions-box { padding: 1rem; }
}

/* ----- Hero animation panel ----- */
.hero-anim-wrap {
  background: var(--paper-tint);
  border: 1px solid var(--rule);
  border-radius: 18px;
  padding: 1.5rem 1.2rem 1.2rem;
  max-width: 1080px;
  margin: 1.2rem auto 0;
}
.hero-anim-svg { width: 100%; height: auto; display: block; }

/* Forward arrows: light-pulse flowing along the path */
.flow-base {
  stroke-linecap: round;
}
.flow-glow {
  stroke-dasharray: 14 36;
  stroke-linecap: round;
  filter: blur(1.2px);
  animation: flow-light 1.2s linear infinite;
}
@keyframes flow-light {
  to { stroke-dashoffset: -50; }
}

.hero-anim-caption {
  text-align: center;
  font-size: 0.92rem;
  color: var(--ink-soft);
  margin-top: 0.6rem;
}
.hero-anim-toggle {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.6rem;
}
.hero-anim-toggle button {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0.32rem 0.9rem;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--ink);
  font-family: var(--sans);
  transition: all 0.15s;
}
.hero-anim-toggle button.active,
.hero-anim-toggle button:hover {
  background: var(--stream-green-dark);
  color: #fff;
  border-color: var(--stream-green-dark);
}

.hero-anim-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.5rem auto 0;
  max-width: 760px;
  padding: 0 0.6rem;
}
.hero-anim-controls button {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid var(--rule);
  background: #fff;
  cursor: pointer;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  transition: background 0.15s, color 0.15s;
  padding: 0;
}
.hero-anim-controls button:hover {
  background: var(--stream-green-dark);
  color: #fff;
  border-color: var(--stream-green-dark);
}
.hero-anim-controls input[type="range"] {
  flex: 1;
  accent-color: var(--stream-green-dark);
  cursor: pointer;
  height: 4px;
}
.hero-anim-controls #hero-anim-time {
  font-size: 0.78rem;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  min-width: 3.2em;
  text-align: right;
  font-family: var(--mono, monospace);
}

/* ----- Abstract ----- */
.abstract-content {
  max-width: 880px;
  margin: 0 auto;
  font-family: var(--serif);
  font-size: 1.08rem;
  line-height: 1.75;
  color: var(--ink);
}
.abstract-content p { margin-bottom: 0.8rem; }
.abstract-content em { color: var(--stream-green-dark); font-style: italic; }
.abstract-content strong { color: var(--accent-red); }

/* ----- Insight (case study) ----- */
.insight-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  margin-top: 1.2rem;
}
.insight-panel {
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 1.2rem 1rem;
  background: #fff;
}
.insight-panel.serial { border-top: 4px solid var(--serial-blue); }
.insight-panel.stream { border-top: 4px solid var(--stream-green); }
.insight-panel h4 {
  font-weight: 700;
  font-size: 1.05rem;
  margin: 0 0 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.insight-panel.serial h4 { color: var(--serial-blue); }
.insight-panel.stream h4 { color: var(--stream-green-dark); }
.insight-verdict {
  text-align: center;
  font-weight: 700;
  margin-top: 0.6rem;
  padding: 0.4rem;
  border-radius: 8px;
  font-size: 0.95rem;
}
.insight-verdict.wrong { background: #fdecea; color: var(--accent-red); }
.insight-verdict.right { background: var(--stream-green-soft); color: var(--stream-green-dark); }
.insight-conclusion {
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.18rem;
  color: var(--ink);
  margin-top: 1.4rem;
  padding: 1rem;
  border-left: 4px solid var(--stream-green);
  background: var(--stream-green-soft);
  border-radius: 0 10px 10px 0;
}
@media (max-width: 768px) { .insight-grid { grid-template-columns: 1fr; } }

/* ----- Result group headers ----- */
.result-group-header {
  text-align: center;
  margin: 2.5rem auto 0.5rem;
  max-width: 700px;
}
.result-group-header h3 {
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--ink);
  margin: 0.3rem 0 0;
}
.result-group-label {
  display: inline-block;
  background: var(--stream-green-dark);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.32rem 1.05rem;
  border-radius: 999px;
  margin-bottom: 0.55rem;
}
/* subsection titles under result groups */
#perturb .section-title,
#results .section-title,
#scaling .section-title,
#pareto .section-title {
  font-size: 1.35rem;
}

/* ----- Theorem tabs ----- */
.theorem-tabs {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
}
.theorem-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  border: 2px solid #b9dccb;
  border-radius: 999px;
  background: #fff;
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s;
}
.theorem-tab:hover {
  border-color: var(--stream-green-dark);
  background: #f3faf6;
}
.theorem-tab.active {
  border-color: var(--stream-green-dark);
  background: var(--stream-green-dark);
  color: #fff;
}
.theorem-tab.active .theorem-tag {
  background: #fff;
  color: var(--stream-green-dark);
}
.theorem-panels {
  max-width: 780px;
  margin: 0 auto;
}
.theorem-panel {
  display: none;
  background: #f3faf6;
  border: 1px solid #b9dccb;
  border-radius: 12px;
  padding: 1.2rem 1.4rem;
  text-align: center;
}
.theorem-panel.active {
  display: block;
}
.theorem-brief {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
  margin-bottom: 0.5rem;
}
@media (max-width: 600px) {
  .theorem-tabs { flex-direction: column; align-items: center; }
}
.theorem-tag {
  display: inline-block;
  background: var(--stream-green-dark);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.theorem-name { font-weight: 700; font-size: 1.05rem; margin-bottom: 0.4rem; color: var(--ink); }
.theorem-formula {
  font-size: 0.92rem;
  background: #fff;
  border: 1px solid #d4ead9;
  border-radius: 8px;
  padding: 0.6rem;
  margin: 0.6rem auto;
  overflow-x: auto;
  display: inline-block;
}
.theorem-note { font-size: 0.85rem; color: var(--ink-soft); }
.theorem-note strong { color: var(--stream-green-dark); }

/* six regime mini-grid inside theorem 1 — single row */
.regime-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.3rem;
  margin: 0.5rem auto;
  max-width: 500px;
}
.regime-mini {
  border: 1px solid #d4ead9;
  border-radius: 6px;
  padding: 0.2rem;
  background: #fff;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.15s, box-shadow 0.15s, background 0.15s;
  text-align: center;
  transform-origin: center;
}
.regime-mini svg { max-height: 28px; }
.regime-mini:hover {
  transform: scale(1.45);
  z-index: 2;
  position: relative;
  border-color: var(--stream-green-dark);
  box-shadow: 0 8px 18px rgba(47,158,110,0.25), 0 0 0 2px rgba(47,158,110,0.25);
  background: #fff;
}
.regime-mini.active {
  border-color: var(--stream-green-dark);
  box-shadow: 0 0 0 2px rgba(47,158,110,0.25);
  background: #f3f9f3;
}
.regime-mini .lbl { font-size: 0.65rem; color: var(--ink-soft); }
.regime-detail {
  margin-top: 0.4rem;
  font-size: 0.78rem;
  background: #fff;
  border: 1px dashed #d4ead9;
  border-radius: 6px;
  padding: 0.4rem 0.5rem;
  font-family: var(--mono);
  color: var(--ink);
}

/* ----- Perturbation panel ----- */
.perturb-wrap {
  max-width: 820px;
  margin: 1.2rem auto 0;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 1.2rem;
}
.perturb-callout {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.8rem;
}
.perturb-callout .left  { color: var(--stream-green-dark); }
.perturb-callout .right { color: var(--accent-red); }

/* ----- Perturbation interactive playground ----- */
.perturb-playground {
  margin: 0.4rem auto 1rem;
  padding: 1rem 1.2rem 0.9rem;
  background: linear-gradient(180deg, #f8faf6 0%, #f3f7ee 100%);
  border: 1px dashed #b6cdb9;
  border-radius: 14px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
  max-width: 760px;
}
.pp-title {
  font-size: 0.86rem;
  color: #4b5563;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.01em;
}
.pp-mask {
  display: flex;
  gap: 8px;
  justify-content: center;
}
.pp-mask span {
  width: 36px; height: 36px;
  border-radius: 5px;
  border: 1.5px solid #9ca3af;
  background: #fff;
  transition: background 0.18s, border-color 0.18s, transform 0.18s;
  display: inline-block;
}
.pp-mask span.perturbed {
  background: #374151;
  border-color: #374151;
  transform: scale(1.06);
}
.pp-slider {
  width: 80%;
  margin: 0.1rem auto 0;
  accent-color: #d68a2b;
  cursor: pointer;
  height: 4px;
}
.pp-axis {
  display: flex;
  justify-content: space-between;
  width: 80%;
  margin: -0.1rem auto 0.3rem;
  font-size: 0.74rem;
  color: var(--ink-soft);
}
.pp-axis-end { font-weight: 600; }
.pp-axis-mid { color: #9ca3af; font-style: italic; }
.pp-bars {
  display: grid;
  grid-template-rows: auto auto;
  gap: 6px;
  max-width: 600px;
  margin: 0.2rem auto 0;
  width: 100%;
}
.pp-bar {
  display: grid;
  grid-template-columns: 60px 1fr 60px;
  align-items: center;
  gap: 10px;
  font-size: 0.84rem;
  font-weight: 700;
}
.pp-bar-label { text-align: right; }
.pp-bar-val { font-variant-numeric: tabular-nums; color: #1f2937; }
.pp-bar-track {
  height: 14px;
  background: #eef2ec;
  border-radius: 5px;
  overflow: hidden;
}
.pp-bar-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 0.22s ease, background 0.18s;
}
.pp-fill-serial { background: #bdd3e8; }
.pp-fill-stream { background: #f2d2a8; }
.pp-meta {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.9rem;
  margin-top: 0.2rem;
  font-size: 0.86rem;
  flex-wrap: wrap;
}
.pp-delta {
  padding: 3px 12px;
  border-radius: 999px;
  background: #eef2f7;
  color: #6b7280;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  transition: background 0.18s, color 0.18s;
}
.pp-delta.pos { background: #d4f0dd; color: #176c4d; }
.pp-delta.neg { background: #fde2dd; color: #c0392b; }
.pp-case {
  font-style: italic;
  color: #6b7280;
  font-size: 0.8rem;
  text-align: center;
  max-width: 460px;
}

/* Toggle button to reveal the full 6-case SVG */
.perturb-toggle-wrap {
  display: flex;
  justify-content: center;
  margin: 0.8rem 0 0.4rem;
}
.perturb-toggle-btn {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0.4rem 1.1rem;
  font-size: 0.85rem;
  font-family: var(--sans);
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s;
}
.perturb-toggle-btn:hover,
.perturb-toggle-btn[aria-expanded="true"] {
  background: var(--stream-green-dark);
  color: #fff;
  border-color: var(--stream-green-dark);
}
.perturb-svg-wrap {
  margin-top: 0.4rem;
}

/* ----- Main results table ----- */
.results-table-wrap { overflow-x: auto; max-width: 820px; margin: 0 auto; }
.results-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.78rem;
}
.results-table th, .results-table td {
  border-bottom: 1px solid var(--rule);
  padding: 0.35rem 0.4rem;
  text-align: center;
}
.results-table thead th {
  background: var(--paper-tint);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.results-table tr.stream-row {
  background: #f1f5f9;
  font-weight: 700;
}
.results-table tr.stream-row td.method-cell {
  color: var(--stream-green-dark);
}
.results-table td.method-cell {
  text-align: left;
  font-weight: 600;
}
.results-table td.model-cell {
  text-align: center;
  font-weight: 600;
  color: var(--ink-soft);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  padding: 0.6rem 0.3rem;
}
.results-table td.avg-col { font-weight: 700; }
.results-table tr.stream-row td.avg-col { color: var(--stream-green-dark); }

/* ----- Scaling law twin panel ----- */
.scaling-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  margin-top: 1rem;
}
.scaling-card {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 1rem;
}
.scaling-card h4 {
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-align: center;
  font-size: 1rem;
}
@media (max-width: 768px) { .scaling-grid { grid-template-columns: 1fr; } }

/* ----- Pareto ----- */
.pareto-wrap {
  max-width: 680px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 1rem;
}
.pareto-callout {
  background: var(--stream-green-soft);
  border-left: 4px solid var(--stream-green);
  border-radius: 0 8px 8px 0;
  padding: 0.7rem 1rem;
  margin-top: 0.8rem;
  font-size: 0.95rem;
  color: var(--ink);
}
.pareto-callout strong { color: var(--stream-green-dark); }

/* ----- BibTeX ----- */
.bibtex-wrap {
  position: relative;
  max-width: 880px;
  margin: 0 auto;
}
.bibtex-wrap pre {
  background: #1f2937;
  color: #e5e7eb;
  padding: 1.2rem;
  border-radius: 12px;
  font-family: var(--mono);
  font-size: 0.85rem;
  overflow-x: auto;
}
.bibtex-copy {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  border-radius: 6px;
  padding: 0.25rem 0.7rem;
  font-size: 0.78rem;
  cursor: pointer;
}
.bibtex-copy:hover { background: rgba(255,255,255,0.25); }

/* ----- Footer ----- */
.page-footer {
  background: var(--paper-tint);
  border-top: 1px solid var(--rule);
  padding: 2rem 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-top: 2.5rem;
}
.page-footer a { color: var(--stream-green-dark); text-decoration: none; }
.page-footer a:hover { text-decoration: underline; }
.footer-logo {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  opacity: 0.85;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.footer-logo:hover { opacity: 1; transform: translateY(-2px); }

/* ----- Misc utility ----- */
.kbd-pill {
  font-family: var(--mono);
  font-size: 0.85rem;
  padding: 0.08rem 0.45rem;
  background: #eef2f6;
  border: 1px solid var(--rule);
  border-radius: 6px;
}
.tick  { color: var(--stream-green-dark); font-weight: 700; }
.cross { color: var(--accent-red); font-weight: 700; }

/* ----- Interactive chart helpers ----- */
#chart-tooltip {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  background: rgba(31, 41, 55, 0.94);
  color: #fff;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  font-family: var(--sans);
  font-size: 0.78rem;
  line-height: 1.45;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  opacity: 0;
  transform: translate(-50%, calc(-100% - 10px));
  transition: opacity 0.12s ease;
  max-width: 300px;
  white-space: nowrap;
}
#chart-tooltip.visible { opacity: 1; }
#chart-tooltip .tt-title {
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 0.18rem;
}
#chart-tooltip .tt-row { display: flex; justify-content: space-between; gap: 0.6rem; }
#chart-tooltip .tt-row .k { color: #cbd5e1; }
#chart-tooltip .tt-row .v { font-weight: 600; }
#chart-tooltip .tt-foot {
  margin-top: 0.25rem;
  padding-top: 0.25rem;
  border-top: 1px solid rgba(255,255,255,0.18);
  font-style: italic;
  color: #cbd5e1;
  white-space: normal;
}

/* clickable cells / points */
.chart-clickable { cursor: pointer; transition: opacity 0.12s, filter 0.12s; }
.chart-clickable:hover { filter: brightness(1.08) drop-shadow(0 0 3px rgba(47,158,110,0.45)); }
.chart-dim { opacity: 0.18; }

/* Heatmap cells: pop out and scale on hover */
.heatmap-cell {
  transition: transform 0.18s ease, filter 0.12s;
  transform-box: fill-box;
  transform-origin: center;
}
.heatmap-cell:hover {
  transform: scale(1.35);
  filter: brightness(1.06) drop-shadow(0 4px 8px rgba(47,158,110,0.45));
}
.chart-emphasised { filter: drop-shadow(0 0 4px rgba(47,158,110,0.65)); }

.chart-legend-item {
  cursor: pointer;
  user-select: none;
}
.chart-legend-item.disabled { opacity: 0.32; }
.chart-axis-tick {
  cursor: pointer;
  user-select: none;
}
.chart-axis-tick:hover { fill: var(--stream-green-dark) !important; font-weight: 700; }
.chart-axis-tick.active { fill: var(--stream-green-dark) !important; font-weight: 700; }

.perturb-group-label {
  cursor: pointer;
  user-select: none;
  transition: filter 0.12s;
}
.perturb-group-label:hover { filter: drop-shadow(0 0 3px rgba(0,0,0,0.18)); }
.perturb-group-label.active text { text-decoration: underline; }
.perturb-row { transition: opacity 0.15s; }

.chart-help {
  font-size: 0.78rem;
  color: var(--ink-soft);
  text-align: center;
  margin-top: 0.4rem;
  font-style: italic;
}
.chart-help .kbd-pill { font-style: normal; }
