:root {
  --bg: #f4efe6;
  --paper: rgba(255, 252, 246, 0.84);
  --ink: #122027;
  --muted: #56656b;
  --line: rgba(18, 32, 39, 0.12);
  --accent: #aa2e25;
  --accent-deep: #7d1f19;
  --navy: #173a52;
  --gold: #c58f2e;
  --olive: #5b6958;
  --shadow: 0 22px 60px rgba(26, 38, 43, 0.14);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --max-width: 1380px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(197, 143, 46, 0.18), transparent 25%),
    radial-gradient(circle at 85% 15%, rgba(23, 58, 82, 0.16), transparent 22%),
    linear-gradient(180deg, #f7f2e8 0%, #efe7da 100%);
  color: var(--ink);
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(18, 32, 39, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18, 32, 39, 0.03) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.36), transparent 80%);
}

.page-shell {
  width: min(calc(100% - 40px), var(--max-width));
  margin: 0 auto;
  padding: 32px 0 64px;
}

main > .panel,
main > .methodology {
  margin-top: 18px;
}

.hero,
.panel,
.control-bar {
  backdrop-filter: blur(16px);
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(320px, 0.9fr);
  gap: 28px;
  padding: 34px;
  border-radius: 34px;
  overflow: hidden;
}

.eyebrow,
.section-tag,
.meta-label,
.mini-label {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.73rem;
  color: var(--muted);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  font-weight: 700;
  line-height: 0.98;
}

h1 {
  font-size: clamp(3rem, 6vw, 5.8rem);
  max-width: 11ch;
}

h2 {
  font-size: clamp(2rem, 3vw, 2.8rem);
}

h3 {
  font-size: 1.25rem;
  line-height: 1.2;
}

.lede,
.panel p,
.method-card p,
.legend-item p,
.story-list p {
  color: var(--muted);
  line-height: 1.65;
  font-size: 1rem;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 8px;
}

.hero-meta strong,
.oil-summary strong {
  display: block;
  margin-top: 8px;
  font-size: 1.05rem;
  line-height: 1.4;
}

.method-card {
  border-left: 1px solid var(--line);
  padding-left: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
}

.method-title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink);
}

.ghost-button,
.segmented button {
  appearance: none;
  border: none;
  cursor: pointer;
  transition:
    background 180ms ease,
    color 180ms ease,
    transform 180ms ease,
    opacity 180ms ease;
}

.ghost-button {
  align-self: flex-start;
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(18, 32, 39, 0.06);
  color: var(--ink);
  font-weight: 600;
}

.ghost-button:hover,
.segmented button:hover {
  transform: translateY(-1px);
}

.control-bar {
  margin-top: 22px;
  padding: 18px 22px;
  border-radius: 24px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.segmented {
  display: inline-flex;
  padding: 6px;
  border-radius: 999px;
  background: rgba(18, 32, 39, 0.06);
  gap: 6px;
  flex-wrap: wrap;
}

.segmented button {
  padding: 12px 18px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.segmented button.active {
  background: var(--navy);
  color: #fff;
}

.range-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
}

.switch {
  position: relative;
  display: inline-flex;
  width: 56px;
  height: 32px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(18, 32, 39, 0.16);
}

.slider::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 12px rgba(18, 32, 39, 0.2);
  transition: transform 180ms ease;
}

.switch input:checked + .slider {
  background: rgba(170, 46, 37, 0.42);
}

.switch input:checked + .slider::before {
  transform: translateX(24px);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.kpi-card {
  padding: 24px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.96), rgba(247, 241, 231, 0.92));
  border: 1px solid rgba(18, 32, 39, 0.08);
  box-shadow: var(--shadow);
}

.kpi-card strong {
  display: block;
  margin-top: 12px;
  font-size: clamp(1.9rem, 4vw, 3.2rem);
  line-height: 0.95;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
}

.kpi-card p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(360px, 0.95fr);
  gap: 18px;
  margin-top: 18px;
}

.span-two {
  grid-column: 1 / -1;
}

.panel {
  position: relative;
  padding: 28px;
  border-radius: var(--radius-xl);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin-bottom: 18px;
}

.panel-note {
  max-width: 36ch;
  text-align: right;
}

.chart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  gap: 18px;
  align-items: stretch;
}

.energy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.energy-card {
  padding: 22px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.46), rgba(255, 248, 238, 0.68));
}

.energy-card-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.segmented-tight {
  padding: 4px;
  gap: 4px;
}

.segmented-tight button {
  padding: 9px 12px;
  font-size: 0.82rem;
}

.chart-card,
.legend-card,
.story-grid article {
  border-radius: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.46), rgba(255, 248, 238, 0.68));
}

.chart-card {
  padding: 16px;
}

.legend-card {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.legend-item {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  margin-top: 6px;
}

.legend-item strong {
  display: block;
  font-size: 1rem;
}

svg {
  width: 100%;
  height: auto;
  display: block;
}

.oil-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.live-status {
  margin: -2px 0 16px;
  font-size: 0.92rem;
  color: var(--muted);
}

.interactive-chart-shell {
  position: relative;
}

.chart-hover-card {
  position: absolute;
  min-width: 140px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(18, 32, 39, 0.92);
  color: #fff;
  box-shadow: 0 16px 32px rgba(18, 32, 39, 0.22);
  pointer-events: none;
  z-index: 2;
}

.chart-hover-card strong,
.chart-hover-card span {
  display: block;
}

.chart-hover-card strong {
  font-size: 0.9rem;
}

.chart-hover-card span {
  margin-top: 4px;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.82);
}

.oil-equivalence {
  margin-top: 14px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(23, 58, 82, 0.07);
  color: var(--ink);
  line-height: 1.55;
}

.comparison-card {
  margin-top: 18px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.46), rgba(255, 248, 238, 0.68));
}

.comparison-header {
  margin-bottom: 14px;
}

.comparison-header h3 {
  margin-top: 8px;
}

.comparison-list {
  display: grid;
  gap: 12px;
}

.comparison-item {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(160px, 0.9fr);
  gap: 16px;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid rgba(18, 32, 39, 0.08);
}

.comparison-item:first-child {
  border-top: none;
  padding-top: 0;
}

.comparison-item-active {
  background: rgba(23, 58, 82, 0.05);
  border-radius: 16px;
  padding: 14px;
  border-top: none;
}

.comparison-item-active + .comparison-item {
  border-top: none;
}

.comparison-copy p {
  margin: 6px 0 0;
}

.comparison-metric span {
  display: block;
  margin-bottom: 8px;
  text-align: right;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
}

.comparison-bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(18, 32, 39, 0.08);
  overflow: hidden;
}

.comparison-bar span {
  display: block;
  height: 100%;
  margin: 0;
  border-radius: inherit;
}

.story-list {
  display: grid;
  gap: 14px;
}

.story-current {
  position: relative;
  z-index: 1;
  margin-bottom: 14px;
}

.story-list-scroll {
  max-height: 780px;
  overflow-y: auto;
  padding-right: 8px;
}

.spend-breakdown-intro {
  margin: 0 0 18px;
}

.spend-breakdown-list {
  display: grid;
  gap: 14px;
}

.spend-item {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--line);
}

.spend-item-top {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.spend-item-top p {
  margin: 6px 0 0;
}

.spend-item-figures {
  min-width: 96px;
  text-align: right;
}

.spend-item-figures span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.spend-item-figures strong {
  display: block;
  margin-top: 6px;
  font-size: 1.2rem;
}

.spend-bar {
  margin-top: 14px;
  height: 10px;
  border-radius: 999px;
  background: rgba(18, 32, 39, 0.08);
  overflow: hidden;
}

.spend-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.story-item {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.54);
  border: 1px solid var(--line);
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.story-item.active {
  border-color: rgba(170, 46, 37, 0.32);
  background: rgba(170, 46, 37, 0.06);
}

.story-item-current {
  border-color: rgba(170, 46, 37, 0.32);
  background: rgba(170, 46, 37, 0.08);
}

.story-item:hover {
  transform: translateY(-1px);
}

.story-item time {
  display: block;
  margin-bottom: 8px;
  font-size: 0.84rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

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

.story-grid article {
  padding: 24px;
}

.story-index {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.12em;
}

.methodology.hidden {
  display: none;
}

.methodology-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.source-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.source-list a {
  color: var(--navy);
  text-decoration: none;
  border-bottom: 1px solid rgba(23, 58, 82, 0.22);
}

.axis-label,
.tick-label,
.annotation {
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
  fill: var(--muted);
}

.axis-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.tick-label {
  font-size: 12px;
}

.annotation {
  font-size: 13px;
}

.line-grid {
  stroke: rgba(18, 32, 39, 0.1);
  stroke-width: 1;
  stroke-dasharray: 2 6;
}

.oil-line {
  fill: none;
  stroke: var(--navy);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.oil-area {
  fill: rgba(23, 58, 82, 0.12);
}

.event-dot {
  fill: var(--accent);
}

.event-line {
  stroke: rgba(170, 46, 37, 0.35);
  stroke-dasharray: 4 5;
}

.hover-line {
  stroke: rgba(18, 32, 39, 0.32);
  stroke-width: 1.5;
  stroke-dasharray: 5 5;
}

.hover-dot {
  fill: var(--navy);
  stroke: #fff;
  stroke-width: 2;
}

.hidden {
  display: none;
}

@media (max-width: 1180px) {
  .hero,
  .two-column,
  .chart-layout,
  .energy-grid,
  .story-grid,
  .hero-meta,
  .methodology-grid,
  .oil-summary,
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .panel-note {
    text-align: left;
  }

  .control-bar {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(calc(100% - 20px), var(--max-width));
    padding-top: 18px;
  }

  .hero,
  .panel,
  .control-bar {
    padding: 20px;
    border-radius: 22px;
  }

  h1 {
    font-size: 2.8rem;
  }

  .spend-item-top {
    flex-direction: column;
  }

  .spend-item-figures {
    text-align: left;
  }

  .comparison-item {
    grid-template-columns: 1fr;
  }

  .comparison-metric span {
    text-align: left;
  }
}
