/* One stylesheet, self-hosted, no web fonts, no external requests.
   Colours are checked for WCAG contrast in both schemes — the site has to
   pass the standard it sells. */

:root {
  --bg: #ffffff;
  --fg: #16191d;
  --muted: #4b5259;
  --line: #d6dae0;
  --accent: #0a4f9c;
  --accent-fg: #ffffff;
  --code-bg: #f2f4f7;
  --note-bg: #fff8e1;
  --note-line: #8a6d00;
  --note-fg: #4d3f00;
  --ok: #14571f;
  --bad: #8f1919;
  --radius: 8px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --fg: #e6edf3;
    --muted: #9aa5b1;
    --line: #303840;
    --accent: #79b8ff;
    --accent-fg: #0d1117;
    --code-bg: #161b22;
    --note-bg: #2a2313;
    --note-line: #d0a92b;
    --note-fg: #f0d98c;
    --ok: #7ee787;
    --bad: #ff9492;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.65;
  color: var(--fg);
  background: var(--bg);
  font-size: 1.0625rem;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-fg);
  padding: .75rem 1rem;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* A visible focus indicator everywhere, never removed. */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.wrap { max-width: 56rem; margin: 0 auto; padding: 0 1.25rem; }

header.site {
  border-bottom: 1px solid var(--line);
  padding: 1rem 0;
}
header.site .wrap { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; }
header.site a.brand { font-weight: 700; color: var(--fg); text-decoration: none; font-size: 1.05rem; }
header.site nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 1.25rem; margin: 0; padding: 0; }

main { padding: 2rem 0 3rem; }

h1 { font-size: 2rem; line-height: 1.25; margin: 0 0 .5rem; }
h2 { font-size: 1.4rem; margin: 2.5rem 0 .75rem; }
h3 { font-size: 1.1rem; margin: 1.75rem 0 .5rem; }
p, li { max-width: 42rem; }
.lede { font-size: 1.2rem; color: var(--muted); max-width: 40rem; }

a { color: var(--accent); }
a:hover { text-decoration-thickness: 2px; }

code, pre, kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .9em;
}
code { background: var(--code-bg); padding: .12em .35em; border-radius: 4px; }
pre {
  background: var(--code-bg);
  padding: 1rem;
  border-radius: var(--radius);
  overflow-x: auto;
  border: 1px solid var(--line);
}
pre code { background: none; padding: 0; }

.cta {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-fg);
  padding: .7rem 1.25rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
}
.cta:hover { text-decoration: underline; }
.cta-row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin: 1.5rem 0; }

.hero-img { width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--line); margin: 1.5rem 0; }

.note {
  background: var(--note-bg);
  border-left: 5px solid var(--note-line);
  color: var(--note-fg);
  padding: .85rem 1rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1.5rem 0;
}
.note :last-child { margin-bottom: 0; }
.note :first-child { margin-top: 0; }

.cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); margin: 1.5rem 0; padding: 0; list-style: none; }
.cards li { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; max-width: none; }
.cards h3 { margin-top: 0; }

.table-scroll { overflow-x: auto; margin: 1.25rem 0; }
table { border-collapse: collapse; width: 100%; }
caption { text-align: left; color: var(--muted); padding-bottom: .5rem; }
th, td { border: 1px solid var(--line); padding: .5rem .65rem; text-align: left; vertical-align: top; }
th { background: var(--code-bg); }

dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.25rem; margin: 1.25rem 0; }
dl.facts dt { font-weight: 600; }
dl.facts dd { margin: 0; }
@media (max-width: 34rem) {
  dl.facts { grid-template-columns: 1fr; gap: .1rem; }
  dl.facts dd { margin-bottom: .75rem; }
}

/* --- form --- */
form .field { margin: 1.1rem 0; }
label { display: block; font-weight: 600; margin-bottom: .3rem; }
.hint { color: var(--muted); font-size: .92rem; margin: .2rem 0 .4rem; }
input[type="text"], input[type="email"], input[type="date"], input[type="file"], select, textarea {
  width: 100%;
  max-width: 34rem;
  padding: .55rem .65rem;
  font: inherit;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--muted);
  border-radius: 6px;
}
textarea { min-height: 9rem; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; }
.row { display: flex; flex-wrap: wrap; gap: 1.1rem; }
.row .field { flex: 1 1 12rem; margin-top: 0; }
button {
  font: inherit;
  font-weight: 600;
  background: var(--accent);
  color: var(--accent-fg);
  border: 1px solid transparent;
  padding: .65rem 1.4rem;
  border-radius: var(--radius);
  cursor: pointer;
}
button:hover { text-decoration: underline; }

[role="alert"] {
  border-left: 5px solid var(--bad);
  background: var(--code-bg);
  padding: .85rem 1rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1.25rem 0;
}
[role="alert"] p { margin: .35rem 0 0; }

#gen-output-wrap { margin-top: 2rem; }
#gen-preview { width: 100%; height: 30rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
#gen-output { white-space: pre-wrap; word-break: break-word; max-height: 30rem; overflow: auto; }
.summary { font-weight: 600; }

footer.site {
  border-top: 1px solid var(--line);
  padding: 2rem 0;
  color: var(--muted);
  font-size: .95rem;
}
footer.site ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 1.25rem; }

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

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