/* RedLine — minimal, always light: white, ink, one red rule. Geist for text, Geist Mono for numbers and code. */
:root {
  --bg: #ffffff;
  --subtle: #fafafa;
  --surface: #ffffff;
  --ink: #111113;
  --ink-2: #3f3f46;
  --muted: #71717a;
  --faint: #a1a1aa;
  --line: #ebebed;
  --line-strong: #dcdce0;
  --hover: #f4f4f5;
  --red: #e5383b;
  --red-ink: #b42326;
  --red-soft: #fdeeee;
  --ok: #15803d;
  --ok-soft: #ecfdf3;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --bar: #111113;
  --shadow-sm: 0 1px 2px rgb(16 16 20 / 5%);
  --shadow-md: 0 8px 24px rgb(16 16 20 / 8%), 0 1px 2px rgb(16 16 20 / 4%);
  --shadow-lg: 0 24px 64px rgb(16 16 20 / 16%);
  --radius: 10px;
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 14px/1.6 var(--font); -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; text-wrap: balance; font-weight: 600; letter-spacing: -0.02em; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; }
code, .mono { font-family: var(--mono); font-size: 0.92em; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--red-soft); }

.wrap {
  max-width: 1120px; margin-inline: auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

/* Brand */
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; font-size: 15px; letter-spacing: -0.01em; text-decoration: none; white-space: nowrap; }
.brand::before { content: ""; width: 22px; height: 22px; border-radius: 6px; background: url("/brand/mark.svg") center / contain no-repeat; flex: none; }
.brand small { font-weight: 400; font-size: 13px; color: var(--muted); letter-spacing: 0; margin-left: -3px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); font: 500 13.5px var(--font);
  text-decoration: none; cursor: pointer; white-space: nowrap; box-shadow: var(--shadow-sm);
  transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { background: var(--hover); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-primary:hover { background: #2a2a2e; }
.btn-danger { color: var(--red-ink); }
.btn-danger:hover { background: var(--red-soft); border-color: #f5c2c3; }
.btn-danger.solid { background: var(--red); color: #fff; border-color: var(--red); }
.btn-danger.solid:hover { background: var(--red-ink); }
.btn-ghost { border-color: transparent; box-shadow: none; background: none; }
.btn-ghost:hover { background: var(--hover); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn-lg { height: 42px; padding: 0 18px; font-size: 14.5px; }

/* Text bits */
.label { font-size: 12.5px; color: var(--muted); }
.eyebrow { font-size: 12px; font-weight: 500; color: var(--red-ink); letter-spacing: 0.02em; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 13px; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-sm); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-head h2, .card-head h3 { font-size: 14px; }
.card-body { padding: 20px; }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 999px;
  font-size: 12px; font-weight: 500; border: 1px solid var(--line); color: var(--ink-2); background: var(--subtle); white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--faint); }
.badge.ok { background: var(--ok-soft); border-color: #c6ecd3; color: var(--ok); }
.badge.ok::before { background: var(--ok); }
.badge.warn { background: var(--warn-soft); border-color: #fde3a7; color: var(--warn); }
.badge.warn::before { background: var(--warn); }
.badge.bad { background: var(--red-soft); border-color: #f5c2c3; color: var(--red-ink); }
.badge.bad::before { background: var(--red); }
.badge.plain::before { display: none; }

/* Inputs */
.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; font-weight: 500; }
.field small { color: var(--muted); font-size: 12.5px; }
input[type="text"], input[type="email"], input[type="number"], select {
  height: 38px; width: 100%; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); font: 14px var(--font); box-shadow: var(--shadow-sm);
}
input:focus, select:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgb(17 17 19 / 8%); }
.check { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.check:hover { background: var(--subtle); }
.check input { width: 16px; height: 16px; accent-color: var(--ink); margin: 0; }
.check code { font-size: 12.5px; color: var(--muted); }

/* Tables */
.tbl { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 500; font-size: 12.5px; background: var(--subtle); }
tbody tr:last-child td { border-bottom: 0; }
th.n { text-align: right; }
td.n { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 13px; }
td.m { font-family: var(--mono); color: var(--muted); font-size: 12.5px; }

/* Code blocks */
pre.code {
  margin: 0; padding: 16px 18px; background: #0f0f11; color: #e6e6ea; border-radius: var(--radius);
  font: 12.5px/1.75 var(--mono); overflow-x: auto;
}
pre.code .c { color: #7a7a85; }
pre.code .s { color: #f3b4b5; }

/* Legal pages */
.legal-head { border-bottom: 1px solid var(--line); }
.legal-head .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.legal { max-width: 700px; padding-block: 56px 88px; }
.legal h1 { font-size: 32px; letter-spacing: -0.03em; }
.legal .meta { color: var(--muted); font-size: 13px; margin-top: 8px; }
.legal .tldr { margin-top: 28px; padding: 16px 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--subtle); font-size: 14px; }
.legal .tldr ul { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 4px; }
.legal h2 { font-size: 17px; margin-top: 40px; scroll-margin-top: 20px; }
.legal p, .legal li { color: var(--ink-2); font-size: 15px; line-height: 1.75; }
.legal p { margin-top: 12px; }
.legal ul { padding-left: 20px; margin-top: 10px; display: grid; gap: 6px; }
.legal table { margin-top: 14px; font-size: 14px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; border-collapse: separate; border-spacing: 0; }
.legal td { white-space: normal; vertical-align: top; }

/* Footer */
.site-foot { border-top: 1px solid var(--line); padding-block: 48px 40px; color: var(--muted); font-size: 13px; background: var(--subtle); }
.foot-grid { display: grid; grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr)); gap: 32px; }
.foot-grid h4 { margin: 0 0 12px; font-size: 13px; font-weight: 500; color: var(--ink); }
.foot-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.foot-grid a { text-decoration: none; }
.foot-grid a:hover { color: var(--ink); }
.foot-base { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); }
@media (max-width: 760px) { .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

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