:root {
  --paper: #f4efe6;
  --paper-2: #ebe5d8;
  --ink: #1b1a1f;
  --ink-2: #48453f;
  --muted: #6f6a61;
  --line: rgba(27, 26, 31, .16);
  --line-strong: rgba(27, 26, 31, .42);
  --dot: rgba(27, 26, 31, .11);
  --accent: #b8400f;
  --accent-hi: #e8551c;
  --on-accent: #fff8f2;
  --term-bg: #1f2430;
  --term-fg: #d9dde6;
  --term-dim: rgba(217, 221, 230, .55);
  --term-line: rgba(217, 221, 230, .38);
  --term-blue: #7cc4f0;
  --term-green: #8bd17c;
  --shadow: 0 40px 80px -40px rgba(27, 26, 31, .55);
  --radius: 6px;
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #131418;
    --paper-2: #1b1c22;
    --ink: #ebe6db;
    --ink-2: #c6c0b3;
    --muted: #9a948a;
    --line: rgba(235, 230, 219, .14);
    --line-strong: rgba(235, 230, 219, .42);
    --dot: rgba(235, 230, 219, .10);
    --accent: #ff7a3d;
    --accent-hi: #ff6a2e;
    --on-accent: #1b1a1f;
    --term-bg: #0d0f14;
    --term-line: rgba(217, 221, 230, .3);
    --shadow: 0 40px 80px -40px rgba(0, 0, 0, .9);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration-color: var(--line-strong); text-underline-offset: .18em; }
a:hover { text-decoration-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
code, pre, kbd { font-family: var(--font-mono); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; margin: 0; }
.wrap { width: min(1180px, 100% - 2rem); margin-inline: auto; }
.mono { font-family: var(--font-mono); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- top bar ---------- */
.top { border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 0; }
.brand { display: flex; align-items: center; gap: .55rem; font-family: var(--font-mono); font-weight: 600; font-size: 1rem; text-decoration: none; letter-spacing: -.01em; }
.brand svg { width: 20px; height: 20px; flex: none; }
.ver { font-size: .74rem; font-weight: 500; color: var(--accent); border: 1px solid currentColor; padding: .05em .5em; border-radius: 999px; margin-left: .2rem; }
.top nav { display: flex; gap: 1.3rem; font-family: var(--font-mono); font-size: .84rem; }
.top nav a { text-decoration: none; color: var(--ink-2); }
.top nav a:hover, .top nav a[aria-current="page"] { color: var(--accent); }
.top nav .sep, footer nav .sep { width: 1px; height: 1.1em; background: var(--line-strong); align-self: center; }
@media (max-width: 640px) { .top nav .opt { display: none; } }

/* ---------- hero ---------- */
.hero { position: relative; padding: clamp(3rem, 7vw, 6rem) 0 clamp(3rem, 6vw, 5rem); overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(var(--dot) 1px, transparent 1.2px);
  background-size: 26px 26px;
  -webkit-mask-image: linear-gradient(to bottom, #000 40%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 40%, transparent 100%);
}
.hero .wrap { position: relative; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
@media (max-width: 940px) { .hero .wrap { grid-template-columns: minmax(0, 1fr); } }
.term-col { min-width: 0; }
.eyebrow { display: flex; align-items: center; gap: .75rem; font-family: var(--font-mono); font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.eyebrow::before { content: ""; width: 2rem; height: 1px; background: currentColor; }
h1 {
  font-size: clamp(2.7rem, 6.2vw, 4.9rem);
  line-height: .98; letter-spacing: -.025em;
  font-variation-settings: "opsz" 144, "SOFT" 30;
  margin: 1.1rem 0 1.4rem; text-wrap: balance;
}
h1 em { font-style: italic; font-weight: 300; color: var(--accent); }
.lead { font-size: clamp(1.05rem, 1.5vw, 1.2rem); color: var(--ink-2); max-width: 33rem; margin: 0 0 2rem; }
.lead strong { font-weight: 500; color: var(--ink); }

.install-hero { display: flex; align-items: center; gap: .7rem; background: var(--ink); color: var(--paper); border-radius: var(--radius); padding: .85rem 1rem; font-family: var(--font-mono); font-size: .92rem; overflow: hidden; position: relative; }
.install-hero .p { color: var(--accent-hi); user-select: none; }
.install-hero code { white-space: pre-wrap; overflow-wrap: anywhere; flex: 1; }
.install-hero .copy { color: var(--paper); border-color: rgba(255,255,255,.25); background: transparent; margin: 0; }
.install-hero .copy:hover { background: rgba(255,255,255,.1); }
.alts { font-family: var(--font-mono); font-size: .78rem; color: var(--muted); margin: .8rem 0 0; }
.alts a { color: var(--ink-2); }
.cta { display: flex; gap: .8rem; margin-top: 1.7rem; flex-wrap: wrap; }
.btn { font-family: var(--font-mono); font-size: .88rem; padding: .7rem 1.15rem; border: 1px solid var(--ink); border-radius: var(--radius); text-decoration: none; transition: transform .15s ease, background .15s ease, color .15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: var(--accent-hi); border-color: var(--accent-hi); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent); border-color: var(--accent); }
.btn.ghost:hover { background: var(--ink); color: var(--paper); }
.uses { list-style: none; margin: 2.4rem 0 0; padding: 1.2rem 0 0; border-top: 1px solid var(--line); display: grid; gap: .55rem; max-width: 33rem; }
.uses li { display: grid; grid-template-columns: 8.5rem 1fr; gap: 1rem; font-size: .92rem; color: var(--ink-2); }
.uses b { font-family: var(--font-mono); font-weight: 500; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); padding-top: .2em; }
@media (max-width: 480px) { .uses li { grid-template-columns: 1fr; gap: .1rem; } }

/* ---------- terminal ---------- */
.term-col { margin-top: clamp(0rem, 2vw, 1.5rem); }
.term { background: var(--term-bg); color: var(--term-fg); border-radius: 10px; box-shadow: var(--shadow), 0 0 0 1px rgba(255,255,255,.06) inset; font-family: var(--font-mono); font-size: 12px; line-height: 1.5; overflow: hidden; }
.term-bar { display: flex; align-items: center; gap: .45rem; padding: .6rem .9rem; background: rgba(255,255,255,.035); border-bottom: 1px solid rgba(255,255,255,.08); font-size: 11px; color: var(--term-dim); }
.term-bar i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.16); }
.term-bar i:nth-child(1) { background: #ff5f57; } .term-bar i:nth-child(2) { background: #febc2e; } .term-bar i:nth-child(3) { background: #28c840; }
.term-bar span { margin-left: auto; margin-right: auto; }
.term-body { padding: 1rem 1.1rem 1.15rem; overflow-x: auto; }
.ln { white-space: pre; min-height: 1.5em; }
.ln.dim { color: var(--term-dim); }
.ln.b { font-weight: 600; }
.ln.gap { height: .8em; min-height: 0; }
.arrow { color: var(--term-green); }
.cmd-text { color: var(--term-blue); display: inline-block; vertical-align: bottom; overflow: hidden; white-space: nowrap; width: 61ch; }
.bar { display: inline-block; width: 16ch; height: .75em; vertical-align: -1px; background: rgba(255,255,255,.08); border-radius: 2px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 100%; background: var(--term-blue); }
.tt { border-collapse: collapse; margin: .3rem 0; }
.tt td { border: 1px solid var(--term-line); padding: .05rem .7rem; white-space: nowrap; }
.tt td + td { text-align: left; }
.row { display: flex; gap: 1.1rem; flex-wrap: wrap; align-items: flex-start; }
.u { text-decoration: underline; text-underline-offset: .15em; }
.ok { color: var(--term-green); font-weight: 600; }
.tip { color: var(--term-dim); font-style: italic; }
.cur { display: inline-block; width: .6ch; height: 1.1em; vertical-align: -2px; background: var(--term-fg); margin-left: .1ch; }
.fig { font-family: var(--font-mono); font-size: .76rem; color: var(--muted); margin: .9rem 0 0 .2rem; }
.fig b { color: var(--accent); font-weight: 600; margin-right: .5rem; }

/* animation timeline: every animated element sets --d, its start delay */
.a { opacity: 0; animation: ln-in .32s ease-out forwards; animation-delay: var(--d, 0s); }
.cmd-text { width: 0; animation: type 1.3s steps(61, end) .35s forwards; }
.bar i { width: 0; animation: fill 1s steps(16, end) 2.35s forwards; }
.cur { animation: blink 1s steps(2, start) infinite; }
@keyframes ln-in { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
@keyframes type { to { width: 61ch; } }
@keyframes fill { to { width: 100%; } }
@keyframes blink { to { visibility: hidden; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .a, .cmd-text, .bar i { animation: none; opacity: 1; }
  .cmd-text { width: 61ch; } .bar i { width: 100%; }
  .btn:hover { transform: none; }
}

/* ---------- sections ---------- */
.sec { padding: clamp(3rem, 7vw, 5.5rem) 0; border-top: 1px solid var(--line); }
.sec-head { display: grid; grid-template-columns: auto 1fr; gap: .6rem 2rem; align-items: baseline; margin-bottom: 2.4rem; }
.idx { font-family: var(--font-mono); font-size: .78rem; color: var(--accent); letter-spacing: .12em; }
.sec h2 { font-size: clamp(1.9rem, 3.4vw, 2.7rem); letter-spacing: -.02em; line-height: 1.05; font-variation-settings: "opsz" 72, "SOFT" 20; max-width: 22ch; text-wrap: balance; }
.sec-head p { grid-column: 2; color: var(--muted); max-width: 46rem; margin: 0; font-size: 1.02rem; }
@media (max-width: 640px) { .sec-head { grid-template-columns: 1fr; } .sec-head p { grid-column: 1; } }

.cells { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.cells.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* stacked rows: text on the left, command on the right */
.cells.stack { grid-template-columns: minmax(0, 1fr); }
.cells.stack .cell { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); grid-template-rows: auto auto 1fr; gap: .5rem clamp(1.5rem, 4vw, 3.5rem); align-items: start; padding: 1.7rem 1.6rem 1.8rem; }
.cells.stack .cell .cmd { grid-column: 2; grid-row: 1 / span 3; align-self: center; margin-top: 0; }
@media (max-width: 860px) {
  .cells.stack .cell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; }
  .cells.stack .cell .cmd { grid-column: 1; grid-row: auto; margin-top: .9rem; }
}
@media (max-width: 900px) { .cells:not(.stack) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 580px) { .cells, .cells.two { grid-template-columns: 1fr; } }
.cell { background: var(--paper); padding: 1.5rem 1.4rem 1.6rem; transition: background .2s ease; display: flex; flex-direction: column; gap: .5rem; }
.cell:hover { background: var(--paper-2); }
.cell .flag { font-family: var(--font-mono); font-size: .78rem; color: var(--accent); margin-bottom: .35rem; }
.cell h3 { font-size: 1.28rem; font-weight: 500; letter-spacing: -.01em; line-height: 1.2; font-variation-settings: "opsz" 40; }
.cell p { margin: 0; color: var(--ink-2); font-size: .95rem; flex: 1; }
.cell .cmd { margin-top: .9rem; }

.cmd { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .6rem; align-items: start; background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem .6rem .75rem .95rem; font-family: var(--font-mono); font-size: .84rem; line-height: 1.65; margin: 0; overflow: hidden; }
.cmd code { display: block; white-space: pre-wrap; overflow-wrap: anywhere; }
.cell:hover .cmd { background: var(--paper); }
.cmd .c { color: var(--muted); }
.cmd .p { color: var(--accent); user-select: none; }
.cmd .k { color: var(--accent); }
.copy { margin-top: -.15rem; font: 500 .68rem/1 var(--font-mono); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); background: var(--paper); border: 1px solid var(--line); border-radius: 4px; padding: .35rem .5rem; cursor: pointer; transition: color .15s, border-color .15s; }
.copy:hover { color: var(--accent); border-color: var(--accent); }
.copy.done { color: var(--accent); border-color: var(--accent); }

/* install */
.src { margin-top: 2rem; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 1rem 2rem; align-items: start; }
@media (max-width: 860px) { .src { grid-template-columns: 1fr; } }
.src p { margin: 0; color: var(--ink-2); font-size: .95rem; }
.src p a { white-space: nowrap; }

/* footer */
footer { border-top: 1px solid var(--line); }
footer .wrap { display: flex; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap; padding: 2.4rem 0 3rem; font-family: var(--font-mono); font-size: .8rem; color: var(--muted); }
footer nav { display: flex; gap: 1.2rem; flex-wrap: wrap; }
footer a { text-decoration: none; color: var(--ink-2); }
footer a:hover { color: var(--accent); }

/* ============================================================
   Docs page (docs/template.html, rendered by microdocs)
   ============================================================ */
.docs { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: clamp(2rem, 5vw, 4.5rem); padding: 2.5rem 0 4.5rem; align-items: start; }
@media (max-width: 860px) { .docs { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; } }
.side { position: sticky; top: 1.25rem; font-family: var(--font-mono); font-size: .8rem; }
@media (max-width: 860px) { .side { position: static; } }
.doc-title { font-family: var(--font-mono); font-weight: 600; font-size: .95rem; letter-spacing: .04em; color: var(--ink); margin: 0 0 1.2rem; padding-bottom: .9rem; border-bottom: 1px solid var(--line); }
.toc-toggle { display: none; width: 100%; text-align: left; font: inherit; letter-spacing: .12em; text-transform: uppercase; font-size: .72rem; color: var(--muted); background: none; border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .8rem; cursor: pointer; }
.toc-toggle::after { content: "+"; float: right; }
.toc-toggle[aria-expanded="true"]::after { content: "–"; }
.toc-title { letter-spacing: .12em; text-transform: uppercase; font-size: .72rem; color: var(--muted); margin: 0 0 .6rem; }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc a { display: block; padding: .28rem 0 .28rem .8rem; border-left: 1px solid var(--line); text-decoration: none; color: var(--ink-2); line-height: 1.35; }
.toc a:hover { color: var(--accent); }
.toc a.active { color: var(--accent); border-left-color: var(--accent); }
.toc .h3 a { padding-left: 1.7rem; font-size: .76rem; color: var(--muted); }
.toc .h3 a.active { color: var(--accent); }
@media (max-width: 860px) {
  .toc-toggle { display: block; }
  .toc-title { display: none; }
  .toc { display: none; margin-top: .6rem; }
  .toc.open { display: block; }
}
.doc[hidden] { display: none; }
.build { font-size: .74rem; }

/* rendered markdown */
.prose { font-size: 1rem; line-height: 1.65; min-width: 0; }
.prose > :first-child { margin-top: 0; }
.prose h1 { font-size: clamp(2.2rem, 4vw, 3rem); line-height: 1.05; letter-spacing: -.02em; font-variation-settings: "opsz" 96, "SOFT" 20; margin: 0 0 1.2rem; }
.prose h2 { font-size: 1.75rem; line-height: 1.15; letter-spacing: -.015em; font-variation-settings: "opsz" 48; margin: 2.8rem 0 1rem; padding-top: 1.6rem; border-top: 1px solid var(--line); }
.prose h3 { font-size: 1.25rem; font-weight: 500; line-height: 1.25; font-variation-settings: "opsz" 40; margin: 2rem 0 .7rem; }
.prose h4 { font-family: var(--font-mono); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 1.6rem 0 .5rem; }
.prose h1, .prose h2, .prose h3, .prose h4 { scroll-margin-top: 1.5rem; }
.prose p { margin: 0 0 1rem; }
.prose a { color: var(--accent); text-decoration-color: rgba(184, 64, 15, .35); }
.prose a:hover { text-decoration-color: currentColor; }
.prose ul, .prose ol { margin: 0 0 1rem; padding-left: 1.3rem; }
.prose li { margin: .3rem 0; }
.prose li > p { margin: 0; }
.prose strong { font-weight: 600; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
.prose blockquote { margin: 1.2rem 0; padding: .2rem 1rem; border-left: 2px solid var(--accent); color: var(--ink-2); }
.prose img { max-width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--line); box-shadow: var(--shadow); margin: .5rem 0 1.5rem; }
.prose code { font-size: .86em; background: var(--paper-2); border: 1px solid var(--line); border-radius: 4px; padding: .08em .35em; }
.prose h1 code, .prose h2 code, .prose h3 code { font-size: .8em; }
.prose pre { margin: 0 0 1.3rem; background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; font-size: .84rem; line-height: 1.6; overflow-x: auto; }
.prose pre code { background: none; border: 0; padding: 0; font-size: inherit; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 1.5rem; font-size: .92rem; }
.prose th { font-family: var(--font-mono); font-weight: 500; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); text-align: left; }
.prose th, .prose td { padding: .55rem .7rem .55rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose td:first-child code { white-space: nowrap; }

/* Pygments tokens (pymdownx.highlight, css_class "highlight") */
.highlight .c, .highlight .c1, .highlight .cm { color: var(--muted); font-style: italic; }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sb { color: var(--accent); }
.highlight .k, .highlight .kd, .highlight .kn, .highlight .nb { font-weight: 600; }
.highlight .o, .highlight .p, .highlight .se { color: var(--ink-2); }
.highlight .nt { color: var(--accent); }
.highlight .na, .highlight .nv { color: var(--ink-2); }
