/* ============================================================
   MANDATE DEMOCRACY® FOUNDATION — site design system
   Concept: "The Citizens' Ballot" — the site as official civic
   document: ballot + voter information pamphlet. Paper ground,
   ink type, ruled structure, measures & findings, one red stamp.
   ============================================================ */

/* ---------- fonts (self-hosted, latin subsets) ---------- */
@font-face { font-family:'Newsreader'; font-style:normal; font-weight:500; font-display:swap; src:url(fonts/Newsreader-500-normal.woff2) format('woff2'); }
@font-face { font-family:'Newsreader'; font-style:normal; font-weight:600; font-display:swap; src:url(fonts/Newsreader-600-normal.woff2) format('woff2'); }
@font-face { font-family:'Newsreader'; font-style:italic; font-weight:500; font-display:swap; src:url(fonts/Newsreader-500-italic.woff2) format('woff2'); }
@font-face { font-family:'Public Sans'; font-style:normal; font-weight:400; font-display:swap; src:url(fonts/PublicSans-400-normal.woff2) format('woff2'); }
@font-face { font-family:'Public Sans'; font-style:normal; font-weight:500; font-display:swap; src:url(fonts/PublicSans-500-normal.woff2) format('woff2'); }
@font-face { font-family:'Public Sans'; font-style:normal; font-weight:700; font-display:swap; src:url(fonts/PublicSans-700-normal.woff2) format('woff2'); }
@font-face { font-family:'Public Sans'; font-style:italic; font-weight:400; font-display:swap; src:url(fonts/PublicSans-400-italic.woff2) format('woff2'); }
@font-face { font-family:'IBM Plex Mono'; font-style:normal; font-weight:400; font-display:swap; src:url(fonts/IBMPlexMono-400-normal.woff2) format('woff2'); }
@font-face { font-family:'IBM Plex Mono'; font-style:normal; font-weight:600; font-display:swap; src:url(fonts/IBMPlexMono-600-normal.woff2) format('woff2'); }

/* ---------- tokens ---------- */
:root {
  --paper:      #f7f5ef;
  --paper-deep: #efece2;
  --white:      #fdfcf9;
  --ink:        #131c2e;
  --ink-soft:   #39435a;
  --muted:      #666d7c;
  --rule:       #d9d4c6;
  --rule-mid:   #b9b3a2;
  --navy:       #1d3461;
  --red:        #b21f2d;
  --red-deep:   #8f1622;

  --serif: 'Newsreader', 'Iowan Old Style', Georgia, serif;
  --sans:  'Public Sans', -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  --mono:  'IBM Plex Mono', 'SF Mono', Menlo, monospace;

  --maxw: 1120px;
  --prose: 66ch;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;            /* 17px */
  line-height: 1.68;
  color: var(--ink);
  background: var(--paper);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2.5px; }
a:hover { color: var(--red); }
::selection { background: var(--navy); color: var(--white); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.08; letter-spacing: -.012em; margin: 0 0 .45em; }
h1 { font-size: clamp(2.4rem, 5.4vw, 4rem); }
h2 { font-size: clamp(1.65rem, 3vw, 2.35rem); }
h3 { font-size: 1.35rem; line-height: 1.25; }
h4 { font-family: var(--sans); font-size: 1rem; font-weight: 700; margin: 0 0 .4em; }
p  { margin: 0 0 1.15em; }
.prose { max-width: var(--prose); }
.prose p, .prose li { color: var(--ink-soft); }
.lead { font-size: 1.2rem; line-height: 1.55; color: var(--ink-soft); }
strong { font-weight: 700; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5rem 0; }

/* mono document label — the workhorse */
.doc-label {
  font-family: var(--mono); font-size: .72rem; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase; color: var(--ink);
}
.doc-label--muted { color: var(--muted); }
.doc-label--red { color: var(--red); }

/* ---------- layout ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: 76px 0; }
.section--rule { border-top: 1px solid var(--rule); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.grid-thirds { display: grid; grid-template-columns: 2fr 1fr; gap: 56px; align-items: start; }
@media (max-width: 860px) {
  .grid2, .grid-thirds { grid-template-columns: 1fr; gap: 36px; }
  .section { padding: 56px 0; }
}

/* ---------- masthead ---------- */
.mast {
  background: var(--paper);
  border-bottom: 3px double var(--ink);
}
.mast-top {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; padding: 18px 0 12px;
  border-bottom: 1px solid var(--rule);
}
.mast-brand { text-decoration: none; color: var(--ink); display: flex; align-items: baseline; gap: 14px; }
.mast-brand:hover { color: var(--ink); }
.mast-name {
  font-family: var(--serif); font-weight: 600; font-size: 1.42rem; letter-spacing: .01em;
  white-space: nowrap;
}
.mast-name .reg { font-size: .6em; vertical-align: super; }
.mast-tag { font-family: var(--mono); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.mast-meta { font-family: var(--mono); font-size: .68rem; letter-spacing: .08em; color: var(--muted); text-align: right; white-space: nowrap; }
.mast-meta span { display: block; }
@media (max-width: 720px) { .mast-meta { display: none; } .mast-tag { display: none; } }

/* nav */
.nav { display: flex; align-items: stretch; gap: 4px; }
.nav > li { list-style: none; position: relative; }
.nav { margin: 0; padding: 0; }
.nav a, .nav button {
  display: block; padding: 12px 14px;
  font-family: var(--sans); font-size: .92rem; font-weight: 500;
  color: var(--ink); text-decoration: none; background: none; border: 0; cursor: pointer;
}
.nav > li > a:hover, .nav > li > button:hover { background: var(--paper-deep); color: var(--ink); }
.nav .sub {
  display: none; position: absolute; left: 0; top: 100%; z-index: 50;
  min-width: 250px; margin: 0; padding: 6px 0;
  background: var(--white); border: 1px solid var(--ink);
  box-shadow: 5px 5px 0 rgba(19,28,46,.14);
}
.nav li:hover > .sub, .nav li:focus-within > .sub { display: block; }
.nav .sub li { list-style: none; }
.nav .sub a { padding: 9px 18px; font-size: .9rem; border-bottom: 1px solid var(--rule); }
.nav .sub li:last-child a { border-bottom: 0; }
.nav .sub a:hover { background: var(--paper); color: var(--red); }
.nav-cta { margin-left: auto; display: flex; align-items: center; padding-left: 12px; }
.nav .nav-cta a.btn {
  display: inline-block; padding: 10px 18px;
  font-size: .85rem; font-weight: 700; color: #fff;
  border: 2px solid var(--red-deep); background: var(--red);
  box-shadow: 3px 3px 0 var(--ink);
}
.nav .nav-cta a.btn:hover { background: var(--red-deep); box-shadow: 1px 1px 0 var(--ink); }
.nav-row { display: flex; align-items: stretch; }
.menu-btn { display: none; }
@media (max-width: 960px) {
  .nav-row { display: block; }
  .menu-btn {
    display: block; width: 100%; text-align: left; padding: 12px 0;
    background: none; border: 0; font-family: var(--mono); font-size: .78rem;
    letter-spacing: .14em; text-transform: uppercase; cursor: pointer; color: var(--ink);
  }
  .nav { display: none; flex-direction: column; padding-bottom: 12px; }
  .nav.open { display: flex; }
  .nav .sub { position: static; display: block; border: 0; box-shadow: none; background: none; padding: 0 0 0 16px; }
  .nav .sub a { border-bottom: 0; padding: 7px 12px; }
  .nav-cta { margin: 8px 0 0; }
}

/* ---------- ballot hero ---------- */
.ballot {
  background: var(--white);
  border: 1px solid var(--ink);
  box-shadow: 7px 7px 0 rgba(19,28,46,.12);
}
.ballot-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 26px; border-bottom: 2px solid var(--ink);
}
.ballot-body { padding: 34px 26px 30px; }
.ballot-q { font-family: var(--serif); font-weight: 600; font-size: clamp(1.7rem, 3.4vw, 2.6rem); line-height: 1.14; letter-spacing: -.01em; margin: 0 0 26px; }
.ballot-opts { margin: 0; padding: 0; list-style: none; }
.ballot-opts li {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 6px; border-top: 1px solid var(--rule);
  font-family: var(--sans); font-weight: 700; letter-spacing: .04em; font-size: 1rem;
}
.oval {
  width: 30px; height: 17px; border: 2px solid var(--ink); border-radius: 50%;
  flex: none; display: inline-block;
}
.oval--filled { background: var(--ink); }
.ballot-opts .picked { color: var(--red); }
.ballot-opts .picked .oval { border-color: var(--red); background: var(--red); }
.ballot-foot { padding: 12px 26px; border-top: 1px solid var(--rule); display:flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* ---------- measure section headings ---------- */
.measure { display: flex; align-items: baseline; gap: 18px; margin-bottom: 34px; }
.measure-no { font-family: var(--mono); font-weight: 600; font-size: .8rem; letter-spacing: .16em; color: var(--red); white-space: nowrap; }
.measure-rule { flex: 1; border-top: 1px solid var(--rule-mid); position: relative; top: -4px; }
.measure + h2, .measure-title { margin-top: 0; }

/* ---------- findings (stats as ruled table) ---------- */
.findings { width: 100%; border-collapse: collapse; border-top: 2px solid var(--ink); }
.findings tr { border-bottom: 1px solid var(--rule); }
.findings td { padding: 18px 8px; vertical-align: baseline; }
.findings .fig {
  font-family: var(--serif); font-weight: 600; font-size: clamp(2rem, 4vw, 2.9rem);
  line-height: 1; white-space: nowrap; width: 1%; padding-right: 28px; color: var(--ink);
}
.findings .what { color: var(--ink-soft); }
.findings .src { font-family: var(--mono); font-size: .68rem; letter-spacing: .06em; color: var(--muted); white-space: nowrap; text-align: right; }
.findings .src a { color: var(--muted); }
.findings .src a:hover { color: var(--red); }

/* ---------- pull quote ---------- */
.pullquote {
  border-left: 3px double var(--ink);
  padding: 6px 0 6px 26px; margin: 2.2rem 0;
}
.pullquote p {
  font-family: var(--serif); font-style: italic; font-weight: 500;
  font-size: clamp(1.25rem, 2.2vw, 1.6rem); line-height: 1.35; color: var(--ink); margin: 0 0 .6em;
}
.pullquote cite { font-family: var(--mono); font-style: normal; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; padding: 13px 26px;
  font-family: var(--sans); font-weight: 700; font-size: .95rem; letter-spacing: .02em;
  text-decoration: none; cursor: pointer; text-align: center;
  border: 2px solid var(--ink); color: var(--ink); background: var(--white);
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); color: var(--ink); }
.btn--primary { background: var(--red); border-color: var(--red-deep); color: #fff; box-shadow: 4px 4px 0 var(--ink); }
.btn--primary:hover { color: #fff; background: var(--red-deep); }
.btn--small { padding: 9px 16px; font-size: .85rem; box-shadow: 3px 3px 0 var(--ink); }
.btn--small:hover { box-shadow: 1px 1px 0 var(--ink); }

/* ---------- lists with ballot bubbles ---------- */
.bubble-list { list-style: none; margin: 0 0 1.2em; padding: 0; }
.bubble-list li { position: relative; padding: 7px 0 7px 40px; color: var(--ink-soft); }
.bubble-list li::before {
  content: ""; position: absolute; left: 2px; top: .78em;
  width: 22px; height: 13px; border: 2px solid var(--ink); border-radius: 50%;
}
.bubble-list--marked li::before { background: var(--ink); }

/* ---------- archival figure ---------- */
.figure { background: var(--white); border: 1px solid var(--rule-mid); padding: 12px 12px 10px; box-shadow: 5px 5px 0 rgba(19,28,46,.08); }
.figure img { filter: sepia(.14) contrast(1.02); border: 1px solid var(--rule); }
.figure figcaption { font-family: var(--mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding-top: 10px; display: flex; justify-content: space-between; gap: 8px; }
.figure--tilt { transform: rotate(-.7deg); }
.figure--tilt2 { transform: rotate(.5deg); }

/* ---------- stamp (one per view, max) ---------- */
.stamp {
  display: inline-block; padding: 8px 16px; text-align: center; line-height: 1.6;
  border: 3px double var(--red); color: var(--red);
  font-family: var(--mono); font-weight: 600; font-size: .78rem;
  letter-spacing: .18em; text-transform: uppercase;
  transform: rotate(-2.4deg); opacity: .92;
}

/* ---------- register (ruled index of links, replaces card grids) ---------- */
.register { border-top: 2px solid var(--ink); }
.register-row {
  display: grid; grid-template-columns: 92px 1fr auto; gap: 20px; align-items: baseline;
  padding: 20px 6px; border-bottom: 1px solid var(--rule);
  text-decoration: none; color: var(--ink);
}
.register-row:hover { background: var(--white); color: var(--ink); }
.register-row:hover .register-go { color: var(--red); transform: translateX(4px); }
.register-no { font-family: var(--mono); font-size: .74rem; font-weight: 600; letter-spacing: .12em; color: var(--muted); }
.register-title { display: block; font-family: var(--serif); font-weight: 600; font-size: 1.25rem; line-height: 1.25; }
.register-desc { display: block; color: var(--muted); font-size: .95rem; margin-top: 3px; }
.register-go { font-family: var(--mono); font-size: .9rem; color: var(--muted); transition: transform .12s ease; }
@media (max-width: 640px) { .register-row { grid-template-columns: 1fr auto; } .register-no { display: none; } }

/* ---------- panel (bordered document box) ---------- */
.panel { background: var(--white); border: 1px solid var(--ink); padding: 30px 30px 26px; }
.panel--shadow { box-shadow: 6px 6px 0 rgba(19,28,46,.1); }
.panel--paper { background: var(--paper); }

/* ---------- page header (interior pages) ---------- */
.page-head { padding: 64px 0 44px; border-bottom: 1px solid var(--rule); background: var(--paper); }
.page-head .doc-label { margin-bottom: 14px; display: block; }
.page-head h1 { margin-bottom: .3em; }
.page-head .lead { max-width: 62ch; }

/* ---------- certification footer ---------- */
.cert { border-top: 3px double var(--ink); background: var(--paper-deep); margin-top: 40px; }
.cert-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; padding: 52px 0 40px; }
.cert h5 { font-family: var(--mono); font-size: .7rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin: 0 0 14px; }
.cert ul { list-style: none; margin: 0; padding: 0; }
.cert li { padding: 3px 0; }
.cert a { color: var(--ink-soft); text-decoration: none; font-size: .93rem; }
.cert a:hover { color: var(--red); text-decoration: underline; }
.cert-org { font-family: var(--serif); font-weight: 600; font-size: 1.3rem; margin-bottom: 8px; }
.cert-note { color: var(--muted); font-size: .9rem; max-width: 40ch; }
.cert-legal {
  border-top: 1px solid var(--rule-mid); padding: 18px 0 26px;
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  font-family: var(--mono); font-size: .68rem; letter-spacing: .07em; color: var(--muted);
}
.cert-legal a { color: var(--muted); }
@media (max-width: 860px) { .cert-grid { grid-template-columns: 1fr 1fr; gap: 28px; padding: 40px 0 28px; } }

/* ---------- testimony (quote rows with portraits) ---------- */
.testimony { border-top: 2px solid var(--ink); }
.testimony-row {
  display: grid; grid-template-columns: 104px 1fr; gap: 26px; align-items: start;
  padding: 28px 0; border-bottom: 1px solid var(--rule);
}
.testimony-row img { border: 1px solid var(--rule-mid); filter: grayscale(.25) sepia(.14) contrast(1.02); }
.testimony-row blockquote { margin: 0; }
.testimony-row blockquote p {
  font-family: var(--serif); font-style: italic; font-weight: 500;
  font-size: 1.22rem; line-height: 1.4; color: var(--ink); margin: 0 0 .5em;
}
.testimony-row cite { font-family: var(--mono); font-style: normal; font-size: .7rem; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); }
.testimony-row--noimg { grid-template-columns: 1fr; }
@media (max-width: 560px) { .testimony-row { grid-template-columns: 76px 1fr; gap: 16px; } }

/* ---------- spec grid (feature list, no cards) ---------- */
.spec-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 56px; }
.spec { border-top: 1px solid var(--rule); padding: 16px 0 14px; }
.spec h4 { margin-bottom: .25em; }
.spec p { color: var(--muted); font-size: .95rem; margin: 0; }
.spec .doc-label { display: inline-block; margin-bottom: 6px; }
@media (max-width: 720px) { .spec-grid { grid-template-columns: 1fr; } }

/* ---------- store catalog ---------- */
.cat { border-top: 2px solid var(--ink); }
.cat-row {
  display: grid; grid-template-columns: 88px 1fr auto auto; gap: 22px; align-items: baseline;
  padding: 22px 6px; border-bottom: 1px solid var(--rule);
}
.cat-no { font-family: var(--mono); font-size: .72rem; font-weight: 600; letter-spacing: .12em; color: var(--muted); }
.cat-name { font-family: var(--serif); font-weight: 600; font-size: 1.3rem; }
.cat-desc { display: block; color: var(--muted); font-size: .95rem; margin-top: 3px; max-width: 52ch; }
.cat-price { font-family: var(--mono); font-weight: 600; font-size: 1rem; white-space: nowrap; }
.cat-price .tbd { color: var(--muted); font-weight: 400; }
@media (max-width: 720px) {
  .cat-row { grid-template-columns: 1fr auto; }
  .cat-no, .cat-row .btn { grid-column: auto; }
  .cat-no { display: none; }
}

/* auction lot */
.lot { background: var(--white); border: 1px solid var(--ink); }
.lot-head { display: flex; justify-content: space-between; gap: 10px; padding: 10px 20px; border-bottom: 2px solid var(--ink); }
.lot-body { padding: 22px 20px; }
.lot-bids { width: 100%; border-collapse: collapse; margin-top: 14px; }
.lot-bids td { padding: 8px 6px; border-top: 1px solid var(--rule); font-size: .92rem; }
.lot-bids .doc-label { font-size: .66rem; }

/* ---------- utility ---------- */
.mt0 { margin-top: 0; } .mb0 { margin-bottom: 0; }
.tight { line-height: 1.45; }
.small { font-size: .92rem; }
.muted { color: var(--muted); }
.skip {
  position: absolute; left: -9999px; top: 0; background: var(--ink); color: #fff;
  padding: 10px 18px; z-index: 100; font-family: var(--sans);
}
.skip:focus { left: 0; }
