/* rechtzeitig docs: plain HTML, no build. Paper, ink and a bit of seal red.
   Light tokens on :root, dark tokens twice: once for the system setting, once for the switch. */

:root {
  --paper: #faf8f3;
  --sheet: #ffffff;
  --ink: #1f1c18;
  --muted: #5f594f;
  --line: #e3ddd0;
  --seal: #8a1c2b;
  --seal-soft: #f4e6e6;
  --on-seal: #ffffff;
  --code-bg: #f1ede4;
  --pass: #2a7347;
  --warn: #8a5300;
  --fail: #b3261e;
  --info: #2c5d9e;
  --skip: #686258;
  --shadow: rgb(0 0 0 / 0.3);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius: 10px;
  --header: 3.6rem;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #17150f; --sheet: #201d17; --ink: #ece6da; --muted: #b0a898; --line: #3a352c;
    --seal: #ee8a96; --seal-soft: #3a2125; --on-seal: #17150f; --code-bg: #2a261f;
    --pass: #6fd09a; --warn: #f0b54f; --fail: #ff8c82; --info: #8db8f0; --skip: #aaa395;
    --shadow: rgb(0 0 0 / 0.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #17150f; --sheet: #201d17; --ink: #ece6da; --muted: #b0a898; --line: #3a352c;
  --seal: #ee8a96; --seal-soft: #3a2125; --on-seal: #17150f; --code-bg: #2a261f;
  --pass: #6fd09a; --warn: #f0b54f; --fail: #ff8c82; --info: #8db8f0; --skip: #aaa395;
  --shadow: rgb(0 0 0 / 0.7);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header) + 1rem); }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--seal); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 2px solid var(--seal); outline-offset: 2px; border-radius: 4px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  background: var(--seal);
  color: var(--on-seal);
  padding: 0.6rem 1rem;
  border-radius: 0 0 var(--radius) var(--radius);
  font-weight: 600;
  text-decoration: none;
}
.skip:focus { top: 0; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 5vw, 3rem); margin: 0 0 0.5rem; }
h2 { font-size: 1.6rem; margin: 3rem 0 1rem; }
h3 { font-size: 1.2rem; margin: 2rem 0 0.75rem; }

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

pre {
  font: 0.88rem/1.5 var(--mono);
  background: var(--code-bg);
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  overflow-x: auto;
}
pre code { background: none; padding: 0; }

/* Header */

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.top-inner {
  max-width: 68rem;
  margin: 0 auto;
  padding: 0.7rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem 1.5rem;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
  text-decoration: none;
  font: 600 1.15rem var(--serif);
}
.brand svg { width: 1.9rem; height: 1.9rem; flex: none; transition: transform 0.4s ease; }
.brand svg circle { fill: var(--seal); }
.brand svg text { fill: var(--on-seal); font: 700 20px var(--serif); }
.brand:hover svg { transform: rotate(-14deg) scale(1.08); }
.nav { margin-left: auto; }
.nav ul { display: flex; gap: 1.25rem; list-style: none; margin: 0; padding: 0; font-size: 0.95rem; }
.nav a { color: var(--muted); text-decoration: none; padding: 0.2rem 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--seal); }

/* Theme switch: two radio buttons that look like one pill */
.theme { display: flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; margin: 0; background: var(--sheet); }
.theme legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.theme input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.theme label {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 1.75rem;
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.theme label:hover { color: var(--ink); }
.theme svg { width: 1rem; height: 1rem; }
.theme input:checked + label { background: var(--seal); color: var(--on-seal); }
.theme input:focus-visible + label { outline: 2px solid var(--seal); outline-offset: 2px; }
.theme input:checked + label svg { animation: spin 0.45s cubic-bezier(.3,1.6,.5,1); }
@keyframes spin { from { transform: rotate(-90deg) scale(0.6); } }

@media (max-width: 34rem) {
  .nav { margin-left: 0; order: 3; width: 100%; }
  .theme { margin-left: auto; }
}

/* Layout */

main { display: block; max-width: 68rem; margin: 0 auto; padding: 2.5rem 1.25rem 4rem; }
.narrow { max-width: 46rem; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 40rem; }

footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9rem; }
footer .inner {
  max-width: 68rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2.5rem;
  display: flex;
  gap: 1rem 2rem;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
}
footer ul { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; list-style: none; margin: 0; padding: 0; }
footer a { color: var(--muted); }
footer a:hover { color: var(--ink); }
.disclaimer::before { content: "§ "; color: var(--seal); font-family: var(--serif); }

/* Home */

.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: center;
  padding: 1.5rem 0 1rem;
}
.stamp {
  width: 9.5rem;
  height: 9.5rem;
  border: 3px double var(--seal);
  border-radius: 50%;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--seal);
  font: 600 0.78rem/1.3 var(--serif);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transform: rotate(-12deg);
  transition: transform 0.5s cubic-bezier(.3,1.6,.5,1);
}
.stamp strong { display: block; font-size: 2.4rem; letter-spacing: 0; line-height: 1; margin: 0.15rem 0; }
.stamp:hover { transform: rotate(4deg) scale(1.05); }
/* The seal's rim carries the maker's name, like the legend around an official seal */
.stamp { position: relative; }
.stamp .rim { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; transition: transform 0.9s cubic-bezier(.3,1.6,.5,1); }
.stamp .rim text { fill: currentColor; font: 600 6.2px var(--serif); letter-spacing: 0.08em; opacity: 0.7; }
.stamp:hover .rim { transform: rotate(-40deg); }
@media (max-width: 40rem) { .hero { grid-template-columns: 1fr; } .stamp { display: none; } }

.covers {
  list-style: none;
  padding: 0;
  margin: 2rem 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
  gap: 0.75rem;
}
.covers li { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; }
.covers strong { display: block; font: 600 1.05rem var(--serif); margin-bottom: 0.2rem; }
.covers p { margin: 0; color: var(--muted); font-size: 0.9rem; }

/* Numbered steps: the number is a sans digit centred in its circle, aligned to the first line */
.steps { list-style: none; padding: 0; margin: 1rem 0; }
.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 1rem;
  align-items: start;
  margin-bottom: 1rem;
}
.steps li::before {
  content: counter(step);
  width: 2rem;
  height: 2rem;
  margin-top: calc((1.6em - 2rem) / 2);
  border-radius: 50%;
  border: 1.5px solid var(--seal);
  color: var(--seal);
  display: grid;
  place-items: center;
  font: 600 0.95rem/1 var(--sans);
  font-variant-numeric: lining-nums tabular-nums;
}
.steps { counter-reset: step; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: 1rem; margin: 1rem 0 2rem; }
.card-link {
  display: block;
  padding: 1.25rem;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.15s, border-color 0.15s;
}
.card-link:hover { transform: translateY(-2px); border-color: var(--seal); }
.card-link strong { font: 600 1.2rem var(--serif); display: block; margin-bottom: 0.25rem; }
.card-link span { color: var(--muted); font-size: 0.95rem; }

/* Technical and legal pages: table of contents + content */

.doc { display: grid; grid-template-columns: 13rem minmax(0, 1fr); gap: 3rem; }
.toc { position: sticky; top: calc(var(--header) + 1.5rem); align-self: start; font-size: 0.92rem; }
.toc h2 { margin: 0 0 0.5rem; color: var(--muted); font: 600 0.75rem var(--sans); letter-spacing: 0.1em; text-transform: uppercase; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc a { display: block; padding: 0.25rem 0 0.25rem 0.9rem; color: var(--muted); text-decoration: none; margin-left: -1px; border-left: 2px solid transparent; }
.toc a:hover { color: var(--ink); border-left-color: var(--seal); }
@media (max-width: 52rem) { .doc { grid-template-columns: 1fr; gap: 1rem; } .toc { position: static; } }

.doc section > h2 { display: flex; gap: 0.6rem; align-items: baseline; padding-top: 0.5rem; border-top: 1px solid var(--line); }
.doc section:first-of-type > h2 { margin-top: 0; }
.par { color: var(--seal); font-family: var(--serif); font-size: 0.85em; font-weight: 400; }

.table-wrap { overflow-x: auto; margin: 1rem 0 1.5rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--sheet); }
table { border-collapse: collapse; width: 100%; font-size: 0.93rem; }
th, td { text-align: left; vertical-align: top; padding: 0.6rem 0.9rem; border-bottom: 1px solid var(--line); }
thead th { font-weight: 600; font-size: 0.8rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); background: color-mix(in srgb, var(--code-bg) 50%, transparent); }
tr:last-child > * { border-bottom: 0; }
td:first-child code, th code { white-space: nowrap; }

.note {
  border-left: 3px solid var(--seal);
  background: var(--seal-soft);
  padding: 0.8rem 1rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1.25rem 0;
}

.red { color: var(--fail); font-weight: 600; }
.green { color: var(--pass); font-weight: 600; }
.updated { color: var(--muted); font-size: 0.9rem; }
address { font-style: normal; }

/* Status pills: icons are SVG masks, so they sit centred in any font */

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  font: 600 0.8rem/1 var(--mono);
  padding: 0.3rem 0.6rem 0.3rem 0.5rem;
  border-radius: 999px;
  border: 1.5px solid currentColor;
  white-space: nowrap;
  vertical-align: 0.05em;
}
.status::before {
  content: "";
  width: 0.85em;
  height: 0.85em;
  flex: none;
  background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}
.s-pass { color: var(--pass); --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 8.5 3.2 3L13 4.5'/%3E%3C/svg%3E"); }
.s-fail { color: var(--fail); --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m4 4 8 8M12 4l-8 8'/%3E%3C/svg%3E"); }
.s-warn { color: var(--warn); --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Crect x='6.8' y='2' width='2.4' height='8' rx='1.2'/%3E%3Ccircle cx='8' cy='13' r='1.5'/%3E%3C/svg%3E"); }
.s-info { color: var(--info); --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='3.2' r='1.5'/%3E%3Crect x='6.8' y='6' width='2.4' height='8' rx='1.2'/%3E%3C/svg%3E"); }
.s-skip { color: var(--skip); --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Crect x='3' y='6.8' width='10' height='2.4' rx='1.2'/%3E%3C/svg%3E"); }

/* Data that leaves the runner: same pill shape, dashed rim and an arrow out of a box */
.sends {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font: 600 0.78rem/1 var(--sans);
  padding: 0.3rem 0.6rem 0.3rem 0.5rem;
  border-radius: 999px;
  border: 1.5px dashed currentColor;
  color: var(--seal);
  background: var(--seal-soft);
  white-space: nowrap;
  vertical-align: 0.05em;
  text-decoration: none;
  justify-self: start;
  width: fit-content;
}
.sends::before {
  content: "";
  width: 1em;
  height: 1em;
  flex: none;
  background: currentColor;
  -webkit-mask: var(--icon-sends) center / contain no-repeat;
  mask: var(--icon-sends) center / contain no-repeat;
}
a.sends:hover { border-style: solid; }
:root { --icon-sends: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 2.5h4.5V7M13.5 2.5 7.5 8.5M11.5 9.5v3a1 1 0 0 1-1 1h-7a1 1 0 0 1-1-1v-7a1 1 0 0 1 1-1h3'/%3E%3C/svg%3E"); }

.legend { list-style: none; padding: 0; display: grid; gap: 0.6rem; margin: 1rem 0 2rem; }
.legend li { display: grid; grid-template-columns: 5.5rem 1fr; gap: 0.75rem; align-items: center; }
.legend .status { justify-self: start; transition: transform 0.25s cubic-bezier(.3,1.8,.5,1); }
.legend li:hover .status { transform: rotate(-8deg) scale(1.1); }

/* Checks page */

.toolbar {
  position: sticky;
  top: var(--header);
  z-index: 5;
  background: var(--paper);
  padding: 0.9rem 0;
  margin: 1.5rem 0 0.5rem;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 0.6rem;
}
@media (max-width: 40rem) { .toolbar { position: static; } }
.search {
  width: 100%;
  font: inherit;
  padding: 0.6rem 0.9rem 0.6rem 2.3rem;
  border: 1px solid var(--muted);
  border-radius: 999px;
  background: var(--sheet) no-repeat 0.85rem 50% / 1rem
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23857e72' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
  color: var(--ink);
}
.search::placeholder { color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.chips .label { font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-right: 0.25rem; min-width: 4.5rem; }
.chip {
  font: 0.86rem var(--sans);
  min-height: 2rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--sheet);
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.12s, background 0.15s, border-color 0.15s;
}
.chip:hover { border-color: var(--seal); }
.chip:active { transform: scale(0.94); }
.chip[aria-pressed="true"] { background: var(--seal); border-color: var(--seal); color: var(--on-seal); }
.chip .n { opacity: 0.75; font-size: 0.8em; margin-left: 0.3em; }
.count { color: var(--muted); font-size: 0.9rem; margin: 0.75rem 0 0; }
.empty { text-align: center; color: var(--muted); padding: 3rem 0; font-family: var(--serif); font-size: 1.15rem; }

.module > h3 { display: flex; align-items: baseline; gap: 0.5rem; }
.module > h3 small { font: 0.85rem var(--sans); color: var(--muted); }

.rules { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); gap: 0.9rem; align-items: start; }

.rule {
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
  animation: pop 0.35s ease both;
}
.rule:hover { transform: translateY(-2px); box-shadow: 0 6px 18px -10px var(--shadow); }
.rule:target { border-color: var(--seal); box-shadow: 0 0 0 3px var(--seal-soft); }
.rule[open] { border-color: color-mix(in srgb, var(--seal) 45%, var(--line)); }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(0.98); } }

.rule summary {
  list-style: none;
  cursor: pointer;
  padding: 1rem 1.1rem 0.9rem;
  display: grid;
  gap: 0.45rem;
  border-radius: var(--radius);
}
.rule summary::-webkit-details-marker { display: none; }
.rule-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.rule-id { font: 600 0.78rem var(--mono); letter-spacing: 0.03em; color: var(--muted); }
.rule-title { font: 600 1.06rem/1.3 var(--serif); }
.rule-law { font-size: 0.88rem; color: var(--seal); font-family: var(--serif); }
.rule-law.none { color: var(--muted); font-style: italic; }
.rule-more { font-size: 0.82rem; color: var(--muted); display: flex; align-items: center; gap: 0.4rem; }
/* Plus drawn with two bars, turns into a cross when open */
.rule-more::before {
  content: "";
  width: 1.1rem;
  height: 1.1rem;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 50%;
  background:
    linear-gradient(currentColor, currentColor) center / 0.5rem 1.5px no-repeat,
    linear-gradient(currentColor, currentColor) center / 1.5px 0.5rem no-repeat;
  transition: transform 0.25s cubic-bezier(.3,1.6,.5,1);
}
.rule[open] .rule-more::before { transform: rotate(45deg); }
.rule:hover .rule-more { color: var(--ink); }

.rule-body { padding: 0 1.1rem 1.1rem; font-size: 0.92rem; border-top: 1px dashed var(--line); }
.rule-body dl { margin: 0.75rem 0 0; display: grid; gap: 0.6rem; }
.rule-body dt { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.rule-body dd { margin: 0.1rem 0 0; }

/* Severity: five beads, filled up to the level. The level is also written out. */
.sev { display: inline-flex; align-items: center; gap: 3px; }
.sev i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.sev[data-level="1"] i:nth-child(-n+1),
.sev[data-level="2"] i:nth-child(-n+2) { background: var(--info); }
.sev[data-level="3"] i:nth-child(-n+3) { background: var(--warn); }
.sev[data-level="4"] i:nth-child(-n+4),
.sev[data-level="5"] i:nth-child(-n+5) { background: var(--fail); }
.sev b { font: 600 0.72rem var(--mono); color: var(--muted); margin-left: 0.35rem; text-transform: uppercase; letter-spacing: 0.05em; }
.rule:hover .sev i { animation: bead 0.5s ease; }
.rule:hover .sev i:nth-child(2) { animation-delay: 0.04s; }
.rule:hover .sev i:nth-child(3) { animation-delay: 0.08s; }
.rule:hover .sev i:nth-child(4) { animation-delay: 0.12s; }
.rule:hover .sev i:nth-child(5) { animation-delay: 0.16s; }
@keyframes bead { 40% { transform: translateY(-3px); } }

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

@media (forced-colors: active) {
  .status::before, .sends::before { background: CanvasText; }
  .sev i { border: 1px solid CanvasText; }
}
