:root {
  --background: #f7f9ff;
  --surface: #ffffff;
  --surface-soft: #eef4ff;
  --primary: #223b6b;
  --primary-light: #3b5284;
  --secondary: #376847;
  --text: #0b1d2d;
  --muted: #575b66;
  --border: #dfe3eb;
  --warning: #805200;
  --warning-bg: #fff8e8;
  --max-width: 1280px;
  --shadow: 0 4px 20px rgba(26, 43, 60, 0.05);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

#top,
#methodology,
#newsletter { scroll-margin-top: 80px; }

body {
  margin: 0;
  color: var(--text);
  background: var(--background);
  font-family: "Public Sans", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body.menu-open { overflow: hidden; }

button,
input { font: inherit; }

button,
a { -webkit-tap-highlight-color: transparent; }

a { color: var(--primary); }

[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page-width,
.header-inner,
.footer-inner {
  width: min(100%, var(--max-width));
  margin-inline: auto;
  padding-inline: 40px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(196, 198, 208, 0.45);
  background: rgba(247, 249, 255, 0.94);
  backdrop-filter: blur(10px);
}

.header-inner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  color: var(--primary);
  font-family: "Playfair Display", Georgia, serif;
  font-size: 20px;
  font-weight: 600;
  text-decoration: none;
}

.desktop-nav,
.footer-inner nav {
  display: flex;
  align-items: center;
  gap: 26px;
}

.desktop-nav a,
.footer-inner nav a {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.desktop-nav a:hover,
.footer-inner nav a:hover { color: var(--primary); }

.menu-button,
.menu-close { display: none; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 40px;
  align-items: end;
  padding-top: 62px;
  padding-bottom: 46px;
}

.hero h1 {
  max-width: 760px;
  margin: 0 0 12px;
  color: var(--primary);
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(38px, 4vw, 52px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.hero p {
  max-width: 750px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.edition-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
  white-space: nowrap;
}

.edition-meta strong {
  color: var(--primary);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.desktop-table-wrap {
  overflow: hidden;
  border: 1px solid #e8eaf0;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

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

th {
  padding: 14px 20px;
  color: var(--muted);
  background: #f9faff;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-align: left;
}

th:nth-child(1) { width: 9%; }
th:nth-child(2) { width: 28%; }
th:nth-child(3) { width: 15%; }
th:nth-child(4) { width: 20%; }
th:nth-child(5) { width: 20%; }
th:nth-child(6) { width: 8%; }

td {
  height: 63px;
  padding: 10px 20px;
  border-top: 1px solid #eceef2;
  vertical-align: middle;
}

.company-row:hover { background: #fbfcff; }

.rank-cell,
.numeric {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.company-name,
.company-sector { display: block; }

.company-name {
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
}

.company-sector {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.3;
}

.score {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
}

.score small {
  font-size: 10px;
  font-weight: 500;
}

.score-strong { color: #1f6a3b; }
.score-good { color: #3d6650; }
.score-fair { color: #706522; }
.score-weak { color: #8a4d40; }

.expand-cell { text-align: right; }

.expand-button {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.expand-button span {
  position: relative;
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 1px solid #b8bdc7;
  border-radius: 50%;
}

.expand-button span::before,
.expand-button span::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 1px;
  background: #78808c;
  transform: translate(-50%, -50%);
}

.expand-button span::after { transform: translate(-50%, -50%) rotate(90deg); }
.expand-button[aria-expanded="true"] span::after { display: none; }

.expand-button:hover span,
.expand-button:focus-visible span { border-color: var(--primary); }

.analysis-row td {
  height: auto;
  padding: 0;
  background: #f8faff;
}

.analysis-panel { padding: 26px 30px 30px; }

.analysis-intro {
  max-width: 870px;
  margin-bottom: 23px;
}

.analysis-intro > span,
.source-links > span {
  color: var(--primary-light);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.analysis-intro h3 {
  margin: 5px 0 6px;
  color: var(--primary);
  font-family: "Playfair Display", Georgia, serif;
  font-size: 22px;
}

.analysis-panel p { margin: 0; color: #3f4651; }

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

.analysis-grid section {
  padding: 16px;
  border: 1px solid #e3e7ef;
  border-radius: 6px;
  background: var(--surface);
}

.analysis-grid h4 {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.analysis-wide { grid-column: 1 / -1; }

.analysis-grid .priority-review {
  border-color: #eadbb6;
  background: var(--warning-bg);
}

.analysis-grid .priority-review h4 { color: var(--warning); }

.source-links {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 20px;
}

.source-links a { font-size: 12px; }

.methodology-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 17px 20px;
  border: 1px solid #e6e9f0;
  border-top: 0;
  border-radius: 0 0 8px 8px;
  background: #f9fbff;
  color: var(--muted);
  font-size: 11px;
}

.methodology-note p { margin: 0; }

.info-icon {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  border: 1px solid #6d7480;
  border-radius: 50%;
  font-family: Georgia, serif;
  font-size: 10px;
  line-height: 12px;
  text-align: center;
}

.mobile-cards { display: none; }

.newsletter {
  display: flex;
  justify-content: center;
  padding-top: 72px;
  padding-bottom: 72px;
}

.newsletter-card {
  width: min(100%, 660px);
  padding: 46px 74px 42px;
  border: 1px solid #e3e6ed;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}

.beta-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  color: #fff;
  background: var(--primary-light);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.newsletter-card h2 {
  margin: 14px 0 8px;
  color: var(--primary);
  font-family: "Playfair Display", Georgia, serif;
  font-size: 25px;
}

.newsletter-card > p {
  max-width: 490px;
  margin: 0 auto 27px;
  color: var(--muted);
}

.newsletter-card form { display: grid; gap: 11px; }

.newsletter-card input {
  width: 100%;
  padding: 12px 4px;
  border: 0;
  border-bottom: 1px solid #b8bcc5;
  border-radius: 0;
  outline: 0;
  background: transparent;
  text-align: center;
}

.newsletter-card input:focus { border-color: var(--primary); }

.newsletter-card button {
  min-height: 40px;
  border: 0;
  border-radius: 2px;
  color: #fff;
  background: var(--primary);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
}

.newsletter-card button:hover { background: var(--primary-light); }

.form-note,
.form-status {
  min-height: 15px;
  margin: 0 !important;
  color: #737781 !important;
  font-size: 10px;
}

.form-status { color: var(--secondary) !important; }

.site-footer {
  border-top: 1px solid #dce3ef;
  background: var(--surface-soft);
}

.footer-inner {
  min-height: 125px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 30px;
  align-items: center;
}

.footer-inner p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  text-align: right;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  max-width: calc(100vw - 40px);
  padding: 12px 16px;
  border-radius: 6px;
  color: #fff;
  background: var(--primary);
  box-shadow: 0 8px 30px rgba(11, 29, 45, 0.2);
  font-size: 13px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid #4f6da8;
  outline-offset: 3px;
}

@media (max-width: 760px) {
  .page-width,
  .header-inner,
  .footer-inner { padding-inline: 16px; }

  .desktop-nav { display: none; }

  .menu-button {
    display: grid;
    gap: 4px;
    width: 38px;
    height: 38px;
    padding: 10px 8px;
    border: 0;
    background: transparent;
  }

  .menu-button span {
    display: block;
    height: 1px;
    background: var(--primary);
  }

  .mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 40;
    padding: 0 16px 24px;
    background: var(--background);
  }

  .mobile-menu-header {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .menu-close {
    display: block;
    width: 40px;
    height: 40px;
    border: 0;
    color: var(--primary);
    background: transparent;
    font-size: 32px;
    font-weight: 300;
    line-height: 1;
  }

  .mobile-menu nav {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding-top: 44px;
  }

  .mobile-menu nav a {
    color: var(--primary);
    font-size: 18px;
    text-decoration: none;
  }

  .hero {
    display: block;
    padding-top: 42px;
    padding-bottom: 34px;
    text-align: center;
  }

  .hero h1 {
    margin-inline: auto;
    font-size: 29px;
    line-height: 1.17;
  }

  .hero p { font-size: 15px; }

  .edition-meta {
    align-items: center;
    margin-top: 17px;
    white-space: normal;
  }

  .desktop-table-wrap { display: none; }

  .mobile-cards {
    display: grid;
    gap: 14px;
  }

  .company-card {
    padding: 17px 16px 13px;
    border: 1px solid #e7e9ee;
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
  }

  .card-heading {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 13px;
    border-bottom: 1px solid #e4e7ec;
  }

  .card-heading h3 {
    margin: 0;
    color: var(--primary);
    font-family: "Playfair Display", Georgia, serif;
    font-size: 21px;
    line-height: 1.25;
  }

  .card-heading p {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 12px;
  }

  .rank-badge {
    flex: 0 0 auto;
    align-self: flex-start;
    padding: 5px 8px;
    border-radius: 3px;
    color: var(--primary);
    background: var(--surface-soft);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.03em;
    white-space: nowrap;
  }

  .card-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 15px 0 11px;
  }

  .card-metrics div:nth-child(2) { text-align: center; }
  .card-metrics div:last-child { text-align: right; }

  .card-metrics dt {
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .card-metrics dd {
    margin: 0;
    font-size: 13px;
  }

  .card-metrics .score small { display: block; font-size: 9px; }

  .mobile-analysis-button {
    width: 100%;
    padding: 9px 0 0;
    border: 0;
    color: var(--primary);
    background: transparent;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-align: right;
    text-transform: uppercase;
  }

  .mobile-analysis-button span {
    display: inline-block;
    margin-left: 3px;
    font-size: 16px;
    transition: transform 160ms ease;
  }

  .mobile-analysis-button[aria-expanded="true"] span { transform: rotate(90deg); }

  .mobile-analysis {
    margin: 12px -16px -13px;
    border-top: 1px solid #e4e7ec;
    background: #f8faff;
  }

  .analysis-panel { padding: 22px 16px; }
  .analysis-intro { margin-bottom: 17px; }
  .analysis-intro h3 { font-size: 20px; }
  .analysis-panel p { font-size: 13px; }
  .analysis-grid { grid-template-columns: 1fr; }
  .analysis-wide { grid-column: auto; }

  .source-links {
    flex-wrap: wrap;
    gap: 9px 16px;
  }

  .source-links > span { flex-basis: 100%; }

  .methodology-note {
    margin-top: 18px;
    padding: 4px 0 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    font-size: 11px;
  }

  .newsletter { padding-top: 48px; padding-bottom: 48px; }

  .newsletter-card {
    padding: 30px 18px;
    background: var(--surface-soft);
  }

  .newsletter-card h2 { font-size: 23px; }

  .footer-inner {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 22px;
    padding-top: 38px;
    padding-bottom: 38px;
    text-align: center;
  }

  .footer-inner nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px 20px;
  }

  .footer-inner p { text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
