/* The docs (docs.html, docs/*.html), the recipes, the comparison, the release
   notes and the privacy pages in the landing page's look:
   the same paper and ink, light and dark, Archivo for text and headings,
   JetBrains Mono for code. The top bar is nav.css. Fonts come from fonts/fonts.css.
   This file is the only place the look lives. */

:root {
  --paper:   #eceee9;
  --paper-2: #e1e6e1;
  --card:    #f7f8f5;
  --ink:     #14201e;
  --ink-2:   #3f4d4a;
  --muted:   #5f6d69;
  --rule:    #c4ccc7;
  --aqua:    #0a7680;
  --amber:   #9c5300;
  --red:     #b3261e;
  --yellow:  #7a6100;
  --green:   #2c6e35;
  --grey:    #6b7672;
  --focus:   #0a7680;

  --term:    #142022;
  --t-ink:   #d5e1dd;
  --t-dim:   #7f928d;
  --t-aqua:  #55d3db;
  --t-amber: #f2a541;
  --t-red:   #ff7b6f;
  --t-yellow:#e7c650;
  --t-green: #8fd694;

  --display: "Archivo", "Archivo Narrow", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --text:    "Archivo", "Helvetica Neue", Arial, sans-serif;
  --mono:    "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --gutter: 16px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:   #0e1a1c;
    --paper-2: #112124;
    --card:    #16282b;
    --ink:     #dde7e4;
    --ink-2:   #b4c4c0;
    --muted:   #8da39e;
    --rule:    #29403f;
    --aqua:    #52cfd8;
    --amber:   #f0a13a;
    --red:     #ff6b5e;
    --yellow:  #e3c04a;
    --green:   #8fd694;
    --grey:    #8da39e;
    --focus:   #52cfd8;
    --term:    #081214;
  }
}

@media (min-width: 720px) { :root { --gutter: 32px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1rem;
  line-height: 1.6;
  font-variation-settings: "wdth" 96;
}

a { color: var(--aqua); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 3px; }

/* The top bar and the skip link are styled by nav.css (every page). */

/* ---------- page ---------- */
main { width: 100%; max-width: 920px; margin: 0 auto; padding: 2.5rem var(--gutter) 4rem; }
.card { background: none; border: 0; padding: 0; }
.home { display: none; } /* the top bar's mark leads home now */

h1 {
  font-family: var(--display); font-variation-settings: "wdth" 70; font-weight: 750;
  font-size: clamp(2.4rem, 7vw, 3.8rem); line-height: .95; letter-spacing: -.01em;
  margin: 0 0 .6rem;
}
h1 .cursor { color: var(--aqua); }
.tagline { font-family: var(--mono); color: var(--aqua); font-size: .92rem; margin: 0 0 1.6rem; }
p.lead { color: var(--ink-2); font-size: 1.08rem; max-width: 44em; }

h2 {
  font-family: var(--display); font-variation-settings: "wdth" 75; font-weight: 700;
  font-size: clamp(1.6rem, 4vw, 2.2rem); line-height: 1.05; letter-spacing: -.005em;
  margin: 3.2rem 0 1rem; padding-bottom: .5rem; border-bottom: 1px solid var(--rule);
}
h3 { font-size: 1.12rem; font-weight: 700; margin: 2.1rem 0 .55rem; color: var(--ink); }
h4 { font-size: 1rem; font-weight: 700; margin: 1.6rem 0 .45rem; color: var(--ink-2); }
h2 code, h3 code, h4 code { font-size: .92em; color: var(--aqua); background: none; border: 0; padding: 0; }

code, kbd, pre { font-family: var(--mono); }
code {
  font-size: .86em; overflow-wrap: anywhere;
  background: var(--card); border: 1px solid var(--rule); border-radius: 4px; padding: .05em .35em;
}
kbd {
  font-size: .8em; white-space: nowrap;
  background: var(--card); border: 1px solid var(--rule); border-bottom-width: 2px; border-radius: 4px; padding: 0 .4em;
}

/* Commands and example sessions: a terminal, in light and dark alike. */
.prompt, .cmd {
  background: var(--term); color: var(--t-ink);
  border-radius: 8px; padding: .9rem 1.05rem; margin: 1.1rem 0;
  overflow-x: auto; white-space: pre; font-family: var(--mono); font-size: .82rem; line-height: 1.7;
}
.prompt code, .cmd code { background: none; border: 0; padding: 0; font-size: 1em; color: inherit; }
.prompt { color: var(--t-dim); }
.prompt .c { color: var(--t-aqua); }
.prompt .o { color: var(--t-dim); font-style: italic; }
.cmd .k { color: var(--t-aqua); }

.tablewrap { overflow-x: auto; margin: 1.1rem 0; border: 1px solid var(--rule); border-radius: 8px; background: var(--card); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: .55rem .75rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); }
tr:last-child td { border-bottom: 0; }
th { background: var(--paper-2); color: var(--ink-2); font-weight: 700; white-space: nowrap; font-size: .82rem; letter-spacing: .02em; }
td code { white-space: nowrap; }
td + td { border-left: 1px solid var(--rule); }
th + th { border-left: 1px solid var(--rule); }

/* A bare <pre> (an example file): wide content scrolls inside its own box,
   never the page (phones). */
pre { overflow-x: auto; max-width: 100%; }

ul, ol { padding-left: 1.3rem; }
li { margin: .3rem 0; }

.note, .warn {
  border-left: 3px solid var(--aqua); background: var(--card);
  padding: .75rem 1rem; margin: 1.2rem 0; color: var(--ink-2); border-radius: 0 8px 8px 0;
}
.warn { border-left-color: var(--red); }

/* Links between the docs and the recipes (examples.html). */
.recipe-link, .more { font-size: .92rem; color: var(--muted); }

/* examples.html: one <article class="recipe"> per workflow. Its sub-headings
   are labels (CLI, In the TUI, …), not sections, so they are set small. */
.recipe h3 {
  font-family: var(--mono); font-size: .76rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .08em; margin: 1.5rem 0 .4rem;
}
.recipe .goal { font-size: 1.04rem; color: var(--ink-2); }
.note strong, .warn strong { color: var(--ink); }

.toc { background: var(--card); border: 1px solid var(--rule); border-radius: 10px; padding: 1.2rem 1.4rem; margin: 2rem 0 1rem; }
.toc .th { font-family: var(--mono); color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .1em; margin: 0 0 .7rem; }
.toc ol { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 2rem; }
.toc li { margin: .22rem 0; break-inside: avoid; }
.toc a { color: var(--ink); text-decoration: none; }
.toc a:hover { color: var(--aqua); text-decoration: underline; }

footer { color: var(--muted); font-size: .88rem; margin-top: 3rem; border-top: 1px solid var(--rule); padding-top: 1.4rem; }
footer a { color: var(--ink-2); }
footer code { font-size: .84em; }
.legal { margin-top: .7rem; }
.legal a { color: var(--muted); }
.legal a:hover { color: var(--aqua); }

/* The docs are one page per topic (docs/*.html) under an index (docs.html):
   a breadcrumb above the title, previous/next at the end, then the full page list. */
.crumbs { font-family: var(--mono); font-size: .8rem; color: var(--muted); margin: 0 0 1rem; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--aqua); }
.doclist { list-style: none; padding: 0; }
.doclist li { margin: .55rem 0; color: var(--ink-2); }
.doclist a { font-weight: 700; }
.pager { display: flex; justify-content: space-between; gap: 1rem; margin: 3.2rem 0 0; padding-top: 1.2rem; border-top: 1px solid var(--rule); }
.pager a { text-decoration: none; font-weight: 700; max-width: 48%; }
.pager a:hover { text-decoration: underline; }
.pager .next { margin-left: auto; text-align: right; }
.pager .lbl { display: block; font-family: var(--mono); font-weight: 400; font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.docnav a[aria-current="page"] { color: var(--aqua); font-weight: 700; }

/* The docs list (<aside class="docside">, partials/docnav.html) closes every
   docs page. From 980px it is a left sidebar instead: fixed beside the text,
   scrolling on its own when it is taller than the window, and the page makes
   room for it. Positioned, not a grid, so the page's flow — and its collapsing
   margins — stay exactly as on a phone. Browsers without :has() keep the list
   at the foot. */
@media (min-width: 980px) {
  main:has(> .card > .docside) {
    max-width: calc(920px + 16rem);
    padding-left: calc(var(--gutter) + 16rem);
  }
  main:has(> .card > .docside) .docside {
    position: fixed; top: 3rem; bottom: 0;
    left: max(var(--gutter), calc((100vw - 920px - 16rem) / 2 + var(--gutter)));
    width: 14rem; overflow-y: auto; overscroll-behavior: contain;
    padding: 1.6rem 1rem 2rem 0;
    border-right: 1px solid var(--rule);
  }
  main:has(> .card > .docside) .docnav { background: none; border: 0; border-radius: 0; padding: 0; margin: 0; }
  main:has(> .card > .docside) .docnav ol { columns: 1; }
  main:has(> .card > .docside) .docnav li { font-size: .86rem; line-height: 1.35; margin: .4rem 0; }
}

/* Docs search (docsearch.js, the pagefind index under /pagefind/). The form
   is `hidden` in the markup; the script shows it once it runs. */
.docsearch { margin: 2rem 0 1rem; }
.docsearch .th { display: block; font-family: var(--mono); color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .1em; margin: 0 0 .5rem; }
.docsearch input {
  width: 100%; font: inherit; font-size: .95rem; color: var(--ink);
  background: var(--card); border: 1px solid var(--rule); border-radius: 8px; padding: .5rem .7rem;
}
.docsearch input:focus { outline: 2px solid var(--focus); outline-offset: 1px; border-color: transparent; }
.docsearch-status { font-size: .84rem; color: var(--muted); margin: .4rem 0 0; min-height: 1.2em; }
.docsearch-status:empty { min-height: 0; margin: 0; }
.docsearch-results { list-style: none; margin: .3rem 0 0; padding: 0; }
.docsearch-results li { margin: .7rem 0; }
.docsearch-results a { font-weight: 700; text-decoration: none; }
.docsearch-results a:hover { text-decoration: underline; }
.docsearch-results p { margin: .15rem 0 0; font-size: .86rem; color: var(--ink-2); }
.docsearch-results mark { background: color-mix(in srgb, var(--aqua) 22%, transparent); color: inherit; border-radius: 2px; }
.docsearch-index { max-width: 34rem; }
@media (min-width: 980px) {
  main:has(> .card > .docside) .docsearch { margin: 0 0 1.4rem; }
}

/* docs/cli.html, the generated CLI reference (make cli-docs): one section per
   command; subcommands are indented in the contents. */
.clitoc { font-family: var(--mono); font-size: .84rem; }
.clitoc .d2 { padding-left: 1.1rem; }
.clishort { font-size: 1.04rem; color: var(--ink-2); }
.climeta { font-size: .92rem; color: var(--muted); margin: 1rem 0 .3rem; }
.clisubs { margin-top: .2rem; }
.clitag {
  font-family: var(--mono); font-size: .7rem; font-weight: 400; color: var(--muted);
  border: 1px solid var(--rule); border-radius: 4px; padding: .05em .4em; vertical-align: middle;
}
/* docs/parity.html: CLI · TUI · MCP side by side. */
table.parity td:first-child { min-width: 14em; }
table.parity td + td { font-size: .86rem; }
.pm-no { color: var(--muted); }
.pm-only {
  font-family: var(--mono); font-size: .7rem; color: var(--amber); white-space: nowrap;
  border: 1px solid currentColor; border-radius: 4px; padding: 0 .35em;
}
.pm-why { display: block; margin-top: .25rem; font-size: .84rem; color: var(--muted); }
pre.helptext {
  background: var(--card); border: 1px solid var(--rule); border-radius: 8px;
  padding: .7rem 1rem; margin: .9rem 0; font-size: .8rem; line-height: 1.6;
}

/* Colours the TUI uses, named rather than hard-coded, so they read on paper in
   both modes and as terminal colours inside a terminal block. */
.tc-green  { color: var(--green); }
.tc-red    { color: var(--red); }
.tc-amber  { color: var(--amber); }
.tc-yellow { color: var(--yellow); }
.tc-grey   { color: var(--grey); }
.tc-b      { font-weight: 700; }
.prompt .tc-green, .cmd .tc-green { color: var(--t-green); }
.prompt .tc-red, .cmd .tc-red { color: var(--t-red); }
.prompt .tc-amber, .cmd .tc-amber { color: var(--t-amber); }
.prompt .tc-yellow, .cmd .tc-yellow { color: var(--t-yellow); }
.prompt .tc-grey, .cmd .tc-grey { color: var(--t-dim); }

/* releases.html: one .release per tag, rendered from releases.json by the
   page's script. The version is the entry's h2, set as a small mono tag. */
#releases .loading, .fallback { color: var(--muted); }
.dh-hint { color: var(--muted); font-size: .92rem; margin: -.4rem 0 1.6rem; }
.release { padding: 1.8rem 0; border-top: 1px solid var(--rule); }
.release:first-child { padding-top: .4rem; border-top: 0; }
.rel-head { display: flex; align-items: baseline; gap: .75rem; flex-wrap: wrap; }
h2.ver {
  margin: 0; padding: .1rem .55rem; border: 1px solid var(--rule); border-radius: 6px;
  background: var(--card); color: var(--aqua);
  font-family: var(--mono); font-variation-settings: normal; font-size: 1.05rem; font-weight: 700;
  line-height: 1.5; letter-spacing: 0;
}
.rel-date { color: var(--muted); font-size: .88rem; }
/* Tag messages carry long unbroken words (a/b/c/d option lists, paths): they
   wrap rather than widen the page on a phone. */
.rel-notes { margin-top: .5rem; color: var(--ink-2); overflow-wrap: anywhere; }
.rel-notes h3.section, .dl-title {
  font-family: var(--mono); font-size: .76rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .08em; margin: 1.2rem 0 .4rem;
}
.rel-notes ul { margin: .25rem 0 .5rem; }
.rel-notes li { margin: .2rem 0; }
.rel-notes p.text { margin: .45rem 0; }
.rel-notes pre.screen {
  background: var(--term); color: var(--t-ink); border-radius: 8px;
  padding: .8rem 1rem; margin: .7rem 0; font-size: .8rem; line-height: 1.6;
  overflow-x: auto; white-space: pre;
}
.links { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; margin-top: .6rem; }
a.btn {
  display: flex; flex-direction: column; gap: .1rem; min-width: 0;
  text-decoration: none; color: var(--ink);
  background: var(--card); border: 1px solid var(--rule); border-radius: 8px; padding: .75rem 1rem;
}
a.btn:hover { border-color: var(--aqua); }
a.btn .t { font-weight: 700; }
a.btn .t::before { content: "→ "; color: var(--aqua); }
a.btn .s { font-family: var(--mono); color: var(--muted); font-size: .78rem; overflow-wrap: anywhere; }
.rel-links { margin-top: .9rem; }
.gh-link { font-size: .9rem; text-decoration: none; }
.gh-link:hover { text-decoration: underline; }

/* The privacy pages (datenschutz.html, datenschutz.en.html): German and
   English, switched by the language bar above the page. */
.langbar {
  display: flex; justify-content: flex-end; gap: .3rem;
  max-width: 920px; margin: 0 auto; padding: .9rem var(--gutter) 0;
  font-family: var(--mono); font-size: .76rem;
}
.langbar a {
  color: var(--muted); text-decoration: none; padding: .15rem .5rem;
  border: 1px solid var(--rule); border-radius: 6px; background: var(--card);
}
.langbar a:hover { color: var(--ink); border-color: var(--aqua); }
.langbar a[aria-current] { color: var(--ink); border-color: var(--aqua); font-weight: 700; }
.langbar + main { padding-top: 1rem; }

@media (max-width: 620px) {
  .toc ol { columns: 1; }
  .links { grid-template-columns: 1fr; }
}

/* Copy button (copy.js) on a command block with data-copy. Its room is
   reserved here whether or not the script runs, so the button appearing
   moves nothing; the button itself exists only when copying can work. */
[data-copy] { position: relative; padding-right: 4.6rem; }
.copybtn {
  position: absolute; top: .45rem; right: .45rem; min-width: 3.9rem;
  font: 600 .72rem/1 "JetBrains Mono", ui-monospace, monospace; letter-spacing: .02em;
  color: var(--t-ink); background: transparent; cursor: pointer; user-select: none;
  border: 1px solid color-mix(in srgb, var(--t-ink) 35%, transparent); border-radius: 6px; padding: .4rem .5rem;
}
.copybtn:hover { border-color: var(--t-aqua); color: var(--t-aqua); }
.copybtn:focus-visible { outline: 2px solid var(--t-aqua); outline-offset: 2px; }
.copybtn.done { color: var(--t-aqua); border-color: var(--t-aqua); }
.copystatus { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
