:root {
  --ink: #211b16;
  --muted: #746858;
  --paper: #12100d;
  --surface: #f2e6cf;
  --surface-strong: #fff8e9;
  --line: #cbb888;
  --blue: #8b2b22;
  --blue-dark: #5f1d19;
  --red: #8b2b22;
  --gold: #c8a85e;
  --gold-light: #d9c07a;
  --parchment: #f2e6cf;
  --archive-paper: #d8c7a5;
  --coal: #211b16;
  --green: #3f704f;
  --amber: #8b6426;
  --shadow: 0 16px 42px rgba(0, 0, 0, 0.28);
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  scrollbar-gutter: stable;
  overflow-y: scroll;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--parchment);
  background: var(--paper);
  line-height: 1.5;
}

body {
  margin: 0;
  min-width: 320px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background:
    radial-gradient(circle at 12% 3%, rgba(139, 43, 34, 0.2), transparent 34rem),
    radial-gradient(circle at 90% 35%, rgba(200, 168, 94, 0.08), transparent 30rem),
    linear-gradient(145deg, #17130f 0%, var(--paper) 48%, #19140f 100%);
}

a {
  color: var(--red);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--blue-dark);
}

.shell {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  background:
    linear-gradient(90deg, rgba(139, 43, 34, 0.14), transparent 35%),
    var(--paper);
  color: var(--parchment);
  border-bottom: 1px solid var(--gold);
  box-shadow: inset 0 -4px 0 var(--red);
}

.header-inner {
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--parchment);
  text-decoration: none;
}

.brand:hover {
  color: var(--gold-light);
}

.brand-mark {
  width: 58px;
  height: 58px;
  display: block;
  overflow: hidden;
  border: 2px solid var(--gold);
  border-radius: 50%;
  background: var(--coal);
  box-shadow: 0 0 0 3px rgba(139, 43, 34, 0.5);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.brand small {
  color: var(--archive-paper);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
}

.main-nav {
  display: flex;
  gap: 26px;
}

.main-nav a {
  color: var(--archive-paper);
  text-decoration: none;
  font-weight: 650;
}

.main-nav a:hover {
  color: var(--gold-light);
}

.page {
  min-height: calc(100vh - 190px);
  padding-block: 48px 72px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(300px, 0.8fr);
  gap: 52px;
  align-items: center;
  padding: 32px 0 56px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  text-wrap: pretty;
}

h1,
h2,
h3 {
  margin-top: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 600;
  line-height: 1.14;
}

h1 {
  margin-bottom: 20px;
  font-size: clamp(2.25rem, 5vw, 4.6rem);
  letter-spacing: -0.025em;
}

h2 {
  letter-spacing: -0.02em;
}

.hero-copy,
.page-heading > p,
.lead {
  max-width: 760px;
  color: var(--archive-paper);
  font-size: 1.12rem;
}

.hero-actions,
.source-links,
.vote-meta,
.deputy-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.hero-actions {
  margin-top: 30px;
}

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 7px;
  font: inherit;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}

.button-primary {
  color: var(--parchment);
  background: var(--blue);
  border-color: #a74337;
  box-shadow: inset 0 0 0 1px rgba(217, 192, 122, 0.22);
}

.button-primary:hover {
  color: white;
  background: var(--blue-dark);
}

.button-secondary {
  color: var(--parchment);
  background: rgba(33, 27, 22, 0.8);
  border-color: var(--gold);
}

.button-secondary:hover {
  color: var(--gold-light);
  background: var(--coal);
}

.source-note,
.vote-card,
.metric,
.dual-summary > article,
.faction-card,
.deputy-card,
.empty-state {
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.source-note {
  padding: 28px;
  border-top: 5px solid var(--gold);
}

.source-note p {
  color: var(--muted);
}

.source-note small {
  display: block;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.status-dot {
  width: 10px;
  height: 10px;
  display: inline-block;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 5px rgba(200, 168, 94, 0.18);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 0 0 64px;
}

.metric-grid-five {
  grid-template-columns: repeat(5, 1fr);
}

.metric {
  min-height: 138px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px;
  color: var(--ink);
}

.metric strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3.2rem);
  letter-spacing: -0.05em;
}

.metric span {
  color: var(--muted);
}

.metric-good strong {
  color: var(--green);
}

.metric-alert strong,
.count-against {
  color: var(--red);
}

.statistics-heading {
  max-width: 900px;
}

.statistics-tabs {
  display: inline-flex;
  gap: 6px;
  margin: 0 0 24px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--coal);
  border-color: rgba(200, 168, 94, 0.48);
}

.statistics-tabs a {
  padding: 9px 16px;
  border-radius: 8px;
  color: var(--archive-paper);
  font-weight: 750;
  text-decoration: none;
}

.statistics-tabs a.is-active {
  color: var(--parchment);
  background: var(--blue);
  box-shadow: 0 5px 18px rgba(95, 29, 25, 0.42);
}

.statistics-metrics {
  margin-bottom: 24px;
}

.statistics-filters {
  flex-wrap: wrap;
}

.statistics-filters label {
  flex: 1 1 170px;
}

.method-note {
  margin-bottom: 20px;
  padding: 15px 18px;
  border-left: 4px solid var(--gold);
  border-radius: 0 10px 10px 0;
  color: var(--muted);
  background: var(--surface);
}

.method-note strong {
  color: var(--ink);
}

.insight-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: -34px 0 56px;
}

.insight-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow);
}

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

.insight-card strong {
  margin-bottom: 5px;
  font-size: 2rem;
  letter-spacing: -0.04em;
}

.insight-card span {
  color: var(--muted);
  font-size: 0.84rem;
}

.insight-card-alert strong {
  color: var(--red);
}

.insight-link {
  grid-column: 1 / -1;
  justify-self: end;
  margin-top: -5px;
  font-weight: 750;
}

.rank-cell {
  width: 76px;
  color: var(--muted);
  font-size: 1.1rem;
  font-weight: 800;
}

.score-cell {
  min-width: 210px;
}

.score-cell > strong {
  display: block;
  margin-bottom: 7px;
  font-size: 1.05rem;
}

.score-track {
  width: 100%;
  height: 7px;
  display: flex;
  overflow: hidden;
  border-radius: 999px;
  background: #d8c7a5;
}

.score-fill {
  width: calc(var(--score) * 0.01%);
  height: 100%;
}

.score-fill-green {
  background: var(--green);
}

.score-fill-blue {
  background: var(--blue);
}

.score-fill-red {
  background: var(--red);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin: 56px 0 22px;
}

.section-heading h2 {
  margin-bottom: 0;
  color: var(--parchment);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
}

.section-heading > a,
.pagination a,
.source-links a,
.insight-link {
  color: var(--gold-light);
}

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

.vote-card {
  padding: 24px;
  color: var(--ink);
}

.vote-card h3 {
  margin: 18px 0;
  font-size: 1.08rem;
  font-weight: 700;
}

.vote-card h3 a,
.deputy-card h2 a,
.deputy-card h3 a,
.faction-card h2 a {
  color: var(--ink);
  text-decoration: none;
}

.vote-meta {
  color: var(--muted);
  font-size: 0.86rem;
}

.badge {
  display: inline-flex;
  padding: 4px 9px;
  border-radius: 999px;
  color: var(--muted);
  background: #dfd2b8;
  font-size: 0.74rem;
  font-weight: 800;
}

.badge-success {
  color: #086342;
  background: #dff4eb;
}

.badge-danger {
  color: #982632;
  background: #fae3e5;
}

.compact-tally {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  color: var(--muted);
  font-size: 0.85rem;
}

.tally-for,
.count-for {
  color: var(--green);
  font-weight: 800;
}

.page-heading,
.detail-heading {
  margin-bottom: 36px;
  color: var(--parchment);
}

.profile-heading {
  color: var(--parchment);
}

.page-heading.narrow,
.prose {
  max-width: 820px;
}

.page-heading h1,
.detail-heading h1,
.profile-heading h1 {
  margin-bottom: 14px;
  font-size: clamp(2.2rem, 4.8vw, 4rem);
}

.detail-heading h1 {
  max-width: 980px;
  margin-top: 18px;
}

.muted,
small {
  color: var(--muted);
}

.filter-bar {
  display: flex;
  gap: 14px;
  align-items: end;
  margin-bottom: 24px;
  padding: 18px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.filter-bar label {
  min-width: 180px;
  flex: 1;
}

.filter-bar label > span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

input,
select {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid #bba875;
  border-radius: 9px;
  color: var(--ink);
  color-scheme: light;
  background: var(--surface-strong);
  font: inherit;
}

input:focus,
select:focus,
a:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(200, 168, 94, 0.42);
  outline-offset: 2px;
}

.table-wrap {
  overflow-x: auto;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

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

th,
td {
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  background: #e5d7bc;
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: #eadfc9;
}

td small {
  display: block;
  margin-top: 5px;
}

.row-link {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.nowrap {
  white-space: nowrap;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  margin-top: 24px;
  color: var(--archive-paper);
}

.dual-summary {
  display: grid;
  grid-template-columns: 1.5fr 0.8fr;
  gap: 18px;
}

.dual-summary > article {
  padding: 28px;
  color: var(--ink);
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.result {
  padding: 18px 14px;
  border-radius: 12px;
  background: #e5d7bc;
}

.result strong,
.result span {
  display: block;
}

.result strong {
  font-size: 2rem;
}

.result-for strong {
  color: var(--green);
}

.result-against strong {
  color: var(--red);
}

.result-abstain strong {
  color: #277595;
}

.official-summary p {
  color: var(--muted);
}

.data-warning {
  padding: 12px 14px;
  border-left: 4px solid var(--amber);
  color: #624817 !important;
  background: #fff7df;
}

.vote-result {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 800;
}

.result-for {
  color: #086342;
  background: #dff4eb;
}

.result-against {
  color: #982632;
  background: #fae3e5;
}

.result-abstain {
  color: #1e637f;
  background: #e1f1f7;
}

.result-absent {
  color: #4f5a6b;
  background: #edf0f4;
}

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

.deputy-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  padding: 20px;
}

.deputy-card h2,
.deputy-card h3 {
  margin-bottom: 7px;
  font-size: 1.04rem;
}

.deputy-card p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.86rem;
}

.deputy-meta {
  color: var(--muted);
  font-size: 0.78rem;
}

.initials {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 14px;
  color: var(--red);
  background: #ddcba8;
  font-weight: 850;
  aspect-ratio: 1 / 1;
  contain: layout paint;
}

.initials-large {
  width: 96px;
  height: 96px;
  border-radius: 24px;
  font-size: 1.8rem;
}

.deputy-photo {
  display: block;
  flex: 0 0 auto;
  object-fit: cover;
  object-position: center top;
  background: #ddcba8;
  aspect-ratio: 1 / 1;
  contain: layout paint;
}

.deputy-photo-card {
  width: 64px;
  height: 64px;
  border-radius: 16px;
}

.deputy-photo-large {
  width: 160px;
  height: 160px;
  border-radius: 24px;
  border: 2px solid var(--gold);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.32);
}

.deputy-table-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 240px;
}

.deputy-photo-table,
.initials-table {
  width: 40px;
  height: 40px;
  border-radius: 11px;
}

.initials-table {
  font-size: 0.72rem;
}

.profile-heading {
  display: flex;
  gap: 28px;
  align-items: center;
  margin-bottom: 38px;
}

.profile-heading p {
  margin-bottom: 12px;
}

.profile-heading p a {
  color: var(--gold-light);
}

.faction-card {
  padding: 26px;
  color: var(--ink);
  border-top: 5px solid var(--gold);
}

.faction-code {
  margin: 0 0 12px;
  color: var(--red);
  font-size: 0.8rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.faction-card h2 {
  min-height: 3.5em;
  font-size: 1.2rem;
}

.faction-card dl {
  display: flex;
  gap: 36px;
  padding: 16px 0;
  border-block: 1px solid var(--line);
}

.faction-card dt,
.faction-card dd {
  margin: 0;
}

.faction-card dt {
  color: var(--muted);
  font-size: 0.76rem;
}

.faction-card dd {
  font-size: 1.5rem;
  font-weight: 800;
}

.text-link {
  display: inline-block;
  margin-top: 8px;
  font-weight: 750;
}

.prose {
  display: grid;
  gap: 12px;
}

.prose section {
  padding: 26px 28px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.prose h2 {
  margin-bottom: 10px;
}

.prose p {
  margin-bottom: 0;
  color: var(--muted);
}

code {
  padding: 2px 5px;
  border-radius: 5px;
  background: #e1d2b5;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 36px;
  text-align: center;
}

.site-footer {
  color: var(--archive-paper);
  background: #0d0b09;
  border-top: 1px solid var(--gold);
  box-shadow: inset 0 4px 0 var(--red);
}

.site-footer strong {
  color: var(--gold-light);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.footer-inner {
  min-height: 106px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  font-size: 0.8rem;
}

.footer-brand p {
  margin: 0 0 12px;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid rgba(200, 168, 94, 0.56);
  border-radius: 999px;
  color: var(--gold-light);
  text-decoration: none;
  font-weight: 750;
}

.social-links a:hover {
  color: var(--parchment);
  border-color: var(--gold-light);
  background: rgba(139, 43, 34, 0.28);
}

html.has-page-transitions body::after {
  background:
    radial-gradient(circle at 12% 3%, rgba(139, 43, 34, 0.2), transparent 34rem),
    var(--paper);
  opacity: 1;
  transition: opacity 260ms ease-out;
}

html.has-page-transitions.page-visible body::after {
  opacity: 0;
}

html.has-page-transitions.page-leaving body::after {
  opacity: 1;
  transition-duration: 180ms;
}

@media (max-width: 900px) {
  .header-inner,
  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
    padding-block: 18px;
  }

  .main-nav {
    width: 100%;
    gap: 18px;
    overflow-x: auto;
  }

  .hero,
  .dual-summary,
  .insight-grid {
    grid-template-columns: 1fr;
  }

  .insight-link {
    justify-self: start;
  }

  .metric-grid,
  .metric-grid-five {
    grid-template-columns: repeat(2, 1fr);
  }

  .filter-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .statistics-tabs {
    display: flex;
  }

  .statistics-tabs a {
    flex: 1;
    text-align: center;
  }

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

@media (max-width: 620px) {
  .shell {
    width: min(100% - 24px, 1180px);
  }

  .page {
    padding-block: 30px 52px;
  }

  .hero {
    gap: 28px;
    padding-top: 10px;
  }

  .vote-cards,
  .deputy-grid,
  .faction-grid,
  .metric-grid,
  .metric-grid-five {
    grid-template-columns: 1fr;
  }

  .metric {
    min-height: 112px;
  }

  .statistics-table th:nth-child(4),
  .statistics-table th:nth-child(5),
  .statistics-table td:nth-child(4),
  .statistics-table td:nth-child(5) {
    display: none;
  }

  .section-heading,
  .profile-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .initials-large {
    width: 72px;
    height: 72px;
    border-radius: 18px;
  }

  .deputy-photo-large {
    width: 112px;
    height: 112px;
    border-radius: 20px;
  }
}
