:root {
  --bg: #f7f2ff;
  --paper: #ffffff;
  --ink: #1d1930;
  --muted: #625a75;
  --purple: #4b1d7a;
  --purple-2: #6f35b0;
  --gold: #f3b23a;
  --gold-soft: #fff2cf;
  --line: #e7def6;
  --shadow: 0 18px 50px rgba(43, 20, 73, .12);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top left, #fff6dc 0, transparent 34rem), var(--bg);
}

a {
  color: inherit;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  background: var(--paper);
  padding: .75rem 1rem;
  border-radius: 999px;
  z-index: 20;
}

.hero {
  padding: 1rem clamp(1rem, 3vw, 3rem) 5.25rem;
  background:
    linear-gradient(135deg, rgba(75,29,122,.97), rgba(111,53,176,.90)),
    url("data:image/svg+xml,%3Csvg width='80' height='80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.15'%3E%3Cpath d='M0 40h80M40 0v80'/%3E%3Ccircle cx='40' cy='40' r='18'/%3E%3C/g%3E%3C/svg%3E");
  color: white;
}

.topbar,
.hero-grid,
main,
footer {
  max-width: 1180px;
  margin: 0 auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: .5rem 0 2.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: .7rem;
  font-weight: 800;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 12px;
  background: var(--gold);
  color: #32124f;
}

.nav-actions {
  display: flex;
  gap: 1rem;
  font-weight: 700;
  font-size: .95rem;
}

.nav-actions a {
  text-decoration: none;
  opacity: .9;
}

.nav-actions a:hover {
  opacity: 1;
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, .55fr);
  gap: 2rem;
  align-items: end;
}

.eyebrow {
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 800;
  font-size: .78rem;
  margin: 0 0 .55rem;
}

h1 {
  font-size: clamp(2.4rem, 7vw, 5.7rem);
  line-height: .94;
  margin: 0;
  letter-spacing: -.06em;
}

.hero-copy {
  max-width: 780px;
  color: rgba(255,255,255,.88);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .8rem;
  margin-top: 1.4rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: .8rem 1.15rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 800;
}

.primary {
  background: var(--gold);
  color: #32124f;
}

.secondary {
  border: 1px solid rgba(255,255,255,.35);
  color: white;
}

.snapshot {
  display: grid;
  gap: .8rem;
}

.snapshot div {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.20);
  border-radius: 18px;
  padding: 1.1rem;
  backdrop-filter: blur(10px);
}

.snapshot strong {
  display: block;
  font-size: 2rem;
}

.snapshot span {
  color: rgba(255,255,255,.78);
}

main {
  padding: 0 clamp(1rem, 3vw, 3rem) 3rem;
}

.panel {
  background: rgba(255,255,255,.92);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  padding: clamp(1rem, 3vw, 1.5rem);
}

.section-heading h2,
.results-header h2,
.map-lookup-header h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  letter-spacing: -.03em;
}

.section-heading p:not(.eyebrow),
.map-lookup-header p {
  color: var(--muted);
  margin: .5rem 0 0;
  line-height: 1.55;
}

/* Full-width embedded address lookup map */

.map-lookup-section {
  margin-top: -3.5rem;
  margin-bottom: 1rem;
  position: relative;
  z-index: 2;
}

.map-lookup-header {
  background: rgba(255,255,255,.96);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: var(--shadow);
  padding: clamp(1rem, 3vw, 1.5rem);
}

.map-frame-wrap {
  width: 100%;
  height: 840px;
  background: #efe7fb;
  border: 1px solid var(--line);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.map-frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* Candidate search */

.search-panel {
  margin-top: 1rem;
  position: relative;
}

.filters {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: .9rem;
  margin-top: 1.25rem;
}

label span,
.sort-label {
  display: grid;
  gap: .35rem;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 800;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 15px;
  min-height: 46px;
  padding: .75rem .85rem;
  font: inherit;
  color: var(--ink);
  background: white;
}

input:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(243,178,58,.55);
  outline-offset: 2px;
}

.active-row,
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--purple);
  font-weight: 800;
  cursor: pointer;
}

.layout {
  display: grid;
  grid-template-columns: 290px minmax(0,1fr);
  gap: 1rem;
  margin-top: 1rem;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 1rem;
}

.sidebar h2,
.sidebar h3 {
  margin: .2rem 0 .8rem;
}

.sidebar h3 {
  margin-top: 1.2rem;
  font-size: 1rem;
  color: var(--muted);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.chip {
  border: 1px solid var(--line);
  background: white;
  color: var(--purple);
  border-radius: 999px;
  padding: .55rem .75rem;
  font-weight: 800;
  cursor: pointer;
}

.chip.active {
  background: var(--purple);
  color: white;
}

.mini-list {
  display: grid;
  gap: .4rem;
}

.mini-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .55rem .65rem;
  border-radius: 12px;
  background: #faf7ff;
  color: var(--muted);
  font-size: .9rem;
}

.mini-item strong {
  color: var(--ink);
}

.cards {
  display: grid;
  gap: .85rem;
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1rem;
  box-shadow: 0 8px 24px rgba(43, 20, 73, .06);
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.card h3 {
  margin: .15rem 0 .35rem;
  font-size: 1.25rem;
  letter-spacing: -.02em;
}

.meta {
  color: var(--muted);
  line-height: 1.5;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .65rem;
}

.badge {
  border-radius: 999px;
  padding: .35rem .55rem;
  background: #f3eefb;
  color: var(--purple);
  font-weight: 800;
  font-size: .8rem;
}

.badge.gold {
  background: var(--gold-soft);
  color: #6a4300;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-top: .85rem;
}

.card-actions a {
  text-decoration: none;
  color: var(--purple);
  font-weight: 800;
  border-bottom: 2px solid var(--gold);
}

.party-dot {
  width: .85rem;
  height: .85rem;
  border-radius: 999px;
  flex: 0 0 auto;
  margin-top: .35rem;
  background: var(--purple);
}

.party-D {
  background: #3468c7;
}

.party-R {
  background: #c73636;
}

.party-G {
  background: #2f8f55;
}

.party-L {
  background: #d09b20;
}

.party-AIP {
  background: #7142a8;
}

.party-IND {
  background: #6b7280;
}

.office-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: .85rem;
  margin-top: 1rem;
}

.office-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1rem;
  background: #fff;
}

.office-card h3 {
  margin: 0 0 .4rem;
}

.office-card p {
  color: var(--muted);
  line-height: 1.55;
}

.offices-panel,
.about-panel,
.source-strip {
  margin-top: 1rem;
}

.notes {
  display: grid;
  gap: .75rem;
  margin-top: 1rem;
}

.note {
  border-left: 5px solid var(--gold);
  background: #fffaf0;
  padding: .9rem 1rem;
  border-radius: 14px;
  color: var(--muted);
}

.source-strip {
  color: var(--muted);
  text-align: center;
}

footer {
  padding: 1.5rem clamp(1rem, 3vw, 3rem) 3rem;
  color: var(--muted);
  text-align: center;
}

.empty {
  padding: 2rem;
  border: 2px dashed var(--line);
  border-radius: 20px;
  color: var(--muted);
  text-align: center;
  background: #fff;
}

/* Responsive layout */

@media (max-width: 900px) {
  .hero-grid,
  .layout,
  .filters {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-bottom: 4rem;
  }

  .map-lookup-section {
    margin-top: -2rem;
  }

  .map-frame-wrap {
    height: 940px;
  }

  .sidebar {
    position: static;
  }
}

@media (max-width: 560px) {
  .topbar,
  .active-row,
  .results-header,
  .card-head {
    align-items: stretch;
    flex-direction: column;
  }

  .nav-actions {
    display: none;
  }

  .hero {
    padding-bottom: 3rem;
  }

  h1 {
    font-size: clamp(2.35rem, 15vw, 4rem);
  }

  .map-frame-wrap {
    height: 980px;
  }
}