/* ==========================================================================
   SeedGrid 32×64 — guide stylesheet
   Screen + print. Paper/light, print-first, high contrast.
   No external fonts, no JS dependencies. The only image is the local logo.
   ========================================================================== */

/* ---- Design tokens ------------------------------------------------------ */
:root {
  --paper: #faf9f6;
  --paper-raised: #ffffff;
  --ink: #1b1b1b;
  --ink-soft: #4b4b4b;
  --ink-faint: #75726c;
  --rule: #d8d4cb;
  --rule-strong: #b6b0a3;
  --accent: #a95e12;          /* muted burnt-orange for emphasis */
  --accent-soft: #f6e7d4;
  --band-a: #faf9f6;
  --band-b: #f0ede5;
  --row-stripe: #f5f2ea;
  --grid-corner: #e9e4d8;
  --maxw: 1080px;
  --font: "Helvetica Neue", Helvetica, Arial, "Segoe UI", system-ui, sans-serif;
  --mono: "SFMono-Regular", ui-monospace, "Cascadia Code", Consolas, Menlo, monospace;
}

* { box-sizing: border-box; }

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

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

a { color: var(--accent); }
a:hover { color: #7c4307; }

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

/* ---- Layout ------------------------------------------------------------- */
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--paper-raised);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.9rem 0 0.6rem;
}

.brand .name {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.brand .brand-logo {
  width: 38px;
  height: 38px;
  align-self: center;
}
.brand .tagline {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.brand .social {
  display: flex;
  gap: 1.25rem;
  margin-left: auto;
  align-self: center;
}
.brand .social a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.95rem;
  font-weight: 600;
}
.brand .social a:hover { color: var(--accent); }
.brand .social svg { flex: none; }

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0 0 0.8rem;
}
.site-nav a {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.95rem;
  font-weight: 600;
}
.site-nav a:hover,
.site-nav a[aria-current="true"] { color: var(--accent); }

main { padding: 2.25rem 0 4rem; }

/* ---- Privacy / safety banner ------------------------------------------- */
.banner {
  background: var(--accent-soft);
  border-bottom: 1px solid var(--rule);
}
.banner .wrap {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
  font-size: 0.95rem;
}
.banner strong { color: var(--accent); }

/* ---- Hero --------------------------------------------------------------- */
.hero {
  border-bottom: 1px solid var(--rule);
  padding: 2.6rem 0 2.2rem;
  margin-bottom: 2.4rem;
}
.hero h1 {
  font-size: clamp(2.1rem, 6vw, 3.2rem);
  line-height: 1.08;
  margin: 0 0 0.35rem;
  letter-spacing: -0.015em;
}
.hero-logo {
  display: block;
  width: 148px;
  height: auto;
  margin-bottom: 1.4rem;
}
.hero .tagline {
  font-size: clamp(1.05rem, 2.6vw, 1.4rem);
  color: var(--ink-soft);
  margin: 0 0 0.3rem;
  font-weight: 600;
}
.hero .slogan {
  font-size: clamp(1.1rem, 2.8vw, 1.5rem);
  color: var(--accent);
  margin: 0 0 0.9rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.hero .lead {
  max-width: 62ch;
  margin: 0;
  color: var(--ink);
}
.hero .eq {
  display: inline-block;
  margin-top: 1.1rem;
  padding: 0.55rem 0.9rem;
  background: var(--paper-raised);
  border: 1px solid var(--rule-strong);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 1.05rem;
}

/* ---- Typography --------------------------------------------------------- */
h2 {
  font-size: 1.65rem;
  margin: 3rem 0 0.8rem;
  padding-bottom: 0.35rem;
  border-bottom: 2px solid var(--rule);
  scroll-margin-top: 1.5rem;
}
h3 { font-size: 1.2rem; margin: 1.9rem 0 0.6rem; }
h4 { font-size: 1.05rem; margin: 1.4rem 0 0.5rem; }

p { margin: 0 0 1rem; max-width: 72ch; }

.small { font-size: 0.9rem; color: var(--ink-soft); }

/* Long donation addresses (Silent Payments) must wrap, never overflow.
   Override the prose max-width cap so they use the full container width. */
.donate p { max-width: none; }
.addr {
  display: block;
  max-width: none;
  font-size: 0.85em;
  word-break: break-all;
  overflow-wrap: anywhere;
}

formula, .formula, code, .code {
  font-family: var(--mono);
  font-size: 0.92em;
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.1em 0.35em;
}
.formula-block {
  display: block;
  margin: 1rem 0;
  padding: 0.7rem 1rem;
  font-family: var(--mono);
  font-size: 0.98rem;
  background: var(--paper-raised);
  border: 1px solid var(--rule-strong);
  border-left: 4px solid var(--accent);
  border-radius: 4px;
  overflow-x: auto;
}

/* ---- Lists -------------------------------------------------------------- */
ol.steps { padding-left: 1.4rem; }
ol.steps li { margin: 0.35rem 0; }
ul.plain { padding-left: 1.3rem; }
ul.plain li { margin: 0.3rem 0; }

/* ---- Tables (prose) ----------------------------------------------------- */
table.data {
  border-collapse: collapse;
  margin: 1rem 0;
  background: var(--paper-raised);
}
table.data th, table.data td {
  border: 1px solid var(--rule);
  padding: 0.35rem 0.7rem;
  text-align: left;
  font-size: 0.95rem;
}
table.data th { background: var(--grid-corner); }

/* ---- Callouts ----------------------------------------------------------- */
.callout {
  border: 1px solid var(--rule-strong);
  border-left: 4px solid var(--accent);
  background: var(--paper-raised);
  border-radius: 6px;
  padding: 0.9rem 1.1rem;
  margin: 1.2rem 0;
  max-width: 76ch;
}
.callout.warn { border-left-color: #9a1c1c; background: #faf0ee; }
.callout h3 { margin-top: 0; font-size: 1.05rem; }
.callout p:last-child { margin-bottom: 0; }

/* ---- Table of contents -------------------------------------------------- */
.toc ul {
  columns: 2;
  column-gap: 2.5rem;
  list-style: none;
  padding-left: 0;
}
.toc a { text-decoration: none; }
@media (max-width: 640px) { .toc ul { columns: 1; } }

/* ---- Footer ------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--rule);
  background: var(--paper-raised);
  padding: 1.6rem 0 2.6rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
}
.site-footer p { max-width: 72ch; }
.site-footer p.donate-line { max-width: none; }

/* ---- QR code popup ------------------------------------------------------ */
.show-qr { white-space: nowrap; }
.qr-popup {
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--paper-raised);
  color: var(--ink);
  padding: 1.25rem;
  max-width: min(92vw, 26rem);
  width: 100%;
  box-shadow: 0 12px 40px rgba(27, 27, 27, 0.25);
}
.qr-popup::backdrop {
  background: rgba(27, 27, 27, 0.55);
}
.qr-popup img {
  display: block;
  width: min(100%, 60vh);
  height: auto;
  margin: 0 auto;
}
.qr-popup .qr-close {
  position: absolute;
  top: 0.4rem;
  right: 0.5rem;
  border: 0;
  background: none;
  color: var(--ink-soft);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
}
.qr-popup .qr-close:hover { color: var(--ink); }
.qr-caption { margin-top: 1rem; }
.qr-caption p { margin: 0 0 0.4rem; }
.qr-heading { font-weight: bold; color: var(--ink); }
@media print {
  .qr-popup { display: none !important; }
}

/* ---- Back-to-top -------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 0.5rem 0.9rem;
  z-index: 50;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

/* ==========================================================================
   PRINT — paper-first. The guide is prose; the grid itself ships as a
   ready-made colour PDF (seedgrid.pdf), so no grid tables live here.
   ========================================================================== */
@media print {
  /* Keep the design's colours (band tints, row striping, header fills) on
     paper; browsers otherwise strip background colours by default. */
  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  @page {
    size: A4;
    margin: 9mm 10mm;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
    line-height: 1.45;
  }

  .site-nav,
  .banner,
  .hero,
  .toc,
  .skip-link,
  .no-print,
  .site-footer .foot-nav { display: none; }

  .wrap { max-width: none; padding: 0; }

  main { padding: 0; }

  h2 { break-after: avoid; margin-top: 1.1rem; }
  h3, h4 { break-after: avoid; }
  a { color: #000; text-decoration: none; }
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 8pt;
    color: #444;
  }
  .toc { display: none; }

  .formula-block,
  table.data,
  .callout {
    border-color: #000;
    border-radius: 0;
  }
}
