:root {
  color-scheme: light dark;
  --paper: #f4f1ea;
  --ink: #1d2420;
  --muted: #555f58;
  --line: #c9c4b6;
  --accent: #0b4dbb; /* QBS brand blue — see DESIGN_DECISIONS.md */
  --on-accent: #ffffff;
  --panel: #fffdf8;
  --error: #9a2c1c;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #141815;
    --ink: #eae7de;
    --muted: #a9b2ab;
    --line: #3a423c;
    --accent: #8fb4f2; /* lightened for dark mode — see DESIGN_DECISIONS.md */
    --on-accent: #0d1f17;
    --panel: #1c221e;
    --error: #ffab9b;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1.0625rem/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--accent); text-underline-offset: 0.2em; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.skip { position: absolute; left: -999rem; }
.skip:focus { left: 1rem; top: 1rem; padding: 0.5rem 1rem; background: var(--panel); }

.bar, main, footer {
  width: min(100% - 2rem, 62rem);
  margin-inline: auto;
}

.bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-block: 1.25rem;
  border-bottom: 1px solid var(--line);
}

.brand { display: inline-flex; align-items: center; line-height: 0; }
.brand img { display: block; height: 2rem; width: auto; }

nav { display: flex; flex-wrap: wrap; gap: 1.25rem; }

h1, h2 { font-family: Georgia, "Times New Roman", serif; line-height: 1.15; text-wrap: balance; }

.intro { padding-block: clamp(2rem, 6vw, 4rem) 2rem; }
.intro h1 { margin: 0 0 1rem; font-size: clamp(2rem, 6vw, 3.5rem); max-width: 18ch; }
.lede { margin: 0; max-width: 54ch; color: var(--muted); font-size: 1.2rem; }

/* The page's signature: a vertical route with the gate as its middle stop. */
.route { list-style: none; margin: 0; padding: 0; }

.stop {
  position: relative;
  padding: 0 0 2.5rem 3rem;
  scroll-margin-top: 1rem;
}

.stop::before {
  content: "";
  position: absolute;
  left: 0.2rem;
  top: 0.35rem;
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: var(--paper);
}

.stop:not(:last-child)::after {
  content: "";
  position: absolute;
  left: calc(0.7rem - 1px);
  top: 1.5rem;
  bottom: -0.2rem;
  border-left: 2px dashed var(--line);
}

.done::before { background: var(--accent); }
.current::before { box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 22%, transparent); }

.stop h2 { margin: 0 0 0.35rem; font-size: 1.4rem; }
.stop p { margin: 0 0 0.75rem; max-width: 54ch; color: var(--muted); }

button {
  min-height: 3rem;
  padding: 0.75rem 1.5rem;
  border: 2px solid var(--accent);
  border-radius: 4px;
  background: var(--accent);
  color: var(--on-accent);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

button:hover:not(:disabled) { filter: brightness(1.12); }
button:disabled { opacity: 0.65; cursor: default; }

#status { min-height: 1.6rem; margin-top: 0.75rem; }
.stop #status[data-state="error"], .warning { color: var(--error); font-weight: 600; }

.detail { padding-block: 2.5rem; border-top: 1px solid var(--line); scroll-margin-top: 1rem; }
.detail h2 { margin-top: 0; font-size: 1.75rem; }
.detail p { max-width: 62ch; }

dl { margin: 0; }
dl div { display: grid; grid-template-columns: minmax(0, 14rem) minmax(0, 1fr); gap: 0.25rem 2rem; padding-block: 1rem; }
dl div + div { border-top: 1px dotted var(--line); }
dt { font-weight: 600; }
dd { margin: 0; color: var(--muted); }

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding-block: 1.5rem 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

footer img { display: block; height: 1.5rem; width: auto; opacity: 0.85; }

.notice { padding-block: 4rem; }

@media (max-width: 36rem) {
  dl div { grid-template-columns: minmax(0, 1fr); }
  button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
