/*
  Stylesheet for the no_peak Methods & Algorithm Reference
  (public/methods.html). A linked, same-origin file — no inline style, no web
  fonts, no external requests of any kind, so the standalone page carries the
  same no-egress property as the app itself.

  The app commits to a single light look so on-screen figures match exports.
  This page is prose rather than figures, so it follows the reader's theme.
*/

:root {
  color-scheme: light dark;

  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --rule: #e1e0d9;
  --border: #c3c2b7;
  --accent: #2a78d6;
  --pulse: #eb6834;
  --code-bg: #f1f0e9;

  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --mono: ui-monospace, Menlo, Consolas, "SF Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8e6e1;
    --ink-2: #b4b1a9;
    --muted: #8c8981;
    --page: #16161a;
    --surface: #1c1c21;
    --rule: #2f2f36;
    --border: #45454e;
    --accent: #7fb2ec;
    --pulse: #f28a5e;
    --code-bg: #23232a;
  }
}

* {
  box-sizing: border-box;
}

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

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

.wrap {
  max-width: 46rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 5rem;
}

.backlink {
  display: inline-block;
  margin-bottom: 2rem;
  color: var(--accent);
  font-size: 0.9rem;
  text-decoration: none;
}

.backlink:hover {
  text-decoration: underline;
}

.masthead {
  border-bottom: 2px solid var(--rule);
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
}

.eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

h1 {
  font-family: var(--serif);
  font-size: 1.9rem;
  line-height: 1.25;
  margin: 0 0 0.75rem;
}

.lede {
  font-size: 1.05rem;
  color: var(--ink-2);
  margin: 0;
}

h2 {
  font-family: var(--serif);
  font-size: 1.35rem;
  margin: 2.75rem 0 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--rule);
}

h3 {
  font-size: 1rem;
  margin: 1.75rem 0 0.5rem;
  color: var(--ink);
}

p {
  margin: 0 0 1rem;
}

a {
  color: var(--accent);
}

ul,
ol {
  margin: 0 0 1rem;
  padding-left: 1.4rem;
}

li {
  margin-bottom: 0.5rem;
}

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--code-bg);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.25rem;
  font-size: 0.92rem;
}

/* Wide tables scroll inside their own box rather than the page. */
.scroll {
  overflow-x: auto;
  margin-bottom: 1.25rem;
}

.scroll table {
  margin-bottom: 0;
  min-width: 28rem;
}

th,
td {
  text-align: left;
  padding: 0.45rem 0.75rem 0.45rem 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

th {
  font-weight: 600;
  color: var(--ink-2);
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

td.num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

/* Command blocks. Long commands scroll inside the box rather than widening
   the page, which is the same rule .scroll applies to wide tables. */
pre {
  font-family: var(--mono);
  font-size: 0.86rem;
  line-height: 1.6;
  background: var(--code-bg);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.85rem 1rem;
  margin: 0 0 1.25rem;
  overflow-x: auto;
}

pre code {
  background: none;
  padding: 0;
  font-size: inherit;
}

.callout {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--pulse);
  padding: 0.9rem 1.1rem;
  margin: 0 0 1.25rem;
}

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

.cite {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
  margin-top: 0.15rem;
}

.refs li {
  margin-bottom: 0.9rem;
}

footer {
  margin-top: 3.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.88rem;
}
