/* pac.money — warm paper, serif display, navy/red accents. Editorial, not
   ornamental: the data is dense, so chrome stays quiet. Dark mode follows the OS. */

/* self-hosted fonts only — the CSP forbids third-party font hosts */
@font-face {
  font-family: Inter;
  src: url('/static/fonts/InterVariable.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: Newsreader;
  src: url('/static/fonts/newsreader-700-normal.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: Newsreader;
  src: url('/static/fonts/newsreader-800-normal.woff2') format('woff2');
  font-weight: 800;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --paper: #f9f8f4;          /* page */
  --card: #ffffff;           /* cards, tables, inputs */
  --surface: #f1f0ea;        /* table header band, recessed wells */
  --ink: #171a2b;
  --muted: #5f6577;
  --line: #e2dfd4;
  --blue: #213c8f;           /* federal navy */
  --red: #b3273a;            /* old glory, toned */
  --blue-soft: #e6ebf7;
  --red-soft: #f8e7ea;
  --ind: #4a5064;
  --ind-soft: #ebe9e1;
  --amber: #8a5a05;
  --amber-soft: #f7ecd3;
  --violet: #5b3fa6;
  --violet-soft: #ece7f8;
  --teal: #0d6e68;
  --teal-soft: #dcefeb;
  --green: #5fcf85;          /* graph ticker nodes */
  --foot-bg: #171a2b;
  --foot-ink: #e6e3d8;
  --foot-muted: #a3a9bd;
  --shadow: 0 1px 2px rgb(23 26 43 / .05), 0 6px 20px -10px rgb(23 26 43 / .14);
  --shadow-hi: 0 2px 4px rgb(23 26 43 / .06), 0 14px 28px -12px rgb(23 26 43 / .22);
  --radius: 8px;
  --serif: Newsreader, Georgia, 'Iowan Old Style', 'Times New Roman', serif;
  --sans: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f121c;
    --card: #161a27;
    --surface: #1c2130;
    --ink: #e8e6dc;
    --muted: #9aa2b6;
    --line: #2b3145;
    --blue: #93aef2;
    --red: #ef7d8e;
    --blue-soft: #1e2744;
    --red-soft: #3a1f28;
    --ind: #aab1c5;
    --ind-soft: #242a3b;
    --amber: #eec06a;
    --amber-soft: #382c15;
    --violet: #c0a7f2;
    --violet-soft: #2a2447;
    --teal: #7bd4cc;
    --teal-soft: #14302e;
    --green: #8fe6ab;
    --foot-bg: #0a0d16;
    --foot-ink: #d6d3c6;
    --foot-muted: #7e869c;
    --shadow: 0 1px 2px rgb(0 0 0 / .35);
    --shadow-hi: 0 4px 16px rgb(0 0 0 / .5);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.55 var(--sans);
  font-optical-sizing: auto;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
::selection { background: var(--blue); color: #fff; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 58px; }
.wordmark { font: 800 23px/1 var(--serif); letter-spacing: -.01em; color: var(--ink); }
.wordmark:hover { text-decoration: none; }
.wordmark span { color: var(--red); }
.site-header nav { display: flex; gap: 22px; }
.site-header nav a { color: var(--muted); font-size: 14.5px; font-weight: 600; }
.site-header nav a:hover { color: var(--ink); text-decoration: none; }

/* hero */
.hero { padding: 64px 0 36px; }
.hero h1 {
  font: 800 clamp(38px, 6.5vw, 62px)/1.06 var(--serif);
  letter-spacing: -.015em; margin: 0;
}
.hero h1 em { font-style: normal; color: var(--red); }
.lede { max-width: 600px; color: var(--muted); font-size: 18px; margin: 18px 0 0; }

/* stat tiles */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 34px 0 8px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px 16px 13px; position: relative; overflow: hidden; box-shadow: var(--shadow);
}
.stat::before { content: ''; position: absolute; inset: 0 auto auto 0; width: 100%; height: 3px; background: var(--blue); }
.stat.warn::before { background: var(--red); }
.stat b { display: block; font: 700 26px/1.15 var(--serif); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stat span { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; line-height: 1.4; }
a.stat { color: inherit; transition: transform .15s ease, box-shadow .15s ease; }
a.stat:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-hi); }

/* "start here" strip: one card per story surface, a live number and the plain sentence
   behind it, so a first visit knows what to click before it meets the raw tables */
.start { margin-top: 0; }
.stories { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.story {
  display: grid; gap: 6px; align-content: start; padding: 18px 20px 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); color: var(--ink); transition: transform .15s ease, box-shadow .15s ease;
}
.story:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-hi); }
.story .kicker { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--red); }
.story b { font: 700 34px/1.1 var(--serif); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.story p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.45; }
.story .go { margin-top: 6px; font-size: 14px; font-weight: 600; color: var(--blue); }

/* sections: serif heading over an ink rule */
section { margin: 44px 0; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 32px; }
body.dev .wordmark::after { content: " dev"; color: var(--red); font-size: .6em; vertical-align: middle; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-bottom: 16px; padding-bottom: 8px; border-bottom: 2px solid var(--ink);
}
.section-head h1, .section-head h2 { font: 700 25px/1.15 var(--serif); letter-spacing: -.01em; margin: 0; }
.section-head > .muted { font-size: 14.5px; }
.more { font-size: 14px; font-weight: 600; }
.section-head.sub { margin: 24px 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.section-head.sub h3 { font: 700 17px/1.2 var(--serif); margin: 0; }
.split .section-head.sub { margin-top: 0; }

/* filters */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filters input[type=search] {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--ink); font: 400 14px/1 var(--sans); padding: 9px 12px; width: 240px;
  -webkit-appearance: none; appearance: none;
}
.filters input[type=search]:focus {
  outline: 2px solid color-mix(in srgb, var(--blue) 35%, transparent); border-color: var(--blue);
}
.filters:has(> input:only-child) { margin-bottom: 14px; }
.chip-group { display: flex; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 3px; }
.chip-group .chip {
  border: 1px solid transparent; background: transparent; cursor: pointer; border-radius: 6px;
  font: 600 13px/1.6 var(--sans); color: var(--muted); padding: 1px 10px;
}
.chip-group .chip.dem { color: var(--blue); }
.chip-group .chip.rep { color: var(--red); }
.chip-group .chip.on { background: var(--card); border-color: var(--line); color: var(--ink); box-shadow: var(--shadow); }
.chip-group .chip.dem.on { color: var(--blue); }
.chip-group .chip.rep.on { color: var(--red); }

/* chips (party, tags) + badges (trade type, flags): tinted pills, sans, no borders */
.chip {
  display: inline-block; border-radius: 6px; padding: 2px 7px;
  font: 700 12px/1.5 var(--sans); color: var(--ind); background: var(--ind-soft);
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.chip.dem { color: var(--blue); background: var(--blue-soft); }
.chip.rep { color: var(--red); background: var(--red-soft); }
.chip.soft { font-weight: 600; }
a.chip:hover { text-decoration: none; color: var(--ink); background: var(--line); }
button.chip { cursor: pointer; border: 0; }
.badge {
  display: inline-block; border-radius: 6px; padding: 2px 7px;
  font: 600 12px/1.5 var(--sans); white-space: nowrap; font-variant-numeric: tabular-nums;
}
.badge.buy { color: var(--blue); background: var(--blue-soft); }
.badge.sell { color: var(--red); background: var(--red-soft); }
.badge.exch { color: var(--ind); background: var(--ind-soft); }
.badge.late { color: var(--amber); background: var(--amber-soft); cursor: help; font-weight: 700; }
.badge.oversight { color: var(--violet); background: var(--violet-soft); cursor: help; margin-right: 4px; }
.badge.former { color: var(--teal); background: var(--teal-soft); margin-right: 4px; }
.oversight-note {
  color: var(--muted); font-size: 14px; margin: 14px 2px 0; max-width: 860px;
  border-left: 3px solid var(--violet); padding-left: 12px;
}
.new-filers { margin-top: 14px; font-size: 14px; }
.new-filers .chip { margin: 2px 2px 2px 0; }

/* member grid */
.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.member-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; color: var(--ink); box-shadow: var(--shadow);
  transition: transform .12s ease, box-shadow .12s ease;
}
.member-card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-hi); }
.member-card img, .member-card .no-photo { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; display: block; }
.no-photo {
  display: flex; align-items: center; justify-content: center;
  font: 800 46px/1 var(--serif); color: var(--muted); background: var(--ind-soft);
}
.member-meta { padding: 10px 12px 12px; display: grid; gap: 6px; justify-items: start; }
.member-meta strong { font: 700 15.5px/1.22 var(--serif); }
.trade-count { font-size: 12.5px; color: var(--muted); }

/* profile */
.profile-head { display: flex; gap: 24px; align-items: center; padding-top: 44px; }
.portrait {
  width: 128px; height: 160px; object-fit: cover; border-radius: var(--radius);
  border: 1px solid var(--line); box-shadow: var(--shadow); flex: none; background: var(--ind-soft);
}
.profile-head.dem .portrait { border-bottom: 4px solid var(--blue); }
.profile-head.rep .portrait { border-bottom: 4px solid var(--red); }
.profile-head h1 {
  font: 700 clamp(30px, 4.5vw, 44px)/1.08 var(--serif);
  letter-spacing: -.015em; margin: 0 0 8px;
}
.meta-line { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 0; }
.asset-chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0 0; }
.tiles { margin-top: 26px; }

/* tables */
.table-wrap {
  overflow-x: auto; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); background: var(--surface); padding: 10px 14px; border-bottom: 1px solid var(--line);
}
th.num { text-align: right; }
th[data-sort] { cursor: pointer; user-select: none; }
th[data-sort]::after { content: '\00a0↕'; opacity: .4; }
th[data-sort].asc::after { content: '\00a0▲'; opacity: 1; }
th[data-sort].desc::after { content: '\00a0▼'; opacity: 1; }
th[data-sort].asc, th[data-sort].desc { color: var(--ink); box-shadow: inset 0 -2px 0 var(--blue); }
td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: color-mix(in srgb, var(--blue) 4%, transparent); }
.person-cell { min-width: 180px; }
.person-cell a { font-weight: 600; color: var(--ink); }
.person-cell .chip { margin-left: 4px; }
.asset-cell { min-width: 220px; max-width: 380px; }
.ticker {
  font: 700 12px/1.3 var(--mono); letter-spacing: .02em;
  background: var(--ind-soft); border-radius: 4px; padding: 2px 6px; margin-right: 6px; color: var(--ind);
}
a.ticker:hover { text-decoration: none; color: var(--ink); background: var(--line); }
.ticker-lg { font-size: 17px; padding: 3px 9px; vertical-align: 3px; }
.asset-name { color: var(--muted); }
.when { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; white-space: nowrap; }
.src { font-size: 13px; white-space: nowrap; }
.expand-btn {
  display: block; width: fit-content; margin: 16px auto 0; padding: 9px 18px;
  font: 600 14px/1 var(--sans); color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 999px; cursor: pointer; box-shadow: var(--shadow);
}
.expand-btn:hover { border-color: var(--ink); text-decoration: none; }

/* holdings: mega-report sections + normalised bands */
.sections { margin-bottom: 4px; }
.sections table { font-size: 13.5px; }
.sections td { padding: 8px 14px; }
.sections a { font-weight: 600; color: var(--ink); }
.sections tr.on { background: var(--blue-soft); box-shadow: inset 3px 0 0 var(--blue); }
sup.mark, span.mark { color: var(--muted); font-weight: 700; cursor: help; letter-spacing: .05em; }
.table-note { color: var(--muted); font-size: 13px; margin: 10px 2px 0; max-width: 760px; }

/* side-by-side mini tables (home: this week, biggest raisers / war chests); half-width
   tables stack the filer's name over the party chip so three columns fit without scrolling */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.split .person-cell { min-width: 130px; }
.split .person-cell a { display: block; line-height: 1.3; }
.split .person-cell .chip { margin: 3px 0 0; }
.split .asset-cell { min-width: 150px; max-width: 240px; }
@media (max-width: 760px) { .split { grid-template-columns: minmax(0, 1fr); } }

/* committee rows outside the member's own campaign (JFCs, leadership PACs, party) */
tr.uncounted td { opacity: .55; }

/* prose pages (about) */
.prose { max-width: 700px; padding-top: 28px; }
.prose h1 {
  font: 800 clamp(30px, 5vw, 42px)/1.1 var(--serif); letter-spacing: -.015em;
  padding-bottom: 14px; border-bottom: 2px solid var(--ink);
}
.prose h2 { font: 700 22px/1.2 var(--serif); margin-top: 34px; }
.prose p, .prose li { color: var(--muted); }
.prose strong { color: var(--ink); }

/* pager + footer */
.pager { display: flex; justify-content: space-between; margin: 20px 0; }
.pager a {
  font-size: 14px; font-weight: 600; color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; box-shadow: var(--shadow);
}
.pager a:hover { border-color: var(--ink); text-decoration: none; }
.site-footer {
  background: var(--foot-bg); color: var(--foot-ink); border-top: 3px solid var(--red);
  margin-top: 64px; padding: 30px 0 44px;
}
.site-footer p { color: var(--foot-muted); font-size: 13.5px; max-width: 780px; }
.site-footer strong { color: var(--foot-ink); }
.site-footer a { color: var(--foot-ink); text-decoration: underline; text-underline-offset: 2px; }
.site-footer a:hover { color: #fff; }

/* graph */
.graph-slider { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.graph-slider input { accent-color: var(--blue); }
.graph-toolbar { margin-bottom: 14px; }
.graph-wrap {
  position: relative; height: calc(100vh - 230px); min-height: 420px; overflow: hidden;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
#graph { display: block; touch-action: none; }
#graph-card {
  position: absolute; top: 12px; right: 12px; width: 264px; max-height: calc(100% - 24px); overflow: auto;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px;
  box-shadow: var(--shadow-hi); font-size: 14px;
}
#graph-card p { margin: 0 0 6px; }
.gc-head { display: flex; justify-content: space-between; gap: 8px; font-weight: 700; }
.gc-head a { color: var(--ink); }
#gc-close { border: 0; background: none; color: var(--muted); font-size: 17px; cursor: pointer; padding: 0 2px; }
#gc-close:hover { color: var(--ink); }
#gc-peers { margin: 8px 0 0; padding-left: 18px; font-size: 13px; }
#gc-peers li { margin: 3px 0; }
#gc-peers button { border: 0; background: none; color: var(--blue); cursor: pointer; padding: 0; font: inherit; font-size: 13px; }
#gc-peers button:hover { text-decoration: underline; }

/* phones: the nav wraps under the wordmark instead of scrolling off-screen, tiles go
   two-up, and tables get tighter so the column that matters (amount, days over) stays
   in view; .sm-hide marks low-priority columns that are dropped at this width */
@media (max-width: 640px) {
  .site-header { position: static; backdrop-filter: none; }
  .header-inner { flex-direction: column; align-items: flex-start; gap: 8px; height: auto; padding: 12px 20px 10px; }
  .site-header nav { flex-wrap: wrap; gap: 4px 13px; }
  .site-header nav a { font-size: 13.5px; }
  .hero { padding: 36px 0 28px; }
  .lede { font-size: 17px; }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 12px 13px 11px; }
  .stat b { font-size: 23px; }
  .stat span { font-size: 12.5px; }
  .section-head h1, .section-head h2 { font-size: 23px; }
  .profile-head { flex-direction: column; align-items: flex-start; gap: 16px; padding-top: 28px; }
  .filters { width: 100%; }
  .filters input[type=search] { width: 100%; }
  table { font-size: 13.5px; }
  th { padding: 9px 8px; font-size: 11px; }
  td { padding: 9px 8px; }
  .person-cell, .split .person-cell { min-width: 110px; }
  .person-cell a { display: block; line-height: 1.3; }
  .person-cell .chip { margin: 3px 0 0; }
  .asset-cell, .split .asset-cell { min-width: 120px; max-width: 200px; }
  .sm-hide { display: none; }
  .member-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .story b { font-size: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  .member-card, .story, a.stat { transition: none; }
  .member-card:hover, .story:hover, a.stat:hover { transform: none; }
}
