/* ============================================================
   Pragma landing page
   Palette note: red and blue are deliberately avoided throughout.
   For a non-partisan organization they read as party colours.
   The identity is ink-on-paper with a single ochre accent.
   ============================================================ */

:root {
  --paper:      #faf8f5;
  --surface:    #ffffff;
  --surface-2:  #f3efe8;
  --ink:        #15171c;
  --ink-2:      #3f4551;
  --muted:      #6d7280;
  --line:       #e4ded3;
  --line-strong:#d3cabb;
  --accent:     #9a5b1c;
  --accent-hover:#7d4914;
  --accent-soft:#f6ead8;

  --font-display: "Newsreader", ui-serif, Georgia, "Times New Roman", serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --wrap: 1120px;
  --radius: 10px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 2px rgba(21,23,28,.05), 0 1px 3px rgba(21,23,28,.04);
  --shadow-md: 0 2px 4px rgba(21,23,28,.04), 0 8px 24px rgba(21,23,28,.07);
  --shadow-lg: 0 4px 8px rgba(21,23,28,.05), 0 20px 48px rgba(21,23,28,.10);

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:      #101216;
    --surface:    #171a20;
    --surface-2:  #1d212a;
    --ink:        #eceef2;
    --ink-2:      #c2c7d1;
    --muted:      #8d94a3;
    --line:       #282c35;
    --line-strong:#3a3f4b;
    --accent:     #e0a44e;
    --accent-hover:#eeb867;
    --accent-soft:#2a2318;

    --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
    --shadow-md: 0 2px 4px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
    --shadow-lg: 0 4px 8px rgba(0,0,0,.3), 0 20px 48px rgba(0,0,0,.45);
  }
}

/* ── reset / base ─────────────────────────────────────────── */

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

html { scroll-behavior: smooth; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 24px;
}

.skip-link {
  position: absolute; left: -9999px;
  background: var(--ink); color: var(--paper);
  padding: 10px 16px; border-radius: 0 0 var(--radius) 0; z-index: 100;
}
.skip-link:focus { left: 0; top: 0; }

/* ── header ───────────────────────────────────────────────── */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(150%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, background .2s ease;
}
.site-header.is-stuck { border-bottom-color: var(--line); }

.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; min-height: 68px;
}

.wordmark {
  display: inline-flex; align-items: center;
  color: var(--ink); text-decoration: none;
}
/* Supplied artwork, keyed to transparent by tools/build-logo.mjs.
   Height is fixed and width follows the 1024x264 aspect ratio. */
.wordmark img { height: 27px; width: auto; }

@media (max-width: 480px) {
  .wordmark img { height: 23px; }
}

.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav a {
  color: var(--ink-2); text-decoration: none;
  font-size: 15px; font-weight: 500;
  transition: color .15s ease;
}
.site-nav a:hover { color: var(--ink); }
.site-nav .nav-cta {
  color: var(--ink);
  border: 1px solid var(--line-strong);
  padding: 7px 16px; border-radius: 100px;
  background: var(--surface);
}
.site-nav .nav-cta:hover { border-color: var(--accent); color: var(--accent); }

@media (max-width: 640px) {
  .site-nav { gap: 16px; }
  .site-nav a:not(.nav-cta) { display: none; }
}

/* ── buttons ──────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-sans); font-size: 16px; font-weight: 500;
  padding: 13px 26px; border-radius: 100px;
  border: 1px solid transparent; cursor: pointer;
  text-decoration: none; white-space: nowrap;
  transition: transform .12s ease, background .15s ease,
              border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--ink); color: var(--paper);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--accent); color: #fff; box-shadow: var(--shadow-md); }
@media (prefers-color-scheme: dark) {
  .btn-primary { background: var(--accent); color: #17130b; }
  .btn-primary:hover { background: var(--accent-hover); color: #17130b; }
}

.btn-ghost {
  background: transparent; color: var(--ink);
  border-color: var(--line-strong);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); background: var(--surface); }

.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: not-allowed; transform: none; }

/* ── hero ─────────────────────────────────────────────────── */

.hero {
  padding: clamp(64px, 11vw, 128px) 0 clamp(56px, 8vw, 96px);
  border-bottom: 1px solid var(--line);
  position: relative; overflow: hidden;
}
/* faint ruled-paper texture, evokes a document without shouting */
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 100% 34px;
  opacity: .35;
  mask-image: radial-gradient(ellipse 70% 60% at 70% 10%, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 70% 10%, #000 0%, transparent 75%);
}
.hero > .wrap { position: relative; z-index: 1; }

.hero-title {
  margin: 0 0 24px;
  font-family: var(--font-display);
  font-size: clamp(44px, 7.5vw, 82px);
  line-height: 1.03;
  letter-spacing: -.03em;
  font-weight: 500;
  max-width: 19ch;
}

.hero-lede {
  margin: 0 0 36px;
  font-size: clamp(17px, 1.9vw, 20px);
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 60ch;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

@media (max-width: 640px) {
  .hero-actions .btn { flex: 1 1 100%; }
}

/* ── section shell ────────────────────────────────────────── */

.section { padding: clamp(64px, 9vw, 112px) 0; }
.section + .section { border-top: 1px solid var(--line); }

.section-head { max-width: 62ch; margin-bottom: clamp(40px, 5vw, 60px); }

.section-title {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-size: clamp(30px, 4.2vw, 44px);
  line-height: 1.12; letter-spacing: -.022em; font-weight: 500;
}
/* ── sources ──────────────────────────────────────────────── */

.source-list {
  list-style: none; margin: 0; padding: 0;
  border-top: 1px solid var(--line);
  max-width: 800px;
}
.source { border-bottom: 1px solid var(--line); }

.source-link {
  display: flex; align-items: baseline; gap: 24px;
  padding: 24px 4px; text-decoration: none; color: inherit;
  transition: background .18s ease, padding-inline .18s ease;
}
.source-link:hover {
  background: var(--surface);
  padding-inline: 14px 10px;
}
.source-main { flex: 1; min-width: 0; }
.source-main h3 {
  margin: 0 0 6px;
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-display);
  font-size: 21px; font-weight: 600; letter-spacing: -.012em; color: var(--ink);
}
.source-main h3 svg {
  width: 14px; height: 14px; flex: none; color: var(--muted);
  transition: color .18s ease, transform .18s ease;
}
.source-link:hover h3 { color: var(--accent); }
.source-link:hover h3 svg { color: var(--accent); transform: translate(2px, -2px); }
.source-main p {
  margin: 0; font-size: 15.5px; line-height: 1.55; color: var(--ink-2); max-width: 60ch;
}
/* Rows offering several language variants are not themselves links. */
.source-link.is-static { cursor: default; }
.source-link.is-static:hover { background: none; padding-inline: 4px; }

.source-langs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.source-langs a {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 500; text-decoration: none;
  color: var(--ink-2);
  border: 1px solid var(--line-strong);
  border-radius: 100px; padding: 5px 13px;
  background: var(--surface);
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.source-langs a:hover { border-color: var(--accent); color: var(--accent); }
.source-langs a svg { width: 12px; height: 12px; flex: none; }

.source-url {
  flex: none; font-size: 13.5px; color: var(--muted);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
@media (max-width: 640px) {
  .source-link { flex-direction: column; gap: 8px; }
}

/* ── material (single download) ───────────────────────────── */

.material {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s ease, border-color .2s ease;
}
.material:hover { box-shadow: var(--shadow-md); border-color: var(--line-strong); }

/* The preview sits full width above the body. The material is a dense
   landscape chart: squeezing it into a thumbnail column makes it
   unreadable, which defeats the point of showing it at all. */
.material-preview {
  display: block; background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.material-preview img {
  width: 100%; height: auto; display: block;
  transition: transform .4s cubic-bezier(.2,.7,.3,1);
}
.material:hover .material-preview img { transform: scale(1.012); }

.material-body {
  padding: 22px 26px 26px;
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
.material-text { flex: 1; min-width: 220px; }
.material-body h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px; font-weight: 600; letter-spacing: -.014em; line-height: 1.25;
}
.material-body h3 + p { margin: 6px 0 0; font-size: 15.5px; line-height: 1.55; color: var(--ink-2); }

.material-actions {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.material-actions svg { width: 15px; height: 15px; flex: none; }
.material-meta { font-size: 13.5px; color: var(--muted); white-space: nowrap; }

.material-empty {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 34px 28px;
  max-width: 720px;
}
.material-empty p { margin: 0; font-size: 16px; color: var(--muted); }
.material-empty strong { color: var(--ink-2); font-weight: 600; }

/* ── join / signup ────────────────────────────────────────── */

.join { background: var(--surface-2); }

.join-wrap {
  display: grid; gap: 28px;
  max-width: 520px; margin-inline: auto;
}


.join-form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 3.5vw, 34px);
  box-shadow: var(--shadow-md);
  display: flex; flex-direction: column; gap: 18px;
}

.field { display: flex; flex-direction: column; gap: 7px; }
.field label {
  font-size: 14.5px; font-weight: 600; color: var(--ink);
  display: flex; align-items: baseline; gap: 7px;
}
.req { color: var(--accent); }
.optional {
  font-weight: 400; font-size: 12.5px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em;
}

.field input {
  width: 100%;
  font-family: var(--font-sans); font-size: 16px; color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 12px 14px;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.field input::placeholder { color: var(--muted); opacity: .75; }
.field input:hover { border-color: var(--muted); }
.field input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.field input[aria-invalid="true"] {
  border-color: #b4442a;
  box-shadow: 0 0 0 3px rgba(180, 68, 42, .14);
}

.field-error {
  margin: 0; min-height: 0; font-size: 13.5px; color: #b4442a; line-height: 1.4;
}
@media (prefers-color-scheme: dark) {
  .field-error { color: #ef9078; }
  .field input[aria-invalid="true"] { border-color: #ef9078; }
}
.field-error:empty { display: none; }

/* honeypot: visually gone, still focusable-free for bots */
.hp {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.spinner {
  width: 15px; height: 15px; flex: none; display: none;
  border: 2px solid color-mix(in srgb, currentColor 30%, transparent);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.is-submitting .spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

.form-status {
  margin: 0; font-size: 14.5px; line-height: 1.5; padding: 0;
}
.form-status:empty { display: none; }
.form-status.is-error { color: #b4442a; }
.form-status.is-success {
  color: var(--ink);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: var(--radius);
  padding: 12px 14px;
}
@media (prefers-color-scheme: dark) {
  .form-status.is-error { color: #ef9078; }
}

/* ── footer ───────────────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: clamp(48px, 6vw, 68px) 0 32px;
}
.footer-inner {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 40px; flex-wrap: wrap; padding-bottom: 36px;
}
.footer-brand img { height: 26px; width: auto; }

.footer-nav { display: flex; flex-wrap: wrap; gap: 12px 28px; }
.footer-nav a { color: var(--ink-2); text-decoration: none; font-size: 15px; }
.footer-nav a:hover { color: var(--accent); text-decoration: underline; }

.footer-legal {
  border-top: 1px solid var(--line); padding-top: 24px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.footer-legal p { margin: 0; font-size: 13.5px; color: var(--muted); }

/* ── reveal on scroll ─────────────────────────────────────── */

.reveal { opacity: 0; transform: translateY(14px); }
.reveal.is-visible {
  opacity: 1; transform: none;
  transition: opacity .6s ease, transform .6s cubic-bezier(.2,.7,.3,1);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
}
