/* Night porch: deep blue ground, warm off-white text, one pale lamp-yellow
   used sparingly (wordmark, 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(20px, 4vw, env(safe-area-inset-right, 0px)) 4rem max(20px, 4vw, 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: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding: 1.5rem 0 1rem;
  border-bottom: 1px solid var(--rule);
}
.mark {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--fg);
  text-decoration: none;
}
.mark::before {
  content: "";
  display: inline-block;
  width: 0.5em;
  height: 0.5em;
  margin-right: 0.5em;
  border-radius: 50%;
  background: var(--lamp);
  vertical-align: 0.1em;
}
nav { display: flex; flex-wrap: wrap; align-items: baseline; 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 {
  font: inherit;
  font-size: 0.85rem;
  padding: 0.05rem 0.55rem;
  color: var(--muted);
  background: none;
  border: 0;
  text-decoration: underline dotted;
  text-underline-offset: 0.25em;
  cursor: pointer;
}
.theme:hover { color: var(--fg); border-color: var(--muted); }

/* 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; }
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; }
.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); }

/* How it works */
.flow { list-style: none; padding: 0; margin: 0 0 1.5rem; counter-reset: step; }
.flow > li {
  position: relative;
  counter-increment: step;
  padding: 0 0 1.25rem 2.5rem;
}
.flow > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.2rem;
  width: 1.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  font-variant-numeric: lining-nums tabular-nums;
  text-align: center;
  color: var(--lamp);
}
.flow > li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: calc(0.75rem - 0.5px);
  top: 2rem;
  bottom: 0.4rem;
  width: 1px;
  background: var(--rule);
}
.flow h3 { font-size: 1rem; margin: 0.25rem 0 0.3rem; }
.flow p { margin: 0 0 0.5rem; }
.outcomes { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.4rem; }
.outcomes li { display: grid; grid-template-columns: 10rem minmax(0, 1fr); align-items: baseline; gap: 0.75rem; }
.outcomes span { font-weight: 700; }
.outcomes .yes { color: var(--go); }
.outcomes .no { color: var(--stop); }

/* 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; }
@media (min-width: 960px) {
  h1.lede { font-size: 1.85rem; max-width: 22ch; }
  .split {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 4rem;
    align-items: start;
  }
  .split > section > :first-child { margin-top: 2.5rem; }
  .intro pre code { font-size: 0.8rem; }
  .with-toc {
    display: grid;
    grid-template-columns: 12rem minmax(0, 1fr);
    gap: 4rem;
    align-items: start;
  }
  .toc {
    position: sticky;
    top: 1.5rem;
    margin-top: 2.6rem;
    display: grid;
    gap: 0.5rem;
    font-size: 0.9rem;
    padding-left: 0.9rem;
    border-left: 1px solid var(--rule);
  }
  .toc a { color: var(--muted); text-decoration: none; }
  .toc a:hover { color: var(--fg); }
}
@media (max-width: 959px) {
  .toc { display: none; }
}
@media (max-width: 1199px) {
  .split { display: block; }
  .intro pre code { font-size: 0.85rem; }
}
h2[id] { scroll-margin-top: 1.5rem; }

/* Setup */
details { margin: 0 0 0.75rem; }
summary { cursor: pointer; font-weight: 700; margin-bottom: 0.5rem; }

/* Contact */
.contact dt { color: var(--muted); font-size: 0.9rem; }
.contact dd { margin: 0 0 1rem; }

/* 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; }
  .outcomes li { grid-template-columns: 8.5rem minmax(0, 1fr); }
  /* 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 a, .theme { padding-block: 0.5rem; }
}
@media (pointer: coarse) {
  .copy { font-size: 0.8rem; padding: 0.6rem 1rem; }
  .codeblock pre { padding-top: 3.4rem; }
}
