/* Deep green, cream and peach. Self-hosted fonts (OFL, see /fonts/LICENSE.txt): no third-party requests,
   and the CSP needs nothing beyond 'self'. Text stays real HTML text, so crawlers and the Markdown copy are unaffected. */

@font-face {
  font-family: "Imbue";
  src: url("/fonts/imbue-var.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Tenor Sans";
  src: url("/fonts/tenor-sans.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("/fonts/instrument-serif-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  --bg: #193d27;
  --bg-deep: #10291a;
  --text: #f6ecdc;
  --muted: #c4bba7;
  --accent: #f4a46a;
  --line: rgba(246, 236, 220, 0.2);
  --error: #ffb4a2;

  --display: "Imbue", "Didot", "Bodoni 72", "Times New Roman", serif;
  --label: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --body: "Tenor Sans", "Gill Sans", "Optima", "Candara", sans-serif;

  --measure: 42rem;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
/* Keep `hidden` working on elements that set their own display (e.g. the donation form). */
[hidden] { display: none !important; }

html { background: var(--bg-deep); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font: 400 1.25rem/1.5 var(--body);
  letter-spacing: 0.005em;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(120% 70% at 50% -10%, #23503a 0%, transparent 60%),
    radial-gradient(90% 60% at 50% 110%, var(--bg-deep) 0%, transparent 70%),
    var(--bg);
}

/* Fine film grain over everything; purely decorative. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--accent); color: var(--bg-deep); }

.wrap { max-width: var(--measure); margin: 0 auto; padding: 0 20px; }

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--muted);
  text-underline-offset: 0.2em;
  transition: color 0.2s, text-decoration-color 0.2s;
}
a:hover { color: var(--accent); text-decoration-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 16px; top: 12px; z-index: 200; background: var(--bg-deep); color: var(--text); padding: 8px 14px; }

/* ---------- header / footer */

.site-header .wrap {
  max-width: 64rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  flex-wrap: wrap;
  padding-top: 22px;
  padding-bottom: 22px;
}
.logo {
  font: italic 400 1.2rem/1 var(--label);
  color: var(--accent);
  text-decoration: none;
}
.site-header ul { display: flex; gap: 22px; list-style: none; margin: 0; padding: 0; }
.site-header nav a {
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
}
.site-header nav a:hover { color: var(--text); }

.site-footer {
  margin-top: 7rem;
  padding: 2.5rem 0 3.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}
.site-footer p { margin: 6px 0; }

/* ---------- hero */

main.wrap { padding-top: clamp(2rem, 7vw, 5rem); }

.page-hero { text-align: center; margin: 0 auto clamp(3.5rem, 9vw, 6rem); }

h1, h2, h3 { font-weight: 400; margin: 0; }

h1 {
  font-family: var(--display);
  font-variation-settings: "opsz" 72;
  font-weight: 380;
  font-size: clamp(4.4rem, 19vw, 9rem);
  line-height: 0.9;
  letter-spacing: -0.01em;
  /* The hero is wider than the text column. */
  margin-inline: calc(50% - min(46vw, 34rem));
}
h1 .h1-line { display: block; }
h1 .amp {
  font-family: var(--label);
  font-style: italic;
  color: var(--accent);
  font-size: 0.92em;
  padding-right: 0.04em;
}

/* Heading + subheading (hgroup is the HTML-standard way to mark a subtitle). */
hgroup p {
  margin: 1.4rem 0 0;
  font: italic 400 clamp(1.35rem, 3.2vw, 1.9rem)/1.2 var(--label);
  color: var(--muted);
}

.lede { font-size: 1.35rem; color: var(--text); }
.page-hero > .lede { margin: 1.6rem auto 0; max-width: 30rem; }
.byline { color: var(--muted); font-size: 0.85rem; letter-spacing: 0.04em; margin-top: 1.5rem; }

/* ---------- sections: small italic labels in the accent colour, generous space between */

section + section { margin-top: clamp(4rem, 9vw, 6rem); }

h2 {
  font: italic 400 1.15rem/1.2 var(--label);
  color: var(--accent);
  margin: 0 0 1rem;
  letter-spacing: 0.01em;
}
h3 { font-family: var(--display); font-size: 1.6rem; margin: 2rem 0 0.5rem; }

p { margin: 0 0 1em; }

/* Numbered lines (001, 002 …): number in its own column, wrapped text hangs under the sentence. */
.propositions p {
  display: grid;
  grid-template-columns: 2.9rem 1fr;
  column-gap: 0.4rem;
  align-items: baseline;
  margin: 0 0 0.75em;
}
.propositions .num {
  font: italic 400 1.05rem/1 var(--label);
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

/* Machines that have visited: an inline, comma-separated list (still a <ul> for HTML and Markdown). */
.crawler-list { list-style: none; padding: 0; margin: 0; }
.crawler-list li { display: inline; }
.crawler-list li:not(:last-child)::after { content: ", "; }
.crawler-list li:last-child::after { content: "."; }

/* ---------- tables (none on the page yet; kept for future content) */

.table-scroll { overflow-x: auto; margin: 16px 0; border-top: 1px solid var(--line); }
table { border-collapse: collapse; width: 100%; font-size: 1rem; }
caption { text-align: left; padding: 10px 0; color: var(--muted); font: italic 1rem var(--label); caption-side: top; }
th, td { text-align: left; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 400; color: var(--muted); }

.breadcrumb ol { display: flex; justify-content: center; gap: 8px; list-style: none; padding: 0; margin: 0 0 1.5rem; font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.breadcrumb li + li::before { content: "/"; margin-right: 8px; }

/* ---------- donation form (§3 WebMCP) */

.form-card {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 18px 28px;
  margin-top: 1.5rem;
}
.field { display: grid; gap: 6px; flex: 1 1 14rem; }
label {
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
input, select, textarea {
  font: 400 1.6rem/1.2 var(--display);
  color: var(--text);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 6px 0;
  width: 100%;
}
input:focus-visible { outline: none; border-bottom-color: var(--accent); }

.button, button {
  display: inline-block;
  font: 400 0.8rem/1 var(--body);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 14px 26px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.button:hover, button:hover { background: var(--accent); color: var(--bg-deep); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button:disabled:hover { background: transparent; color: var(--accent); }
.form-status-live { flex-basis: 100%; margin: 0; color: var(--muted); font-size: 1rem; }
.form-status-live:empty { display: none; }

/* Shown while an AI agent is filling the form (Chrome WebMCP pseudo-classes). */
form:tool-form-active { outline: 1px dashed var(--accent); outline-offset: 10px; }
button:tool-submit-active { outline: 1px dashed var(--error); outline-offset: 4px; }

/* ---------- checklist notes (mockup only — `npm run deploy` refuses to ship while any remain) */

.cl-note {
  margin: 16px 0;
  padding: 12px 16px;
  color: var(--text);
  border: 1px dashed var(--accent);
  font-size: 0.9rem;
  line-height: 1.5;
}
.cl-note::before {
  content: "Checklist " attr(data-checklist);
  display: block;
  font: italic 1rem var(--label);
  color: var(--accent);
  margin-bottom: 4px;
}

/* ---------- one quiet entrance on load (content is in the HTML regardless; this is only opacity/transform) */

@media (prefers-reduced-motion: no-preference) {
  .page-hero, article > section { animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .page-hero hgroup p { animation: rise 0.9s 0.25s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  article > section:nth-of-type(1) { animation-delay: 0.35s; }
  article > section:nth-of-type(2) { animation-delay: 0.5s; }
  article > section:nth-of-type(3) { animation-delay: 0.65s; }
  @keyframes rise { from { opacity: 0; transform: translateY(14px); } }
}

@media (max-width: 480px) {
  body { font-size: 1.12rem; }
  .site-header .wrap { justify-content: center; }
  .propositions p { grid-template-columns: 2.4rem 1fr; }
}
