/* Night porch: deep blue ground, warm off-white text, one pale lamp-yellow
   used sparingly (step numbers, link underlines). Light theme is
   cool paper, not cream. Type: Verdana and the system monospace, both
   preinstalled, so no font files load. */

:root {
  color-scheme: dark;
  --bg: #0e1520;
  --surface: #141d2b;
  --rule: #26344b;
  --fg: #e7e3d9;
  --muted: #95a1b3;
  --lamp: #f1dc8f;
  --go: #93cfa9;
  --stop: #ef9f9a;
  --text: Verdana, Geneva, "DejaVu Sans", sans-serif;
  --mono: Menlo, Consolas, "DejaVu Sans Mono", "Courier New", monospace;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6f9;
  --surface: #e8ecf2;
  --rule: #cdd5e0;
  --fg: #142131;
  --muted: #4d5b6e;
  --lamp: #7d5f00;
  --go: #1d6a41;
  --stop: #a3302b;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0 auto;
  padding: 0 max(clamp(20px, 4vw, 56px), env(safe-area-inset-right, 0px)) 4rem max(clamp(20px, 4vw, 56px), env(safe-area-inset-left, 0px));
  max-width: 80rem;
  font: 16px/1.65 var(--text);
  color: var(--fg);
  background: var(--bg);
}
a { color: var(--fg); text-decoration-color: var(--lamp); text-underline-offset: 0.2em; }
a:hover { color: var(--lamp); }
:focus-visible { outline: 2px solid var(--lamp); outline-offset: 3px; border-radius: 2px; }

/* Header and wordmark */
header.site {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding: 1.25rem 0 1rem;
  border-bottom: 1px solid var(--rule);
}
.mark {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--fg);
  text-decoration: none;
}
.logo { position: relative; top: 0.18rem; width: 1.9rem; height: 1.9rem; flex: none; color: #8b97a8; }
:root[data-theme="light"] .logo { color: #0e1520; }
nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1.25rem; font-size: 0.95rem; }
nav a { color: var(--muted); text-decoration: none; }
nav a:hover, nav a[aria-current] { color: var(--fg); }
.theme {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  color: var(--muted);
  background: none;
  border: 0;
  border-radius: 3px;
  cursor: pointer;
}
.theme:hover { color: var(--fg); }
.theme svg { width: 1.2rem; height: 1.2rem; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* Text */
main { padding-top: 0.5rem; }
h1, h2, h3 { font-weight: 700; text-wrap: balance; }
h1 { font-size: 1.6rem; line-height: 1.25; margin: 2.25rem 0 1rem; }
h1.lede { font-size: 1.5rem; font-weight: 700; max-width: none; text-wrap: wrap; }
h2 { font-size: 1.1rem; margin: 2.5rem 0 0.75rem; }
p, ol, ul, dl { margin: 0 0 1.1rem; }
p:has(+ pre), p:has(+ .codeblock) { margin-bottom: 0.6rem; }
h1 + pre, h1 + .codeblock { margin-bottom: 1.25rem; }
code { font-family: var(--mono); font-size: 0.86em; }
:not(pre) > code { background: var(--surface); padding: 0.1em 0.3em; border-radius: 2px; white-space: nowrap; }

/* Code blocks */
pre {
  margin: 0 0 1.5rem;
  padding: 0.9rem 1rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 3px;
  overflow-x: auto;
  line-height: 1.5;
}
pre code { font-size: 0.85rem; white-space: pre; }
.hero { margin: 0 0 1.5rem; padding: 1.5rem 1rem; text-align: center; }
.hero code { font-size: 0.95rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.codeblock { position: relative; }
.codeblock pre { padding-top: 2.4rem; }
.copy {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  font: 0.75rem var(--text);
  padding: 0.2rem 0.55rem;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 2px;
  cursor: pointer;
}
.copy:hover { color: var(--fg); border-color: var(--muted); }

/* Intro: two columns on wide screens, so the row is filled */
.lead { display: grid; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 960px) { .lead { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 3rem; } }

/* How it works: four steps across the page, then the two outcomes */
.how { margin-top: 3rem; }
.flow { list-style: none; padding: 0; margin: 1.5rem 0 1.75rem; counter-reset: step; display: grid; gap: 1.75rem; grid-template-columns: minmax(0, 1fr); }
.flow > li { counter-increment: step; max-width: none; border-top: 1px solid var(--rule); padding-top: 0.9rem; }
.flow > li::before {
  content: counter(step);
  display: block;
  margin-bottom: 0.6rem;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--lamp);
}
.flow h3 { font-size: 1rem; margin: 0 0 0.35rem; }
.flow p { margin: 0 0 0.5rem; }
.outcomes, .cards { list-style: none; padding: 0; margin: 0 0 2rem; display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
.outcomes li, .cards li { display: grid; gap: 0.25rem; max-width: none; padding: 1rem 1.1rem; background: var(--surface); border: 1px solid var(--rule); border-radius: 3px; }
.outcomes strong { font-size: 1.05rem; }
.outcomes .yes strong { color: var(--go); }
.outcomes .no strong { color: var(--stop); }
@media (min-width: 640px) {
  .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem 2.5rem; }
  .outcomes, .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
  .flow { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem; }
}

/* Wide layout: text keeps a readable measure inside a full-width page */
main p, main li, main dl { max-width: 68ch; }
main p { text-wrap: pretty; }
.doc p, .doc li, .doc dl { max-width: none; }
@media (min-width: 960px) {
  h1.lede { font-size: 1.85rem; }
  .with-toc {
    display: grid;
    grid-template-columns: 13rem minmax(0, 1fr);
    gap: 4rem;
    align-items: start;
  }
}

/* Setup section navigation: a row on small screens, a sticky list beside the page from 960px */
.toc { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin: 1.25rem 0 0; padding-bottom: 0.75rem; border-bottom: 1px solid var(--rule); font-size: 0.95rem; }
.toc a { color: var(--muted); text-decoration: none; }
.toc a:hover, .toc a[aria-current] { color: var(--fg); }
.toc a[aria-current] { font-weight: 700; }
@media (min-width: 960px) {
  .toc { position: sticky; top: 1.5rem; display: grid; gap: 0.5rem; margin-top: 2.6rem; padding: 0 0 0 0.9rem; border-bottom: 0; border-left: 1px solid var(--rule); font-size: 0.9rem; }
}
.next { margin-top: 2rem; }

/* Setup */
.steps { padding-left: 1.4rem; }
.steps li { margin-bottom: 0.75rem; }
details { margin: 0 0 0.75rem; }
summary { cursor: pointer; font-weight: 700; margin-bottom: 0.5rem; }

/* Contact */
@media (min-width: 960px) { .help { columns: 2; column-gap: 3rem; } .help li { break-inside: avoid; } }
.cards { margin: 1.5rem 0 2rem; }
.cards .label { color: var(--muted); font-size: 0.9rem; }
.scope { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1fr); }
.scope h3 { font-size: 1rem; margin: 0 0 0.5rem; }
@media (min-width: 960px) { .scope { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4rem; } }

/* 404 notice */
.notice {
  font-size: 0.9rem;
  color: var(--muted);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 0.75rem 0;
  margin-top: 2rem;
}

@media (max-width: 600px) {
  body { font-size: 15px; }
  /* Wrap code on phones so the header line is readable without scrolling;
     the server configs keep their layout and scroll instead. */
  pre code { white-space: pre-wrap; overflow-wrap: anywhere; }
  details pre code { white-space: pre; overflow-wrap: normal; }
  :not(pre) > code { white-space: normal; overflow-wrap: anywhere; }
  nav { gap: 0.25rem 0.9rem; }
  nav a { padding-block: 0.5rem; }
}
@media (pointer: coarse) {
  .copy { font-size: 0.8rem; padding: 0.6rem 1rem; }
  .codeblock pre { padding-top: 3.4rem; }
}
