/* ==========================================================================
   Permit Atlas — design system
   Direction: civic records / policy-tracker. Cool paper, navy ink, teal accent,
   hairline rules, mono for data. No firearm imagery anywhere in the system.
   ========================================================================== */

/* --------------------------------------------------------------- tokens --- */
:root {
  /* surface + ink */
  --ink: #0c1420;
  --navy: #16324f;
  --navy-deep: #0e2135;
  --paper: #f5f7f9;
  --paper-2: #eaeff4;
  --card: #ffffff;
  --rule: #d7dee6;
  --rule-strong: #b9c5d1;
  --text: #1b2733;
  --muted: #59697a;
  --accent: #0e6e77;
  --accent-deep: #0a545b;
  --accent-wash: #e6f1f2;

  /* status categories — also referenced by data/states.js statusKey values */
  --status-permit-required: #1b3f6b;
  --status-shall-issue: #0e6e77;
  --status-permitless-optional: #8c6a20;
  --status-local-variation: #6a4a7c;
  --status-none: #8b98a6;

  /* type */
  --font-display: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;

  /* rhythm */
  --shell: 1180px;
  --gutter: clamp(1.125rem, 4vw, 2.5rem);
  --section-y: clamp(3.5rem, 7vw, 6.5rem);
  --radius: 4px;
  --radius-lg: 8px;

  --shadow-sm: 0 1px 2px rgba(12, 20, 32, 0.06);
  --shadow-md: 0 12px 32px -18px rgba(12, 20, 32, 0.35);

  /* Surfaces that stay dark in both themes, plus every place ink is used as a BACKGROUND.
     These exist so the dark theme can invert text ink without inverting buttons and bands. */
  --header-bg: rgba(255, 255, 255, 0.94);
  --band-bg: #0c1420;
  --footer-bg: #0e2135;
  --skip-bg: #0c1420;
  --skip-fg: #ffffff;
  --btn-primary-bg: #0c1420;
  --btn-primary-bg-hover: #16324f;
  --btn-primary-fg: #ffffff;
  --btn-accent-bg: #0e6e77;
  --btn-accent-bg-hover: #0a545b;
  --btn-accent-fg: #ffffff;
  --tile-active-bg: #0c1420;
  --tile-active-fg: #ffffff;
  --pending-bg: #fdf6e6;
  --pending-border: #eddcb4;
  --pending-fg: #7a5c12;
  --warn-bg: #fdf9f0;
  --warn-border: #b98a2a;
  --warn-fg: #8a6a20;
  --mark-bg: #0c1420;
  --mark-fg: #ffffff;
}

/* Dark theme. Two selectors on purpose: the media query serves visitors who never touched the
   toggle (and anyone with JavaScript off), the attribute serves an explicit choice. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --ink: #f0f5f9;
    --navy: #2a4a6b;
    --navy-deep: #0a141f;
    --paper: #0a1017;
    --paper-2: #111b25;
    --card: #131d28;
    --rule: #22303e;
    --rule-strong: #35485d;
    --text: #dae3ea;
    --muted: #93a4b5;
    --accent: #3fa8b2;
    --accent-deep: #6fd0d8;
    --accent-wash: #12303a;
    --status-permit-required: #5f92d1;
    --status-shall-issue: #3fb0ba;
    --status-permitless-optional: #c79b45;
    --status-local-variation: #a684bf;
    --status-none: #6b7a8a;
    --header-bg: rgba(10, 16, 23, 0.92);
    --band-bg: #101b26;
    --footer-bg: #08111a;
    --skip-bg: #e9f0f6;
    --skip-fg: #0a1017;
    --btn-primary-bg: #e9f0f6;
    --btn-primary-bg-hover: #c9d8e5;
    --btn-primary-fg: #0a1017;
    --btn-accent-bg: #4fbcc6;
    --btn-accent-bg-hover: #7ad3db;
    --btn-accent-fg: #05171a;
    --tile-active-bg: #e9f0f6;
    --tile-active-fg: #0a1017;
    --pending-bg: #2a2213;
    --pending-border: #4d3f1d;
    --pending-fg: #e2c477;
    --warn-bg: #1d190f;
    --warn-border: #8a6a20;
    --warn-fg: #d9b568;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 12px 32px -16px rgba(0, 0, 0, 0.8);
    --mark-bg: #e9f0f6;
    --mark-fg: #0a1017;
  }
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --ink: #f0f5f9;
  --navy: #2a4a6b;
  --navy-deep: #0a141f;
  --paper: #0a1017;
  --paper-2: #111b25;
  --card: #131d28;
  --rule: #22303e;
  --rule-strong: #35485d;
  --text: #dae3ea;
  --muted: #93a4b5;
  --accent: #3fa8b2;
  --accent-deep: #6fd0d8;
  --accent-wash: #12303a;
  --status-permit-required: #5f92d1;
  --status-shall-issue: #3fb0ba;
  --status-permitless-optional: #c79b45;
  --status-local-variation: #a684bf;
  --status-none: #6b7a8a;
  --header-bg: rgba(10, 16, 23, 0.92);
  --band-bg: #101b26;
  --footer-bg: #08111a;
  --skip-bg: #e9f0f6;
  --skip-fg: #0a1017;
  --btn-primary-bg: #e9f0f6;
  --btn-primary-bg-hover: #c9d8e5;
  --btn-primary-fg: #0a1017;
  --btn-accent-bg: #4fbcc6;
  --btn-accent-bg-hover: #7ad3db;
  --btn-accent-fg: #05171a;
  --tile-active-bg: #e9f0f6;
  --tile-active-fg: #0a1017;
  --pending-bg: #2a2213;
  --pending-border: #4d3f1d;
  --pending-fg: #e2c477;
  --warn-bg: #1d190f;
  --warn-border: #8a6a20;
  --warn-fg: #d9b568;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 12px 32px -16px rgba(0, 0, 0, 0.8);
  --mark-bg: #e9f0f6;
  --mark-fg: #0a1017;
}

/* ---------------------------------------------------------------- reset --- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  max-width: 100%;
  height: auto;
  display: block;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 0.6em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.125rem, 5.2vw, 3.5rem);
}
h2 {
  font-size: clamp(1.65rem, 3.4vw, 2.35rem);
}
h3 {
  font-size: 1.1875rem;
  letter-spacing: -0.01em;
}
h4 {
  font-size: 1.0625rem;
  letter-spacing: 0;
}

p {
  margin: 0 0 1.1em;
  max-width: 72ch;
}

a {
  color: var(--accent-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--ink);
}

ul,
ol {
  margin: 0 0 1.1em;
  padding-left: 1.15rem;
}

li {
  margin-bottom: 0.4em;
}

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2.5rem 0;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ------------------------------------------------------------ structure --- */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--section-y);
}

.section--tight {
  padding-block: clamp(2.5rem, 5vw, 4rem);
}

.section--paper {
  background: var(--card);
  border-block: 1px solid var(--rule);
}

.section--wash {
  background: var(--paper-2);
  border-block: 1px solid var(--rule);
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  z-index: 100;
  background: var(--skip-bg);
  color: var(--skip-fg);
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 0.75rem;
  color: var(--skip-fg);
}

/* ------------------------------------------------------- shared devices --- */
/* Mono eyebrow with a filing-tab tick — the recurring structural motif. */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1rem;
}

.eyebrow::before {
  content: '';
  width: 1.5rem;
  height: 2px;
  background: var(--accent);
  flex: none;
}

.lede {
  font-size: 1.1875rem;
  color: var(--muted);
  max-width: 60ch;
}

.section-head {
  max-width: 68ch;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.fine {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.6;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
}

/* ------------------------------------------------------------- buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  padding: 0.8rem 1.4rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease,
    transform 0.15s ease;
}

.btn svg {
  flex: none;
}

.btn--primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-fg);
  border-color: var(--btn-primary-bg);
}

.btn--primary:hover {
  background: var(--btn-primary-bg-hover);
  border-color: var(--btn-primary-bg-hover);
  color: var(--btn-primary-fg);
}

.btn--accent {
  background: var(--btn-accent-bg);
  color: var(--btn-accent-fg);
  border-color: var(--btn-accent-bg);
}

.btn--accent:hover {
  background: var(--btn-accent-bg-hover);
  border-color: var(--btn-accent-bg-hover);
  color: var(--btn-accent-fg);
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule-strong);
}

.btn--ghost:hover {
  border-color: var(--ink);
  background: var(--card);
  color: var(--ink);
}

.btn--light {
  background: #ffffff;
  color: #0c1420;
  border-color: #ffffff;
}

.btn--light:hover {
  background: #d8e7e9;
  border-color: #d8e7e9;
  color: #0c1420;
}

.btn--outline-light {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}

.btn--outline-light:hover {
  border-color: #fff;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.btn[aria-disabled='true'],
.btn:disabled {
  background: var(--paper-2);
  border-color: var(--rule);
  color: var(--muted);
  cursor: not-allowed;
  pointer-events: none;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

/* -------------------------------------------------------------- header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--rule);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--ink);
}

.brand__mark {
  width: 2rem;
  height: 2rem;
  flex: none;
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: -0.02em;
}

.brand__tag {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* The theme and menu buttons need the room on small screens. */
@media (max-width: 480px) {
  .site-header .brand__tag {
    display: none;
  }
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  order: 2;
}

.header__actions {
  order: 3;
}

@media (min-width: 861px) {
  .nav {
    margin-left: auto;
  }
}

.nav__list {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__list li {
  margin: 0;
}

.nav__link {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  padding-block: 0.35rem;
  border-bottom: 2px solid transparent;
}

.nav__link:hover {
  color: var(--ink);
  border-bottom-color: var(--rule-strong);
}

.nav__link[aria-current='page'] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.nav__cta {
  padding: 0.55rem 1rem;
  font-size: 0.9375rem;
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: none;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.375rem;
  height: 2.375rem;
  padding: 0;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.theme-toggle:hover {
  color: var(--ink);
  border-color: var(--rule-strong);
  background: var(--paper);
}

/* One icon per theme; the resolved theme decides which is in the box. */
.theme-toggle__moon {
  display: none;
}

:root[data-theme='dark'] .theme-toggle__sun {
  display: none;
}

:root[data-theme='dark'] .theme-toggle__moon {
  display: block;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .theme-toggle__sun {
    display: none;
  }

  :root:not([data-theme='light']) .theme-toggle__moon {
    display: block;
  }
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  cursor: pointer;
}

@media (max-width: 860px) {
  .nav-toggle {
    display: inline-flex;
  }

  .nav {
    position: absolute;
    inset: 4.25rem 0 auto;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--card);
    border-bottom: 1px solid var(--rule);
    box-shadow: var(--shadow-md);
    padding: 0.5rem var(--gutter) 1.25rem;
  }

  .nav.is-open {
    display: flex;
  }

  .nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .nav__link {
    display: block;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--rule);
  }

  .nav__link[aria-current='page'] {
    border-bottom-color: var(--accent);
  }

  .nav__cta {
    margin-top: 1rem;
    justify-content: center;
  }
}

/* ------------------------------------------- eligibility offer splash --- */
html.is-offer-locked body {
  overflow: hidden;
}

.offer-splash {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #070c12;
}

.offer-splash[hidden] {
  display: none;
}

.offer-splash__close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  z-index: 2;
  padding: 0.45rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--radius);
  background: rgba(7, 12, 18, 0.72);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}

.offer-splash__close:hover,
.offer-splash__close:focus-visible {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
}

.offer-splash__link {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.offer-splash__link:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}

.offer-splash__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

@media (min-width: 768px) {
  .offer-splash {
    padding: clamp(2rem, 6vh, 4rem) var(--gutter);
    background: rgba(12, 20, 32, 0.55);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    backdrop-filter: blur(18px) saturate(140%);
  }

  .offer-splash__close {
    top: max(1rem, 3vh);
    right: max(1rem, var(--gutter));
  }

  .offer-splash__link {
    width: min(1080px, 88vw);
    height: auto;
    overflow: hidden;
    border-radius: var(--radius-lg);
    box-shadow: 0 28px 64px -12px rgba(0, 0, 0, 0.55);
    background: #fff;
    transition: transform 160ms ease, box-shadow 160ms ease;
  }

  .offer-splash__link:hover {
    transform: translateY(-2px);
    box-shadow: 0 32px 72px -12px rgba(0, 0, 0, 0.6);
  }

  .offer-splash__img {
    width: 100%;
    height: auto;
    max-height: 78vh;
    object-fit: contain;
  }
}

/* ---------------------------------------------------------------- hero --- */
.hero {
  background: var(--card);
  border-bottom: 1px solid var(--rule);
  padding-block: clamp(2.75rem, 6vw, 5rem);
  position: relative;
  overflow: hidden;
}

.hero::after {
  /* hairline graph paper, extremely quiet */
  content: '';
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--paper-2) 1px, transparent 1px),
    linear-gradient(90deg, var(--paper-2) 1px, transparent 1px);
  background-size: 56px 56px;
  opacity: 0.55;
  mask-image: radial-gradient(120% 90% at 85% 10%, #000 0%, transparent 70%);
  pointer-events: none;
}

.hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  gap: clamp(2.25rem, 5vw, 3.5rem);
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

.hero__inner > *,
.picker > *,
.split > * {
  min-width: 0;
}

@media (min-width: 940px) {
  .hero__inner {
    grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr);
    align-items: center;
  }
}

.hero h1 {
  margin-bottom: 1rem;
}

.hero__sub {
  font-size: 1.1875rem;
  color: var(--muted);
  max-width: 46ch;
}

.hero__disclosure {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  margin-top: 1.5rem;
  padding: 0.85rem 1rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.875rem;
  color: var(--muted);
  max-width: 52ch;
}

.hero__disclosure svg {
  flex: none;
  margin-top: 0.15rem;
  color: var(--accent);
}

.hero__stats {
  display: grid;
  gap: 1.25rem 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  max-width: 34rem;
}

.hero__stat {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero__stat b {
  display: block;
  font-family: var(--font-display);
  font-size: 1.3125rem;
  margin-bottom: 0.15rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-transform: none;
}

/* ------------------------------------------------- signature: tile map --- */
.atlas {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: clamp(1rem, 2.5vw, 1.5rem);
}

.atlas__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.85rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
}

.atlas__title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
}

.atlas__count {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
}

/* Below ~560px twelve columns would render 8px labels, so the map scrolls sideways instead. */
.atlas__scroll {
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

.tilemap {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: clamp(3px, 0.55vw, 6px);
  min-width: 27rem;
}

/* keeps tiles square without JS */
.tilemap::before {
  content: '';
  grid-area: 1 / 1;
  aspect-ratio: 1;
  width: 0;
}

.tile {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  border: 1px solid var(--rule);
  border-bottom-width: 3px;
  border-bottom-color: var(--status-none);
  border-radius: 3px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: clamp(0.625rem, 0.95vw, 0.75rem);
  font-weight: 500;
  letter-spacing: 0.03em;
  text-decoration: none;
  cursor: pointer;
  padding: 0;
  transition: background-color 0.12s ease, transform 0.12s ease, border-color 0.12s ease;
}

.tile:hover {
  background: var(--card);
  border-color: var(--ink);
  transform: translateY(-1px);
  color: var(--ink);
}

.tile[aria-pressed='true'],
.tile.is-active {
  background: var(--tile-active-bg);
  border-color: var(--tile-active-bg);
  color: var(--tile-active-fg);
}

.tile[data-status='permit-required'] {
  border-bottom-color: var(--status-permit-required);
}
.tile[data-status='shall-issue'] {
  border-bottom-color: var(--status-shall-issue);
}
.tile[data-status='permitless-optional'] {
  border-bottom-color: var(--status-permitless-optional);
}
.tile[data-status='local-variation'] {
  border-bottom-color: var(--status-local-variation);
}

.legend {
  display: grid;
  gap: 0.4rem 1rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  margin: 1.1rem 0 0;
  padding: 1rem 0 0;
  border-top: 1px solid var(--rule);
  list-style: none;
}

.legend li {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.45;
}

.legend__swatch {
  flex: none;
  width: 0.875rem;
  height: 0.875rem;
  margin-top: 0.22rem;
  border-radius: 2px;
  background: var(--status-none);
}

.legend__swatch[data-status='permit-required'] {
  background: var(--status-permit-required);
}
.legend__swatch[data-status='shall-issue'] {
  background: var(--status-shall-issue);
}
.legend__swatch[data-status='permitless-optional'] {
  background: var(--status-permitless-optional);
}
.legend__swatch[data-status='local-variation'] {
  background: var(--status-local-variation);
}

.atlas__hint {
  display: none;
  margin: 0.75rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

@media (max-width: 560px) {
  .atlas__hint {
    display: block;
  }
}

.atlas__note {
  margin: 0.9rem 0 0;
  font-size: 0.75rem;
  color: var(--muted);
  font-family: var(--font-mono);
  line-height: 1.5;
}

/* -------------------------------------------------------- state picker --- */
.picker {
  display: grid;
  gap: clamp(1.5rem, 4vw, 2.5rem);
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 940px) {
  .picker {
    grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
    align-items: start;
  }
}

.picker__form {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 3vw, 1.75rem);
  position: relative;
}

@media (min-width: 940px) {
  .picker__form {
    position: sticky;
    top: 5.5rem;
  }
}

.field {
  display: block;
  margin-bottom: 1rem;
}

.field__label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.field__hint {
  font-size: 0.8125rem;
  color: var(--muted);
  margin: 0.5rem 0 0;
}

.combo {
  position: relative;
}

.input,
.select {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text);
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  padding: 0.75rem 2.5rem 0.75rem 0.85rem;
  appearance: none;
}

.input::placeholder {
  color: #8b98a6;
}

.input:focus,
.select:focus {
  background: #fff;
  border-color: var(--accent);
  outline: 2px solid var(--accent-wash);
  outline-offset: 0;
}

.combo__icon {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.combo__list {
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  top: calc(100% + 0.35rem);
  max-height: 17rem;
  overflow-y: auto;
  margin: 0;
  padding: 0.25rem;
  list-style: none;
  background: var(--card);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

.combo__list[hidden] {
  display: none;
}

.combo__option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0;
  padding: 0.55rem 0.65rem;
  border-radius: 3px;
  font-size: 0.9375rem;
  cursor: pointer;
}

.combo__option[aria-selected='true'],
.combo__option:hover {
  background: var(--accent-wash);
}

.combo__option .mono {
  color: var(--muted);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: right;
}

.combo__empty {
  padding: 0.65rem;
  font-size: 0.9375rem;
  color: var(--muted);
}

/* ---------------------------------------------------------- state card --- */
.state-panel {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.state-panel--empty {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 18rem;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  background: var(--card);
  border-style: dashed;
}

.state-panel__head {
  padding: clamp(1.25rem, 3vw, 1.75rem);
  border-bottom: 1px solid var(--rule);
  background: linear-gradient(180deg, var(--paper) 0%, var(--card) 100%);
}

.state-panel__name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.state-panel__name h3 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 1.875rem);
}

.state-panel__body {
  padding: clamp(1.25rem, 3vw, 1.75rem);
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
}

.status-chip::before {
  content: '';
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--status-none);
  flex: none;
}

.status-chip[data-status='permit-required']::before {
  background: var(--status-permit-required);
}
.status-chip[data-status='shall-issue']::before {
  background: var(--status-shall-issue);
}
.status-chip[data-status='permitless-optional']::before {
  background: var(--status-permitless-optional);
}
.status-chip[data-status='local-variation']::before {
  background: var(--status-local-variation);
}

.chip-pending {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pending-fg);
  background: var(--pending-bg);
  border: 1px solid var(--pending-border);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
}

/* definition rows — the "record sheet" pattern */
.record {
  margin: 0;
  border-top: 1px solid var(--rule);
}

.record__row {
  display: grid;
  gap: 0.25rem 1.5rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--rule);
}

@media (min-width: 620px) {
  .record__row {
    grid-template-columns: minmax(0, 11rem) minmax(0, 1fr);
  }
}

.record__key {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

.record__val {
  margin: 0;
  color: var(--text);
}

/* -------------------------------------------------------- provider CTA --- */
.provider {
  margin-top: 1.5rem;
  padding: clamp(1.1rem, 2.5vw, 1.5rem);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}

.provider__label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.65rem;
}

.provider__note {
  font-size: 0.875rem;
  color: var(--muted);
  margin: 0 0 1rem;
  max-width: 60ch;
}

.provider__unavailable {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  font-size: 0.9375rem;
  color: var(--text);
}

.provider__unavailable svg {
  flex: none;
  margin-top: 0.2rem;
  color: var(--muted);
}

.affiliate-disclosure {
  margin: 1rem 0 0;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.55;
}

/* -------------------------------------------------------------- steps --- */
.steps {
  display: grid;
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  overflow: hidden;
  counter-reset: step;
}

@media (min-width: 800px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
}

.step {
  background: var(--card);
  padding: clamp(1.5rem, 3vw, 2rem);
}

.step__num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: var(--accent);
  display: block;
  margin-bottom: 1.5rem;
}

.step h3 {
  margin-bottom: 0.5rem;
}

.step p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9375rem;
}

/* -------------------------------------------------------------- cards --- */
.cards {
  display: grid;
  gap: clamp(0.75rem, 1.6vw, 1rem);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.35rem;
}

.card__icon {
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--accent-wash);
  color: var(--accent-deep);
  margin-bottom: 1rem;
}

.card h3 {
  font-size: 1.0625rem;
  margin-bottom: 0.35rem;
}

.card p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--muted);
}

.card--link {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.card--link:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
  color: inherit;
}

/* --------------------------------------------------------- two-column --- */
.split {
  display: grid;
  gap: clamp(1.75rem, 4vw, 3.5rem);
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 900px) {
  .split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .split--narrow-right {
    grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
  }
}

.panel {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: clamp(1.35rem, 3vw, 2rem);
}

.panel h3 {
  margin-bottom: 1rem;
}

.checklist {
  list-style: none;
  padding: 0;
  margin: 0;
}

.checklist li {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.9375rem;
}

.checklist li:last-child {
  border-bottom: 0;
}

.checklist svg {
  flex: none;
  margin-top: 0.2rem;
  color: var(--accent);
}

/* ---------------------------------------------------------------- faq --- */
.faq {
  border-top: 1px solid var(--rule);
  max-width: 78ch;
}

.faq__item {
  border-bottom: 1px solid var(--rule);
}

.faq__item summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.15rem 0;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.0625rem;
  color: var(--ink);
  list-style: none;
}

.faq__item summary::-webkit-details-marker {
  display: none;
}

.faq__item summary::after {
  content: '+';
  font-family: var(--font-mono);
  font-size: 1.25rem;
  line-height: 1;
  color: var(--accent);
  flex: none;
  transition: transform 0.15s ease;
}

.faq__item[open] summary::after {
  content: '–';
}

.faq__answer {
  padding-bottom: 1.15rem;
  color: var(--muted);
  max-width: 68ch;
}

.faq__answer p:last-child {
  margin-bottom: 0;
}

/* ------------------------------------------------------------ cta band --- */
.cta-band {
  background: var(--band-bg);
  color: #fff;
  position: relative;
  overflow: hidden;
}

.cta-band::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(100% 100% at 0% 100%, #000, transparent 65%);
}

.cta-band .shell {
  position: relative;
  z-index: 1;
}

.cta-band h2,
.cta-band h3 {
  color: #fff;
}

.cta-band p {
  color: rgba(255, 255, 255, 0.78);
  max-width: 58ch;
}

.cta-band .eyebrow {
  color: rgba(255, 255, 255, 0.65);
}

.cta-band .eyebrow::before {
  background: #4fb3bd;
}

/* --------------------------------------------------------------- table --- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--card);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

caption {
  text-align: left;
  padding: 1rem 1.25rem;
  font-size: 0.875rem;
  color: var(--muted);
  border-bottom: 1px solid var(--rule);
}

th,
td {
  text-align: left;
  padding: 0.8rem 1.25rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

thead th {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  background: var(--paper);
  position: sticky;
  top: 0;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: var(--paper);
}

/* ------------------------------------------------------- state a-z grid --- */
.state-index {
  display: grid;
  gap: 0.4rem 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  list-style: none;
  padding: 0;
  margin: 0;
}

.state-index li {
  margin: 0;
  border-bottom: 1px solid var(--rule);
}

.state-index a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0;
  text-decoration: none;
  color: var(--text);
  font-size: 0.9375rem;
}

.state-index a:hover {
  color: var(--ink);
}

.state-index a span {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--muted);
  letter-spacing: 0.08em;
}

/* ------------------------------------------------------------- article --- */
.prose {
  max-width: 74ch;
}

.prose h2 {
  margin-top: 2.5rem;
  font-size: clamp(1.375rem, 2.6vw, 1.75rem);
}

.prose h3 {
  margin-top: 1.75rem;
}

.prose > :first-child {
  margin-top: 0;
}

.page-head {
  background: var(--card);
  border-bottom: 1px solid var(--rule);
  padding-block: clamp(2.5rem, 5vw, 4rem);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.breadcrumb li {
  margin: 0;
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.breadcrumb li + li::before {
  content: '/';
  color: var(--rule-strong);
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.notice {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 1rem 1.15rem;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  background: var(--card);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.9375rem;
  color: var(--text);
  margin: 0 0 1.5rem;
}

.notice--warn {
  border-left-color: var(--warn-border);
  background: var(--warn-bg);
}

.notice svg {
  flex: none;
  margin-top: 0.2rem;
  color: var(--accent);
}

.notice--warn svg {
  color: var(--warn-fg);
}

.notice p {
  margin: 0;
  max-width: none;
}

.notice p + p {
  margin-top: 0.5rem;
}

/* -------------------------------------------------------------- footer --- */
.site-footer {
  background: var(--footer-bg);
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.9375rem;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
}

.site-footer a:hover {
  color: #fff;
  text-decoration: underline;
}

.footer__top {
  display: grid;
  gap: clamp(2rem, 4vw, 3rem);
  padding-block: clamp(2.5rem, 5vw, 4rem);
  grid-template-columns: 1fr;
}

@media (min-width: 800px) {
  .footer__top {
    grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr));
  }
}

.footer__brand .brand {
  color: #fff;
}

.footer__brand .brand__tag {
  color: rgba(255, 255, 255, 0.55);
}

.footer__brand p {
  margin-top: 1rem;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.6);
  max-width: 42ch;
}

.footer__col h4 {
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.footer__col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer__col li {
  margin-bottom: 0.6rem;
  font-size: 0.9375rem;
}

.footer__legal {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-block: 2rem 2.5rem;
}

.footer__legal p {
  font-size: 0.8125rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.6);
  max-width: 100ch;
  margin-bottom: 0.85rem;
}

.footer__legal p:last-child {
  margin-bottom: 0;
}

.footer__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  justify-content: space-between;
  align-items: baseline;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-block: 1.25rem 2rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

/* ------------------------------------------------------------ utility --- */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

.stack > * + * {
  margin-top: 1rem;
}

.mt-0 {
  margin-top: 0;
}

.mb-0 {
  margin-bottom: 0;
}

.text-center {
  text-align: center;
}

.center-narrow {
  max-width: 62ch;
  margin-inline: auto;
}

noscript .notice {
  margin-bottom: 1.5rem;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .tile:hover,
  .card--link:hover,
  .offer-splash__link:hover {
    transform: none;
  }
}

@media print {
  .site-header,
  .cta-band,
  .provider,
  .nav-toggle,
  .offer-splash {
    display: none;
  }

  body {
    background: #fff;
  }
}
