/* digspect: public site styles. Mobile first: every layout starts at phone width and widens from there.
   Always dark: the logo's navy is the page, its blue and pink the accents. Montserrat (Google Fonts) for the logo only. */

:root {
  --navy: #0a1428; --brand-blue: #5bcffa; --brand-pink: #f5abb9;
  --bg: #0a1428; --surface: #101d36; --surface-2: #172746; --text: #eef1f7; --muted: #9ba7c0; --line: #233557;
  --accent: #5bcffa; --neg: #ff6f86; --pos: #5bcffa; --focus: #5bcffa;

  --b-xh: #8e1238; --b-xh-t: #fff;
  --b-vh: #c42a4d; --b-vh-t: #fff;
  --b-h: #e0606a;  --b-h-t: #1a0710;
  --b-u: #f2a98a;  --b-u-t: #3a1306;
  --b-m: #2a3b5e;  --b-m-t: #dfe5f1;
  --b-s: #8fd6f7;  --b-s-t: #062338;
  --b-ss: #2f9fd6; --b-ss-t: #04182a;

  --d-hostile: #4a1430; --d-hostile-t: #ffc2cf;
  --d-restrictive: #47280f; --d-restrictive-t: #f8cfa8;
  --d-affirming: #0f3653; --d-affirming-t: #bfe9fd;
  --d-none: #1d2d4d; --d-none-t: #cdd5e6;
  --rh-hostile-b: #d9536f; --rh-hostile-t: #ffa8ba;
  --rh-supportive-b: #4fb8e6; --rh-supportive-t: #a9e3fc;
  --rh-org: #9b2457; --rh-org-t: #fff;

  /* category colours for the "where the points come from" bar on the rankings */
  --c-statements: #5bcffa; --c-votes: #f5abb9; --c-motions: #b79cff; --c-government: #ffd166; --c-orgs: #ff5470;

  --radius: 12px;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 4px 14px rgb(0 0 0 / 0.25);
  --header-h: 52px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 17px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
@media (min-width: 900px) { body { font-size: 16px; } }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.2; text-wrap: balance; overflow-wrap: normal; }
h1 { font-size: clamp(1.6rem, 1.1rem + 2.4vw, 2.5rem); margin: 0 0 .4em; letter-spacing: -0.01em; }
h2 { font-size: 1.3rem; margin: 2rem 0 .5rem; }
h3 { font-size: 1.05rem; margin: 1.4rem 0 .5rem; }
img { max-width: 100%; }
button, select, input { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.count { color: var(--muted); font-weight: 400; font-size: .9em; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
main { padding-top: 16px; padding-bottom: 48px; }

/* ---------------------------------------------------------------- header and footer */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: var(--header-h); }
.brand { text-decoration: none; font-size: 1.6rem; line-height: 1; padding: 6px 0; }
.site-header nav { display: flex; gap: 2px; }
.site-header nav a { color: var(--muted); text-decoration: none; padding: 10px 10px; border-radius: 8px; font-weight: 500; font-size: .95rem; }
.site-header nav a:hover { background: var(--surface-2); color: var(--text); }
.site-header nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; padding: 16px 0 32px; }
.site-footer p { margin: .5em 0; max-width: 80ch; }

/* ---------------------------------------------------------------- logo */
.wordmark {
  font-family: "Montserrat", system-ui, sans-serif; font-weight: 900; letter-spacing: -0.04em; line-height: 0.9;
  display: inline-flex; white-space: nowrap;
}
.wm-dig { color: var(--text); }
.wm-blue { color: var(--brand-blue); }
.wm-pink { color: var(--brand-pink); }
.lockup { display: inline-flex; flex-direction: column; align-items: center; margin: 4px 0 24px; max-width: 100%; }
.lockup .wordmark { font-size: clamp(3.2rem, 17vw, 6.5rem); }
.tagline-row { display: flex; align-items: center; width: 100%; gap: 0.7rem; margin-top: .9rem; }
.tagline-row::before, .tagline-row::after { content: ""; flex: 1; min-width: 12px; height: 3px; background: var(--text); }
.tagline {
  font-family: "Montserrat", system-ui, sans-serif; font-weight: 600; text-transform: uppercase; white-space: nowrap;
  font-size: clamp(0.68rem, 2.6vw, 1.1rem); letter-spacing: 0.28em; margin-right: -0.28em; color: var(--text);
}
.disclaimer {
  align-self: flex-end; margin: 0.5rem 0 0; font-family: "Montserrat", system-ui, sans-serif; font-style: italic;
  font-weight: 600; font-size: clamp(0.62rem, 2vw, 0.85rem); color: var(--muted);
}

.lede { font-size: 1.05rem; color: var(--muted); max-width: 70ch; margin: 0 0 1rem; }
.lede strong { color: var(--text); }
.help { color: var(--muted); max-width: 80ch; margin-top: -.2rem; font-size: .95rem; }

/* ---------------------------------------------------------------- chips */
.band, .dir, .rh, .party, .flag {
  display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 2px 10px;
  font-size: .8rem; font-weight: 600; line-height: 1.5;
}
.band { white-space: nowrap; }
.band-xh { background: var(--b-xh); color: var(--b-xh-t); }
.band-vh { background: var(--b-vh); color: var(--b-vh-t); }
.band-h { background: var(--b-h); color: var(--b-h-t); }
.band-u { background: var(--b-u); color: var(--b-u-t); }
.band-m { background: var(--b-m); color: var(--b-m-t); }
.band-s { background: var(--b-s); color: var(--b-s-t); }
.band-ss { background: var(--b-ss); color: var(--b-ss-t); }
.band-large { font-size: .95rem; padding: 4px 12px; }
.dir-trans_hostile { background: var(--d-hostile); color: var(--d-hostile-t); }
.dir-restrictive { background: var(--d-restrictive); color: var(--d-restrictive-t); }
.dir-affirming { background: var(--d-affirming); color: var(--d-affirming-t); }
.dir-no_position, .dir-none { background: var(--d-none); color: var(--d-none-t); }
.rh { font-weight: 500; cursor: help; }
.rh-hostile { color: var(--rh-hostile-t); box-shadow: inset 0 0 0 1px var(--rh-hostile-b); }
.rh-supportive { color: var(--rh-supportive-t); box-shadow: inset 0 0 0 1px var(--rh-supportive-b); }
.rh-org { background: var(--rh-org); color: var(--rh-org-t); }
.flag { background: var(--surface-2); color: var(--muted); font-weight: 500; }
.party { background: var(--surface-2); color: var(--text); font-weight: 500; padding-left: 8px; }
.party::before, .dot { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--party, var(--muted)); flex: none; }
.dot { display: inline-block; margin-right: 5px; vertical-align: 1px; }
.weight { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.pts { font-weight: 700; white-space: nowrap; }
.neg { color: var(--neg); }
.pos { color: var(--pos); }
.zero { color: var(--muted); font-weight: 400; }

/* the popup definition shown when a rhetoric code is tapped (site.js) */
.tip {
  position: absolute; z-index: 30; max-width: min(320px, calc(100vw - 32px)); background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: .9rem; box-shadow: var(--shadow);
}

/* ---------------------------------------------------------------- rankings */
.bands {
  display: flex; gap: 8px; margin: 0 -16px 12px; padding: 4px 16px; overflow-x: auto; scrollbar-width: none;
  scroll-snap-type: x proximity;
}
.bands::-webkit-scrollbar { display: none; }
.band-chip {
  border: 0; cursor: pointer; font-size: .85rem; font-weight: 600; border-radius: 999px; padding: 8px 14px; min-height: 40px;
  display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; flex: none; scroll-snap-align: start;
}
.band-chip .band-count { font-weight: 400; opacity: .85; }
.band-chip[aria-pressed="true"] { outline: 3px solid var(--text); outline-offset: 2px; }
.bands.filtering .band-chip[aria-pressed="false"] { opacity: .45; }
@media (min-width: 900px) { .bands { flex-wrap: wrap; margin: 0 0 12px; padding: 4px 0; overflow: visible; } }

.filter-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; }
.filter-panel > summary {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; min-height: 48px;
  cursor: pointer; font-weight: 600; list-style: none;
}
.filter-panel > summary::-webkit-details-marker { display: none; }
.filter-panel > summary span::before { content: "▸ "; color: var(--muted); }
.filter-panel[open] > summary span::before { content: "▾ "; }
.filter-panel output { color: var(--muted); font-weight: 400; font-size: .9rem; }
.filters { display: grid; gap: 14px; padding: 0 16px 16px; }
.filters .field { display: grid; gap: 4px; font-size: .8rem; font-weight: 600; color: var(--muted); }
.filters select {
  width: 100%; font-size: 1rem; background: var(--bg); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; min-height: 44px;
}
.seg { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.seg legend { font-size: .8rem; font-weight: 600; color: var(--muted); margin-bottom: 4px; width: 100%; }
.seg label { flex: 1 1 auto; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
  display: block; text-align: center; padding: 9px 12px; min-height: 44px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); cursor: pointer; font-size: .95rem;
}
.seg input:checked + span { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 600; }
.seg input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: .95rem; }
.check input { width: 20px; height: 20px; accent-color: var(--brand-blue); }
.reset { justify-self: start; background: none; border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; min-height: 44px; cursor: pointer; color: var(--muted); }
@media (min-width: 900px) {
  .filters { grid-template-columns: auto 1fr 1fr 1fr; align-items: end; }
  .filters .check, .filters .reset { grid-column: auto; }
}

.legend { list-style: none; padding: 0; margin: 4px 0 12px; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .8rem; color: var(--muted); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.c-statements { background: var(--c-statements); }
.c-votes { background: var(--c-votes); }
.c-motions { background: var(--c-motions); }
.c-government { background: var(--c-government); }
.c-orgs { background: var(--c-orgs); }

.people { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
@media (min-width: 760px) { .people { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1150px) { .people { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.person-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px;
  display: grid; gap: 10px; align-content: start; content-visibility: auto; contain-intrinsic-size: auto 170px;
}
.person-card[hidden] { display: none; }
.card-main { display: grid; grid-template-columns: auto 48px 1fr; gap: 12px; align-items: center; text-decoration: none; color: var(--text); }
.card-main:hover .name { text-decoration: underline; }
.rank { font-weight: 800; font-size: 1.25rem; min-width: 2.2ch; text-align: right; }
.card-main img, .avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; background: var(--surface-2); }
.avatar { display: inline-grid; place-items: center; font-weight: 700; font-size: .9rem; color: var(--muted); }
.who { display: grid; min-width: 0; }
.name { font-weight: 700; font-size: 1.05rem; line-height: 1.25; }
.title { color: var(--muted); font-size: .85rem; line-height: 1.35; }
.card-score { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.card-score .total .pts { font-size: 1.3rem; }
.mix { display: flex; height: 8px; border-radius: 999px; overflow: hidden; gap: 2px; background: var(--surface-2); }
.mix span { min-width: 3px; }
.mix span.plus { background-image: repeating-linear-gradient(135deg, transparent 0 3px, rgb(10 20 40 / .55) 3px 5px); }
.more > summary {
  cursor: pointer; color: var(--accent); font-size: .9rem; min-height: 32px; display: flex; align-items: center; list-style: none;
}
.more > summary::-webkit-details-marker { display: none; }
.more > summary::before { content: "▸"; margin-right: 6px; }
.more[open] > summary::before { content: "▾"; }
.cats { margin: 6px 0 8px; display: grid; gap: 6px; }
.cats div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dashed var(--line); padding-bottom: 4px; }
.cats dt { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .92rem; }
.cats dd { margin: 0; }
.full { display: inline-block; padding: 6px 0; font-weight: 600; text-decoration: none; }
.empty { color: var(--muted); text-align: center; padding: 24px; }
.more-wrap { text-align: center; margin: 16px 0; }
.show-more, .show-all {
  background: var(--surface); border: 1px solid var(--line); color: var(--text); border-radius: 999px;
  padding: 10px 22px; min-height: 44px; cursor: pointer; font-weight: 600;
}
.show-more:hover, .show-all:hover { border-color: var(--accent); }

/* ---------------------------------------------------------------- member page */
.back { margin: 0 0 10px; }
.back a { text-decoration: none; display: inline-block; padding: 6px 0; }
.hero {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow); display: grid; gap: 16px;
}
.hero-person { display: grid; grid-template-columns: 72px 1fr; gap: 14px; align-items: center; }
.portrait, .avatar.large { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; background: var(--surface-2); font-size: 1.4rem; }
.hero-id h1 { margin: 0; font-size: clamp(1.4rem, 1rem + 2.5vw, 2.3rem); }
.hero-id p { margin: .2em 0 0; }
.hero-title { color: var(--muted); }
.hero-score { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; border-top: 1px solid var(--line); padding-top: 14px; }
.rank-box { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.rank-big { font-size: 2.6rem; font-weight: 800; line-height: 1; letter-spacing: -0.03em; white-space: nowrap; }
.rank-box { flex: none; }
.total-line { white-space: nowrap; }
.rank-big .hash { color: var(--muted); font-weight: 600; font-size: .55em; vertical-align: .4em; margin-right: 1px; }
.rank-of { color: var(--muted); font-size: .8rem; line-height: 1.3; }
.score-box { display: grid; gap: 4px; justify-items: start; margin-left: auto; text-align: right; }
.score-box > * { justify-self: end; }
.total-line { font-size: 1.05rem; }
.total-line .pts { font-size: 1.25rem; }
.rank-house { color: var(--muted); font-size: .85rem; }
@media (min-width: 760px) {
  .hero { grid-template-columns: 1fr auto; padding: 24px; align-items: center; }
  .hero-person { grid-template-columns: 110px 1fr; gap: 20px; }
  .portrait, .avatar.large { width: 110px; height: 110px; }
  .hero-score { border-top: 0; padding-top: 0; }
}

/* The record: one accordion panel per section; an open panel's header sticks under the site header,
   so it is always clear which section you are in. */
.record { margin-top: 24px; }
.record-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.record-head h2 { margin: 0; }
.record > .help { margin: 6px 0 12px; }
.toggle-all {
  background: none; border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: 6px 14px;
  min-height: 40px; cursor: pointer; font-size: .9rem; white-space: nowrap;
}
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px;
  box-shadow: var(--shadow); border-left: 5px solid var(--cat, var(--line));
}
/* each section's accent: the same colours as the rankings bar */
.cat-statements { --cat: var(--c-statements); }
.cat-votes { --cat: var(--c-votes); }
.cat-motions { --cat: var(--c-motions); }
.cat-government { --cat: var(--c-government); }
.cat-orgs { --cat: var(--c-orgs); }
.panel .bar.neg, .panel .bar.pos { background-color: var(--cat); }
.panel .bar.pos { background-image: repeating-linear-gradient(135deg, transparent 0 3px, rgb(10 20 40 / .55) 3px 5px); }
.panel .card blockquote { border-left-color: var(--cat); }
.panel[open] > summary { border-bottom: 2px solid var(--cat, var(--line)); }
.hero-mix { grid-column: 1 / -1; height: 10px; }
.panel[open] { border-color: #34507f; }
.panel > summary {
  list-style: none; cursor: pointer; display: grid; gap: 6px; padding: 14px 16px; border-radius: var(--radius);
  background: var(--surface);
}
.panel > summary::-webkit-details-marker { display: none; }
.panel[open] > summary {
  position: sticky; top: var(--header-h); z-index: 5;
  border-radius: var(--radius) var(--radius) 0 0;
}
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.panel-title { font-weight: 700; font-size: 1.08rem; display: inline-flex; align-items: center; gap: 8px; }
.panel-title::before {
  content: ""; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg); transition: transform .15s; flex: none; margin-right: 2px;
}
.panel[open] .panel-title::before { transform: rotate(45deg); }
.panel-head .pts { font-size: 1.1rem; }
.panel-sub { color: var(--muted); font-size: .85rem; }
.part { white-space: nowrap; }
.bar-track { display: block; height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bar { display: block; height: 100%; width: max(var(--w), 3px); border-radius: 999px; }
.bar.neg { background: var(--neg); }
.bar.pos { background: var(--pos); }
.panel-body { padding: 12px 12px 14px; }
.panel-body > .help { margin: 0 0 12px; }
.panel .card { background: var(--bg); box-shadow: none; }
.close-panel {
  display: block; margin: 14px auto 0; background: none; border: 0; color: var(--accent); cursor: pointer;
  padding: 10px 16px; min-height: 44px; font-size: .9rem;
}
@media (min-width: 760px) { .panel-body { padding: 14px 16px 16px; } }

/* an anti-trans group inside its panel: collapsed, with its quote count */
.group { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; background: var(--surface-2); }
.group > summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 14px; min-height: 48px; font-weight: 600;
}
.group > summary::-webkit-details-marker { display: none; }
.group-name { display: inline-flex; align-items: center; gap: 8px; }
.group-name::before {
  content: ""; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg); transition: transform .15s; flex: none;
}
.group[open] .group-name::before { transform: rotate(45deg); }
.group .count { white-space: nowrap; }
.group > .cards { padding: 0 8px 10px; }
.quote-filter { display: flex; gap: 8px; margin: 0 -12px 12px; padding: 2px 12px; overflow-x: auto; scrollbar-width: none; }
.quote-filter::-webkit-scrollbar { display: none; }
.quote-filter button {
  flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 8px 14px;
  min-height: 40px; cursor: pointer; font-size: .9rem;
}
.quote-filter button[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.quote-filter button[aria-pressed="true"] .count { color: inherit; opacity: .8; }
@media (min-width: 900px) { .quote-filter { margin: 0 0 12px; padding: 2px 0; flex-wrap: wrap; } }

.cards { display: grid; gap: 10px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px;
  box-shadow: var(--shadow);
}
.card[hidden] { display: none; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.card-head .meta { color: var(--muted); font-size: .85rem; }
.card-head .pts { font-size: 1.05rem; }
.card-title { margin: 4px 0 6px; font-weight: 600; line-height: 1.35; }
.card-title a { text-decoration: none; }
.card-title a:hover { text-decoration: underline; }
.ext { font-size: .8em; }
.card blockquote { margin: 8px 0 10px; padding-left: 12px; border-left: 3px solid var(--brand-pink); font-size: 1rem; }
.card .about { margin: 0 0 6px; font-size: .95rem; line-height: 1.45; }
.card .meant { margin: 0 0 8px; color: var(--muted); font-size: .85rem; }
.did { margin: 4px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.arrow { color: var(--muted); }
.evidence { color: var(--muted); font-style: italic; font-size: .9rem; margin: 8px 0 0; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.show-all { margin: 12px auto 0; display: block; }

/* ---------------------------------------------------------------- methodology */
.prose { max-width: 820px; }
.prose p, .prose dd { max-width: 75ch; }
.defs { display: grid; gap: 4px 16px; margin: 0; }
.defs dt { font-weight: 600; margin-top: 10px; }
.defs dd { margin: 0; color: var(--muted); }
@media (min-width: 760px) {
  .defs { grid-template-columns: max-content 1fr; align-items: baseline; }
  .defs dt { margin-top: 0; white-space: nowrap; }
}
.method-list { display: grid; gap: 10px; }
.method-card h3 { margin: 0; font-size: 1.02rem; }
.method-card p { margin: 6px 0 0; color: var(--muted); }
.weight-tag { font-weight: 700; color: var(--brand-blue); white-space: nowrap; }
.band-list { list-style: none; padding: 0; display: grid; gap: 8px; }
.band-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }

@media print {
  .site-header, .filter-panel, .bands, .quote-filter, .show-more, .show-all, .toggle-all, .close-panel { display: none; }
  .card[hidden], .person-card[hidden] { display: block; }
}
