:root {
  --paper: #f6f7f2;
  --panel: #ffffff;
  --ink: #202422;
  --muted: #63706b;
  --line: #dbe1dc;
  --line-strong: #c6cfc8;
  --teal: #0f766e;
  --blue: #2563eb;
  --amber: #b45309;
  --rose: #be123c;
  --charcoal: #24302f;
  --shadow: 0 18px 46px rgba(36, 48, 47, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(219, 225, 220, 0.48), rgba(246, 247, 242, 0) 340px),
    var(--paper);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.5;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration-color: rgba(15, 118, 110, 0.38);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--teal);
  text-decoration-color: var(--teal);
}

button,
input,
select {
  font: inherit;
}

.site-header {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: #1f2d2b;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(90deg, transparent 0, #000 18%, #000 82%, transparent 100%);
}

.site-header::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--teal), var(--amber), var(--blue), var(--rose));
}

.hero-shell,
.page-shell,
.site-footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.hero-shell {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(440px, 0.78fr);
  gap: 40px;
  align-items: center;
  padding: 44px 0 52px;
}

.hero-copy {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: #b9d6d0;
  font-size: 0.92rem;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  max-width: 720px;
  font-size: clamp(2.4rem, 5vw, 4.75rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.lede {
  max-width: 680px;
  margin-bottom: 0;
  color: #d7e1de;
  font-size: 1.08rem;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-width: 620px;
  margin: 24px 0 20px;
}

.hero-metrics div {
  min-height: 74px;
  padding: 13px 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.hero-metrics strong {
  display: block;
  color: #ffffff;
  font-size: 1.82rem;
  line-height: 1;
}

.hero-metrics span {
  display: block;
  margin-top: 6px;
  color: #b9d6d0;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-start;
}

.source-links a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #f8fbfa;
  text-decoration: none;
}

.source-links a:hover {
  background: rgba(255, 255, 255, 0.1);
}

.hero-visual {
  min-width: 0;
  margin: 0;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: #f6f7f2;
  box-shadow: 0 28px 74px rgba(2, 8, 8, 0.28);
}

.hero-visual img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
}

.hero-visual figcaption {
  margin-top: 10px;
  color: #45514d;
  font-size: 0.86rem;
}

.hero-visual figcaption strong {
  color: #0f766e;
}

.page-shell {
  padding-bottom: 44px;
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 22px 0 16px;
}

.stat-item {
  min-height: 74px;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stat-item span {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
}

.stat-item strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 1.42rem;
  line-height: 1.15;
}

.controls {
  display: grid;
  grid-template-columns: minmax(260px, 1.5fr) minmax(160px, 0.65fr) minmax(180px, 0.8fr) minmax(220px, 0.9fr) auto;
  gap: 10px;
  align-items: end;
  padding: 14px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.controls label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.controls input[type="search"],
.controls select {
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fbfcfa;
  color: var(--ink);
}

.controls input[type="search"]:focus,
.controls select:focus,
.controls input[type="range"]:focus {
  outline: 3px solid rgba(15, 118, 110, 0.18);
  border-color: var(--teal);
}

.range-control strong {
  color: var(--ink);
}

.controls input[type="range"] {
  width: 100%;
  min-height: 42px;
  accent-color: var(--teal);
}

.controls button,
.band-tabs button {
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fbfcfa;
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
}

.controls button {
  padding: 0 15px;
}

.controls button:hover,
.band-tabs button:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.band-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 18px;
}

.band-tabs button {
  padding: 0 14px;
}

.band-tabs button.active {
  background: var(--charcoal);
  border-color: var(--charcoal);
  color: #fff;
}

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

.insights {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 14px;
}

.insight-panel,
.review-card,
.empty-state {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(36, 48, 47, 0.06);
}

.insight-panel {
  padding: 16px;
}

.insight-panel h2,
.results-header h2 {
  margin-bottom: 10px;
  font-size: 1.05rem;
  line-height: 1.2;
}

.histogram {
  height: 190px;
  display: flex;
  align-items: end;
  gap: 8px;
  padding-top: 12px;
}

.histogram-bar {
  flex: 1;
  min-width: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 5px 2px;
  border-radius: 7px 7px 4px 4px;
  background: linear-gradient(180deg, var(--teal), #135e63);
  color: #fff;
  font-size: 0.72rem;
}

.histogram-bar:nth-child(1),
.histogram-bar:nth-child(2),
.histogram-bar:nth-child(3) {
  background: linear-gradient(180deg, var(--rose), #861337);
}

.histogram-bar:nth-child(4),
.histogram-bar:nth-child(5) {
  background: linear-gradient(180deg, var(--amber), #8b3f08);
}

.histogram-bar:nth-last-child(1),
.histogram-bar:nth-last-child(2) {
  background: linear-gradient(180deg, var(--blue), #1d4ed8);
}

.top-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
}

.top-list li {
  padding-left: 2px;
}

.top-list a {
  display: inline;
  font-weight: 700;
}

.top-list span {
  float: right;
  margin-left: 8px;
  color: var(--teal);
  font-weight: 800;
}

.results-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  margin-bottom: 10px;
}

.results-header p {
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 700;
}

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

.review-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  overflow: hidden;
}

.review-card.finalist {
  border-left: 6px solid var(--teal);
}

.review-card.strong {
  border-left: 6px solid var(--blue);
}

.review-card.middle {
  border-left: 6px solid var(--amber);
}

.review-card.low {
  border-left: 6px solid var(--rose);
}

.review-rank {
  display: flex;
  align-items: start;
  justify-content: center;
  padding-top: 22px;
  background: #eef2ef;
  color: var(--charcoal);
  font-weight: 900;
}

.review-main {
  min-width: 0;
  padding: 18px;
}

.review-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 18px;
  align-items: start;
}

.review-title {
  display: inline;
  color: var(--ink);
  font-size: 1.18rem;
  font-weight: 850;
  line-height: 1.28;
  overflow-wrap: anywhere;
}

.review-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.84rem;
}

.review-meta span:not(:last-child)::after {
  content: "/";
  margin-left: 7px;
  color: #a7b0ab;
}

.score-box {
  min-height: 88px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  text-align: right;
}

.score-box strong {
  display: block;
  font-size: 1.72rem;
  line-height: 1;
  color: var(--teal);
}

.score-box span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.75rem;
}

.score-meter {
  height: 8px;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe6e1;
}

.score-meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--blue));
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.tag {
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef4f3;
  color: #175d58;
  font-size: 0.76rem;
  font-weight: 800;
}

.prediction {
  margin: 14px 0;
  padding: 12px 14px;
  border-left: 4px solid var(--teal);
  background: #f1f7f5;
  border-radius: 0 8px 8px 0;
  color: #26312e;
}

.evidence-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.evidence-grid section {
  min-width: 0;
}

.evidence-grid h3 {
  margin-bottom: 6px;
  color: var(--charcoal);
  font-size: 0.92rem;
}

.evidence-grid ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 18px;
  color: #3c4642;
}

.empty-state {
  padding: 32px;
  color: var(--muted);
  text-align: center;
}

.site-footer {
  padding: 28px 0 40px;
  color: var(--muted);
  font-size: 0.92rem;
}

.site-footer p {
  margin-bottom: 0;
}

@media (max-width: 1020px) {
  .hero-shell {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .hero-visual {
    max-width: 760px;
  }

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

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

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

  .insights {
    position: static;
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .hero-shell,
  .page-shell,
  .site-footer {
    width: min(100% - 20px, 1180px);
  }

  .hero-shell {
    padding: 28px 0 34px;
  }

  .hero-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 18px 0 18px;
  }

  .hero-metrics div {
    min-height: 66px;
    padding: 10px 9px;
  }

  .hero-metrics strong {
    font-size: 1.42rem;
  }

  .hero-metrics span {
    font-size: 0.68rem;
    line-height: 1.15;
  }

  h1 {
    font-size: 2.18rem;
  }

  .lede {
    font-size: 1rem;
  }

  .source-links {
    justify-content: flex-start;
  }

  .hero-visual {
    padding: 9px;
  }

  .hero-visual figcaption {
    font-size: 0.78rem;
  }

  .controls,
  .insights,
  .evidence-grid {
    grid-template-columns: 1fr;
  }

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

  .stat-item {
    min-height: 66px;
    padding: 12px;
  }

  .stat-item strong {
    font-size: 1.28rem;
  }

  .controls {
    padding: 12px;
  }

  .review-card {
    grid-template-columns: 1fr;
  }

  .review-rank {
    min-height: 42px;
    align-items: center;
    justify-content: flex-start;
    padding: 0 14px;
  }

  .review-heading {
    grid-template-columns: 1fr;
  }

  .score-box {
    max-width: 170px;
    text-align: left;
  }

  .results-header {
    display: grid;
    gap: 2px;
  }
}
