/* One left-aligned reading column; the tree figure is the page's one strong element. */
:root {
  --bg: #f5f7f4;        /* paper with a slight green bias */
  --fg: #18211d;        /* ink */
  --muted: #56635c;     /* secondary text */
  --rule: #d5ddd7;      /* hairlines and the figure's edge */
  --panel: #ebf0ec;     /* the tree and the command */
  --accent: #1d6b57;    /* links and branch names */
  --policy: #8a4b12;    /* the one policy line */

  --font-text: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-code: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, monospace;

  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: clamp(1.6rem, 1.2rem + 1.8vw, 2.25rem);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101513;
    --fg: #e2e8e4;
    --muted: #9aa8a0;
    --rule: #2a3530;
    --panel: #18201c;
    --accent: #6cc4a8;
    --policy: #e3a15f;
    color-scheme: dark;
  }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: var(--step-0) / 1.6 var(--font-text);
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

main, footer {
  max-width: 44rem;
  margin-inline: auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

main {
  display: grid;
  gap: 3rem;
  padding-block: clamp(3rem, 8vw, 6rem) 3rem;
}

.intro { display: grid; gap: 1rem; }

.name {
  margin: 0;
  font: 600 var(--step-1) / 1 var(--font-code);
  color: var(--accent);
  letter-spacing: -0.01em;
}

h1 {
  margin: 0;
  font-size: var(--step-2);
  line-height: 1.2;
  font-weight: 650;
  letter-spacing: -0.02em;
  text-wrap: balance;
  max-width: 30ch;
}

.lede {
  margin: 0;
  max-width: 60ch;
  color: var(--muted);
  font-size: 1.0625rem;
}

h2 {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

section p { margin: 0; max-width: 64ch; }

pre {
  margin: 0;
  font: 0.9375rem / 1.55 var(--font-code);
  overflow-x: auto;
  background: var(--panel);
  border-radius: 6px;
}

.tree { margin: 0; display: grid; gap: 0.75rem; min-width: 0; }

.tree pre {
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--rule);
}

.tree .node { color: var(--accent); font-weight: 600; }
.tree .note { color: var(--muted); }
.tree .policy { color: var(--policy); }

.tree figcaption {
  color: var(--muted);
  font-size: 0.9375rem;
  max-width: 60ch;
}

.command { padding: 0.875rem 1.25rem; margin-bottom: 0.75rem; }

.aside { color: var(--muted); font-size: 0.9375rem; }

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

a:hover { text-decoration-thickness: 2px; }

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

.links {
  list-style: none;
  margin: 0;
  padding: 1.5rem 0 0;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.75rem;
}

footer {
  padding-block: 0 3rem;
  color: var(--muted);
  font-size: 0.875rem;
}

footer p { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
