/* One stylesheet, tokens first, so light and dark are one set of decisions. */
:root {
  --bg: #ffffff;
  --panel: #f6f7f9;
  --ink: #16181d;
  --muted: #5b616e;
  --line: #e3e6ea;
  --accent: #7a3ea3;
  --accent-ink: #ffffff;
  --warn-bg: #fff7ed;
  --warn-line: #f0c191;
  --code-bg: #f2f3f5;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a;
    --panel: #1c1f25;
    --ink: #e9ebef;
    --muted: #9aa2b1;
    --line: #2c313a;
    --accent: #c78ae8;
    --accent-ink: #1a1020;
    --warn-bg: #2a1f14;
    --warn-line: #6b4a26;
    --code-bg: #23272e;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 8px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 6px; }

header.site, main, footer.site { max-width: 60rem; margin: 0 auto; padding: 0 1.25rem; }
header.site {
  display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; align-items: baseline;
  padding-top: 1.5rem; padding-bottom: 1.5rem;
}
.brand { font-weight: 700; text-decoration: none; color: var(--ink); margin-right: auto; }
header.site nav { display: flex; flex-wrap: wrap; gap: 1rem; }
header.site nav a { color: var(--muted); text-decoration: none; }
header.site nav a:hover { color: var(--ink); }
header.site nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }

main { padding-bottom: 3rem; }
h1 { font-size: 2rem; line-height: 1.2; margin: 1rem 0 .5rem; }
h2 { font-size: 1.3rem; margin: 2.5rem 0 .5rem; }
h3 { font-size: 1.05rem; margin: 1.5rem 0 .35rem; }
p, li { color: var(--ink); }
.lede { font-size: 1.1rem; color: var(--muted); }
.fine { font-size: .85rem; color: var(--muted); }
a { color: var(--accent); }

.hero { padding: 1rem 0 .5rem; }
.hero h1 { font-size: 2.25rem; }
.cta {
  display: inline-block; margin: .5rem .5rem .5rem 0; padding: .6rem 1.1rem;
  background: var(--accent); color: var(--accent-ink); border-radius: 8px;
  text-decoration: none; font-weight: 600;
}
.cta.ghost { background: transparent; color: var(--accent); border: 1px solid var(--line); }

ul.ticks, ul.crosses { list-style: none; padding-left: 0; }
ul.ticks li, ul.crosses li { padding-left: 1.6rem; position: relative; margin: .4rem 0; }
ul.ticks li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
ul.crosses li::before { content: "—"; position: absolute; left: 0; color: var(--muted); }
ol.steps li { margin: .5rem 0; }

pre {
  background: var(--code-bg); border: 1px solid var(--line); border-radius: 8px;
  padding: 1rem; overflow-x: auto;
}
code { background: var(--code-bg); padding: .1em .35em; border-radius: 4px; font-size: .92em; }
pre code { background: none; padding: 0; }
kbd {
  background: var(--panel); border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 4px; padding: .05em .4em; font-size: .85em;
}

.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: 34rem; margin: 1rem 0; }
th, td { text-align: left; vertical-align: top; padding: .6rem .75rem; border-bottom: 1px solid var(--line); }
th { font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
td:first-child { white-space: nowrap; }

/* The figure scrolls rather than shrinking. Below about 30rem the cookie names
   stop being readable, and an illegible diagram is worse than a scrollbar. */
.figure { margin: 1.5rem 0; overflow-x: auto; }
.figure svg { width: 100%; min-width: 30rem; height: auto; display: block; }
.figure figcaption { font-size: .85rem; color: var(--muted); margin-top: .6rem; }

.warn {
  background: var(--warn-bg); border: 1px solid var(--warn-line);
  border-radius: 10px; padding: .25rem 1.25rem 1rem; margin: 1.5rem 0;
}
.warn h2, .warn h3 { margin-top: 1.25rem; }

footer.site { border-top: 1px solid var(--line); padding-top: 1.5rem; padding-bottom: 3rem; color: var(--muted); }
footer.site a { color: var(--muted); }
footer.site p { margin: .4rem 0; font-size: .9rem; }

@media (max-width: 34rem) {
  .hero h1 { font-size: 1.7rem; }
  h1 { font-size: 1.6rem; }
}
