/* plain.css: the base shared by every "plain" trainer page.

   A plain page is one scrolling document with its own markup and, if it needs one,
   its own script: no chapter renderer and no lesson document. What every such page
   shares lives here, so that a dozen pages do not carry a dozen copies of it: the
   palette, the type, the top link, the section rhythm with its draft numerals, cards,
   native disclosures, segmented controls, sliders, tone chips, the reading list and
   the footer. Whatever makes a page itself (its picture, its instrument) stays in
   that page's own <style>.

   Phone first: one column is the base, the wide layout is the enhancement, and
   nothing is pinned to the viewport. Light only, by policy: there is no dark scheme,
   and nothing here reacts to the system colour setting. */

:root {
  color-scheme: light;
  --ink: #172129;
  --muted: #586770;
  --faint: #88969e;
  --paper: #f4f1ea;
  --panel: #ffffff;
  --line: #dcd7cb;
  --hull: #0b2a3a;
  --hull-2: #123f55;
  --accent: #177f99;
  --accent-deep: #0b4c61;
  --accent-soft: #e0f1f5;
  --good: #11845f;
  --good-soft: #e3f3ec;
  --warn: #b46b18;
  --warn-soft: #fbefdc;
  --bad: #b83f43;
  --bad-soft: #fbe6e7;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  padding: 0 16px 64px;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.6 var(--sans);
}
.wrap { max-width: 720px; margin: 0 auto; }
code { font-family: var(--mono); font-size: 0.88em; padding: 1px 2px; border-radius: 4px; background: #ece8dd; color: var(--accent-deep); }
pre { margin: 10px 0 0; padding: 13px; overflow-x: auto; border-radius: 11px; background: #101a21; color: #dce9ed; }
pre code { padding: 0; background: none; color: inherit; font-size: 0.82rem; }
a { color: var(--accent-deep); }
button { font: inherit; color: inherit; }

.top { padding: 14px 0 6px; }
.top a { display: inline-block; padding: 11px 0; font-weight: 700; text-decoration: none; }
.top a:hover { text-decoration: underline; }

.eyebrow { margin: 0; color: var(--accent-deep); font-size: 0.74rem; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase; }
h1 {
  margin: 6px 0 12px; font-family: var(--serif); font-weight: 600;
  font-size: clamp(2.4rem, 11vw, 3.6rem); line-height: 1; letter-spacing: -0.02em;
}
.promise { margin: 0 0 6px; font-size: 1.1rem; color: var(--muted); }
.promise b { color: var(--ink); }

/* Each section carries a draft number, painted large and faint at the top right like
   the numerals up a ship's stem. Decoration that also works as wayfinding. */
section { position: relative; margin-top: 44px; padding-top: 18px; border-top: 1px solid var(--line); }
.draft {
  position: absolute; top: 6px; right: 0; margin: 0;
  font-family: var(--serif); font-size: 4.4rem; font-weight: 700; line-height: 1;
  color: rgba(11, 42, 58, 0.09); letter-spacing: -0.04em; pointer-events: none; user-select: none;
}
h2 {
  position: relative; margin: 14px 0 6px; font-family: var(--serif); font-weight: 600;
  font-size: 1.6rem; line-height: 1.2; letter-spacing: -0.01em;
}
h2 + p { margin-top: 0; color: var(--muted); }
h3 { margin: 22px 0 6px; font-size: 1.02rem; }

.card { margin: 14px 0; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.card.warn { border-left: 5px solid var(--warn); }
.card.bad { border-left: 5px solid var(--bad); background: var(--bad-soft); }
.card.good { border-left: 5px solid var(--good); }

.tone { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; vertical-align: middle; margin-left: 6px; }
.tone.good { background: var(--good-soft); color: var(--good); }
.tone.warn { background: var(--warn-soft); color: var(--warn); }
.tone.bad { background: var(--bad-soft); color: var(--bad); }
.tone.neutral { background: #ece8dd; color: var(--muted); }

/* A native disclosure: no script, keyboard and screen-reader navigable for free, and
   on a phone the page opens as a short list rather than a wall of prose. A flex summary
   drops the native triangle, so the affordance is put back on the right. */
details { margin: 10px 0; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
details[open] { border-color: var(--accent); }
summary {
  position: relative; padding: 15px 48px 15px 16px; min-height: 48px; cursor: pointer;
  font-weight: 700; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  color: var(--accent); font-size: 1.5rem; font-weight: 400; line-height: 1;
}
details[open] summary::after { content: "−"; }
summary .what { color: var(--muted); font-weight: 400; font-size: 0.95rem; }
details > div { padding: 0 16px 16px; }
details p { margin: 0 0 10px; }
details p:last-child { margin-bottom: 0; }
.label { color: var(--accent-deep); font-weight: 700; }

/* Segmented controls: a row of pressable buttons, the pressed one inked. Tap targets
   are at least 44px tall for a thumb. */
.control { margin: 0 0 12px; }
.control[hidden] { display: none; }
.control-label {
  display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline;
  margin: 0 0 6px; font-weight: 700; font-size: 0.92rem;
}
.control-label code { font-weight: 500; }
.control-note { margin: 4px 0 0; font-size: 0.82rem; color: var(--muted); }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button {
  flex: 1 1 auto; min-height: 44px; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel);
  cursor: pointer; text-align: left; line-height: 1.25;
}
.seg button small { display: block; color: var(--muted); font-size: 0.76rem; font-weight: 500; }
.seg button[aria-pressed="true"] { border-color: var(--hull); background: var(--hull); color: #fff; }
.seg button[aria-pressed="true"] small { color: #cfe2ea; }
.seg button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.control.na .seg button { opacity: 0.45; cursor: default; }

.range { display: block; }
.range .control-label { justify-content: space-between; }
.range output { font-family: var(--mono); font-weight: 700; color: var(--accent-deep); }
.range input[type="range"] { width: 100%; margin: 0; accent-color: var(--accent); height: 44px; }

.links { margin: 14px 0 0; padding: 0; list-style: none; }
.links li { margin: 0 0 10px; }
.links a { display: block; padding: 13px 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); text-decoration: none; }
.links a:hover { border-color: var(--accent); }
.links b { display: block; color: var(--accent-deep); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; }
.links strong { display: block; margin-top: 3px; color: var(--ink); }
.links small { display: block; margin-top: 2px; color: var(--muted); line-height: 1.45; }

footer { margin-top: 44px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--faint); font-size: 0.9rem; }

@media (min-width: 860px) {
  body { padding: 0 28px 80px; font-size: 18px; }
  .wrap { max-width: 760px; }
  .wrap.wide { max-width: 980px; }
  .draft { font-size: 5.2rem; }
  .two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  .two .card { margin: 0; }
}
