/* ============================================================
   Spettro Data Dashboard: Redesigned Design System
   Dark terminal aesthetic with refined typographic hierarchy.
   JetBrains Mono throughout for a unified terminal look.
   ============================================================ */

/* ---------- 1. Design Tokens ---------- */
:root {
  color-scheme: dark;

  /* surfaces */
  --bg:            #060707;
  --bg-2:          #0d0e0e;
  --panel:         #131414;
  --panel-2:       #0f1010;
  --panel-elevated: #181a1a;
  --surface-hover: rgba(255, 255, 255, 0.025);
  --tooltip-bg:    #131414;

  /* hairlines: cool gray, very subtle */
  --line:        rgba(255, 255, 255, 0.09);
  --line-soft:   rgba(255, 255, 255, 0.06);
  --line-strong: rgba(255, 255, 255, 0.20);

  /* text: warm off-white hierarchy — matches spettro.app landing */
  --text:  #f4f3ee;
  --muted: rgba(244, 243, 238, 0.70);
  --soft:  rgba(244, 243, 238, 0.50);
  --dim:   rgba(244, 243, 238, 0.36);

  /* accent: teal/mint — matches spettro.app landing */
  --accent:      #2cf0c5;
  --accent-2:    #6affd9;
  --accent-soft: rgba(44, 240, 197, 0.16);
  --accent-glow: rgba(44, 240, 197, 0.25);

  /* semantic deltas */
  --pos: #25e8c0;
  --neg: #f06c6c;

  /* fonts: JetBrains Mono for body, Instrument Serif for display */
  --mono: "JetBrains Mono", "SFMono-Regular", "IBM Plex Mono", "Consolas", monospace;
  --serif: "Instrument Serif", "Playfair Display", Didot, Georgia, serif;

  /* glass language, shared with spettro.app */
  --glass-border: rgba(255, 255, 255, 0.09);
  --glass-border-strong: rgba(255, 255, 255, 0.18);
  --glass-bg: rgba(255, 255, 255, 0.028);
  --glass-bg-hover: rgba(255, 255, 255, 0.05);
  --glass-sheen: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02) 55%);
  --glass-sheen-hover: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.035) 55%);
  --glass-blur: blur(10px);
  --grad-em: linear-gradient(100deg, #d9fff3 0%, #8fe8ff 45%, #e8c8ff 100%);

  --shadow-sm:  0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md:  0 8px 30px rgba(0, 0, 0, 0.35);
  --shadow-lg:  0 26px 70px rgba(0, 0, 0, 0.36);

  /* primary button */
  --btn-grad:   linear-gradient(135deg, #f4fffa 0%, #b6f4e0 100%);
  --btn-grad-h: linear-gradient(135deg, #ffffff 0%, #c8f7e8 100%);

  /* stacked-bar ramp (green → blue → purple) */
  --g1: #2cf0c5;
  --g2: #28d0c8;
  --g3: #2aa2d4;
  --g4: #3875cc;
  --g5: #4856bc;
  --g6: #5648a8;
  --g7: #663894;
  --g8: #76307c;

  /* layout */
  --max-w: 1240px;
  --gutter: 24px;
  --nav-h: 60px;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-pill: 999px;
}

/* ---------- 2. Reset & Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 20px);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: tabular-nums;
  overflow-x: hidden;
}

::selection {
  background: rgba(37, 232, 192, 0.24);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* ---------- 3. Page Shell ---------- */
.page-shell {
  position: relative;
  min-height: 100vh;
}

.page-content {
  position: relative;
  z-index: 1;
}

/* ---------- 4. Top Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--line-soft);
}

.site-header .nav-inner {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* wordmark */
.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.nav-brand .wordmark {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
}
.nav-brand .tag {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--dim);
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 3px;
  letter-spacing: 0.06em;
  text-transform: lowercase;
}

/* center nav links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  flex: 1;
  justify-content: center;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }

.nav-links a {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--soft);
  letter-spacing: -0.01em;
  white-space: nowrap;
  position: relative;
  padding: 2px 0;
  transition: color 0.2s ease;
}
.nav-links a::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--accent);
  border-radius: 1px;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.nav-links a:hover {
  color: var(--text);
}
.nav-links a:hover::after {
  width: 100%;
}

/* right icons */
.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  color: var(--soft);
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.nav-icon:hover {
  color: var(--text);
  border-color: var(--line);
  background: var(--surface-hover);
}
.nav-icon:active {
  transform: scale(0.96);
}
.nav-icon svg { width: 14px; height: 14px; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  background: var(--btn-grad);
  color: #060707;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s ease, box-shadow 0.2s ease;
}
.btn-primary:hover {
  background: var(--btn-grad-h);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--accent-glow);
}
.btn-primary:active {
  transform: translateY(0) scale(0.98);
}

/* ---------- 5. Hero / Header Block ---------- */
.hero-block {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 56px var(--gutter) 40px;
}

.updated-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--soft);
  margin-bottom: 28px;
  background: var(--panel-2);
}
.updated-badge svg { width: 11px; height: 11px; opacity: 0.6; }

.hero-title {
  font-family: var(--serif);
  font-size: clamp(38px, 5.5vw, 56px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.035em;
  color: var(--text);
  margin-bottom: 16px;
}

.hero-intro {
  max-width: 540px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.65;
  font-family: var(--mono);
}

/* ---------- 6. KPI Strip ---------- */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 36px;
}
.kpi-cell {
  background: var(--panel);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}
/* Primary (Total Tokens) cell: clean accent left-bar */
.kpi-cell--primary {
  background: var(--panel);
}
.kpi-cell--primary::before {
  content: '';
  position: absolute;
  left: 0;
  top: 16px;
  bottom: 16px;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--accent);
  opacity: 0.7;
}
.kpi-cell--primary .kpi-value {
  color: var(--accent);
}
.kpi-cell--primary .kpi-label {
  color: var(--accent);
  opacity: 0.55;
}
/* Secondary (Top Model) cell: subtle border accent */
.kpi-cell--secondary {
  background: var(--panel);
}
.kpi-cell--secondary::before {
  content: '';
  position: absolute;
  left: 0;
  top: 16px;
  bottom: 16px;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--accent-2);
  opacity: 0.35;
}
.kpi-cell--secondary .kpi-value {
  color: var(--text);
}
.kpi-cell--secondary .kpi-label {
  color: var(--dim);
}
/* Sub-value line */
.kpi-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  font-family: var(--mono);
}
.kpi-label {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--dim);
}
.kpi-value {
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
@media (max-width: 480px) {
  .kpi-strip { grid-template-columns: 1fr; }
}

/* ---------- 7. Section System ---------- */
.section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
  margin-bottom: 48px;
}

/* Panel variant: content sits inside a rounded card */
.section-panel {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 40px;
}

/* Bare variant: no panel, just padding, for visual rhythm variation */
.section-bare {
  padding: 0;
}

.section-header {
  margin-bottom: 28px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.section-title {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}
.section-subtitle {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  color: var(--dim);
}

/* ---------- 8. Stacked Bar Chart ---------- */
.chart-container {
  width: 100%;
  overflow-x: auto;
  margin-bottom: 32px;
}

/*
 * Responsive chart toggle.
 * Both desktop (50-day) and mobile (20-day) SVGs are rendered into the
 * DOM at build time; only one is ever visible based on viewport width.
 * The breakpoint matches the existing 768px responsive breakpoint used
 * throughout the dashboard.
 */
.chart-desktop { display: block; }
.chart-mobile  { display: none; }
@media (max-width: 767px) {
  .chart-desktop { display: none; }
  .chart-mobile  { display: block; }
}

/*
 * When two chart variants coexist inside a single .chart-container,
 * collapse the margin on the wrapper so only visible chart's bottom
 * spacing is in effect (avoid double-gaps).
 */
.chart-container .chart-desktop + .chart-mobile {
  margin-top: 0;
}
.stacked-chart {
  width: 100%;
  height: 300px;
  display: block;
}
.stacked-chart .bar-segment {
  transition: opacity 0.15s ease;
}
.stacked-chart.has-active .bar-segment {
  opacity: 0.12;
}
.stacked-chart.has-active .bar-segment.active {
  opacity: 1;
}
.stacked-chart .chart-col-hit {
  fill: transparent;
  cursor: crosshair;
}
.chart-date-label {
  font-family: var(--mono);
  font-size: 9px;
  fill: var(--dim);
  text-anchor: middle;
}
.chart-guide-line {
  stroke: var(--line-soft);
  stroke-width: 1;
  stroke-dasharray: 2 4;
}
.chart-grid-line {
  stroke: var(--line-soft);
  stroke-width: 1;
  stroke-dasharray: 2 4;
}
.chart-y-axis-label {
  font-family: var(--mono);
  font-size: 10px;
  fill: var(--dim);
  text-anchor: end;
  dominant-baseline: middle;
}

/* ---------- 8b. Market Share chart + legend ---------- */
.share-chart {
  height: 340px;
}
.share-legend {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 24px;
}
.share-legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  background: var(--panel);
  font-family: var(--mono);
  font-size: 12px;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.share-legend-item:hover {
  background: var(--panel-elevated);
}
.share-legend-item.active {
  background: var(--surface-hover);
  box-shadow: inset 2px 0 0 var(--accent);
}
.share-legend-item .sl-rank {
  color: var(--dim);
  font-size: 10px;
  flex: 0 0 auto;
}
.share-legend-item .sl-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex: 0 0 auto;
}
.share-legend-item .sl-name {
  color: var(--text);
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.share-legend-item .sl-tokens {
  color: var(--dim);
  flex: 0 0 auto;
}
.share-legend-item .sl-share {
  color: var(--text);
  font-weight: 600;
  flex: 0 0 auto;
  min-width: 46px;
  text-align: right;
}
.share-range {
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
  letter-spacing: 0.03em;
}
/* The date-range label uses the same desktop/mobile toggle as the charts */
.share-range-desktop { display: block; }
.share-range-mobile  { display: none; }
@media (max-width: 767px) {
  .share-range-desktop { display: none; }
  .share-range-mobile  { display: block; }
}
@media (max-width: 720px) {
  .share-legend { grid-template-columns: 1fr; }
}

/* ---------- 9. Model Cards ---------- */
.cards-featured {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

/* Perforated divider */
.cards-divider {
  height: 6px;
  margin: 4px 0 20px;
  background-image: radial-gradient(var(--line-strong) 1px, transparent 1.4px);
  background-size: 10px 6px;
  background-repeat: repeat-x;
  background-position: center;
  opacity: 0.5;
}

.model-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 170px;
  overflow: hidden;
}
/* hover effects removed on model cards */
.model-card.featured {
  min-height: 190px;
  background: var(--panel-2);
  border-color: var(--line-soft);
}

/* Watermark logo on featured cards */
.card-watermark-logo {
  position: absolute;
  top: 50%;
  right: -8px;
  transform: translateY(-50%);
  width: 140px;
  height: 140px;
  color: var(--text);
  opacity: 0.04;
  pointer-events: none;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-watermark-logo svg {
  width: 100%;
  height: 100%;
}

.card-top {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.card-rank {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
  font-weight: 400;
  letter-spacing: 0.03em;
}
.card-watermark {
  font-size: 11px;
  color: var(--dim);
  opacity: 0.5;
}

.card-body {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}
.card-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.card-alias {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}
.card-provider {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
}
.card-provider-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: var(--dim);
  opacity: 0.6;
}
.card-provider-logo svg {
  width: 18px;
  height: 18px;
}
/* hover highlight removed on card provider logos */
.card-metric {
  text-align: right;
}
.card-metric-value {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.model-card.featured .card-metric-value {
  font-size: 26px;
}
.card-delta {
  font-family: var(--mono);
  font-size: 11px;
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
}
.card-delta.pos { color: var(--pos); }
.card-delta.neg { color: var(--neg); }
.card-delta.new { color: var(--pos); }

/* ---------- 10. Horizontal Bar List ---------- */
.bar-list {
  display: flex;
  flex-direction: column;
}
.bar-list-headers {
  display: grid;
  gap: 16px;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 4px;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--dim);
}
.bar-list-row {
  display: grid;
  gap: 16px;
  align-items: center;
  padding: 12px 4px;
  border-bottom: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
  position: relative;
  border-radius: 3px;
}
.bar-list-row:hover {
  background: var(--surface-hover);
}
/* Only show a separator on the LAST few rows, not every row */
.bar-list-row:nth-last-child(-n+3) {
  border-bottom: 1px solid var(--line-soft);
}
.bar-list-row:last-child {
  border-bottom: none;
}

.bar-value {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.bar-label {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.15s ease;
}
.bar-list-row:hover .bar-label {
  color: var(--text);
}
.bar-cell {
  position: relative;
  height: 7px;
  background: rgba(255, 255, 255, 0.025);
  border-radius: 2px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- 11. Tooltip ---------- */
.tooltip {
  position: absolute;
  z-index: 200;
  background: var(--tooltip-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text);
  line-height: 1.7;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  box-shadow: var(--shadow-md);
}
.tooltip.visible {
  opacity: 1;
}
.tooltip .tip-label {
  color: var(--dim);
  margin-right: 6px;
}
.tooltip .tip-value {
  color: var(--text);
  font-weight: 600;
}

/* Rich chart tooltip */
.chart-tooltip {
  position: absolute;
  z-index: 200;
  min-width: 200px;
  background: var(--tooltip-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease;
  box-shadow: var(--shadow-md);
}
.chart-tooltip.visible {
  opacity: 1;
}
.chart-tooltip .ct-header {
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-bottom: 1px;
}
.chart-tooltip .ct-total {
  color: var(--dim);
  margin-bottom: 8px;
}
.chart-tooltip .ct-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 1px 0;
  color: var(--dim);
}
.chart-tooltip .ct-row.active {
  color: var(--text);
  font-weight: 600;
}
.chart-tooltip .ct-swatch {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex: 0 0 auto;
}
.chart-tooltip .ct-name {
  flex: 1 1 auto;
  white-space: nowrap;
}
.chart-tooltip .ct-tokens {
  color: var(--text);
  text-align: right;
  flex: 0 0 auto;
}
.chart-tooltip .ct-share {
  color: var(--dim);
  text-align: right;
  flex: 0 0 auto;
  min-width: 40px;
}
.chart-tooltip .ct-row.active .ct-share {
  color: var(--text);
}

/* ---------- 12. Leaderboard Table ---------- */
.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 12px;
}
.leaderboard-table th {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--dim);
  font-weight: 400;
  white-space: nowrap;
}
.leaderboard-table th.num { text-align: right; }
.leaderboard-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.leaderboard-table td.num {
  text-align: right;
  color: var(--text);
}
.leaderboard-table td.alias {
  color: var(--text);
  font-weight: 600;
  font-family: var(--mono);
  font-size: 13px;
}
.leaderboard-table td.provider {
  color: var(--dim);
}
.provider-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}
.provider-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: var(--dim);
  opacity: 0.6;
  flex: 0 0 auto;
}
.provider-logo svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}
/* hover green highlight removed from leaderboard provider logos */
.leaderboard-table td.delta.pos { color: var(--pos); }
.leaderboard-table td.delta.neg { color: var(--neg); }
.leaderboard-table td.delta.new { color: var(--pos); }
.leaderboard-table tbody tr {
  transition: background 0.15s ease;
}
.leaderboard-table tbody tr:hover td {
  background: var(--surface-hover);
}
.leaderboard-table tr:last-child td {
  border-bottom: none;
}

.table-wrapper {
  overflow-x: auto;
}

/* ---------- 13. Footer ---------- */
.site-footer {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 40px var(--gutter) 56px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.footer-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.footer-copyright {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
}
.footer-by {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.footer-by a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.footer-logo {
  height: 14px;
  width: auto;
  display: block;
  filter: grayscale(100%) brightness(1.2);
  opacity: 0.7;
  transition: opacity 0.2s ease, filter 0.2s ease;
}
.footer-by a:hover .footer-logo {
  opacity: 1;
  filter: grayscale(0%) brightness(1);
}
.footer-right {
  display: flex;
  gap: 18px;
}
.footer-right a {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--soft);
  transition: color 0.2s ease;
}
.footer-right a:hover {
  color: var(--text);
}
@media (max-width: 640px) {
  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ---------- 14. Section Variants ---------- */
.bar-list-two-col .bar-list-headers {
  grid-template-columns: 90px 170px 1fr 1fr;
}
.bar-list-two-col .bar-list-row {
  grid-template-columns: 90px 170px 1fr 1fr;
}
.bar-list-one-col .bar-list-headers {
  grid-template-columns: 90px 170px 1fr;
}
.bar-list-one-col .bar-list-row {
  grid-template-columns: 90px 170px 1fr;
}

/* ---------- 15. Responsive ---------- */
@media (max-width: 1024px) {
  .cards-featured {
    grid-template-columns: repeat(2, 1fr);
  }
  .cards-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .section-panel {
    padding: 28px 20px;
  }
  .cards-featured {
    grid-template-columns: 1fr;
  }
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .nav-links {
    display: none;
  }
  .bar-list-two-col .bar-list-headers,
  .bar-list-two-col .bar-list-row {
    grid-template-columns: 70px 130px 1fr;
  }
  .bar-list-two-col .bar-cell.secondary-col {
    display: none;
  }
  .bar-list-one-col .bar-list-headers,
  .bar-list-one-col .bar-list-row {
    grid-template-columns: 70px 130px 1fr;
  }
}

@media (max-width: 480px) {
  .cards-grid {
    grid-template-columns: 1fr;
  }
  .hero-title {
    font-size: 34px;
  }
  .section-panel {
    padding: 20px 16px;
  }
  .kpi-value {
    font-size: 22px;
  }
}

/* ---------- 16. Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .bar-fill {
    transition: none !important;
  }
}

/* ============================================================
   17. GLASS / SERIF COHERENCE — matches spettro.app landing
   Serif display type, gradient italics, frosted glass panels,
   ambient teal/violet glows, scanline overlay.
   ============================================================ */

/* Atmosphere: teal/violet washes on the page background */
body {
  background:
    radial-gradient(circle at 18% 12%, rgba(44, 240, 197, 0.06), transparent 28%),
    radial-gradient(circle at 82% 28%, rgba(44, 240, 197, 0.045), transparent 22%),
    linear-gradient(180deg, #070808 0%, #050606 60%, #070808 100%);
}

/* Faint CRT scanline grid, same as the landing page shell */
.page-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.014) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.012) 1px, transparent 1px);
  background-size: 100% 4px, 4px 100%;
  opacity: 0.16;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 92%);
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 92%);
}

/* Header: glass gradient like the landing header */
.site-header {
  background: rgba(0, 0, 0, 0.70);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(15px) saturate(1.3);
  -webkit-backdrop-filter: blur(15px) saturate(1.3);
}

.nav-brand .tag {
  border-radius: 999px;
  padding: 2px 8px;
}

/* ── Hero ── */

.hero-block {
  position: relative;
  padding-top: 72px;
}

/* Ambient glow behind the hero, echoing the landing hero atmosphere */
.hero-block::before {
  content: "";
  position: absolute;
  top: -4rem;
  left: 50%;
  transform: translateX(-50%);
  width: min(60rem, 100%);
  height: 22rem;
  background:
    radial-gradient(50% 60% at 42% 30%, rgba(44, 240, 197, 0.07), transparent 70%),
    radial-gradient(45% 55% at 68% 45%, rgba(44, 240, 197, 0.04), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.hero-block > * {
  position: relative;
  z-index: 1;
}

/* Serif display headline; Instrument Serif has no bold, keep weight 400 */
.hero-title {
  font-family: var(--serif);
  font-weight: 400;
  font-synthesis: none;
  font-size: clamp(44px, 7vw, 76px);
  line-height: 1.04;
  letter-spacing: -0.015em;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.5);
}

/* Site-signature gradient italic, same stops as the landing hero */
.hero-title em,
.section-title em {
  font-style: italic;
  background: linear-gradient(100deg, #d9fff3 0%, #8fe8ff 45%, #e8c8ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-intro {
  font-size: 15px;
  color: rgba(244, 243, 238, 0.78);
}

/* Updated badge → frosted pill, same family as the landing chips */
.updated-badge {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(12, 18, 22, 0.42);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 6px 14px;
  color: rgba(244, 243, 238, 0.7);
}

/* ── Ambient section glows (alternating corners, teal ↔ violet) ── */

.section {
  position: relative;
}

.section::before {
  content: "";
  position: absolute;
  inset: -24px 0;
  background:
    radial-gradient(42% 55% at 12% 8%, rgba(44, 240, 197, 0.05), transparent 70%),
    radial-gradient(38% 50% at 88% 85%, rgba(44, 240, 197, 0.03), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.section:nth-of-type(even)::before {
  background:
    radial-gradient(42% 55% at 88% 10%, rgba(44, 240, 197, 0.04), transparent 70%),
    radial-gradient(38% 50% at 10% 90%, rgba(44, 240, 197, 0.03), transparent 70%);
}

.section > * {
  position: relative;
  z-index: 1;
}

/* ── Glass panels & cards ── */

.section-panel {
  border: 1px solid var(--glass-border);
  border-radius: 1rem;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Serif section titles, matching the landing's display h2s */
.section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-synthesis: none;
  font-size: clamp(30px, 3.4vw, 40px);
  letter-spacing: -0.01em;
  line-height: 1.06;
}

.kpi-strip {
  gap: 12px;
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: visible;
}

.kpi-cell {
  border: 1px solid var(--glass-border);
  border-radius: 1rem;
  background: var(--glass-sheen);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.kpi-cell--primary::before,
.kpi-cell--secondary::before {
  border-radius: 2px;
  left: -1px;
}

.model-card,
.share-legend-item,
.chart-tooltip,
.tooltip {
  border-color: var(--glass-border);
}

.model-card {
  background: var(--glass-sheen);
  border-radius: 0.9rem;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.model-card.featured {
  background:
    radial-gradient(120% 130% at 15% 0%, rgba(44, 240, 197, 0.05), transparent 55%),
    var(--glass-sheen);
  border-color: rgba(44, 240, 197, 0.18);
}

.share-legend {
  background: var(--glass-border);
  border-color: var(--glass-border);
  border-radius: 1rem;
}

.share-legend-item {
  background: rgba(10, 12, 12, 0.55);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

.share-legend-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* Leaderboard: bare table gains a soft glass frame */
#leaderboard .table-wrapper {
  border: 1px solid var(--glass-border);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.015);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

.leaderboard-table th,
.leaderboard-table td {
  padding-left: 18px;
  padding-right: 18px;
}

/* Tooltips: frosted dark glass */
.tooltip,
.chart-tooltip {
  background: rgba(16, 18, 18, 0.85);
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  border-radius: 0.6rem;
}

/* Bar tracks read as recessed glass */
.bar-cell {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
}

.bar-fill {
  border-radius: 999px;
}

/* Footer wordmark row aligns with glass hairlines */
.site-footer {
  border-top-color: var(--glass-border);
}

/* Header logo image replaces the text wordmark, same as the landing */
.wordmark-img {
  display: block;
  height: 26px;
  width: auto;
}

@media (max-width: 640px) {
  .wordmark-img {
    height: 20px;
  }
}

/* ---------- 16. Leaderboard rank trend ---------- */
.leaderboard-table th.trend-col,
.leaderboard-table td.trend-col {
  padding-left: 0;
  padding-right: 6px;
  width: 34px;
}
.trend {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.trend.up   { color: var(--pos); }
.trend.down { color: var(--neg); }
.trend.flat { color: var(--dim); }
.trend.none { color: var(--dim); opacity: 0.5; }

.leaderboard-table td.alias .model-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.leaderboard-table td.alias .model-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent-glow);
}

/* ---------- 17. Model detail page ---------- */
.back-link {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--soft);
  text-decoration: none;
  margin-bottom: 18px;
  transition: color 0.15s ease;
}
.back-link:hover { color: var(--accent); }

.model-hero-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}
.model-hero-rank {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
}
.model-hero-head .card-delta {
  font-size: 14px;
}
.model-hero-head .delta-note {
  font-size: 10px;
  color: var(--dim);
}
.model-hero-provider {
  display: flex;
  align-items: center;
  gap: 8px;
}
.model-stats {
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 767px) {
  .model-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .model-stats { grid-template-columns: 1fr; }
}

/* Prompt vs completion split bar */
.token-split {
  width: 100%;
}
.token-split-bar {
  height: 14px;
  border-radius: var(--radius-pill);
  background: var(--g4);
  overflow: hidden;
  display: flex;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
}
.token-split-bar .split-prompt {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--g1), var(--g2));
}
.token-split-legend {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}
.split-swatch {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  margin-right: 6px;
}
.split-swatch-prompt { background: var(--g1); }
.split-swatch-completion { background: var(--g4); }
