:root {
  --ink: #17211b;
  --muted: #58645d;
  --paper: #f7f5ef;
  --panel: #ffffff;
  --line: #d9d4c6;
  --teal: #0f766e;
  --blue: #2563eb;
  --gold: #b7791f;
  --coral: #c2410c;
  --green: #3f7f45;
  --violet: #6d5bd0;
  --shadow: 0 18px 44px rgba(26, 30, 24, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 0 32px;
  background: rgba(247, 245, 239, 0.93);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 780;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: #fff;
  background: var(--teal);
  border-radius: 8px;
  font-size: 0.82rem;
  letter-spacing: 0;
}

.topnav {
  display: flex;
  gap: 6px;
}

.topnav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 680;
  padding: 10px 12px;
  border-radius: 8px;
}

.topnav a:hover,
.topnav a:focus-visible {
  color: var(--ink);
  background: #ebe6d9;
  outline: none;
}

.hero-band {
  min-height: 560px;
  display: flex;
  align-items: stretch;
  background: #1d2b26;
  color: #fff;
  overflow: hidden;
}

.hero-inner {
  width: min(1440px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(420px, 1.1fr);
  align-items: center;
  gap: 24px;
  padding: 40px 32px 30px;
}

.hero-copy {
  max-width: 680px;
}

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

.hero-copy .eyebrow {
  color: #f7c76c;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: 4rem;
  line-height: 0.98;
  letter-spacing: 0;
  max-width: 760px;
}

h2 {
  margin: 0;
  font-size: 2rem;
  line-height: 1.08;
  letter-spacing: 0;
}

h3 {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.18;
  letter-spacing: 0;
}

.lede {
  margin: 22px 0 0;
  max-width: 650px;
  color: #e4e0d3;
  font-size: 1.12rem;
  line-height: 1.6;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(96px, 1fr));
  gap: 1px;
  margin-top: 32px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.14);
}

.hero-stats div {
  min-width: 0;
  padding: 18px 16px;
  background: rgba(14, 26, 22, 0.58);
}

.hero-stats strong {
  display: block;
  font-size: 2rem;
  line-height: 1;
}

.hero-stats span {
  display: block;
  margin-top: 7px;
  color: #d9d3c5;
  font-size: 0.86rem;
  font-weight: 700;
}

.map-wrap {
  position: relative;
  min-height: 460px;
  align-self: stretch;
}

#successMap {
  width: 100%;
  height: 100%;
  min-height: 460px;
  display: block;
}

.map-key {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.map-key span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 5px 9px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #f8f4e9;
  font-size: 0.76rem;
  font-weight: 720;
}

.map-key i,
.category-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
}

.tool-band,
.browse-band,
.scope-band {
  background: var(--paper);
}

.spotlight-band {
  background: #efe9dc;
}

.tool-inner,
.section-inner {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 34px 32px;
}

.tool-inner {
  display: grid;
  gap: 18px;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 250px) minmax(210px, 250px) auto;
  gap: 12px;
  align-items: end;
}

.search-box,
.select-box,
.toggle-box {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.search-box input,
.select-box select {
  width: 100%;
  min-height: 48px;
  color: var(--ink);
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  outline: none;
}

.search-box input:focus,
.select-box select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.16);
}

.segment-control {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-height: 48px;
  padding: 4px;
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.segment-button {
  min-width: 0;
  min-height: 38px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 780;
  text-transform: none;
  letter-spacing: 0;
}

.segment-button:hover,
.segment-button:focus-visible {
  background: #f4ecdf;
  outline: none;
}

.segment-button[data-active="true"] {
  color: #fff;
  background: var(--teal);
}

.clear-button,
.chip,
.letter-button,
.spotlight-card button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  color: var(--ink);
  cursor: pointer;
  font-weight: 780;
}

.clear-button {
  min-width: 84px;
  height: 48px;
}

.clear-button:hover,
.chip:hover,
.letter-button:hover,
.spotlight-card button:hover {
  border-color: #b9ad97;
  background: #f4ecdf;
}

.filter-group,
.letter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
}

.chip[data-active="true"],
.letter-button[data-active="true"] {
  color: #fff;
  background: var(--teal);
  border-color: var(--teal);
}

.chip i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.letter-button {
  width: 38px;
  padding: 0;
}

.section-inner {
  padding-top: 54px;
  padding-bottom: 58px;
}

.section-heading,
.results-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin-bottom: 24px;
}

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

.spotlight-card {
  min-height: 210px;
  display: grid;
  align-content: space-between;
  gap: 22px;
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 12px 30px rgba(26, 30, 24, 0.08);
}

.spotlight-card p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.spotlight-card strong {
  display: block;
  color: var(--teal);
  font-size: 2.1rem;
  line-height: 1;
  margin-bottom: 10px;
}

.spotlight-card button {
  justify-self: start;
  padding: 0 12px;
}

.result-count {
  margin: 0;
  color: var(--muted);
  font-weight: 760;
}

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

.leader-card {
  min-height: 194px;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 12px;
  padding: 18px;
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(26, 30, 24, 0.06);
}

.leader-card:hover {
  border-color: #b9ad97;
  box-shadow: var(--shadow);
}

.card-topline {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 820;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.leaders {
  margin: 0;
  color: #354039;
  line-height: 1.5;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: end;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid #ded8ca;
  border-radius: 999px;
  color: #4d554f;
  background: #f9f4e9;
  font-size: 0.74rem;
  font-weight: 720;
}

.empty-state {
  padding: 28px;
  margin: 0;
  color: var(--muted);
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.scope-copy {
  max-width: 860px;
}

.scope-copy p:last-child {
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

@media (max-width: 1080px) {
  .hero-inner {
    grid-template-columns: 1fr;
    padding-top: 42px;
  }

  .map-wrap {
    min-height: 420px;
  }

  #successMap {
    min-height: 420px;
  }

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

@media (max-width: 760px) {
  .topbar {
    position: static;
    align-items: flex-start;
    gap: 12px;
    flex-direction: column;
    padding: 16px;
  }

  .topnav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .hero-band {
    min-height: auto;
  }

  .hero-inner,
  .tool-inner,
  .section-inner {
    padding-left: 16px;
    padding-right: 16px;
  }

  .hero-inner {
    gap: 14px;
    padding-top: 24px;
    padding-bottom: 18px;
  }

  h1 {
    font-size: 2.15rem;
  }

  .lede {
    margin-top: 16px;
    font-size: 1rem;
    line-height: 1.5;
  }

  .hero-stats {
    margin-top: 22px;
  }

  .hero-stats div {
    padding: 14px 12px;
  }

  .hero-stats strong {
    font-size: 1.7rem;
  }

  h2 {
    font-size: 1.55rem;
  }

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

  .map-wrap,
  #successMap {
    min-height: 170px;
  }

  .map-key {
    display: none;
  }

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

  .clear-button {
    width: 100%;
  }

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

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