:root {
  --paper: #fafaf7;
  --ink: #0b0b0a;
  --grey-1: #efefea;
  --grey-2: #dcdcd4;
  --grey-3: #77776f;
  --gold: #a98b4f;
  --gold-soft: #c8b084;
  --pitch: #1f5c39;
  --pitch-soft: #eaf1eb;
  --glass: rgba(250, 250, 247, .74);
  --line: rgba(11, 11, 10, .12);
  --shadow: 0 24px 70px rgba(0, 0, 0, .1);
  --radius: 20px;
  --display: "Archivo", system-ui, sans-serif;
  --body: "Instrument Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

[data-theme="dark"] {
  --paper: #0c0c0b;
  --ink: #f4f4ef;
  --grey-1: #171715;
  --grey-2: #282824;
  --grey-3: #9b9b91;
  --gold: #c8b084;
  --gold-soft: #a98b4f;
  --pitch: #54a474;
  --pitch-soft: #12211a;
  --glass: rgba(12, 12, 11, .74);
  --line: rgba(244, 244, 239, .14);
  --shadow: 0 24px 70px rgba(0, 0, 0, .42);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.wrap {
  width: min(100% - 48px, 1240px);
  margin: 0 auto;
}

.narrow {
  width: min(100% - 48px, 780px);
}

.eyebrow {
  display: block;
  margin-bottom: 18px;
  color: var(--grey-3);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.eyebrow b {
  color: var(--gold);
  font-weight: 500;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  gap: 10px;
  border: 0;
  border-radius: 999px;
  padding: 14px 24px;
  font-weight: 700;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--ink);
  color: var(--paper);
}

.btn-primary:hover {
  box-shadow: var(--shadow);
}

.btn-ghost {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
}

.btn-sm {
  min-height: 38px;
  padding: 9px 18px;
  font-size: 14px;
}

.site-nav {
  position: fixed;
  z-index: 50;
  top: 0;
  right: 0;
  left: 0;
  border-bottom: 1px solid var(--line);
  background: var(--glass);
  backdrop-filter: blur(18px);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 66px;
}

.logo {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 850;
}

.logo span {
  color: var(--gold);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 14px;
  font-weight: 650;
}

.nav-links a:not(.btn) {
  color: color-mix(in srgb, var(--ink) 78%, transparent);
}

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

.theme-toggle,
.nav-toggle {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
}

.theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
}

.theme-dot {
  display: block;
  width: 15px;
  height: 15px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: linear-gradient(90deg, var(--ink) 0 50%, transparent 50% 100%);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 999px;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
}

.nav-toggle span + span {
  margin-top: 4px;
}

.hero {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  padding: 138px 0 70px;
  display: flex;
  align-items: center;
}

#globe {
  position: absolute;
  z-index: 0;
  top: 50%;
  right: -110px;
  width: min(720px, 58vw);
  height: min(720px, 58vw);
  transform: translateY(-50%);
  opacity: 1;
  pointer-events: none;
}

.hero-grad {
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, var(--paper) 0%, color-mix(in srgb, var(--paper) 94%, transparent) 48%, color-mix(in srgb, var(--paper) 40%, transparent) 66%, color-mix(in srgb, var(--paper) 18%, transparent) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 760px;
}

.hero h1,
.page-title {
  margin: 0;
  font-family: var(--display);
  font-variation-settings: "wdth" 72;
  font-weight: 850;
  line-height: .95;
  text-transform: uppercase;
}

.hero h1 {
  font-size: 92px;
}

.hero h1 span {
  display: block;
  max-width: 640px;
  margin-top: 22px;
  color: var(--grey-3);
  font-size: 36px;
  font-weight: 320;
  line-height: 1.1;
  text-transform: none;
}

.page-title {
  font-size: 64px;
}

.hero-sub,
.section-sub {
  max-width: 610px;
  color: var(--grey-3);
  font-size: 18px;
}

.hero-sub {
  margin: 26px 0 34px;
}

.section-sub {
  margin: 0 0 42px;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 54px;
}

.live-strip {
  display: flex;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
}

.live-cell {
  min-width: 148px;
  padding: 18px 30px 0 0;
}

.live-cell + .live-cell {
  padding-left: 30px;
  border-left: 1px solid var(--line);
}

.live-cell strong {
  display: block;
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 500;
}

.live-cell span {
  display: block;
  color: var(--grey-3);
  font-size: 12px;
  text-transform: uppercase;
}

.live-cell i {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--pitch);
  animation: pulse 2s infinite;
}

main section,
.page-main {
  padding-top: 108px;
}

.page-main {
  min-height: 70vh;
}

h2 {
  margin: 0 0 16px;
  font-family: var(--display);
  font-variation-settings: "wdth" 78;
  font-size: 52px;
  font-weight: 800;
  line-height: 1.02;
}

.index-band {
  overflow: hidden;
  border-radius: 28px;
  background: var(--ink);
  color: var(--paper);
}

[data-theme="dark"] .index-band {
  background: var(--grey-1);
}

.index-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .85fr);
  gap: 56px;
  align-items: center;
  padding: 64px;
}

.index-meta {
  color: var(--gold-soft);
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
}

.index-score {
  margin: 10px 0 22px;
  font-family: var(--display);
  font-variation-settings: "wdth" 70;
  font-size: 158px;
  font-weight: 850;
  line-height: .9;
}

.index-score small {
  color: var(--grey-3);
  font-size: 36px;
  font-weight: 400;
}

.trend-chip {
  display: inline-flex;
  margin-top: 20px;
  border: 1px solid color-mix(in srgb, var(--paper) 24%, transparent);
  border-radius: 999px;
  padding: 8px 15px;
  color: var(--gold-soft);
  font-family: var(--mono);
  font-size: 12px;
}

#spark {
  display: block;
  width: 100%;
  height: 190px;
}

.country-rows {
  margin-top: 22px;
}

.country-row {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid color-mix(in srgb, var(--paper) 16%, transparent);
  padding: 10px 0;
  font-size: 14px;
}

.country-row span:last-child {
  color: var(--gold-soft);
  font-family: var(--mono);
}

.index-note,
.disclaimer,
.rank-note {
  color: var(--grey-3);
  font-size: 13px;
}

.index-note {
  margin: 0;
  padding: 0 64px 34px;
}

.dash-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.dash-grid.single {
  grid-template-columns: minmax(0, 1fr);
}

.card,
.opinion,
.nom-card,
.rank-card,
.tl-card,
.country-tile,
.method-card,
.source-list {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--grey-1);
}

.card {
  min-height: 178px;
  padding: 26px;
}

.card h3,
.trans-item h3 {
  margin: 0 0 12px;
  color: var(--grey-3);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.card strong {
  display: block;
  font-family: var(--mono);
  font-size: 34px;
  font-weight: 500;
}

.card span {
  display: block;
  margin-top: 8px;
  color: var(--grey-3);
  font-size: 13px;
}

.vote-band,
.timeline-band,
.transparency-band {
  margin-top: 108px;
  padding: 108px 0;
}

.vote-band {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--grey-1);
}

.vote-layout {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(360px, 1fr);
  gap: 48px;
  align-items: start;
}

.vote-shell,
.nom-card {
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.vote-shell {
  padding: 34px;
}

.action-form {
  display: grid;
  gap: 18px;
}

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

.span-2 {
  grid-column: span 2;
}

label {
  display: grid;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--grey-1);
  color: var(--ink);
  padding: 13px 15px;
  font-size: 15px;
}

textarea {
  min-height: 118px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--gold);
  outline: 0;
}

.choice-set {
  display: grid;
  gap: 12px;
  margin: 0;
  border: 0;
  padding: 0;
}

.choice-set legend {
  margin-bottom: 8px;
  font-weight: 800;
}

.choice-set label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--grey-1);
  padding: 16px;
}

.choice-set input {
  width: auto;
  margin-top: 4px;
  accent-color: var(--gold);
}

.choice-set small,
.check span {
  display: block;
  color: var(--grey-3);
  font-weight: 400;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 500;
}

.check input {
  width: auto;
  margin-top: 4px;
  accent-color: var(--gold);
}

.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.form-status {
  min-height: 22px;
  margin: 0;
  color: var(--grey-3);
  font-size: 14px;
  font-weight: 600;
}

.form-status.ok {
  color: var(--pitch);
}

.form-status.error {
  color: #b54034;
}

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

.opinion {
  min-height: 190px;
  padding: 26px;
}

.opinion blockquote {
  margin: 16px 0;
  font-size: 16px;
}

.meta {
  display: flex;
  gap: 10px;
  color: var(--grey-3);
  font-size: 13px;
}

.empty {
  color: var(--grey-3);
}

.disclaimer {
  max-width: 670px;
  margin-top: 30px;
  border-left: 2px solid var(--gold);
  padding-left: 16px;
}

.next-grid {
  display: grid;
  grid-template-columns: minmax(320px, .8fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.nom-card,
.rank-card {
  padding: 32px;
}

.rank-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.rank-tab {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--grey-3);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
}

.rank-tab.on {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.rank-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 13px 0;
}

.rank-row:last-child {
  border-bottom: 0;
}

.rank-pos {
  color: var(--grey-3);
  font-family: var(--display);
  font-variation-settings: "wdth" 70;
  font-size: 24px;
  font-weight: 850;
}

.rank-name {
  overflow-wrap: anywhere;
  font-weight: 750;
}

.rank-bar {
  height: 5px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 5px;
  background: var(--grey-2);
}

.rank-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--pitch));
}

.rank-count {
  color: var(--grey-3);
  font-family: var(--mono);
  font-size: 13px;
}

.timeline-band {
  border-top: 1px solid var(--line);
}

.tl-scroll {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 20px;
  scroll-snap-type: x mandatory;
}

.tl-card {
  min-width: 292px;
  padding: 26px;
  scroll-snap-align: start;
}

.tl-year {
  color: var(--gold);
  font-family: var(--display);
  font-variation-settings: "wdth" 70;
  font-size: 44px;
  font-weight: 850;
  line-height: 1;
}

.tl-card h3 {
  margin: 14px 0 8px;
  font-size: 17px;
}

.tl-card p {
  color: var(--grey-3);
  font-size: 14px;
}

.tl-src {
  display: inline-flex;
  margin-top: 12px;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 12px;
}

.transparency-band {
  border-top: 1px solid var(--line);
  background: var(--grey-1);
}

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

.trans-item {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.trans-item p {
  margin: 0;
  color: var(--grey-3);
  font-size: 14px;
}

.country-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.country-tile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 84px;
  gap: 20px;
  padding: 22px;
}

.country-tile strong {
  font-family: var(--mono);
}

.method-card,
.source-list {
  padding: 24px;
}

.method-card code {
  display: inline-block;
  overflow-wrap: anywhere;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 14px;
}

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

.source-list a {
  color: var(--gold);
  font-weight: 700;
}

footer {
  margin-top: 70px;
  border-top: 1px solid var(--line);
  padding: 68px 0 44px;
}

.foot-grid {
  display: flex;
  justify-content: space-between;
  gap: 42px;
}

.foot-grid p {
  max-width: 300px;
  color: var(--grey-3);
  font-size: 14px;
}

.foot-contact {
  display: inline-flex;
  margin-top: 12px;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 54px;
}

.foot-col {
  display: grid;
  gap: 10px;
  font-size: 14px;
}

.foot-col b {
  color: var(--grey-3);
  font-size: 12px;
  text-transform: uppercase;
}

.foot-bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 50px;
  color: var(--grey-3);
  font-size: 12px;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: .3;
  }
}

@media (max-width: 980px) {
  .nav-toggle {
    display: grid;
  }

  .nav-links {
    position: absolute;
    top: 66px;
    right: 24px;
    left: 24px;
    display: none;
    grid-template-columns: 1fr;
    gap: 0;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--paper);
    box-shadow: var(--shadow);
    padding: 12px;
  }

  .nav-links.open {
    display: grid;
  }

  .nav-links a,
  .nav-links button {
    justify-content: flex-start;
    margin: 2px 0;
  }

  .hero h1 {
    font-size: 70px;
  }

  .hero h1 span {
    font-size: 30px;
  }

  #globe {
    right: -240px;
    width: 760px;
    height: 760px;
    opacity: .9;
  }

  .hero-grad {
    background: linear-gradient(90deg, var(--paper) 0%, color-mix(in srgb, var(--paper) 86%, transparent) 56%, color-mix(in srgb, var(--paper) 22%, transparent) 100%);
  }

  .index-grid,
  .vote-layout,
  .next-grid {
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 640px) {
  .wrap,
  .narrow {
    width: min(100% - 32px, 1240px);
  }

  .hero {
    min-height: 920px;
    padding-top: 116px;
  }

  .hero h1,
  .page-title {
    font-size: 48px;
  }

  .hero h1 span {
    font-size: 24px;
  }

  h2 {
    font-size: 36px;
  }

  .live-cell,
  .live-cell + .live-cell {
    width: 50%;
    border-left: 0;
    padding: 16px 16px 0 0;
  }

  .dash-grid,
  .trans-grid,
  .country-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }

  .index-grid,
  .index-note,
  .vote-shell,
  .nom-card,
  .rank-card {
    padding: 24px;
  }

  .index-score {
    font-size: 112px;
  }

  .vote-band,
  .timeline-band,
  .transparency-band,
  main section,
  .page-main {
    padding-top: 78px;
  }

  .vote-band,
  .timeline-band,
  .transparency-band {
    margin-top: 78px;
    padding-bottom: 78px;
  }

  .foot-grid,
  .foot-bottom {
    display: grid;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
