/* Global layout */
body {
  margin: 0;
  padding: 0;
  background-color: var(--color-bg);
  color: var(--color-text-main);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.interactive-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 16px;
  box-sizing: border-box;
}

/* Header */
.interactive-header {
  max-width: 880px;
  margin: 0 0 28px 0;
  text-align: left;
}

.header-kicker {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-westland);
  margin-bottom: 8px;
}

.header-title {
  font-size: clamp(26px, 3.8vw, 38px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 12px 0;
  color: var(--color-text-main);
}

.header-dek {
  font-size: clamp(15px, 1.7vw, 18px);
  color: var(--color-text-muted);
  line-height: 1.45;
  margin: 0 0 14px 0;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--color-text-subtle);
  font-weight: 500;
}

.meta-divider {
  opacity: 0.5;
}

/* Scrolly layout */
.scrolly-layout {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  position: relative;
  gap: 28px;
}

/* Sticky stage wrapper */
.graphic-stage-wrapper {
  flex: 1 1 58%;
  position: sticky;
  top: 16px;
  height: calc(100vh - 32px);
  max-height: 640px;
  min-height: 480px;
  display: flex;
  flex-direction: column;
}

.graphic-stage {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  width: 100%;
  height: 100%;
  padding: 10px 10px 4px 10px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

#stage-svg {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  display: block;
}

.stage-legend {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 6px 10px;
  border-top: 1px solid var(--color-border);
  font-size: 11px;
  color: var(--color-text-muted);
  background: var(--color-surface);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-pill {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}

/* Narrative flow */
.narrative-flow {
  flex: 1 1 42%;
  display: flex;
  flex-direction: column;
  gap: 35vh;
  padding-bottom: 20vh;
}

.step {
  min-height: 55vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.step-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-md);
  box-sizing: border-box;
  width: 100%;
}

.step-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: var(--color-surface-alt);
  color: var(--color-text-muted);
  margin-bottom: 12px;
  border: 1px solid var(--color-border);
}

.step-card h2 {
  font-size: 21px;
  font-weight: 700;
  margin: 0 0 12px 0;
  color: var(--color-text-main);
  line-height: 1.25;
}

.step-card p {
  font-size: 14.5px;
  color: var(--color-text-muted);
  margin: 0 0 12px 0;
  line-height: 1.5;
}

.step-card p:last-child {
  margin-bottom: 0;
}

.matchup-list {
  margin: 12px 0;
  padding-left: 18px;
  font-size: 14px;
  color: var(--color-text-muted);
}

.matchup-list li {
  margin-bottom: 8px;
}

.subtext {
  font-size: 13px !important;
  color: var(--color-text-subtle) !important;
}

.step-stat-callout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 16px 0;
  padding: 12px;
  background: var(--color-surface-alt);
  border-radius: var(--radius-md);
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-num {
  font-size: 28px;
  font-weight: 800;
  color: var(--color-westland);
  line-height: 1;
}

.stat-label {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.step-cite {
  margin-top: 14px;
  font-size: 11px;
  color: var(--color-text-subtle);
  border-top: 1px dashed var(--color-border);
  padding-top: 8px;
}

/* Comparison table */
.comparison-summary-table {
  margin: 16px 0 8px 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  font-size: 13px;
}

.comp-row {
  display: grid;
  grid-template-columns: 2fr 1.5fr 1.5fr;
  padding: 8px 10px;
  border-bottom: 1px solid var(--color-border);
}

.comp-row:last-child {
  border-bottom: none;
}

.comp-header {
  background: var(--color-surface-alt);
  font-weight: 700;
  color: var(--color-text-main);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.team-col {
  text-align: right;
  font-weight: 600;
}

.team-col.westland {
  color: var(--color-westland);
}

.team-col.perrysburg {
  color: var(--color-perrysburg);
}

/* Footer */
.interactive-footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
  font-size: 13px;
  color: var(--color-text-subtle);
}

.footer-sources h3 {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-main);
  margin: 0 0 8px 0;
}

.footer-sources ul {
  margin: 0 0 16px 0;
  padding-left: 20px;
}

.footer-sources li {
  margin-bottom: 6px;
  line-height: 1.45;
}

.footer-note {
  margin: 0;
  font-style: italic;
}

/* SVG Chart Typography & Styling */
.chart-title {
  font-size: 15px;
  font-weight: 700;
  fill: var(--color-text-main);
}

.chart-subtitle {
  font-size: 12px;
  fill: var(--color-text-subtle);
}

.chart-label {
  font-size: 12px;
  fill: var(--color-text-main);
  font-weight: 500;
}

.chart-label-bold {
  font-size: 12px;
  fill: var(--color-text-main);
  font-weight: 700;
}

.chart-label-subtle {
  font-size: 11px;
  fill: var(--color-text-subtle);
}

/* Responsive mobile reflow */
@media (max-width: 820px) {
  .interactive-container {
    padding: 12px 10px;
  }

  .interactive-header {
    margin-bottom: 16px;
  }

  .scrolly-layout {
    flex-direction: column;
    gap: 16px;
  }

  .graphic-stage-wrapper {
    position: sticky;
    top: 6px;
    width: 100%;
    height: 40vh;
    min-height: 310px;
    max-height: 350px;
    z-index: 10;
  }

  .graphic-stage {
    padding: 6px 8px 2px 8px;
  }

  .stage-legend {
    padding: 4px 6px;
    font-size: 10px;
    gap: 8px;
  }

  .narrative-flow {
    width: 100%;
    gap: 25vh;
    padding-bottom: 15vh;
  }

  .step {
    min-height: auto;
  }

  .step-card {
    padding: 16px;
  }

  .chart-label,
  .chart-label-bold {
    font-size: 12px;
  }

  .comp-row {
    font-size: 12px;
    padding: 6px 8px;
  }
}