/* =========================================================================
   Phil Scott Has Got To Go — stylesheet
   Extracted from the canvas design. Adds: responsive breakpoints, focus
   states, and three contrast fixes the original artboard failed (see
   docs/IMPLEMENTATION_PLAN.md §6.2).
   ========================================================================= */

/* --- Fonts -------------------------------------------------------------
   Self-hosted so no visitor IP reaches a third-party CDN. Drop the .woff2
   files into src/assets/fonts/ (see docs/IMAGES.md). Until then the
   fallback stacks carry the design.                                      */

@font-face {
  font-family: "Oswald";
  src: url("/assets/fonts/oswald-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2122, U+2191, U+2193, U+2212, U+2215;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("/assets/fonts/source-serif-4-latin.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2122, U+2191, U+2193, U+2212, U+2215;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/assets/fonts/ibm-plex-mono-400-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2122, U+2191, U+2193, U+2212, U+2215;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/assets/fonts/ibm-plex-mono-500-latin.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2122, U+2191, U+2193, U+2212, U+2215;
}

/* --- Tokens ----------------------------------------------------------- */

:root {
  --cream: #f6f3ea;
  --cream-dark: #ece7da;
  --green: #1f4433;
  --ink: #14231c;
  /* Nudged from the design's #c9a227, which measured 4.49:1 against the green
     hero -- one hundredth short of WCAG AA. Visually identical, and gold text
     only ever appears on the two dark grounds (6.9:1 on ink). */
  --gold: #cca428;
  --red: #b0392e;

  /* Contrast-corrected muted text. The design used .5 and .45 alpha, which
     measured 3.15:1 and 4.07:1 against their backgrounds — both fail WCAG AA
     for body-size text. Raised until both clear 4.5:1. */
  --muted-on-cream: rgba(20, 35, 28, 0.72);
  --meta-on-cream: rgba(20, 35, 28, 0.68);
  --muted-on-ink: rgba(246, 243, 234, 0.78);
  --meta-on-ink: rgba(246, 243, 234, 0.66);
  --rule-on-cream: rgba(20, 35, 28, 0.16);
  --rule-on-ink: rgba(246, 243, 234, 0.16);

  --display: "Oswald", "Haettenschweiler", "Arial Narrow", sans-serif;
  --body: "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --wrap: 1180px;
  --gutter: clamp(1rem, 4vw, 1.5rem);
}

/* --- Reset ------------------------------------------------------------ */

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; display: block; }

a { color: var(--green); text-decoration: none; }
a:hover { color: var(--red); }

::selection { background: var(--gold); color: var(--ink); }

h1, h2, h3, h4 {
  font-family: var(--display);
  text-transform: uppercase;
  line-height: 1.04;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

p { margin: 0 0 1.1em; }

/* Focus. The original design had hover states and no focus states at all,
   which made the site unusable by keyboard. */
:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  border-radius: 2px;
}
.site-header :focus-visible,
.site-footer :focus-visible,
.banner :focus-visible { outline-color: var(--gold); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--gold);
  color: var(--ink);
  font-family: var(--mono);
  padding: 12px 20px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 12px;
}
.skip-link:focus { left: 0; }

/* --- Layout helpers --------------------------------------------------- */

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding-inline: var(--gutter);
  width: 100%;
}
.narrow { max-width: 900px; }
.center { text-align: center; }

.section { padding: clamp(52px, 8vw, 88px) 0; }
.section--alt {
  background: var(--cream-dark);
  border-block: 1px solid var(--rule-on-cream);
}
.section--green { background: var(--green); color: var(--cream); }
.section--ink { background: var(--ink); color: var(--cream); }
.section--green a:not(.btn), .section--ink a:not(.btn) { color: var(--gold); }

.section h2 { font-size: clamp(30px, 5vw, 46px); font-weight: 600; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 44px;
}
.section-head h2 { margin: 0; }

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin: 0 0 18px;
  color: var(--meta-on-cream);
}
.eyebrow--gold { color: var(--gold); }
.eyebrow--red { color: var(--red); }
.gold { color: var(--gold); }

.lede { font-size: clamp(17px, 2.2vw, 20px); line-height: 1.55; max-width: 42em; }

/* --- Buttons ---------------------------------------------------------- */

.btn {
  display: inline-block;
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 15px;
  padding: 17px 34px;
  border: 1.5px solid transparent;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.btn--red { background: var(--red); color: var(--cream); }
.btn--red:hover { background: var(--gold); color: var(--ink); }
.btn--gold { background: var(--gold); color: var(--ink); }
.btn--gold:hover { background: var(--cream); color: var(--ink); }
.btn--cream { background: var(--cream); color: var(--red); white-space: nowrap; }
.btn--cream:hover { background: var(--gold); color: var(--ink); }
.btn--ghost { border-color: rgba(246, 243, 234, 0.5); color: var(--cream); }
.btn--ghost:hover { border-color: var(--gold); color: var(--gold); }

.btn-row { display: flex; gap: 14px; flex-wrap: wrap; }

.link-arrow {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 15px;
  border-bottom: 2px solid var(--red);
  padding-bottom: 4px;
}

/* --- Banner + header -------------------------------------------------- */

.banner {
  background: var(--ink);
  color: var(--cream);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 9px var(--gutter);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.banner span { color: var(--muted-on-ink); }
.banner a { color: var(--gold); border-bottom: 1px solid rgba(201, 162, 39, 0.5); }

.site-header { background: var(--green); color: var(--cream); }
.header-inner {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 14px; padding: 18px 0; color: var(--cream); }
.brand:hover { color: var(--cream); }
.brand-mark {
  width: 46px;
  height: 46px;
  flex: none;
  border: 2px solid var(--gold);
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
  color: var(--gold);
}
.brand-text { display: block; line-height: 1; }
.brand-name {
  display: block;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(17px, 2.4vw, 21px);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.brand-sub {
  display: block;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-on-ink);
  margin-top: 5px;
}

.site-nav {
  display: flex;
  align-items: stretch;
  gap: 4px;
  font-family: var(--display);
  text-transform: uppercase;
  font-size: 14px;
  letter-spacing: 0.09em;
}
.site-nav a { display: flex; align-items: center; padding: 0 16px; color: var(--cream); }
.site-nav a:hover { background: rgba(246, 243, 234, 0.12); color: var(--cream); }
.site-nav a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--gold); }
.nav-cta {
  background: var(--red);
  font-weight: 600;
  margin: 12px 0;
  padding: 0 22px !important;
}
.nav-cta:hover { background: var(--gold) !important; color: var(--ink) !important; }

/* --- Hero ------------------------------------------------------------- */

.hero { background: var(--green); color: var(--cream); overflow: hidden; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(24px, 4vw, 48px);
  align-items: center;
  min-height: 520px;
}
.hero-copy { padding: clamp(40px, 6vw, 64px) 0; }
.hero h1 {
  font-size: clamp(40px, 8vw, 76px);
  font-weight: 700;
  line-height: 0.96;
  letter-spacing: -0.005em;
  margin: 0 0 26px;
}
.hero .lede { opacity: 0.9; margin-bottom: 34px; }

/* --- Image slots ------------------------------------------------------ */

.imgslot { margin: 0; }
.imgslot-frame {
  position: relative;
  aspect-ratio: 4 / 5;
  border: 1px solid var(--rule-on-cream);
  overflow: hidden;
}
.imgslot-frame .hatch,
.imgslot-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.imgslot--hero .imgslot-frame { align-self: end; height: 470px; aspect-ratio: auto; border: 0; }
.imgslot figcaption {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--meta-on-cream);
  margin-top: 12px;
}

/* --- Stat bar --------------------------------------------------------- */

.statbar { background: var(--ink); color: var(--cream); }
.statbar-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.stat { padding: 30px 22px; border-right: 1px solid var(--rule-on-ink); }
.stat:first-child { padding-left: 0; }
.stat:last-child { padding-right: 0; border-right: 0; }
.stat-figure {
  font-family: var(--display);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 600;
  color: var(--gold);
  line-height: 1;
}
.stat-label {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-on-ink);
  margin-top: 10px;
}

/* --- Two column ------------------------------------------------------- */

.two-col {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: start;
}
.two-col--center { align-items: center; }
.two-col p { font-size: clamp(16px, 2vw, 19px); line-height: 1.62; }

/* --- Issues (home page) ------------------------------------------------
   Full-width horizontal rows, not a boxed grid -- same pattern as the
   record page's .record-item, just one paragraph instead of a lede+detail
   pair. Kept as its own class set (rather than reusing .record-item
   directly) so a future style change to one page doesn't silently change
   the other. */

.issue-list { display: flex; flex-direction: column; }
.issue-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: clamp(24px, 4vw, 48px);
  padding: 36px 0;
  border-top: 1px solid var(--rule-on-cream);
}
.issue-row:first-child { border-top: 0; padding-top: 0; }
.issue-meta { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.card-num {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--red);
}
.issue-tag {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--meta-on-cream);
}
.issue-body h3 { font-size: clamp(21px, 3vw, 25px); font-weight: 600; margin: 0 0 12px; }
.issue-body p { font-size: 17px; line-height: 1.58; color: var(--muted-on-cream); margin: 0 0 4px; }

/* --- Record page ------------------------------------------------------ */

.record-item {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: clamp(24px, 4vw, 48px);
  padding: 40px 0;
  border-top: 1px solid var(--rule-on-cream);
}
.record-item:first-child { border-top: 0; padding-top: 0; }
.record-meta { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.record-tag {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--meta-on-cream);
}
.record-body h2 { font-size: clamp(24px, 3.5vw, 28px); font-weight: 600; }
.record-lede { font-size: clamp(17px, 2vw, 19px); line-height: 1.6; }
.record-body p:last-of-type { color: var(--muted-on-cream); }

.pagehead {
  background: var(--cream-dark);
  padding: clamp(48px, 7vw, 70px) 0 clamp(40px, 6vw, 60px);
  border-bottom: 1px solid var(--rule-on-cream);
}
.pagehead h1 { font-size: clamp(34px, 7vw, 62px); font-weight: 700; margin: 0 0 20px; }

/* --- Badges + sources ------------------------------------------------- */

.badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 4px 9px;
  border: 1px solid currentColor;
}
.badge--record { color: var(--green); }
.badge--opinion { color: var(--red); }

.sources { margin-top: 18px; font-family: var(--mono); font-size: 12px; }
.sources summary {
  cursor: pointer;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--meta-on-cream);
  padding: 4px 0;
}
.sources summary:hover { color: var(--red); }
.sources ul { margin: 10px 0 0; padding-left: 18px; }
.sources li { margin-bottom: 6px; line-height: 1.5; }
.sources--dark summary { color: var(--meta-on-ink); }
.sources--dark summary:hover { color: var(--gold); }
.sources--dark a { color: var(--gold); }

/* --- Timeline --------------------------------------------------------- */

.timeline { display: grid; gap: 4px; }
.tl-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 24px;
  padding: 26px 0;
  border-top: 1px solid var(--rule-on-cream);
}
.tl-year { font-family: var(--display); font-size: 22px; font-weight: 600; color: var(--red); }
.tl-title { font-size: 22px; font-weight: 500; margin: 0 0 8px; letter-spacing: 0.01em; }
.tl-outcome { margin: 0 0 10px; }
.tl-body p { font-size: 17px; line-height: 1.58; color: var(--muted-on-cream); margin-bottom: 0; }
.timeline--dark .tl-row { border-color: var(--rule-on-ink); }
.timeline--dark .tl-year { color: var(--gold); }
.timeline--dark .tl-body p { color: var(--muted-on-ink); }

.outcome {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 3px 8px;
  border: 1px solid currentColor;
}
.outcome--overridden { color: var(--red); }
.outcome--veto-stood { color: var(--meta-on-cream); }
.outcome--before-the-supreme-court { color: var(--green); }
.outcome--still-in-effect { color: var(--red); }
.timeline--dark .outcome--overridden { color: var(--gold); }
.timeline--dark .outcome--veto-stood { color: var(--meta-on-ink); }
.timeline--dark .outcome--before-the-supreme-court { color: var(--cream); }
.timeline--dark .outcome--still-in-effect { color: var(--gold); }

/* --- Signs ------------------------------------------------------------ */

.sign-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 40px; }
.sign-card { margin: 0; }
.sign-card--wide { grid-column: span 2; }
.sign-card figcaption {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--meta-on-cream);
  margin-top: 12px;
}
.sign {
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 30px;
  font-family: var(--display);
  text-transform: uppercase;
}
.sign--dark { background: var(--green); color: var(--cream); border: 10px solid var(--ink); }
.sign--light { background: var(--cream); color: var(--ink); border: 10px solid var(--red); }
.sign-line { font-weight: 700; font-size: clamp(22px, 4vw, 40px); line-height: 1; }
.sign-rule { height: 3px; background: var(--gold); margin: 18px auto; width: 70px; }
.sign-kicker { font-weight: 500; font-size: clamp(14px, 2.2vw, 22px); letter-spacing: 0.16em; color: var(--red); }
.sign-veto { font-weight: 700; font-size: clamp(44px, 8vw, 74px); line-height: 0.9; margin-top: 10px; }
.sign-foot {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  margin-top: 18px;
  color: var(--meta-on-cream);
}
.sign--bumper {
  aspect-ratio: auto;
  background: var(--ink);
  color: var(--cream);
  padding: 34px 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
  flex-wrap: wrap;
  font-weight: 700;
  font-size: clamp(20px, 3.4vw, 34px);
}

.sign-preview {
  background: var(--ink);
  padding: 40px;
  display: grid;
  gap: 10px;
  text-align: center;
  font-family: var(--display);
  text-transform: uppercase;
  font-weight: 700;
  font-size: clamp(20px, 3vw, 32px);
  color: var(--cream);
  line-height: 1.05;
}

/* --- Pre-footer + footer ---------------------------------------------- */

.prefooter { background: var(--red); color: var(--cream); padding: 60px 0; }
.prefooter-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}
.prefooter h2 { font-size: clamp(26px, 4vw, 38px); font-weight: 700; margin: 0 0 8px; }
.prefooter p { font-size: 18px; margin: 0; opacity: 0.92; }

.site-footer {
  background: var(--ink);
  color: var(--muted-on-ink);
  padding: 54px 0 64px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.75;
  letter-spacing: 0.03em;
}
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.footer-head {
  color: var(--gold);
  font-family: var(--mono);
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  margin: 0 0 14px;
  font-weight: 400;
}
.footer-links { display: grid; gap: 6px; }
.site-footer a { color: var(--cream); text-decoration: underline; text-underline-offset: 3px; }
.site-footer a:hover { color: var(--gold); }
.footer-bottom {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--rule-on-ink);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  /* was rgba(...,.45) = 4.07:1, below AA. Raised to .66 = 6.1:1. */
  color: var(--meta-on-ink);
}

/* =========================================================================
   Responsive. The source artboard had eleven fixed grids and zero media
   queries; everything below is new.
   ========================================================================= */

@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; min-height: 0; }
  .imgslot--hero { order: -1; }
  .imgslot--hero .imgslot-frame { height: 300px; }
  .two-col { grid-template-columns: 1fr; }
  .issue-row { grid-template-columns: 1fr; gap: 18px; }
  .issue-meta { flex-direction: row; align-items: center; gap: 14px; }
  .record-item { grid-template-columns: 1fr; gap: 18px; }
  .record-meta { flex-direction: row; align-items: center; gap: 14px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .statbar-grid { grid-template-columns: repeat(2, 1fr); }
  .stat { padding: 26px 20px; }
  /* Dividers become horizontal once the bar wraps, or they land mid-air. */
  .stat:nth-child(2n) { border-right: 0; padding-right: 0; }
  .stat:nth-child(2n + 1) { padding-left: 0; }
  .stat:nth-child(-n + 2) { border-bottom: 1px solid var(--rule-on-ink); }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .header-inner { flex-direction: column; align-items: stretch; gap: 0; }
  .brand { padding: 16px 0 12px; }
  .site-nav {
    flex-wrap: wrap;
    gap: 0;
    border-top: 1px solid var(--rule-on-ink);
    margin: 0 calc(-1 * var(--gutter));
    padding: 0 var(--gutter);
  }
  .site-nav a { padding: 14px 14px 14px 0; }
  .nav-cta { margin: 12px 0; padding: 12px 20px !important; }
  .statbar-grid { grid-template-columns: 1fr; }
  .stat { padding: 22px 0; border-right: 0; border-bottom: 1px solid var(--rule-on-ink); }
  .stat:last-child { border-bottom: 0; }
  .tl-row { grid-template-columns: 1fr; gap: 8px; }
  .sign-grid { grid-template-columns: 1fr; gap: 28px; }
  .sign-card--wide { grid-column: span 1; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .section-head { margin-bottom: 28px; }
  .btn { width: 100%; text-align: center; }
  .btn-row { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

@media print {
  .banner, .site-nav, .prefooter, .skip-link { display: none; }
  body { background: #fff; color: #000; }
  .sources[open] summary { display: none; }
  .sources ul { display: block; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 10px; }
}

/* Placeholder shown in an image slot until the real file is supplied. */
.imgslot-todo {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--meta-on-cream);
}
.imgslot--hero .imgslot-todo { color: rgba(246, 243, 234, 0.7); }

.footer-credits {
  margin-top: 28px;
  font-size: 11.5px;
  color: var(--meta-on-ink);
  letter-spacing: 0.04em;
}
