/* ds-train — layout and components.
   NO HEX VALUES. Only semantic tokens from tokens.css, which is the one file
   allowed to contain them. Cedar (--accent-graphic) is 4.01:1 on Parchment and
   fails as small text, so it appears only in rules, chips and focus rings —
   --accent-text carries anything a person has to read. */

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

body {
  margin: 0;
  background: var(--surface);
  color: var(--text-body);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
}

h1, h2, h3 { font-family: 'Poppins', system-ui, sans-serif; line-height: 1.25; }
h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem); margin: 0; }
h2 { font-size: 1.3rem; margin: 2.4rem 0 .7rem; }

/* Skip link: visible the moment it is focused, not a permanently hidden
   element that only a screen reader ever finds. */
.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--cta-bg); color: var(--cta-text);
  padding: .7rem 1rem; z-index: 10; font-weight: 600;
}
.skip:focus { left: 0; }

/* One visible focus style everywhere. Never `outline: none`. */
:focus-visible {
  outline: var(--focus-width, 3px) solid var(--accent-graphic);
  outline-offset: 2px;
}
main:focus { outline: none; }   /* programmatic target of the skip link */

.band { padding: 1.6rem clamp(1rem, 5vw, 3rem); border-bottom: 1px solid var(--rule); }
.foot { border-bottom: 0; border-top: 1px solid var(--rule); margin-top: 3rem; }
main { padding: 1.6rem clamp(1rem, 5vw, 3rem) 0; max-width: 46rem; }

.eyebrow {
  margin: 0 0 .25rem; text-transform: uppercase; letter-spacing: .09em;
  font-size: .74rem; color: var(--accent-text); font-weight: 600;
}
.muted { color: var(--text-muted); font-size: .92rem; }

/* ── module list ─────────────────────────────────────────────────────────── */
.mods { list-style: none; margin: 1.5rem 0 0; padding: 0; }
.mod {
  display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap;
  padding: .8rem 0; border-bottom: 1px solid var(--rule);
}
.mod a { display: flex; gap: .7rem; align-items: baseline; text-decoration: none; color: inherit; }
.mod a:hover .mod-title, .mod a:focus-visible .mod-title { text-decoration: underline; }
.mod-id {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: .85rem; color: var(--accent-text); min-width: 3.1rem;
}
.mod-title { font-weight: 500; }
.mod-state { margin-left: auto; font-size: .85rem; color: var(--text-muted); }
.is-done .mod-title::after { content: ' ✓'; color: var(--accent-text); }

/* Chips carry a text label, never colour alone — colour is not information. */
.chip {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .06em;
  padding: .18rem .5rem; border: 1px solid var(--accent-graphic);
  border-radius: 2px; white-space: nowrap; font-weight: 600;
}
.chip-req { border-color: var(--rule-strong); }
.chip-draft { color: var(--text-muted); border-color: var(--rule-strong); }
.chip-ok, .chip-no { border-color: var(--rule-strong); }

/* ── content ─────────────────────────────────────────────────────────────── */
.objective { border-left: 3px solid var(--accent-graphic); padding-left: .9rem; }
.gatebar {
  border: 1px solid var(--rule-strong); padding: .8rem 1rem;
  background: transparent; margin: 1.4rem 0;
}
.abs, .scen { padding-left: 1.2rem; }
.abs li, .scen li { margin-bottom: 1.15rem; }
.abs-rule { font-weight: 600; margin: 0 0 .3rem; }
.abs-why, .scen-a { margin: 0; color: var(--text-body); }
.scen-q { margin: 0 0 .35rem; }
.plain { padding-left: 1.2rem; }
.plain li { margin-bottom: .5rem; }

.env { border-collapse: collapse; width: 100%; margin: 1rem 0; }
.env caption { text-align: left; padding-bottom: .5rem; }
.env th, .env td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.env th { width: 34%; font-weight: 600; }

.source { margin-top: 2.2rem; padding-top: .9rem; border-top: 1px solid var(--rule); font-size: .92rem; }
code { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: .88em; }

/* ── forms ───────────────────────────────────────────────────────────────── */
.repform, .complete {
  margin: 1.6rem 0; padding: 1rem; border: 1px solid var(--rule-strong);
  display: flex; flex-wrap: wrap; gap: .6rem; align-items: center;
}
.repform label, .complete label { font-weight: 600; font-size: .92rem; }
input[type=text] {
  font: inherit; padding: .5rem .6rem; border: 1px solid var(--rule-strong);
  background: var(--surface); color: var(--text-body); min-width: 12rem;
}
button {
  font: inherit; font-weight: 600; cursor: pointer;
  padding: .55rem 1.1rem; border: 1px solid var(--cta-bg);
  background: var(--cta-bg); color: var(--cta-text);
}
button:hover { filter: brightness(.96); }
.repform .muted, .complete .muted { flex-basis: 100%; margin: .2rem 0 0; }
.back { margin: 2rem 0 3rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
