/*
 * One stylesheet for three pages.
 *
 * No webfont, no icon set, nothing from anywhere — see the header of
 * `src/http/static.ts`. The typeface is the system one, because a
 * webfont on a registration page sends every visitor's address to a
 * third country before they have read the first sentence, and this
 * product is sold on that not happening.
 */

:root {
  --ground: #fbfaf8;
  --card: #ffffff;
  --ink: #15181c;
  --ink-quiet: #5b6470;
  --rule: #e2e0dc;
  --accent: #1f5c4d;
  --accent-ground: #edf4f1;
  --warn: #8a4b16;
  --warn-ground: #fdf3e8;
  --bad: #8c2d2d;
  --bad-ground: #fbeeee;
  --radius: 10px;
}

* { box-sizing: border-box; }

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

.page {
  max-width: 62rem;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

header.top { border-bottom: 1px solid var(--rule); background: var(--card); }
header.top .page { padding-block: 1rem; display: flex; gap: 1rem; align-items: baseline; flex-wrap: wrap; }
header.top .brand { font-weight: 650; letter-spacing: -0.01em; }
header.top nav { margin-left: auto; display: flex; gap: 1.25rem; }
header.top a { color: var(--ink-quiet); text-decoration: none; }
header.top a:hover { color: var(--accent); text-decoration: underline; }

h1 { font-size: clamp(1.7rem, 1.2rem + 2vw, 2.6rem); line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 0.75rem; text-wrap: balance; }
h2 { font-size: 1.3rem; letter-spacing: -0.01em; margin: 2.5rem 0 0.75rem; text-wrap: balance; }
h3 { font-size: 1rem; margin: 1.5rem 0 0.5rem; }
p { max-width: 42rem; }
.lead { font-size: 1.1rem; color: var(--ink-quiet); max-width: 44rem; }

.card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
}

.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }

table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.scroller { overflow-x: auto; }
th, td { text-align: left; padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--rule); }
th { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-quiet); font-weight: 600; }
td.num, th.num { text-align: right; }

form { display: grid; gap: 0.75rem; max-width: 30rem; }
label { display: grid; gap: 0.3rem; font-size: 0.9rem; color: var(--ink-quiet); }
label.inline { grid-auto-flow: column; justify-content: start; gap: 0.5rem; align-items: center; }
label.inline input { width: auto; }

input, select, textarea {
  font: inherit;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--card);
  color: var(--ink);
}
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
textarea { min-height: 7rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85rem; }

button {
  font: inherit;
  font-weight: 600;
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}
button.secondary { background: transparent; color: var(--accent); }
button.destructive { border-color: var(--bad); background: transparent; color: var(--bad); }
button[disabled] { opacity: 0.55; cursor: progress; }
/* A link that starts a sign-in looks like the action it is. */
a.button {
  display: inline-block;
  font-weight: 600;
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}

code, .secret {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  background: var(--accent-ground);
  padding: 0.1em 0.35em;
  border-radius: 5px;
  overflow-wrap: anywhere;
}
.secret { display: block; padding: 0.7rem 0.8rem; font-size: 0.95rem; }

.note { border-radius: var(--radius); padding: 0.85rem 1rem; margin: 1rem 0; max-width: 42rem; }
.note.ok { background: var(--accent-ground); border: 1px solid var(--accent); }
.note.warn { background: var(--warn-ground); border: 1px solid var(--warn); color: var(--warn); }
.note.bad { background: var(--bad-ground); border: 1px solid var(--bad); color: var(--bad); }

.quiet { color: var(--ink-quiet); font-size: 0.9rem; }
.foot { margin-top: 3.5rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); color: var(--ink-quiet); font-size: 0.9rem; }
[hidden] { display: none !important; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #101316;
    --card: #171b1f;
    --ink: #e9ecef;
    --ink-quiet: #a0a9b4;
    --rule: #2a3037;
    --accent: #6ec2a8;
    --accent-ground: #16241f;
    --warn: #e0a566;
    --warn-ground: #2a2013;
    --bad: #e88a8a;
    --bad-ground: #2a1616;
  }
  :root:not([data-theme="light"]) button,
  :root:not([data-theme="light"]) a.button { color: #0d1114; }
}
