/*
 * One stylesheet, no framework, no remote font.
 *
 * Light is defined on bare `:root` and dark is a `prefers-color-scheme`
 * override of the SAME tokens — never a colour whose only definition lives
 * inside the media query, because that renders as an unstyled default for
 * anyone whose OS reports no preference.
 */

:root {
  --bg: #fbfbfa;
  --bg-raised: #fff;
  --bg-code: #f2f1ee;
  --ink: #16150f;
  --ink-soft: #55534a;
  --line: #e0ded7;
  --accent: #1c5e4a;
  --accent-ink: #fff;
  --focus: #1c5e4a;

  --measure: 46rem;
  --page: 68rem;
  --mono:
    ui-monospace, "SF Mono", "SFMono-Regular", Menlo, Consolas,
    "Liberation Mono", monospace;
  --sans:
    system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #100f0d;
    --bg-raised: #1a1917;
    --bg-code: #1e1d1a;
    --ink: #f2f1ec;
    --ink-soft: #a8a49a;
    --line: #302e2a;
    --accent: #6fd3ac;
    --accent-ink: #0d1a15;
    --focus: #6fd3ac;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 3px;
}

code {
  font-family: var(--mono);
  font-size: 0.9em;
}

h1,
h2,
h3 {
  line-height: 1.2;
  text-wrap: balance;
}

/* ── page frame ──────────────────────────────────────────────────────────── */

.bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: center;
  justify-content: space-between;
  max-width: var(--page);
  padding: 1.25rem 1.5rem;
  margin-inline: auto;
}

.bar nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: center;
}

.wordmark {
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
  text-decoration: none;
}

.cta {
  padding: 0.35rem 0.9rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent-ink);
  text-decoration: none;
  background: var(--accent);
  border-radius: 999px;
}

main {
  max-width: var(--page);
  padding: 1rem 1.5rem 4rem;
  margin-inline: auto;
}

footer.bar {
  font-size: 0.9rem;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
}

footer.bar a {
  color: var(--ink-soft);
}

/* ── hero ────────────────────────────────────────────────────────────────── */

.hero {
  padding-block: clamp(2rem, 6vw, 4.5rem) 3rem;
}

.hero h1 {
  max-width: var(--measure);
  margin: 0 0 1rem;
  font-size: clamp(2rem, 1.35rem + 3.2vw, 3.4rem);
  letter-spacing: -0.025em;
}

.lede {
  max-width: var(--measure);
  margin: 0 0 2.25rem;
  font-size: 1.1em;
  color: var(--ink-soft);
}

.fineprint {
  max-width: var(--measure);
  margin: 1.5rem 0 0;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

/* ── the command ─────────────────────────────────────────────────────────── */

.command {
  position: relative;
  margin: 0 0 1.25rem;
  overflow: hidden;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.command figcaption {
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
  background: var(--bg-code);
  border-bottom: 1px solid var(--line);
}

.command pre {
  padding: 1.1rem 1rem;
  margin: 0;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: clamp(0.8rem, 0.7rem + 0.45vw, 0.95rem);
  line-height: 1.65;
  -webkit-user-select: all;
  /*
   * The no-JavaScript copy affordance: one click (or one Cmd-A inside the
   * block) selects the whole command rather than a word of it.
   */
  user-select: all;
}

.command.output pre {
  color: var(--ink-soft);
}

/*
 * Injected by copy.js and therefore styled here rather than there — a button
 * that only exists when the script ran cannot leave a dead control on the page
 * when it did not.
 */
.copy-button {
  position: absolute;
  top: 0.45rem;
  right: 0.6rem;
  padding: 0.25rem 0.7rem;
  font: inherit;
  font-size: 0.8rem;
  color: var(--ink-soft);
  cursor: pointer;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.copy-button:hover {
  color: var(--ink);
  border-color: var(--ink-soft);
}

/* ── facts ───────────────────────────────────────────────────────────────── */

.facts h2,
.doors h2 {
  margin: 0 0 1.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.facts ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 2rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.facts h3,
.doors h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}

.facts p,
.doors p {
  margin: 0;
  font-size: 0.98rem;
  color: var(--ink-soft);
}

.facts,
.doors {
  padding-block: 2.5rem;
  border-top: 1px solid var(--line);
}

/* ── doors ───────────────────────────────────────────────────────────────── */

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

.door-grid article {
  padding: 1.4rem;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.door-grid code {
  overflow-wrap: anywhere;
}

/* Placed after `.doors p` so equal specificity resolves in its favour. */
.doors .links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
  font-family: var(--mono);
  font-size: 0.9rem;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}
