:root {
  --bg: #fafaf8; --fg: #0a0a0a; --fg-muted: #6b6b66;
  --rule: #e8e6df; --accent: #c84e1a; --ok: #2d5a3e; --warn: #b8860b;
  --font-display: "Inter Tight", "Söhne", system-ui, sans-serif;
  --font-body: -apple-system, "Helvetica Neue", sans-serif;
  --font-mono: "IBM Plex Mono", "JetBrains Mono", ui-monospace, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111110; --fg: #f0eee6; --fg-muted: #8a8a82;
    --rule: #2a2926; --accent: #e26534; --ok: #5a8d6e; --warn: #d4a534;
  }
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  background: var(--bg); color: var(--fg); font-family: var(--font-body);
  font-size: 17px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
body { padding: 24px; max-width: 720px; margin: 0 auto 0 24px; }
@media (min-width: 768px) { body { padding: 40px; margin: 0 auto 0 64px; } }
@media (min-width: 1024px) { body { margin: 0 auto 0 96px; } }
::selection { background: var(--fg); color: var(--bg); }

nav.topbar {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--font-mono); font-size: 16px;
  margin-bottom: 64px; padding-bottom: 16px; border-bottom: 1px solid var(--rule);
}
nav.topbar .nameplate { font-weight: 500; }
nav.topbar .nameplate a { color: var(--fg); text-decoration: none; }
nav.topbar .links a { color: var(--fg); text-decoration: none; margin-left: 16px; }
nav.topbar .links a:hover { color: var(--accent); text-decoration: underline; }

h1.hero {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(40px, 8vw, 64px); line-height: 1.1; letter-spacing: -0.02em;
  margin-bottom: 24px;
}
h1.hero .dot { color: var(--accent); }
p.subhead {
  font-family: var(--font-display); font-weight: 400; font-size: 24px;
  line-height: 1.3; color: var(--fg-muted); margin-bottom: 48px;
}

pre.terminal {
  font-family: var(--font-mono); font-size: 15px; line-height: 1.6;
  background: var(--fg); color: var(--bg); padding: 24px; border-radius: 4px;
  overflow-x: auto; margin-bottom: 64px; white-space: pre;
  position: relative;
}
pre.terminal .prompt { color: var(--fg-muted); user-select: none; }
pre.terminal .ok { color: #5a8d6e; }
pre.terminal .num { color: #d4a534; }
pre.terminal .total { color: var(--bg); font-weight: 500; }
/* Selection inside terminals: invert back so text stays readable. Need both selectors:
   `::selection` (no space) for direct text inside <pre>, ` ::selection` (space) for spans. */
pre.terminal::selection,
pre.terminal ::selection { background: var(--bg); color: var(--fg); }

/* Copy button — auto-injected by inline JS for any <pre class="terminal" data-copy="..."> */
pre.terminal .copy-btn {
  position: absolute; top: 10px; right: 10px;
  font-family: var(--font-mono); font-size: 12px; line-height: 1;
  background: transparent; color: var(--bg);
  border: 1px solid var(--bg); border-radius: 3px;
  padding: 5px 10px; cursor: pointer;
  opacity: 0.45; user-select: none;
  transition: opacity 100ms ease, background 100ms ease, color 100ms ease;
}
pre.terminal:hover .copy-btn { opacity: 0.8; }
pre.terminal .copy-btn:hover,
pre.terminal .copy-btn:focus-visible { opacity: 1; background: var(--bg); color: var(--fg); }
pre.terminal .copy-btn[data-state="copied"] { opacity: 1; }

h2 {
  font-family: var(--font-display); font-weight: 700; font-size: 32px;
  line-height: 1.3; letter-spacing: -0.01em; margin-bottom: 24px;
}
h3 {
  font-family: var(--font-display); font-weight: 700; font-size: 22px;
  line-height: 1.3; margin-bottom: 12px; margin-top: 32px;
}
section { margin-bottom: 80px; }
section p { margin-bottom: 16px; max-width: 640px; }
section a {
  color: var(--fg); text-decoration: underline;
  text-decoration-color: var(--rule); text-underline-offset: 3px;
}
section a:hover { color: var(--accent); text-decoration-color: var(--accent); }

ol.steps { list-style: none; counter-reset: step; }
ol.steps li {
  counter-increment: step; position: relative; padding-left: 40px;
  margin-bottom: 24px; max-width: 640px;
}
ol.steps li::before {
  content: counter(step) ".";
  position: absolute; left: 0; top: 0;
  font-family: var(--font-mono); font-size: 17px; color: var(--fg-muted);
}
ol.steps strong { font-weight: 500; }

ul.pushbacks { list-style: none; max-width: 640px; }
ul.pushbacks li {
  padding: 16px 0; border-top: 1px solid var(--rule);
  display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: baseline;
}
ul.pushbacks li:last-child { border-bottom: 1px solid var(--rule); }
ul.pushbacks .reflex {
  font-family: var(--font-mono); font-size: 14px; color: var(--fg-muted);
  text-decoration: line-through;
}
ul.pushbacks .pick { font-weight: 500; }
ul.pushbacks .why { display: block; color: var(--fg-muted); font-size: 15px; margin-top: 4px; }

.signup {
  border: 1px solid var(--rule); border-radius: 4px;
  padding: 24px; margin-bottom: 24px; max-width: 640px;
}
.signup h3 { margin-top: 0; margin-bottom: 8px; }
.signup p { color: var(--fg-muted); font-size: 15px; margin-bottom: 16px; }
.signup form { display: flex; gap: 8px; flex-wrap: wrap; }
.signup input[type=email] {
  flex: 1; min-width: 200px;
  font-family: var(--font-mono); font-size: 14px;
  background: transparent; color: var(--fg);
  border: 1px solid var(--rule); border-radius: 4px;
  padding: 10px 12px;
}
.signup input[type=email]:focus { outline: none; border-color: var(--fg); }
.signup button {
  font-family: var(--font-mono); font-size: 14px;
  background: transparent; color: var(--fg); border: 1px solid var(--fg);
  padding: 10px 20px; border-radius: 4px; cursor: pointer;
  transition: background 100ms, color 100ms;
}
.signup button:hover { background: var(--fg); color: var(--bg); }
.signup.primary { border-color: var(--accent); }
.signup.primary button { background: var(--accent); border-color: var(--accent); color: #fff; }
.signup.primary button:hover { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.signup button:disabled { opacity: 0.6; cursor: progress; }
.signup-status { margin-top: 12px; font-size: 14px; color: var(--fg-muted); }

.install-tools { margin: 24px 0; }
.install-tools summary { cursor: pointer; font-weight: 500; padding: 8px 0; color: var(--fg-muted); }
.install-tools summary:hover { color: var(--fg); }
.install-tools[open] summary { color: var(--fg); }
.tool-table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 14px; }
.tool-table th, .tool-table td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.tool-table th { color: var(--fg-muted); font-weight: 500; }
.tool-table code { font-size: 13px; }

.principles { list-style: none; }
.principles li {
  padding: 32px 0; border-top: 1px solid var(--rule);
  scroll-margin-top: 24px;
}
.principles li:last-child { border-bottom: 1px solid var(--rule); }
.principles .num {
  font-family: var(--font-mono); font-size: 14px; color: var(--fg-muted);
  display: block; margin-bottom: 8px;
}
.principles h3 {
  font-family: var(--font-display); font-weight: 700; font-size: 28px;
  line-height: 1.2; margin: 0 0 16px 0; letter-spacing: -0.01em;
}
.principles h3 a { color: var(--fg); text-decoration: none; }
.principles h3 a:hover { color: var(--accent); }
.principles p { color: var(--fg-muted); margin-bottom: 12px; }
.principles p:last-child { margin-bottom: 0; }

.tip {
  font-family: var(--font-mono); font-size: 13px; color: var(--fg-muted);
  border-left: 2px solid var(--rule); padding: 8px 0 8px 16px;
  margin-bottom: 24px; max-width: 640px;
}

footer {
  font-family: var(--font-mono); font-size: 14px; color: var(--fg-muted);
  padding-top: 24px; padding-bottom: 48px; border-top: 1px solid var(--rule);
  display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between;
}
footer a { color: var(--fg-muted); text-decoration: none; }
footer a:hover { color: var(--accent); }

*:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
