/* Names by State — one shared design system.
   Mobile first. System fonts only. No framework, no webfonts, no images.
   Desktop content column: 1200px. Hero bands and header/footer are full width. */
:root {
  --navy: #1d3557;
  --navy-mid: #2a4a73;
  --navy-dark: #12263f;
  --accent: #e4572e;
  --accent-dark: #c7431f;
  --accent-soft: #fdf0eb;
  --cream: #fdf6ef;
  --ink: #22292f;
  --muted: #5b6770;
  --line: #dfe4e8;
  --bg: #ffffff;
  --bg-soft: #f5f7f8;
  --good: #1e7d4d;
  --bad: #b3261e;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(18, 38, 63, 0.08), 0 4px 14px rgba(18, 38, 63, 0.06);
  --shadow-lift: 0 2px 6px rgba(18, 38, 63, 0.1), 0 10px 26px rgba(18, 38, 63, 0.1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
}
a { color: var(--navy); }
a:hover { color: var(--accent); }
h1, h2, h3 { line-height: 1.25; color: var(--navy-dark); }
h1 { font-size: 1.9rem; margin: 0.3rem 0 0.6rem; letter-spacing: -0.01em; }
h2 { font-size: 1.35rem; margin: 2rem 0 0.6rem; }
h3 { font-size: 1.1rem; margin: 1.4rem 0 0.4rem; }
p { margin: 0.5rem 0 0.9rem; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ---------- Header ---------- */
.site-header {
  background: var(--navy);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 10px rgba(18, 38, 63, 0.25);
}
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  padding-top: 10px;
  padding-bottom: 10px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 800;
  font-size: 1.2rem;
  text-decoration: none;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.brand:hover { color: #fff; }
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: 1.15rem;
  font-weight: 800;
  flex: 0 0 auto;
}
.brand span { color: #ffb59e; }
.main-nav { display: flex; flex-wrap: wrap; gap: 2px 6px; margin-left: auto; }
.main-nav a {
  color: #dbe6f2;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 9px 12px;
  border-radius: 8px;
}
.main-nav a:hover { color: #fff; background: rgba(255, 255, 255, 0.12); text-decoration: none; }
.main-nav a[aria-current="page"] { color: #fff; background: rgba(255, 255, 255, 0.16); }
.header-search { display: none; }

/* ---------- Hero band (full width) ---------- */
.page-hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 62%, #2f567f 100%);
  color: #fff;
  border-bottom: 4px solid var(--accent);
}
.page-hero .wrap { padding-top: 40px; padding-bottom: 38px; }
.page-hero h1 { color: #fff; font-size: clamp(1.9rem, 4vw, 2.6rem); margin: 0.5rem 0 0.7rem; }
.page-hero .lead { color: #dbe6f2; font-size: 1.15rem; max-width: 780px; margin-bottom: 0.4rem; }
.page-hero a { color: #ffd9c9; }
.crumbs { font-size: 0.85rem; color: var(--muted); margin: 16px 0 0; }
.crumbs a { color: var(--muted); }
.crumbs-hero { margin: 0 0 4px; color: #a9bed6; }
.crumbs-hero a { color: #a9bed6; }

/* Stat chips row (hero + cards) */
.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 22px 0 4px;
  list-style: none;
  padding: 0;
}
.stat {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius);
  padding: 12px 18px;
  min-width: 150px;
}
.stat b {
  display: block;
  font-size: 1.45rem;
  line-height: 1.2;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.stat span { font-size: 0.82rem; color: #c3d3e6; }

/* Hero search (homepage) */
.hero-search {
  background: #fff;
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 22px 0 6px;
  max-width: 640px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}
.hero-search label { display: block; margin: 0 0 6px; font-weight: 700; color: var(--navy-dark); }
.hero-search .search-row { display: flex; gap: 10px; }
.hero-search input[type="text"] {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 48px;
  padding: 8px 14px;
  font-size: 1.05rem;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.hero-search .btn { margin-top: 0; flex: 0 0 auto; }

/* ---------- Page body ---------- */
main.wrap { padding-top: 8px; padding-bottom: 8px; }
.lead { font-size: 1.08rem; }
.answer-box {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 18px 0;
}
.answer-box p { margin: 0.3rem 0; }
.verdict { font-size: 1.25rem; font-weight: 700; color: var(--navy-dark); }

/* Two-column content grid (state pages) */
.content-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; margin-top: 8px; }
.content-side { display: flex; flex-direction: column; gap: 18px; }
.side-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
}
.side-card h2 { margin-top: 0; font-size: 1.15rem; }
.side-card h2:first-child { margin-top: 0; }
.glance-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}
.glance-row:first-of-type { border-top: 0; }
.glance-row .k { color: var(--muted); font-size: 0.92rem; }
.glance-row .v { font-weight: 800; color: var(--navy-dark); text-align: right; font-variant-numeric: tabular-nums; }
.side-card .btn { margin-top: 6px; }

/* Two-column table pair (unique / movers pages) */
.two-col { display: grid; grid-template-columns: 1fr; gap: 0 28px; }
.two-col > div { min-width: 0; }

/* Section bands + cards on the homepage */
.home-section { margin: 34px 0; }
.home-section > h2 { font-size: 1.5rem; margin-bottom: 4px; }
.home-section .section-note { color: var(--muted); margin-top: 0; }
.band-card {
  background: var(--cream);
  border: 1px solid #f0dfcd;
  border-radius: var(--radius);
  padding: 20px 22px;
}
.mini-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
}
.mini-card h3 { margin-top: 0; }
.mini-card ul { margin: 0.4rem 0; padding-left: 1.1rem; }
.mini-card li { margin: 0.45rem 0; }
.feature-card {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
}
.feature-card .verdict { margin-top: 0; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 12px 0; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
caption { text-align: left; font-weight: 700; color: var(--navy-dark); padding: 12px 14px 4px; background: #fff; }
th, td { padding: 9px 12px; text-align: left; border-top: 1px solid var(--line); }
thead th {
  background: #eef2f7;
  color: var(--navy-dark);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  position: sticky;
  top: 0;
}
tbody tr:nth-child(even) td { background: #fafbfc; }
tbody tr:hover td { background: #f2f7fc; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.rank { font-weight: 700; color: var(--navy); }
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 6px;
  border-radius: 8px;
  background: #eef2f7;
  color: var(--navy-dark);
  font-weight: 800;
  font-size: 0.9rem;
}
tr.top-row td.rank .rank-badge { background: var(--accent); color: #fff; }
.up { color: var(--good); font-weight: 700; }
.down { color: var(--bad); font-weight: 700; }
.same { color: var(--muted); }
tr.extra-row { display: none; }
table.expanded tr.extra-row { display: table-row; }
.show-all {
  display: block;
  width: 100%;
  margin: 12px 0 4px;
  padding: 12px;
  background: #fff;
  color: var(--navy);
  border: 2px solid var(--navy);
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  min-height: 48px;
}
.show-all:hover { background: var(--navy); color: #fff; }

/* Filter + segmented toggle */
.filter-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 14px 0; }
.filter-row label { font-weight: 600; }
.filter-row input[type="search"], .filter-row input[type="text"] {
  flex: 1 1 200px; min-height: 48px; padding: 8px 14px; font-size: 1rem;
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
}
.seg { display: inline-flex; border: 1px solid var(--navy); border-radius: var(--radius); overflow: hidden; background: #fff; box-shadow: var(--shadow); }
.seg button {
  border: 0; background: #fff; color: var(--navy); padding: 10px 22px;
  font-size: 1rem; font-weight: 700; cursor: pointer; min-height: 48px;
}
.seg button[aria-pressed="true"] { background: var(--navy); color: #fff; }
.no-match { display: none; color: var(--muted); padding: 12px 0; }
section[data-sex-section] > h2 {
  border-left: 4px solid var(--accent);
  padding-left: 12px;
}
section[data-sex-section="M"] > h2 { border-left-color: var(--navy); }

/* ---------- Tool card ---------- */
.tool-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin: 18px 0;
  background: #fff;
  box-shadow: var(--shadow);
}
.tool-card label { display: block; font-weight: 600; margin: 12px 0 4px; }
.tool-card input[type="text"], .tool-card select {
  width: 100%; min-height: 48px; padding: 8px 12px; font-size: 1rem;
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
}
.tool-grid { display: grid; grid-template-columns: 1fr; gap: 0 16px; }
.btn {
  display: inline-block; margin-top: 16px; padding: 13px 24px; min-height: 48px;
  background: var(--accent); color: #fff; border: 0; border-radius: var(--radius);
  font-size: 1rem; font-weight: 700; cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--accent-dark); color: #fff; }
.btn-secondary { background: var(--navy); }
.btn-secondary:hover { background: var(--navy-dark); }
.result-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin: 18px 0;
  background: #fff;
  box-shadow: var(--shadow);
}
.result-card .verdict { margin-top: 0; font-size: 1.45rem; }
.vs-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 16px 0; }
.vs-cell {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-top: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.vs-cell + .vs-cell { border-top-color: var(--navy); }
.vs-cell h3 { margin-top: 0; }
.vs-cell .big { font-size: 1.9rem; font-weight: 800; color: var(--navy-dark); margin: 0.2rem 0; }
.note { font-size: 0.92rem; color: var(--muted); }
.error-box { border-left: 4px solid var(--bad); background: #fdf3f2; }

/* ---------- State picker grid ---------- */
.state-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
  list-style: none; margin: 14px 0; padding: 0;
}
.state-grid a {
  display: block; padding: 14px 14px; border: 1px solid var(--line);
  border-radius: var(--radius); text-decoration: none; font-weight: 700;
  color: var(--navy-dark); min-height: 44px; background: #fff; box-shadow: var(--shadow);
}
.state-grid a span { display: block; font-size: 0.82rem; font-weight: 600; color: var(--accent); margin-top: 2px; }
.state-grid a:hover { border-color: var(--navy); background: #f2f7fc; box-shadow: var(--shadow-lift); }
.state-grid li.soon {
  padding: 14px; color: var(--muted); border: 1px dashed var(--line);
  border-radius: var(--radius); background: var(--bg-soft);
}

/* ---------- Try this next ---------- */
.next-block { border-top: 2px solid var(--line); margin-top: 2.5rem; padding-top: 0.6rem; }
.next-list {
  list-style: none;
  margin: 0.8rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.next-list li { margin: 0; }
.next-list a {
  display: block;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 700;
  color: var(--navy-dark);
  box-shadow: var(--shadow);
}
.next-list a:hover { border-color: var(--accent); color: var(--accent); box-shadow: var(--shadow-lift); }

/* ---------- Source line ---------- */
.source-line {
  font-size: 0.88rem;
  color: var(--muted);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-top: 2.5rem;
  padding: 12px 16px;
}

/* ---------- Definition / method boxes ---------- */
.def-box { background: var(--accent-soft); border-radius: var(--radius); padding: 14px 18px; margin: 16px 0; }
.def-box p { margin: 0.3rem 0; }
.def-box h2 { margin-top: 0; }

/* ---------- Charts ---------- */
.chart-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin: 16px 0;
}
.chart { width: 100%; height: auto; display: block; margin: 10px 0; }
.chart .axis { stroke: #9aa5ad; stroke-width: 1; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .line-a { stroke: var(--accent); stroke-width: 2.5; fill: none; }
.chart .line-b { stroke: var(--navy); stroke-width: 2.5; fill: none; }
.chart .dot { fill: var(--accent); }
.chart text { font-size: 12px; fill: var(--muted); font-family: system-ui, sans-serif; }
.chart .ylabel { font-size: 12px; fill: var(--navy-dark); font-weight: 700; }

/* ---------- Prose card (trust pages) ---------- */
.prose-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 28px;
  margin: 18px 0;
  max-width: 820px;
}
.prose-card h2 { margin-top: 1.6rem; }
.prose-card h2:first-child { margin-top: 0; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-dark); color: #cdd9e8; margin-top: 4rem; }
.site-footer .wrap { padding-top: 40px; padding-bottom: 0; font-size: 0.95rem; }
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  padding-bottom: 28px;
}
.footer-col h3 {
  color: #fff;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 12px;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin: 7px 0; }
.footer-col a { color: #cdd9e8; text-decoration: none; }
.footer-col a:hover { color: #fff; text-decoration: underline; }
.footer-col p { color: #a9bed6; margin: 0.4rem 0; }
.footer-brand { color: #fff; font-weight: 800; font-size: 1.15rem; text-decoration: none; display: inline-flex; align-items: center; gap: 10px; }
.footer-brand:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  padding: 18px 0 22px;
  font-size: 0.88rem;
  color: #a9bed6;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 24px;
  justify-content: space-between;
}
.footer-bottom p { margin: 0; }

/* ---------- Breakpoints ---------- */
@media (min-width: 640px) {
  h1 { font-size: 2.2rem; }
  .tool-grid { grid-template-columns: 1fr 1fr; }
  .state-grid { grid-template-columns: repeat(4, 1fr); }
  .vs-grid { grid-template-columns: 1fr 1fr; gap: 16px; }
  .next-list { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .state-grid { grid-template-columns: repeat(5, 1fr); }
  .two-col { grid-template-columns: 1fr 1fr; }
  .header-search {
    display: flex;
    margin-left: auto;
  }
  .header-search input[type="text"] {
    min-height: 38px;
    width: 190px;
    padding: 6px 12px;
    font-size: 0.92rem;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
  }
  .header-search input[type="text"]::placeholder { color: #c3d3e6; }
  .header-search input[type="text"]:focus { background: #fff; color: var(--ink); outline: none; }
  .main-nav { margin-left: 0; }
}
@media (min-width: 1024px) {
  .content-grid { grid-template-columns: minmax(0, 1fr) 320px; }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
}

/* Homepage search: label above a full-width input (kept for the hero form). */
#home-search label { display: block; margin: 0 0 6px; font-weight: 600; }
#home-search input[type="text"] {
  min-height: 48px; padding: 8px 14px; font-size: 1.05rem;
  border: 1px solid var(--line); border-radius: 10px;
}
