:root {
  --bg: #10141a;
  --cream: #f5eee3;
  --moss: #284f3d;
  --moss-deep: #173327;
  --sand: #efce89;
  --rose: #f0a7a2;
  --ink: #16211a;
  --text: #eef2ed;
  --muted: #aab7af;
  --line: rgba(255, 255, 255, 0.08);
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.3);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --max: 1240px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  font-family: "Manrope", system-ui, sans-serif;
  background:
    radial-gradient(circle at 14% 10%, rgba(239, 206, 137, 0.14), transparent 24%),
    radial-gradient(circle at 84% 8%, rgba(40, 79, 61, 0.2), transparent 22%),
    linear-gradient(180deg, #10141a 0%, #0a0e12 100%);
  color: var(--text);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(circle at center, black 48%, transparent 95%);
  pointer-events: none;
}

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

button,
input,
select {
  font: inherit;
}

.rank-shell {
  position: relative;
  z-index: 1;
  width: min(calc(100% - 40px), var(--max));
  margin: 0 auto;
  padding: 28px 0 72px;
}

.rank-header {
  position: sticky;
  top: 12px;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(16, 20, 26, 0.76);
  backdrop-filter: blur(18px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24);
}

.rank-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--sand) 0%, #daae62 100%);
  color: var(--ink);
  font-weight: 800;
  letter-spacing: 0.08em;
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy strong {
  font-size: 0.95rem;
}

.brand-copy span,
.rank-nav a,
.hero-lead,
.section-heading p,
.signal-card p,
.flow-card p,
.candidate-card p {
  color: var(--muted);
}

.brand-copy span {
  font-size: 0.82rem;
}

.rank-nav {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 14px;
}

.rank-nav a {
  font-size: 0.92rem;
}

.hero-grid,
.section-block {
  margin-bottom: 28px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  gap: 28px;
  padding: 42px;
  border: 1px solid rgba(245, 238, 227, 0.12);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 12% 14%, rgba(239, 206, 137, 0.18), transparent 24%),
    radial-gradient(circle at 88% 12%, rgba(40, 79, 61, 0.18), transparent 20%),
    linear-gradient(135deg, rgba(245, 238, 227, 0.96), rgba(225, 235, 229, 0.94));
  color: var(--ink);
  box-shadow: var(--shadow);
}

.eyebrow,
.signal-label,
.control-label,
.stage-name {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow {
  background: rgba(40, 79, 61, 0.12);
  color: var(--moss-deep);
}

.signal-label,
.control-label,
.stage-name {
  background: rgba(239, 206, 137, 0.12);
  color: #f2dca7;
}

.hero-copy h1,
.section-heading h2,
.signal-card h2,
.closing-panel h2 {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 700;
  line-height: 0.96;
  letter-spacing: -0.04em;
}

.hero-copy h1 {
  margin-top: 18px;
  max-width: 12ch;
  font-size: clamp(3rem, 6vw, 5.2rem);
}

.hero-lead {
  max-width: 60ch;
  margin: 22px 0 0;
  font-size: 1.05rem;
  line-height: 1.6;
}

.hero-actions,
.closing-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 700;
}

.button-primary {
  background: linear-gradient(135deg, var(--moss) 0%, #436e59 100%);
  color: #f8f4ec;
}

.button-secondary {
  border-color: rgba(22, 33, 26, 0.12);
  background: rgba(255, 255, 255, 0.46);
  color: var(--ink);
}

.hero-metrics,
.metric-strip,
.flow-grid {
  display: grid;
  gap: 16px;
}

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

.metric-card,
.mini-metric,
.signal-card,
.control-panel,
.stage-panel,
.flow-card,
.closing-panel {
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.metric-card,
.mini-metric {
  display: grid;
  gap: 4px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.6);
}

.metric-value,
.mini-metric span {
  font-family: "Fraunces", Georgia, serif;
  font-size: 2rem;
  line-height: 1;
}

.metric-label,
.mini-metric small {
  color: #5b6a60;
}

.hero-rail {
  display: grid;
  gap: 18px;
  align-content: start;
}

.signal-card {
  padding: 24px;
  border-radius: 28px;
}

.signal-card-dark {
  background: linear-gradient(155deg, #1f3f31 0%, #2c5944 100%);
  color: #f8f4ec;
}

.signal-card-dark .signal-label {
  background: rgba(245, 238, 227, 0.16);
  color: #dfe8e1;
}

.signal-card-light {
  background: rgba(255, 255, 255, 0.52);
  color: var(--ink);
  border-color: rgba(22, 33, 26, 0.08);
}

.signal-card-light .signal-label {
  background: rgba(40, 79, 61, 0.12);
  color: #456150;
}

.section-heading {
  max-width: 74ch;
  margin-bottom: 20px;
}

.section-heading h2 {
  font-size: clamp(2.3rem, 4vw, 3.6rem);
}

.section-heading p {
  margin: 12px 0 0;
  line-height: 1.6;
}

.lab-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.78fr) minmax(0, 1.22fr);
  gap: 24px;
}

.control-panel,
.stage-panel,
.closing-panel {
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.04);
}

.control-panel,
.stage-panel {
  padding: 22px;
}

.control-panel {
  display: grid;
  gap: 18px;
  align-content: start;
}

.control-block {
  display: grid;
  gap: 12px;
}

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

.chip-button {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
}

.chip-button.is-active {
  background: rgba(239, 206, 137, 0.16);
  border-color: rgba(239, 206, 137, 0.28);
}

select,
input[type="range"] {
  width: 100%;
}

select {
  min-height: 46px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

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

.stage-panel {
  display: grid;
  gap: 18px;
}

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

.stage-pill {
  display: grid;
  gap: 4px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.stage-pill strong {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.8rem;
  line-height: 1;
}

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

.candidate-board {
  display: grid;
  gap: 14px;
}

.candidate-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.candidate-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 14px;
}

.candidate-head h3 {
  margin: 0;
  font-size: 1.08rem;
}

.candidate-meta {
  color: var(--muted);
  font-size: 0.88rem;
}

.winner-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.winner-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(239, 206, 137, 0.14);
  color: #f2dca7;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.score-grid {
  display: grid;
  gap: 10px;
}

.score-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 56px;
  gap: 12px;
  align-items: center;
}

.score-row span,
.score-row strong {
  font-size: 0.92rem;
}

.bar-track {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 999px;
}

.fill-semantic {
  background: linear-gradient(90deg, #8bc7ff 0%, #4a7de0 100%);
}

.fill-lexical {
  background: linear-gradient(90deg, #efce89 0%, #df9a4c 100%);
}

.fill-hybrid {
  background: linear-gradient(90deg, #93dfb6 0%, #3e9864 100%);
}

.fill-rerank {
  background: linear-gradient(90deg, #f0a7a2 0%, #cc5f5a 100%);
}

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

.flow-card {
  padding: 20px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.flow-card h3 {
  margin: 0 0 10px;
  font-size: 1.2rem;
}

.closing-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 28px;
}

[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 460ms ease, transform 460ms ease;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1040px) {
  .hero-grid,
  .lab-grid,
  .flow-grid {
    grid-template-columns: 1fr;
  }

  .hero-metrics,
  .metric-strip,
  .stage-ribbon {
    grid-template-columns: 1fr;
  }

  .closing-panel {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 760px) {
  .rank-shell {
    width: min(calc(100% - 24px), var(--max));
    padding-top: 16px;
  }

  .rank-header {
    position: static;
    border-radius: 24px;
    flex-direction: column;
    align-items: stretch;
  }

  .rank-nav {
    justify-content: flex-start;
  }

  .hero-grid,
  .control-panel,
  .stage-panel,
  .flow-card,
  .closing-panel {
    border-radius: 24px;
  }

  .hero-grid {
    padding: 28px;
  }

  .score-row {
    grid-template-columns: 1fr;
  }
}
