/*
 * Knickknacks: minimalist, after Daniel Raubenheimer's "Covid-19 Mobile
 * Registration Form" (light and dark). Big bold grotesque headings, muted
 * grey body copy, fully rounded fields that sit flat on the page (no borders,
 * no shadows), and one outlined pill button. Light and dark follow the
 * visitor's system setting.
 */

:root {
  color-scheme: light;
  --bg: #F4F5F7;
  --field: #FFFFFF;
  --ink: #16181B;
  --muted: #6B7077;
  --faint: #9AA0A6;
  --line: #DDE0E5;
  --neg: #C8412B;
  --pos: #1F7A55;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #1E2124;
    --field: #464B51;
    --ink: #F2F3F5;
    --muted: #A9AEB5;
    --faint: #8B9097;
    --line: #3A3F45;
    --neg: #FF8A70;
    --pos: #6FD3A6;
  }
}

* { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 16px; line-height: 1.5;
  min-height: 100dvh; display: flex; flex-direction: column;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---------- layout ---------- */
.page { width: 100%; max-width: 760px; margin: 0 auto; padding: 8px 20px 56px; flex: 1; }
/* a public form has no nav: a centred, phone-sized column */
body.public .page { max-width: 520px; padding-top: 40px; }
/* signed-out screens keep the nav's edges and limit how wide their text runs */
.measure { max-width: 480px; }
.foot { text-align: center; color: var(--faint); font-size: 12px; padding: 0 20px 28px; }

.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 760px; width: 100%; margin: 0 auto; padding: 22px 20px 12px; }
.brand { font-weight: 700; letter-spacing: -.03em; font-size: 19px; text-decoration: none; }
.nav nav { display: flex; align-items: center; gap: 20px; font-size: 14px; }
.nav nav a, .nav nav .link { color: var(--muted); text-decoration: none; font-weight: 500; }
.nav nav a.on, .nav nav a:hover, .nav nav .link:hover { color: var(--ink); }
.nav form { display: contents; }

.flash { max-width: 720px; margin: 16px auto 0; width: calc(100% - 40px); padding: 14px 20px; border-radius: 22px; font-size: 14px; line-height: 1.5; background: var(--field); overflow-wrap: anywhere; }
.flash.notice { color: var(--pos); }
.flash.alert { color: var(--neg); }

/* ---------- type ---------- */
h1, .title { font-size: 34px; line-height: 1.08; font-weight: 700; letter-spacing: -.035em; margin: 28px 0 14px; }
h2 { font-size: 19px; font-weight: 700; letter-spacing: -.02em; margin: 40px 0 14px; }
.lede { color: var(--muted); font-size: 15px; max-width: 34em; margin-bottom: 28px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.note { color: var(--faint); font-size: 12.5px; max-width: 30em; margin-top: 18px; }
code, .mono { font-family: var(--mono); font-size: .92em; }

/* ---------- buttons ---------- */
.btn, button.btn, input[type=submit].btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 32px; border-radius: 999px; cursor: pointer; text-decoration: none; white-space: nowrap;
  background: transparent; color: var(--ink); border: 1.5px solid var(--ink);
  font-weight: 700; font-size: 16px; letter-spacing: -.01em;
}
.btn:hover { background: var(--ink); color: var(--bg); }
.btn.solid { background: var(--ink); color: var(--bg); }
.btn.solid:hover { opacity: .88; }
.btn.sm { height: 36px; padding: 0 18px; font-size: 14px; }
.btn.block { width: 100%; }
.btn.quiet { border-color: var(--line); color: var(--muted); font-weight: 500; }
.btn.quiet:hover { border-color: var(--ink); background: transparent; color: var(--ink); }
.btn.danger { color: var(--neg); border-color: var(--neg); }
.btn.danger:hover { background: var(--neg); color: var(--bg); }
.link { background: none; border: 0; padding: 0; cursor: pointer; font-size: 14px; color: var(--muted); }
.link:hover { color: var(--ink); }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row form { display: contents; }

/* ---------- fields ---------- */
.field { margin-bottom: 18px; }
.label { display: block; font-size: 14px; font-weight: 500; margin: 0 0 8px 20px; }
.label .req { color: var(--faint); font-weight: 400; font-size: 12px; margin-left: 6px; }
.help { color: var(--faint); font-size: 12.5px; margin: 6px 0 0 20px; }
.error { color: var(--neg); font-size: 13px; margin: 6px 0 0 20px; }

.input, select.input, textarea.input {
  display: block; width: 100%; height: 52px; padding: 0 22px; border: 0; border-radius: 999px;
  background: var(--field); color: var(--ink); font-size: 16px; appearance: none; -webkit-appearance: none;
}
select.input {
  padding-right: 48px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%239AA0A6' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 22px center;
}
textarea.input { height: auto; min-height: 128px; padding: 16px 22px; border-radius: 26px; resize: vertical; line-height: 1.45; }
.input::placeholder { color: var(--faint); }
.input:focus, .stepper:focus-within, .chip:has(input:focus-visible) { outline: 1.5px solid var(--ink); outline-offset: 2px; }
.field.bad .input, .field.bad .stepper { outline: 1.5px solid var(--neg); outline-offset: 2px; }
.stepper .input, .field.bad .stepper .input { outline: none; }
legend.label { padding: 0; float: none; width: auto; }
input[type=date].input { min-height: 52px; }

/* the "− 37 +" control */
.stepper { display: flex; align-items: center; height: 52px; border-radius: 999px; background: var(--field); padding: 0 8px; }
.stepper .input { background: transparent; text-align: center; padding: 0 4px; height: 100%; -moz-appearance: textfield; }
.stepper .input::-webkit-outer-spin-button, .stepper .input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper button { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; }
.stepper button:hover { color: var(--ink); background: var(--bg); }

/* pill choices: single, multiple, yes/no, rating */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { position: relative; display: inline-flex; align-items: center; min-height: 48px; padding: 0 22px; border-radius: 999px; background: var(--field); cursor: pointer; font-size: 15px; user-select: none; }
.chip input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.chip:has(input:checked) { background: var(--ink); color: var(--bg); font-weight: 500; }
.chip.round { width: 52px; height: 52px; padding: 0; justify-content: center; }
.honey { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- surfaces ---------- */
.card { background: var(--field); border-radius: 26px; padding: 20px 24px; }
.stack { display: grid; gap: 12px; }
a.card { display: block; text-decoration: none; }
a.card:hover { outline: 1.5px solid var(--ink); }
.pill { display: inline-flex; align-items: center; height: 26px; padding: 0 12px; border-radius: 999px; background: var(--field); color: var(--muted); font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.pill.open { color: var(--pos); }
.pill.warn { color: var(--neg); }

.formrow, a.card.formrow { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.formrow .t { font-weight: 700; letter-spacing: -.02em; font-size: 18px; overflow: hidden; text-overflow: ellipsis; }
.formrow .s { color: var(--muted); font-size: 13.5px; margin-top: 2px; }

.linkbox { display: flex; align-items: center; gap: 10px; background: var(--field); border-radius: 999px; padding: 6px 6px 6px 22px; }
.linkbox code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }

.qa { display: grid; gap: 4px; padding: 14px 0; border-top: 1px solid var(--line); }
.qa:first-child { border-top: 0; }
.qa .q { color: var(--muted); font-size: 13px; }
.qa .a { overflow-wrap: anywhere; white-space: pre-wrap; }
.rhead { display: flex; justify-content: space-between; color: var(--faint); font-size: 12.5px; margin-bottom: 4px; }

.tally { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 14px; align-items: center; font-size: 14px; }
.bar { grid-column: 1 / -1; height: 6px; border-radius: 99px; background: var(--bg); overflow: hidden; margin-bottom: 8px; }
.bar i { display: block; height: 100%; background: var(--ink); border-radius: 99px; }

.prompt { background: var(--field); border-radius: 26px; padding: 18px 22px; font-family: var(--mono); font-size: 12.5px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 320px; overflow: auto; }
.secret { background: var(--field); border-radius: 26px; padding: 16px 22px; display: grid; gap: 10px; }
.secret code { overflow-wrap: anywhere; }
.keyrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.keyrow:first-child { border-top: 0; }
.keyrow form { display: contents; }

.hero { padding: 28px 0 8px; }
.hero h1 { font-size: 44px; margin-top: 12px; }
.tool { display: grid; gap: 8px; }
.tool h3 { font-size: 22px; font-weight: 700; letter-spacing: -.03em; }
.steps { counter-reset: s; display: grid; gap: 14px; padding: 0; list-style: none; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 30px 1fr; gap: 10px; color: var(--muted); font-size: 15px; }
.steps li::before { content: counter(s); width: 26px; height: 26px; border-radius: 50%; background: var(--field); display: grid; place-items: center; font-size: 12.5px; font-weight: 700; color: var(--ink); }
.steps b { color: var(--ink); font-weight: 500; }

.stepdots { display: flex; gap: 6px; margin: 28px 0 0; }
.stepdots span { width: 28px; height: 4px; border-radius: 4px; background: var(--line); }
.stepdots span.on { background: var(--ink); }
.code { letter-spacing: .4em; text-align: center; font-family: var(--mono); }

.doc h2 { margin-top: 36px; }
.doc p, .doc li { color: var(--muted); margin-bottom: 10px; font-size: 15px; max-width: 40em; }
.doc pre { background: var(--field); border-radius: 22px; padding: 16px 20px; font-family: var(--mono); font-size: 12.5px; line-height: 1.6; overflow-x: auto; margin: 12px 0 20px; color: var(--ink); }
.doc table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.doc th { text-align: left; color: var(--faint); font-weight: 500; font-size: 12px; padding: 8px 10px 8px 0; }
.doc td { padding: 10px 10px 10px 0; border-top: 1px solid var(--line); color: var(--muted); vertical-align: top; }
.doc td:first-child { font-family: var(--mono); color: var(--ink); white-space: nowrap; }
.scroll { overflow-x: auto; }

@media (min-width: 720px) {
  h1, .title { font-size: 40px; }
  .hero h1 { font-size: 60px; }
}
