/* docket.at. Colours follow the apps' Theme (mac/Sources/DocketDesign/Theme.swift): zinc greys, one blue accent. */
:root {
  color-scheme: light dark;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --canvas: #fcfcfc;
  --surface: #ffffff;
  --label: #18181b;
  --muted: #67676f;
  --faint: #a1a1aa;
  --border: #e4e4e7;
  --fill: #f4f4f5;
  --accent: #1b4ed8;
  --link: #1b4ed8;
  --ai: #6d4ae8;
  --code-bg: #18181b;
  --code-text: #f4f4f5;
  --code-muted: #a1a1aa;
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #000000;
    --surface: #111111;
    --label: #f5f5f5;
    --muted: #a3a3a3;
    --faint: #737373;
    --border: rgba(255, 255, 255, .1);
    --fill: rgba(255, 255, 255, .06);
    --accent: #346bf1;
    --link: #7ea2f8;
    --ai: #a48bff;
    --code-bg: #111111;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 16px/1.6 var(--font);
  color: var(--label);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; }

[hidden] { display: none !important; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: 960px; margin: 0 auto; padding: 0 24px; }
/* Reading pages share the header's left edge and keep a readable measure. */
.prose > * { max-width: 680px; }

/* Header and footer */
.top { border-bottom: 1px solid var(--border); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--label); font-weight: 600; font-size: 17px; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand img { width: 28px; height: 28px; }
.nav { display: flex; gap: 4px; }
.nav a { color: var(--muted); font-size: 15px; padding: 6px 10px; border-radius: 8px; }
.nav a:hover { color: var(--label); background: var(--fill); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--label); }

.foot { border-top: 1px solid var(--border); margin-top: 96px; padding: 28px 0 40px; color: var(--muted); font-size: 14px; }
.foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.foot a { color: var(--muted); }
.foot a:hover { color: var(--label); }

/* Type */
h1, h2, h3 { font-weight: 600; line-height: 1.2; letter-spacing: -.02em; margin: 0; }
h1 { font-size: clamp(32px, 6vw, 48px); letter-spacing: -.03em; }
.page h1 { font-size: clamp(30px, 5vw, 38px); }
h2 { font-size: 22px; margin: 56px 0 12px; }
h3 { font-size: 17px; letter-spacing: -.01em; margin: 28px 0 8px; }
p, ul, ol { margin: 0 0 16px; }
ul, ol { padding-left: 22px; }
li { margin: 4px 0; }
li::marker { color: var(--faint); }
.lede { font-size: 19px; color: var(--muted); margin-top: 16px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
strong { font-weight: 600; }

code { font: .875em/1.5 var(--mono); background: var(--fill); padding: 2px 5px; border-radius: 4px; overflow-wrap: anywhere; }
pre {
  margin: 0 0 20px; padding: 16px 18px; border-radius: 12px; overflow-x: auto;
  background: var(--code-bg); color: var(--code-text); border: 1px solid var(--border);
  font: 14px/1.6 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere;
}
pre code { background: none; padding: 0; font: inherit; overflow-wrap: normal; }
pre .p { color: var(--code-muted); user-select: none; }
pre .c { color: var(--code-muted); }

/* Pieces */
.pill {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--muted);
  border: 1px solid var(--border); background: var(--surface); padding: 4px 12px 4px 10px; border-radius: 999px;
}
.pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--ai); }

.buttons { display: flex; flex-wrap: wrap; gap: 12px; margin: 32px 0 0; }
.button {
  display: inline-flex; align-items: center; justify-content: center; height: 44px; padding: 0 20px; border-radius: 10px;
  font-size: 15px; font-weight: 500; background: var(--accent); color: #fff; border: 1px solid transparent;
}
.button:hover { text-decoration: none; filter: brightness(1.08); }
.button.secondary { background: var(--surface); color: var(--label); border-color: var(--border); }
.button.secondary:hover { background: var(--fill); filter: none; }

.hero { padding: 88px 0 24px; }
.hero h1 { margin-top: 24px; max-width: 760px; }
.hero .lede { max-width: 640px; }
.oneliner { margin-top: 48px; max-width: 640px; }
.oneliner pre { margin-bottom: 8px; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 24px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px 22px; }
.card h3 { margin: 0 0 6px; font-size: 16px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }

.steps { list-style: none; padding: 0; counter-reset: step; display: grid; gap: 16px; margin-top: 24px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 32px 1fr; gap: 0 14px; margin: 0; }
.steps li::before {
  content: counter(step); grid-row: span 2; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font-size: 13px; font-weight: 600; background: var(--fill); color: var(--label); margin-top: 1px;
}
.steps strong { display: block; }
.steps span { color: var(--muted); }

.note { border: 1px solid var(--border); background: var(--surface); border-radius: 12px; padding: 16px 20px; margin: 0 0 20px; }
.note p:last-child { margin-bottom: 0; }

.page { padding: 64px 0 0; }
.page .lede { margin-bottom: 8px; }
.updated { color: var(--muted); font-size: 14px; margin-top: 12px; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 28px 0 0; }
.toc li { margin: 0; }
.toc a { display: inline-block; font-size: 14px; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 3px 12px; }
.toc a:hover { color: var(--label); text-decoration: none; background: var(--fill); }
h2[id] { scroll-margin-top: 24px; }

/* Download */
.app { display: flex; gap: 20px; align-items: flex-start; }
.app img { width: 64px; height: 64px; flex: none; }
.app h2 { margin: 2px 0 4px; }
.app p { margin: 0; }
.app .buttons { margin-top: 16px; }
.sha { margin-top: 12px; font: 12px/1.5 var(--mono); color: var(--faint); overflow-wrap: anywhere; }

@media (max-width: 600px) {
  .wrap { padding: 0 20px; }
  .top .wrap { height: 56px; }
  .brand span { display: none; }
  .nav a { padding: 6px 8px; }
  .hero { padding-top: 56px; }
  .lede { font-size: 17px; }
  .page { padding-top: 44px; }
  h2 { margin-top: 44px; }
  pre { font-size: 13px; padding: 14px; }
  .button { flex: 1 1 auto; }
  .app { flex-direction: column; gap: 14px; }
}

/* /stats: Felix's private usage page */
.stats .tablewrap { overflow-x: auto; margin: 0 0 16px; }
.stats table { border-collapse: collapse; font-size: 15px; min-width: 320px; }
.stats th, .stats td { padding: 6px 18px 6px 0; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.stats thead th { color: var(--muted); font-weight: 500; font-size: 14px; }
.stats .num { text-align: right; font-variant-numeric: tabular-nums; padding-right: 0; padding-left: 18px; }
.stats tbody th { font-weight: 400; }
.stats h2 { margin-top: 40px; }

/* /stats: invites and requests */
.stats form.inline { display: inline; margin: 0; }
.stats button { font: inherit; font-size: 14px; padding: 4px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--label); cursor: pointer; }
.stats button:hover { background: var(--fill); }
.stats input:not([type="checkbox"]) { font: inherit; font-size: 14px; padding: 5px 9px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--label); }
.stats input.link { width: 300px; max-width: 100%; font-family: var(--mono); font-size: 12px; }
.stats td, .stats th { vertical-align: top; }
.stats table.invites th, .stats table.invites td { white-space: normal; }
.stats .invite-form { display: grid; gap: 10px; max-width: 420px; }
.stats .invite-form label { display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
.stats .invite-form label.check { display: flex; gap: 8px; align-items: center; }
.stats .invite-form button { justify-self: start; }

/* /request */
.request-form { display: grid; gap: 16px; max-width: 480px; margin-top: 28px; }
.request-form label { display: grid; gap: 6px; font-size: 15px; color: var(--muted); }
.request-form input:not(.hp), .request-form textarea { font: inherit; font-size: 16px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--label); }
.request-form button { justify-self: start; cursor: pointer; }
.request-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* /stats: friend feedback */
.stats .note-card { border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; margin: 0 0 14px; max-width: 680px; background: var(--surface); }
.stats .note-card p { margin: 0 0 8px; }
.stats .note-text { font: inherit; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0 0 10px; }
.stats .thumb { display: block; border: 1px solid var(--border); border-radius: 8px; margin: 0 0 10px; max-width: 100%; height: auto; }
