/*
 * The static pages - privacy notice and terms, imprint, help, "What is KUVRT" (docs/ux-system.md
 * "Public pages") - drawn as part of the app: its colours, type scale, radii and bar, the light
 * theme first as the app, and the dark one where the reader's system asks for it. Plain CSS
 * fetched by name and loading no font: the face is named, and a reader without it gets the
 * system's. The values are those of web/src/styles/tokens.css, which this file cannot import;
 * `scripts/tokens.test.ts` fails on a copied value that differs.
 */
:root {
  color-scheme: light;
  --bg: #f8f6f4;
  --surface: #ffffff;
  --raised: #ffffff;
  --fill: #f1efec;
  --line: #e6e4e1;
  --line-strong: #86837f;
  --text: #13110f;
  --text-muted: #5c5955;
  --accent: #2b2623;
  --on-accent: #ffffff;
  --signal: #a5473a;
  --link: #9b4134;
  --warn: #875503;
  --edge: 0 0 0 1px #e6e4e1;
  font-family: 'Hanken Grotesk', system-ui, sans-serif;
  font-synthesis: none;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #151311;
    --surface: #1b1917;
    --raised: #22201e;
    --fill: #242220;
    --line: #2d2b29;
    --line-strong: #757370;
    --text: #eeeceb;
    --text-muted: #aba9a5;
    --accent: #e8e3df;
    --on-accent: #1b1816;
    --signal: #c8705f;
    --link: #df8f80;
    --warn: #dbaa52;
    --edge: inset 0 1px 0 rgb(255 255 255 / 0.04);
  }
}
* {
  box-sizing: border-box;
}
/* An anchor jumped to lands below the bar that stays at the top. */
html {
  scroll-padding-top: 76px;
}
body {
  margin: 0;
  padding: 0 16px 48px;
  font-size: 16px;
  line-height: 1.55;
  background: var(--bg);
  color: var(--text);
  overflow-wrap: break-word;
}
main {
  max-width: 44rem;
  margin-inline: auto;
}
a {
  color: var(--link);
  text-underline-offset: 0.15em;
}
h1 {
  font-size: 24px;
  line-height: 1.25;
  margin-block: 28px 8px;
}
h2 {
  font-size: 20px;
  line-height: 1.3;
  margin-block: 24px 8px;
}
h3 {
  font-size: 17px;
  line-height: 1.35;
  margin-block: 20px 4px;
}
h4 {
  font-size: 15px;
  color: var(--text-muted);
  margin-block: 16px 4px;
}
p,
ul,
ol {
  margin-block: 8px;
}
ul,
ol {
  padding-inline-start: 1.4em;
}
li + li {
  margin-top: 6px;
}
code {
  font-size: 0.9em;
}

/* A part of a page is a card, as a group of settings is in the app. */
section {
  margin-top: 20px;
  padding: 4px 20px 16px;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--edge);
}
section > h2:first-child {
  margin-top: 16px;
}
@media (max-width: 30rem) {
  section {
    padding: 2px 16px 12px;
  }
}

dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 10px 20px;
  margin: 16px 0;
  padding: 16px 20px;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--edge);
}
dt {
  font-weight: 600;
  color: var(--text-muted);
}
dd {
  margin: 0;
}
@media (max-width: 30rem) {
  dl {
    grid-template-columns: 1fr;
    gap: 2px;
    padding: 14px 16px;
  }
  dd + dt {
    margin-top: 10px;
  }
}

/* A row of links that is still a 44px target on a phone. */
nav.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 20px;
}
nav.links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 600;
  text-decoration: none;
}
@media (hover: hover) {
  nav.links a:hover {
    text-decoration: underline;
  }
}

/*
 * The mark and the name across the top of every page, the app's 60px bar, leading back to the
 * app. The bar's ground runs to both edges of the window without widening the page.
 */
.page-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  height: 60px;
  background: var(--surface);
  /* The ground, then 1px lower the line under it, both out to the window's edges. */
  box-shadow:
    0 0 0 100vmax var(--surface),
    0 1px 0 100vmax var(--line);
  clip-path: inset(0 -100vmax -1px);
}
.page-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--text);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.14em;
  text-decoration: none;
}
.page-brand .logo {
  width: 32px;
  height: 32px;
}
.logo {
  color: var(--text);
  flex: none;
}
.logo-key {
  fill: var(--signal);
}
.page-lead {
  font-size: 17px;
  font-weight: 500;
  color: var(--text-muted);
}
.page-button {
  display: inline-flex;
  align-items: center;
  min-height: 50px;
  padding-inline: 24px;
  border-radius: 12px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  text-decoration: none;
}
.page-footer {
  margin-top: 40px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.page-footer nav.links a {
  color: var(--text-muted);
  font-weight: 400;
}

/* Help (docs/ux-system.md "Help"), made at build time from the app's help content. */
.table {
  overflow-x: auto;
}
table {
  border-collapse: collapse;
  font-size: 14px;
}
th,
td {
  text-align: left;
  vertical-align: top;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
}
.note {
  margin-block: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--fill);
}
.note > :first-child {
  margin-top: 0;
}
.note > :last-child {
  margin-bottom: 0;
}
.note .label,
.label {
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-block-end: 4px;
}
.callout {
  padding: 12px 14px;
  border: 1px solid color-mix(in oklab, var(--warn) 30%, transparent);
  border-radius: 14px;
  background: color-mix(in oklab, var(--warn) 16%, transparent);
  font-size: 15px;
}

/* "What is KUVRT": the way in, set apart from the cards above it. */
.page-cta {
  margin-top: 28px;
}

/*
 * A help question's page: where it sits above its heading, and the questions before and after it
 * with the way back to all of them below its card.
 */
nav.page-trail {
  margin-top: 12px;
  font-size: 14px;
}
nav.page-trail a {
  color: var(--text-muted);
  font-weight: 400;
}
nav.page-trail + h1 {
  margin-top: 4px;
}
nav.page-pager {
  margin-top: 20px;
  justify-content: space-between;
}
