/* preambient.com/manifesto/ — a letter. One column of text and a signature:
   no script, no motion, one small SVG image (the signature). Its own file so the one-screen root never
   downloads it. Field and ink are the root's tokens (labs.css); keep them equal. */

/* "Newsreader Text" is declared in the page head so the
   build can version its URL. Newsreader, SIL OFL 1.1 (OFL-Newsreader.txt beside the file).
   Subset: Basic Latin plus curly quotes, dashes, ellipsis, copyright; wght 300-500, opsz 16-60,
   so the headline gets the display cut and the body the text cut. Recipe: the manifesto decision record. */

:root {
  color-scheme: light dark;
  --stage-top: #dcdfe4;
  --stage-mid: #e6e8ec;
  --stage-bot: #edeef1;
  --headline: rgba(0, 0, 0, 0.875);
  --text: rgba(23, 24, 21, 0.9);
  --muted: rgba(23, 24, 26, 0.74);
  --line: rgba(23, 24, 26, 0.34);
  --focus: #482873;
  --serif: "Newsreader Text", Georgia, "Times New Roman", serif;
  --mono: Consolas, Monaco, "Lucida Console", "Courier New", monospace;
  --gutter: clamp(20px, 4vw, 56px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --stage-top: #0e0f11;
    --stage-mid: #101113;
    --stage-bot: #131417;
    --headline: rgba(255, 255, 255, 0.92);
    --text: rgba(255, 255, 255, 0.84);
    --muted: rgba(255, 255, 255, 0.62);
    --line: rgba(255, 255, 255, 0.36);
    --focus: #b9a2e0;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--stage-bot);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--stage-top) 0, var(--stage-mid) 60vh, var(--stage-bot) 120vh);
  color: var(--text);
  font-family: var(--serif);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.top {
  padding: calc(28px + env(safe-area-inset-top, 0px)) var(--gutter) 0;
}

.top__wordmark {
  font-weight: 300;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -0.022em;
  color: var(--headline);
  text-decoration: none;
}

main {
  flex: 1;
  padding: clamp(56px, 12vh, 136px) var(--gutter) clamp(72px, 12vh, 128px);
}

.letter {
  max-width: 1040px;
  margin: 0 auto;
}

.letter h1 {
  margin: 0;
  max-width: 19em;
  font-weight: 300;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--headline);
  text-wrap: balance;
}

.letter__body,
.letter__sign {
  max-width: 62ch;
  font-size: 20px;
  line-height: 1.6;
}

.letter__body {
  margin-top: clamp(40px, 7vh, 72px);
  hanging-punctuation: first;
}

.letter__body p {
  margin: 0 0 1.15em;
  /* Justified (Blocksatz), Phil 2026-09-20. Hyphenation is what keeps the word
     gaps even, above all on a phone; without it the narrow column opens rivers. */
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
  -webkit-hyphens: auto;
  hyphenate-limit-chars: 6 3 3;
  text-wrap: pretty;
}

.letter__body p:last-child { margin-bottom: 0; }

.letter__sign {
  margin-top: 2.6em;
}

.letter__sign p { margin: 0; }

/* The signature sits above the printed name, the width of a pen signature on a letter.
   The SVG's ink is near-black; dark mode inverts it to a light ink. The SVG is a stand-in
   drawn for the site: replace it with a trace of Phil's real signature before going public. */
.letter__signature {
  display: block;
  width: 196px;
  max-width: 100%;
  height: auto;
  margin: 0 0 0.3em -4px;
}

@media (prefers-color-scheme: dark) {
  .letter__signature { filter: invert(1); opacity: 0.88; }
}

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: var(--line);
}

@media (hover: hover) {
  a:hover { text-decoration-color: currentColor; }
}

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

.site-footer {
  padding: 0 var(--gutter) calc(28px + env(safe-area-inset-bottom, 0px));
  text-align: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* Desktop: the letter sits on the page's centre line (Phil, 2026-09-20). The headline is
   centred over the column; the body and signature share one centred column, and the
   signature stays on the column's left edge, where a letter is signed. */
@media (min-width: 900px) {
  .letter h1 {
    margin-inline: auto;
    text-align: center;
  }

  .letter__body,
  .letter__sign {
    margin-inline: auto;
  }
}

@media (max-width: 480px) {
  .letter__body,
  .letter__sign { font-size: 18px; }
  .letter__signature { width: 168px; }
  .top__wordmark { font-size: 22px; }
}

@media print {
  html, body { background: #fff; }
  body { color: #000; }
  .letter h1, .top__wordmark { color: #000; }
  .letter__body, .letter__sign { font-size: 11.5pt; }
  .letter__signature { filter: none; opacity: 1; }
  .site-footer { color: #444; }
}
