:root {
  --page-bg: #f3efe6;
  --page-bg-deep: #e9e0d0;
  --paper: rgba(248, 245, 238, 0.86);
  --paper-strong: #fbf8f1;
  --ink: #1a1917;
  --ink-soft: #4f4b44;
  --ink-muted: #79736a;
  --border: rgba(32, 29, 24, 0.14);
  --accent: #d94c42;
  --accent-dark: #8a2e2d;
  --navy: #16354f;
  --shadow: 0 20px 60px rgba(28, 25, 21, 0.1);
  --radius-lg: 30px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --display-font: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --ui-font: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--ui-font);
  background:
    radial-gradient(circle at top left, rgba(217, 76, 66, 0.12), transparent 28%),
    radial-gradient(circle at top right, rgba(22, 53, 79, 0.12), transparent 24%),
    linear-gradient(180deg, #f7f4ee 0%, var(--page-bg) 50%, var(--page-bg-deep) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    linear-gradient(90deg, rgba(0, 0, 0, 0.02) 0, rgba(0, 0, 0, 0.02) 1px, transparent 1px),
    linear-gradient(180deg, rgba(0, 0, 0, 0.015) 0, rgba(0, 0, 0, 0.015) 1px, transparent 1px);
  background-size: 20px 20px;
}

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

button {
  font: inherit;
}

.page-frame {
  position: relative;
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 24px 40px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 0 22px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.brand__mark {
  font-family: var(--display-font);
  font-size: clamp(2rem, 2.5vw, 2.8rem);
  line-height: 0.92;
  letter-spacing: -0.04em;
}

.brand__tag {
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding-top: 2px;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 16px;
}

.site-nav a {
  position: relative;
  padding-bottom: 4px;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  transform: scaleX(0);
  transform-origin: center;
  background: var(--accent);
  transition: transform 180ms ease;
}

.site-nav a:hover::after,
.site-nav a[aria-current="page"]::after {
  transform: scaleX(1);
}

.site-nav a[aria-current="page"] {
  color: var(--ink);
}

.page-main {
  display: grid;
  gap: 28px;
  padding-top: 28px;
}

.hero,
.section,
.site-footer {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(251, 248, 241, 0.95), rgba(244, 239, 228, 0.86));
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.8fr);
  gap: 24px;
  padding: 34px;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 24px 0;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: sweep 8s linear infinite;
  opacity: 0.45;
}

.hero__copy {
  display: grid;
  gap: 14px;
}

.hero__copy h1 {
  margin: 0;
  max-width: 14ch;
  font-family: var(--display-font);
  font-size: clamp(2.4rem, 5vw, 4.4rem);
  line-height: 0.98;
  letter-spacing: -0.05em;
}

.hero__lede {
  max-width: 62ch;
  margin: 0;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ink-soft);
}

.hero__callouts {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.callout {
  margin: 0;
  padding: 12px 16px;
  border: 1px solid rgba(26, 25, 23, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink-soft);
}

.hero__panel {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 18px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(25, 24, 22, 0.96), rgba(45, 40, 34, 0.92));
  color: #f4f0e8;
}

.hero__panel--compact {
  min-width: 0;
}

.hero-panel__stat {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
}

.hero-panel__stat strong {
  font-family: var(--display-font);
  font-size: 1.5rem;
  letter-spacing: -0.03em;
}

.label,
.eyebrow,
.controls__label,
.insight-card__eyebrow {
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.hero .label {
  color: rgba(244, 240, 232, 0.7);
}

.section {
  padding: 30px;
}

.section--hero {
  padding-top: 22px;
}

.geography-shell {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.geography-shell__title {
  margin: 0;
  font-family: var(--display-font);
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1;
  letter-spacing: -0.05em;
}

.geography-selector {
  min-width: min(100%, 320px);
  display: grid;
  gap: 10px;
}

.geography-selector select {
  width: 100%;
  appearance: none;
  padding: 14px 16px;
  border: 1px solid rgba(26, 25, 23, 0.14);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(246, 240, 228, 0.92));
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.feature-panel {
  background:
    linear-gradient(135deg, rgba(22, 53, 79, 0.05), transparent 38%),
    linear-gradient(180deg, rgba(251, 248, 241, 0.97), rgba(244, 239, 228, 0.92));
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-head--stacked {
  align-items: start;
}

.section-head h2,
.editorial-card h2,
.editorial-card h3,
.coalition-card h3 {
  margin: 0;
  font-family: var(--display-font);
  font-size: clamp(1.6rem, 2vw, 2.2rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.section-link {
  color: var(--accent-dark);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.74rem;
}

.section-intro {
  max-width: 66ch;
  margin: 0 0 18px;
  color: var(--ink-soft);
  line-height: 1.7;
}

.section-intro--tight {
  margin-top: 12px;
  margin-bottom: 0;
}

.section-intro--single-line {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: none;
}

.hero__callouts--section {
  margin-bottom: 22px;
}

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

.party-grid,
.coalition-grid,
.insight-grid {
  display: grid;
  gap: 16px;
}

.party-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.coalition-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.insight-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.party-card,
.editorial-card,
.coalition-card,
.insight-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(26, 25, 23, 0.08);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.58);
  animation: rise 500ms ease both;
}

.party-card {
  padding: 18px;
}

.party-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--party-color, var(--accent));
}

.party-card__head,
.coalition-card__head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.party-card__name {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
}

.party-card__detail {
  margin: 4px 0 0;
  color: var(--ink-muted);
  font-size: 0.92rem;
}

.party-card__body {
  display: grid;
  gap: 4px;
  margin-top: 18px;
}

.party-card__body strong,
.coalition-card strong,
.insight-card strong {
  font-family: var(--display-font);
  font-size: clamp(2.1rem, 3vw, 3.2rem);
  line-height: 1;
  letter-spacing: -0.05em;
}

.party-card__body p,
.coalition-card p,
.insight-card p,
.editorial-card p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.6;
}

.party-card__bar,
.coalition-card__bar {
  height: 10px;
  margin-top: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
}

.party-card__bar span,
.coalition-card__bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--party-color, var(--accent)), rgba(0, 0, 0, 0.12));
}

.delta {
  display: inline-flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.delta--positive {
  color: #135d2d;
  background: rgba(19, 93, 45, 0.1);
}

.delta--negative {
  color: #8f1f22;
  background: rgba(143, 31, 34, 0.1);
}

.delta--flat {
  color: var(--ink-muted);
  background: rgba(26, 25, 23, 0.06);
}

.chart-shell {
  min-height: 420px;
  padding: 12px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.55);
}

.chart-shell--large {
  min-height: 540px;
}

.trend-chart {
  width: 100%;
  height: auto;
}

.chart-bg {
  fill: rgba(254, 252, 248, 0.96);
}

.chart-grid__line {
  stroke: rgba(26, 25, 23, 0.08);
  stroke-width: 1;
}

.chart-axis {
  stroke: rgba(26, 25, 23, 0.18);
  stroke-width: 1.2;
}

.chart-axis__label,
.chart-label text,
.trend-latest-value {
  font-family: var(--ui-font);
  font-size: 12px;
  fill: var(--ink-muted);
}

.trend-latest-value {
  font-weight: 700;
}

.trend-band {
  opacity: 0.09;
}

.trend-line {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.poll-dot {
  opacity: 0.42;
}

.controls {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.controls__group {
  display: grid;
  gap: 10px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid rgba(26, 25, 23, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  color: var(--ink-soft);
  cursor: pointer;
  transition:
    transform 120ms ease,
    border-color 120ms ease,
    color 120ms ease;
}

.chip:hover {
  transform: translateY(-1px);
  border-color: rgba(26, 25, 23, 0.24);
}

.chip--active {
  border-color: rgba(26, 25, 23, 0.42);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
}

.chip__swatch {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.table-shell {
  overflow: auto;
  border-radius: 22px;
  border: 1px solid rgba(26, 25, 23, 0.08);
  background: rgba(255, 255, 255, 0.58);
}

.table-shell--hero {
  background: rgba(255, 255, 255, 0.66);
  margin-top: 0;
  border-color: rgba(26, 25, 23, 0.12);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table thead {
  background: rgba(26, 25, 23, 0.04);
}

.data-table th,
.data-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(26, 25, 23, 0.08);
  vertical-align: top;
}

.data-table--hero th,
.data-table--hero td {
  white-space: nowrap;
  border-right: 1px solid rgba(26, 25, 23, 0.08);
}

.data-table--hero th:last-child,
.data-table--hero td:last-child {
  border-right: none;
}

.data-table--hero th:not(:first-child):not(:nth-child(2)),
.data-table--hero td:not(:first-child):not(:nth-child(2)) {
  text-align: center;
}

.data-table--hero th:not(:first-child):not(:nth-child(2)) {
  background: rgba(26, 25, 23, 0.04);
}

.party-header {
  background: var(--party-bg) !important;
}

.party-header__dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 8px;
  border-radius: 999px;
  background: var(--party-color);
  vertical-align: middle;
}

.party-cell {
  color: var(--ink);
  font-weight: 700;
  background: transparent;
}

.hero-table-aggregate-row td {
  background-color: rgba(22, 53, 79, 0.06);
  border-top: 1px solid rgba(26, 25, 23, 0.12);
  border-bottom: 1px solid rgba(26, 25, 23, 0.12);
}

.hero-table-aggregate-row td:first-child,
.hero-table-aggregate-row td:nth-child(2) {
  background-color: rgba(22, 53, 79, 0.1);
}

.hero-table-aggregate-row .party-cell {
  background: rgba(22, 53, 79, 0.06);
}

.data-table th {
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.data-table td span {
  display: block;
  margin-top: 4px;
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.editorial-stack {
  display: grid;
  gap: 16px;
}

.editorial-card {
  padding: 22px;
}

.editorial-card--muted {
  background: rgba(26, 25, 23, 0.04);
}

.copy-list {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--ink-soft);
  line-height: 1.7;
}

.coalition-card {
  padding: 22px;
}

.coalition-card__meta {
  margin-top: 12px;
  font-size: 0.92rem;
}

.coalition-card--positive {
  border-color: rgba(19, 93, 45, 0.2);
}

.coalition-card--negative {
  border-color: rgba(143, 31, 34, 0.18);
}

.coalition-card--caution {
  border-color: rgba(163, 117, 12, 0.22);
}

.coalition-card--muted {
  border-color: rgba(26, 25, 23, 0.12);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.status-pill--positive {
  color: #135d2d;
  background: rgba(19, 93, 45, 0.1);
}

.status-pill--negative {
  color: #8f1f22;
  background: rgba(143, 31, 34, 0.1);
}

.status-pill--caution {
  color: #8f6c12;
  background: rgba(143, 108, 18, 0.12);
}

.status-pill--muted {
  color: var(--ink-muted);
  background: rgba(26, 25, 23, 0.06);
}

.insight-card {
  padding: 18px;
}

.empty-state,
.noscript {
  padding: 18px;
  border: 1px dashed rgba(26, 25, 23, 0.24);
  border-radius: 18px;
  color: var(--ink-muted);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 20px 24px;
}

.site-footer p {
  margin: 0;
  color: var(--ink-soft);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes sweep {
  0% {
    transform: translateX(-30%);
  }

  50% {
    transform: translateX(20%);
  }

  100% {
    transform: translateX(60%);
  }
}

@keyframes chart-draw {
  to {
    stroke-dashoffset: 0;
  }
}

@media (max-width: 1080px) {
  .geography-shell,
  .hero,
  .two-column,
  .coalition-grid,
  .insight-grid {
    grid-template-columns: 1fr;
  }

  .geography-shell {
    display: grid;
    align-items: start;
  }

  .party-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-footer {
    flex-direction: column;
    align-items: start;
  }
}

@media (max-width: 720px) {
  .page-frame {
    padding: 18px 14px 28px;
  }

  .site-header,
  .section,
  .hero,
  .site-footer {
    padding-left: 18px;
    padding-right: 18px;
  }

  .site-header {
    align-items: start;
    flex-direction: column;
  }

  .site-nav {
    justify-content: start;
  }

  .hero {
    padding-top: 24px;
    padding-bottom: 24px;
  }

  .hero__copy h1 {
    max-width: 11ch;
  }

  .party-grid {
    grid-template-columns: 1fr;
  }

  .chart-shell {
    padding: 8px;
  }

  .data-table th,
  .data-table td {
    padding: 12px;
  }
}
