:root {
  --navy-deep: #071f2f;
  --navy: #0b3048;
  --navy-soft: #174b67;
  --ink: #14232c;
  --muted: #61717c;
  --paper: #f4f1e9;
  --surface: #ffffff;
  --surface-soft: #f8fafb;
  --line: #d8e0e4;
  --gold: #d8ad5f;
  --gold-soft: #f4e5bd;
  --teal: #14766e;
  --red: #a64a42;
  --blue: #426b9b;
  --shadow: 0 14px 34px rgba(8, 32, 47, 0.1);
}

* {
  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;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

.directory-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  min-height: 76px;
  align-items: center;
  gap: 24px;
  padding: 11px clamp(20px, 4vw, 64px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  background: rgba(7, 31, 47, 0.97);
  backdrop-filter: blur(16px);
}

.directory-brand {
  display: inline-flex;
  align-items: center;
}

.directory-brand img {
  display: block;
  width: auto;
  height: 48px;
}

.directory-region {
  width: max-content;
  border-left: 1px solid rgba(255, 255, 255, 0.22);
  padding-left: 22px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.directory-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(14px, 2.4vw, 30px);
}

.directory-nav a {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.76rem;
  font-weight: 780;
  text-decoration: none;
}

.directory-nav a:hover,
.directory-nav a:focus-visible {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.directory-hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(110deg, rgba(7, 31, 47, 0.98) 0%, rgba(11, 48, 72, 0.94) 60%, rgba(23, 75, 103, 0.9) 100%),
    repeating-linear-gradient(135deg, transparent 0 22px, rgba(255, 255, 255, 0.025) 22px 23px);
}

.directory-hero::after {
  position: absolute;
  right: -120px;
  bottom: -230px;
  width: 520px;
  height: 520px;
  border: 1px solid rgba(216, 173, 95, 0.28);
  border-radius: 50%;
  box-shadow:
    0 0 0 54px rgba(216, 173, 95, 0.04),
    0 0 0 108px rgba(216, 173, 95, 0.025);
  content: "";
}

.directory-hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.7fr);
  gap: clamp(42px, 7vw, 110px);
  align-items: end;
  max-width: 1440px;
  margin: 0 auto;
  padding: clamp(60px, 8vw, 116px) clamp(22px, 5vw, 76px) clamp(72px, 9vw, 128px);
}

.directory-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin-bottom: 34px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.7rem;
  font-weight: 760;
}

.directory-breadcrumbs a {
  color: rgba(255, 255, 255, 0.8);
  text-underline-offset: 3px;
}

.directory-kicker,
.section-eyebrow {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.directory-hero h1 {
  max-width: 940px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3rem, 6.3vw, 6.2rem);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 0.96;
  text-wrap: balance;
}

.directory-intro {
  max-width: 790px;
  margin: 30px 0 0;
  color: rgba(255, 255, 255, 0.74);
  font-size: clamp(1rem, 1.4vw, 1.18rem);
  line-height: 1.7;
}

.directory-scorecard {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  padding: 26px;
  background: rgba(5, 25, 39, 0.64);
  box-shadow: 0 22px 55px rgba(0, 12, 20, 0.26);
}

.directory-scorecard::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 72px;
  height: 4px;
  border-radius: 9px 0 4px;
  content: "";
  background: var(--gold);
}

.directory-scorecard > p {
  margin: 0;
  color: var(--gold-soft);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.directory-scorecard dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
  margin: 24px 0;
}

.directory-scorecard dt {
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.62rem;
  font-weight: 780;
  line-height: 1.3;
  text-transform: uppercase;
}

.directory-scorecard dd {
  margin: 7px 0 0;
  color: #fff;
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 860;
  letter-spacing: -0.04em;
}

.directory-scorecard small {
  display: block;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.72rem;
  line-height: 1.5;
}

.directory-about,
.directory-method {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.35fr);
  gap: clamp(38px, 8vw, 130px);
  max-width: 1440px;
  margin: 0 auto;
  padding: clamp(48px, 6vw, 86px) clamp(22px, 5vw, 76px);
}

.directory-about {
  align-items: center;
}

.directory-about h2,
.directory-method h2,
.browser-heading h2 {
  margin: 0;
  color: var(--navy-deep);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 3.4vw, 3.3rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.05;
  text-wrap: balance;
}

.directory-about > p {
  margin: 0;
  padding-left: clamp(24px, 4vw, 58px);
  border-left: 3px solid var(--gold);
  color: #41545f;
  font-size: 1rem;
  line-height: 1.85;
}

.directory-browser {
  padding: clamp(48px, 6vw, 86px) clamp(22px, 5vw, 76px) clamp(72px, 8vw, 118px);
  border-top: 1px solid #ccd6db;
  border-bottom: 1px solid #ccd6db;
  background: #edf1f2;
}

.browser-heading,
.directory-controls,
.group-shortcuts,
.directory-results-head,
.entity-grid,
.directory-empty,
.show-more {
  width: min(100%, 1440px);
  margin-right: auto;
  margin-left: auto;
}

.browser-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
}

.directory-status {
  max-width: 320px;
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 0.77rem;
  font-weight: 760;
  text-align: right;
}

.directory-controls {
  display: grid;
  grid-template-columns: minmax(250px, 1.7fr) repeat(4, minmax(150px, 0.8fr)) auto;
  gap: 12px;
  margin-top: 38px;
  padding: 20px;
  border: 1px solid #ccd7dc;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(8, 32, 47, 0.06);
}

.directory-controls label {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.directory-controls label > span {
  color: #52636e;
  font-size: 0.64rem;
  font-weight: 850;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.directory-controls input,
.directory-controls select {
  width: 100%;
  min-height: 46px;
  border: 1px solid #bfcbd1;
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fbfcfc;
  font-size: 0.78rem;
  font-weight: 650;
}

.directory-controls input:focus,
.directory-controls select:focus {
  border-color: var(--navy-soft);
  outline: 3px solid rgba(23, 75, 103, 0.15);
}

.clear-filters {
  align-self: end;
  min-height: 46px;
  border: 1px solid var(--navy);
  border-radius: 6px;
  padding: 10px 17px;
  color: var(--navy);
  background: transparent;
  font-size: 0.73rem;
  font-weight: 850;
  cursor: pointer;
}

.clear-filters:hover,
.clear-filters:focus-visible {
  color: #fff;
  background: var(--navy);
}

.group-shortcuts {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
  margin-top: 18px;
}

.group-shortcuts button {
  display: grid;
  grid-template-columns: 35px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  border: 1px solid #c5d0d5;
  border-radius: 7px;
  padding: 9px 11px;
  color: #43555f;
  background: rgba(255, 255, 255, 0.72);
  text-align: left;
  cursor: pointer;
}

.group-shortcuts button > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--navy-soft);
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.03em;
}

.group-shortcuts button strong {
  overflow: hidden;
  font-size: 0.7rem;
  line-height: 1.25;
  text-overflow: ellipsis;
}

.group-shortcuts button small {
  color: #7b8a92;
  font-size: 0.68rem;
  font-weight: 800;
}

.group-shortcuts button:hover,
.group-shortcuts button:focus-visible,
.group-shortcuts button.is-active {
  border-color: var(--navy);
  color: var(--navy-deep);
  background: #fff;
  box-shadow: 0 5px 13px rgba(8, 32, 47, 0.07);
}

.group-shortcuts button.is-active {
  box-shadow: inset 0 -3px 0 var(--gold);
}

.directory-results-head {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  margin-top: 36px;
  padding-bottom: 15px;
  border-bottom: 1px solid #c6d0d5;
}

.directory-results-head p {
  margin: 0;
  color: #667780;
  font-size: 0.72rem;
}

.directory-results-head p:first-child {
  color: var(--navy-deep);
  font-weight: 850;
}

.entity-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 17px;
  margin-top: 20px;
}

.entity-card {
  display: flex;
  min-width: 0;
  min-height: 430px;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #cbd5da;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(8, 32, 47, 0.055);
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.entity-card:hover {
  border-color: #9cafb9;
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.entity-card-head {
  display: grid;
  grid-template-columns: 45px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 22px 22px 15px;
}

.entity-group-mark {
  display: grid;
  width: 43px;
  height: 43px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--navy-soft);
  font-size: 0.66rem;
  font-weight: 920;
  letter-spacing: 0.03em;
}

.entity-card[data-group="candidate-committees"] .entity-group-mark {
  background: #466b9f;
}

.entity-card[data-group="labor"] .entity-group-mark {
  background: #a14f49;
}

.entity-card[data-group="tribal"] .entity-group-mark {
  background: #8a6738;
}

.entity-card[data-group="major-donors"] .entity-group-mark {
  color: #432f0f;
  background: var(--gold);
}

.entity-card[data-group="parties"] .entity-group-mark {
  background: #62518b;
}

.entity-card[data-group="pacs-committees"] .entity-group-mark {
  background: #17756d;
}

.entity-card[data-group="vendors"] .entity-group-mark {
  background: #5c6f79;
}

.entity-card[data-group="individuals"] .entity-group-mark {
  background: #8a5d72;
}

.entity-group-label {
  margin: 1px 0 7px;
  color: #6b7b84;
  font-size: 0.62rem;
  font-weight: 880;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.entity-card h3 {
  margin: 0;
  color: var(--navy-deep);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.16rem;
  font-weight: 650;
  line-height: 1.23;
}

.entity-card h3 a {
  text-decoration: none;
}

.entity-card h3 a:hover,
.entity-card h3 a:focus-visible {
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.entity-card-meta {
  display: flex;
  min-height: 45px;
  flex-wrap: wrap;
  gap: 6px;
  align-content: start;
  padding: 0 22px 15px;
}

.entity-card-meta > * {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  border: 1px solid #d3dce0;
  border-radius: 4px;
  padding: 4px 7px;
  color: #5b6c76;
  background: #f8fafb;
  font-size: 0.62rem;
  font-weight: 760;
  line-height: 1.25;
}

.official-id-link {
  color: var(--navy);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.official-id-link:hover,
.official-id-link:focus-visible {
  border-color: var(--navy-soft);
  color: var(--navy-deep);
}

.entity-money-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #f8fafb;
}

.entity-money-grid > div {
  min-width: 0;
  padding: 13px 14px;
  border-right: 1px solid var(--line);
}

.entity-money-grid > div:last-child {
  border-right: 0;
}

.entity-money-grid dt {
  color: #73838c;
  font-size: 0.58rem;
  font-weight: 820;
  text-transform: uppercase;
}

.entity-money-grid dd {
  overflow: hidden;
  margin: 5px 0 0;
  color: var(--navy-deep);
  font-size: 0.88rem;
  font-weight: 880;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entity-connections {
  flex: 1;
  padding: 16px 22px 12px;
}

.entity-connections > p {
  margin: 0 0 8px;
  color: #7b8991;
  font-size: 0.6rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.entity-connections > a,
.entity-connections > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 9px 0;
  border-top: 1px solid #e5eaed;
  color: inherit;
  text-decoration: none;
}

.entity-connections strong,
.entity-connections small {
  display: block;
}

.entity-connections strong {
  color: #21343f;
  font-size: 0.73rem;
  line-height: 1.3;
}

.entity-connections small {
  margin-top: 3px;
  color: #77868e;
  font-size: 0.61rem;
  line-height: 1.3;
}

.entity-connections b {
  color: var(--navy);
  font-size: 0.72rem;
}

.entity-connections > a:hover strong,
.entity-connections > a:focus-visible strong {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.no-connections {
  flex: 1;
  margin: 0;
  padding: 19px 22px;
  color: #7b8991;
  font-size: 0.7rem;
  line-height: 1.55;
}

.entity-card-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 13px;
  align-items: center;
  padding: 13px 22px 16px;
  border-top: 1px solid #e1e7ea;
  color: #718089;
  font-size: 0.62rem;
  font-weight: 720;
}

.entity-card-foot a {
  margin-left: auto;
  color: var(--navy);
  font-weight: 860;
  text-decoration: none;
}

.entity-card-foot a:hover,
.entity-card-foot a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.directory-empty,
.directory-error {
  margin-top: 24px;
  border: 1px dashed #aab8bf;
  border-radius: 9px;
  padding: 44px 24px;
  color: #52636d;
  background: rgba(255, 255, 255, 0.56);
  text-align: center;
}

.directory-empty strong,
.directory-error strong {
  color: var(--navy-deep);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.4rem;
}

.directory-empty p,
.directory-error p {
  margin: 8px 0 0;
  font-size: 0.78rem;
}

.show-more {
  display: block;
  width: max-content;
  min-width: 230px;
  margin-top: 28px;
  border: 1px solid var(--navy);
  border-radius: 6px;
  padding: 13px 22px;
  color: #fff;
  background: var(--navy);
  font-size: 0.76rem;
  font-weight: 850;
  cursor: pointer;
}

.show-more:hover,
.show-more:focus-visible {
  color: var(--navy);
  background: #fff;
}

.directory-method {
  padding-top: clamp(58px, 7vw, 96px);
  padding-bottom: clamp(58px, 7vw, 96px);
}

.directory-method > div:last-child {
  color: #4e606a;
  font-size: 0.83rem;
  line-height: 1.75;
}

.directory-method p {
  margin: 0 0 15px;
}

.directory-method small {
  color: #7a898f;
}

.directory-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 26px clamp(22px, 5vw, 76px);
  color: rgba(255, 255, 255, 0.66);
  background: var(--navy-deep);
  font-size: 0.7rem;
  font-weight: 720;
}

.directory-footer a {
  color: #fff;
  text-underline-offset: 3px;
}

@media (max-width: 1180px) {
  .directory-controls {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

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

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

@media (max-width: 860px) {
  .directory-header {
    grid-template-columns: 1fr auto;
    gap: 10px 20px;
  }

  .directory-region {
    justify-self: end;
  }

  .directory-nav {
    grid-column: 1 / -1;
    justify-content: flex-start;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }

  .directory-hero-inner,
  .directory-about,
  .directory-method {
    grid-template-columns: 1fr;
  }

  .directory-scorecard {
    max-width: 540px;
  }

  .directory-about > p {
    padding-top: 18px;
    padding-left: 0;
    border-top: 3px solid var(--gold);
    border-left: 0;
  }

  .browser-heading {
    align-items: start;
    flex-direction: column;
  }

  .directory-status {
    max-width: none;
    text-align: left;
  }
}

@media (max-width: 650px) {
  .directory-header {
    position: relative;
  }

  .directory-brand img {
    height: 42px;
  }

  .directory-region {
    border-left: 0;
    padding-left: 0;
    font-size: 0.62rem;
  }

  .directory-nav {
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .directory-nav a {
    white-space: nowrap;
  }

  .directory-hero-inner {
    padding-top: 48px;
    padding-bottom: 62px;
  }

  .directory-hero h1 {
    font-size: clamp(2.65rem, 14vw, 4.1rem);
  }

  .directory-scorecard dl {
    grid-template-columns: 1fr;
  }

  .directory-scorecard dl > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 20px;
  }

  .directory-controls,
  .group-shortcuts,
  .entity-grid {
    grid-template-columns: 1fr;
  }

  .search-control {
    grid-column: auto;
  }

  .group-shortcuts {
    display: flex;
    overflow-x: auto;
    padding-bottom: 5px;
    scroll-snap-type: x proximity;
  }

  .group-shortcuts button {
    min-width: 230px;
    scroll-snap-align: start;
  }

  .directory-results-head {
    align-items: start;
    flex-direction: column;
    gap: 6px;
  }

  .entity-card {
    min-height: 0;
  }

  .directory-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .entity-card {
    transition: none;
  }
}
