/*
  VOICE   formal, declarative, unadorned — a public statement, not a campaign
  IDEA    a printed broadside: one sheet, one column, headline over a fine rule
  PICTURE none but the type itself; the statement is the picture
  COLOUR  cream paper, near-black ink, terracotta rule; red-white-blue only in the printer's mark
  TYPE    Source Serif 4 (optical sizes) for title and text; Source Sans 3 for links, labels, controls
  LAYOUT  single 65-character column, compact vertical rhythm, thin rules for hierarchy
*/

@font-face {
  font-family: "Source Serif 4";
  src: url("/fonts/serif.woff2") format("woff2-variations"), url("/fonts/serif.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("/fonts/sans.woff2") format("woff2-variations"), url("/fonts/sans.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #FAF6EB;
  --ink: #171512;
  --ink-2: #4E483F;      /* secondary text: 8.3:1 on paper */
  --hair: #CFC5B1;       /* hairline rules */
  --accent: #C96442;     /* terracotta: the title rule, focus */
  --accent-ink: #9C4428; /* terracotta dark enough for small text: 5.6:1 on paper */
  --field: #FFFDF7;
  --serif: "Source Serif 4", "Iowan Old Style", Charter, "Bitstream Charter", Georgia, serif;
  --sans: "Source Sans 3", "Helvetica Neue", Arial, system-ui, sans-serif;
  --measure: 65ch;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 1.25rem; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);   /* 17px → 19px */
  line-height: 1.55;
  font-optical-sizing: auto;
  font-kerning: normal;
  font-variant-ligatures: common-ligatures;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.sheet {
  max-width: calc(var(--measure) + 2 * max(1.25rem, 5vw));
  margin: 0 auto;
  padding: clamp(1.75rem, 6vh, 5rem) max(1.25rem, 5vw) clamp(3rem, 8vh, 6rem);
}

/* ---------- masthead ---------- */
h1 {
  margin: 0;
  font-size: clamp(2.375rem, 1.35rem + 4.4vw, 4.25rem);   /* 38px → 68px */
  line-height: 1.02;
  font-weight: 700;
  letter-spacing: -0.012em;
  text-wrap: balance;
  padding-bottom: clamp(0.85rem, 1.6vw, 1.25rem);
  border-bottom: 2px solid var(--accent);
}

.masthead-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: baseline;
  gap: 0.25rem 1.5rem;
  margin: 0.7rem 0 clamp(1.5rem, 3.5vw, 2.5rem);
  font-family: var(--sans);
  font-size: 0.875rem;
  line-height: 1.4;
}

a, .copy-link {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover, .copy-link:hover { text-decoration-color: var(--accent); text-decoration-thickness: 2px; }

.copy-link {
  font: inherit;
  color: var(--ink-2);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration-color: var(--hair);
}
.copy-link:hover { color: var(--ink); }

/* Comfortable touch targets without changing the look */
.masthead-links a, .copy-link { padding-block: 0.6rem; margin-block: -0.6rem; }

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

/* ---------- statement ---------- */
.statement p { margin: 0 0 1.05em; }
.statement strong { font-weight: 700; }

.affirmations {
  margin: 1.5em 0 0;
  padding-left: 2.1em;            /* the numerals hang in this margin */
}
.affirmations li {
  padding-left: 0.35em;
  margin: 0 0 1.15em;
}
.affirmations li:last-child { margin-bottom: 0; }
.affirmations li::marker {
  font-weight: 600;
  font-variant-numeric: lining-nums tabular-nums;
}

/* ---------- divider with printer's mark ---------- */
.divider {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin: clamp(2rem, 4.5vw, 2.75rem) 0 clamp(1.5rem, 3.5vw, 2rem);
}
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--hair); }
.mark { display: block; flex: none; }

/* ---------- form ---------- */
h2 {
  margin: 0 0 1.1rem;
  font-size: 1.375rem;
  line-height: 1.2;
  font-weight: 650;
  letter-spacing: -0.003em;
}
.sign:focus { outline: none; }

form { font-family: var(--sans); font-size: 1rem; }

.field { margin: 0 0 1.05rem; }
.field-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 1rem; }
@media (max-width: 34rem) { .field-row { grid-template-columns: minmax(0, 1fr); } }

label { display: block; margin: 0 0 0.3rem; font-size: 0.9375rem; font-weight: 600; line-height: 1.3; }
.hint { font-weight: 400; color: var(--ink-2); margin-left: 0.35em; }

input[type="text"], input[type="email"] {
  display: block;
  width: 100%;
  min-height: 2.875rem;
  padding: 0.55rem 0.7rem;
  font: 400 1rem/1.4 var(--sans);   /* 16px: no zoom on iOS */
  color: var(--ink);
  background: var(--field);
  border: 1px solid #8F877A;        /* 3.4:1 against paper: a visible boundary */
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
}
input[type="text"]:hover, input[type="email"]:hover { border-color: var(--ink); }
input[type="text"]:focus-visible, input[type="email"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--ink); }
input[aria-invalid="true"] { border-color: var(--accent-ink); border-width: 1.5px; }

.error {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
  line-height: 1.35;
  color: var(--accent-ink);
  font-weight: 600;
}

.consent {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.7rem;
  align-items: start;
  margin: 0.35rem 0 1.4rem;
}
.consent input {
  width: 1.25rem;
  height: 1.25rem;
  margin: 0.1rem 0 0;
  accent-color: var(--ink);
}
.consent label { margin: 0; font-weight: 400; font-size: 0.9375rem; line-height: 1.45; cursor: pointer; }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.submit-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; }
.submit {
  min-height: 2.875rem;
  min-width: 8.5rem;
  padding: 0.6rem 1.6rem;
  font: 600 1rem/1 var(--sans);
  letter-spacing: 0.01em;
  color: var(--paper);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 0;
  cursor: pointer;
}
.submit:hover { background: #2E2A24; }
.submit:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.submit[aria-disabled="true"] { opacity: 0.7; cursor: progress; }

.form-status { margin: 0; font-size: 0.9375rem; color: var(--ink-2); }
.form-status.is-error, .form-note.is-error { color: var(--accent-ink); font-weight: 600; }
.form-note { font-family: var(--sans); font-size: 0.9375rem; margin: -0.25rem 0 1rem; }

.confirmation {
  border-top: 1px solid var(--ink);
  padding: 1rem 0 0.25rem;
}
.confirmation:focus { outline: none; }
.confirmation p { margin: 0; }
.confirmation-head { font-weight: 700; font-size: 1.125rem; margin-bottom: 0.35rem !important; }
#confirmation-detail { font-size: 1rem; color: var(--ink-2); }

/* ---------- signatories ---------- */
.signatories { margin-bottom: 2.25rem; padding-bottom: 1.75rem; border-bottom: 1px solid var(--hair); }
.signatories ul { list-style: none; margin: 0; padding: 0; }
.signatories li { padding: 0.45rem 0; border-bottom: 1px solid #E6DECD; line-height: 1.35; }
.signatories li:last-child { border-bottom: 0; }
.sig-name { font-weight: 600; }
.sig-extra { display: block; font-family: var(--sans); font-size: 0.875rem; color: var(--ink-2); margin-top: 0.1rem; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- print: the broadside itself ---------- */
@media print {
  body { background: #fff; font-size: 11.5pt; }
  .sheet { padding: 0; max-width: none; }
  .masthead-links, .sign { display: none; }
  h1 { font-size: 34pt; }
  a { text-decoration: none; }
}

[hidden] { display: none !important; }
.signer-count { margin: -0.35rem 0 1.1rem; color: var(--ink-2); font: 1rem/1.5 var(--sans); font-variant-numeric: tabular-nums; }
.share { position: relative; }
.share-options { position: absolute; z-index: 5; top: calc(100% + 0.65rem); right: 0; min-width: 10rem; padding: 0.4rem 0; background: var(--field); border: 1px solid var(--hair); }
.share-options a, .share-options button { display: block; width: 100%; text-align: left; margin: 0; padding: 0.65rem 1rem; white-space: nowrap; }
.share-options a:hover, .share-options button:hover { background: var(--paper); }
