/* Canopy documentation — light-first palette, dark defined by overriding tokens
   only. Every colour has its definition on bare :root, so a viewer with no
   explicit choice and no OS preference still gets a complete palette. */

:root {
  --bg: #ffffff;
  --bg-sunken: #f6f7f8;
  --bg-raised: #ffffff;
  --bg-code: #f4f6f7;
  --bg-hover: #eef0f2;
  --line: #e3e6e8;
  --line-soft: #eceef0;
  --tx: #16191c;
  --tx-2: #4a5157;
  --tx-3: #757d85;
  --accent: #0d8b93;
  --accent-2: #0a6f76;
  --accent-dim: #e6f5f6;
  --amber: #a2650c;
  --amber-dim: #fdf3e2;
  --red: #b5382f;
  --red-dim: #fdeeec;
  --green: #17794a;
  --green-dim: #e9f6ef;
  --shadow: 0 1px 2px rgba(16, 24, 32, 0.06), 0 8px 24px rgba(16, 24, 32, 0.07);
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --hd-h: 54px;
  --side-w: 268px;
  --toc-w: 214px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16181b;
    --bg-sunken: #121417;
    --bg-raised: #1d2024;
    --bg-code: #14171a;
    --bg-hover: #24282d;
    --line: #2a2e34;
    --line-soft: #22262b;
    --tx: #e8eaec;
    --tx-2: #b0b6bd;
    --tx-3: #838b93;
    --accent: #5cc7cd;
    --accent-2: #8bdbdf;
    --accent-dim: #16323a;
    --amber: #e6ad5f;
    --amber-dim: #2f2618;
    --red: #e8796d;
    --red-dim: #331d1c;
    --green: #55c98a;
    --green-dim: #162c22;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px rgba(0, 0, 0, 0.45);
    color-scheme: dark;
  }
}

/* Same values again for an explicit dark choice, so the toggle wins in both
   directions (nested @media is supported, but a plain block is safer here). */
:root[data-theme="dark"] {
  --bg: #16181b;
  --bg-sunken: #121417;
  --bg-raised: #1d2024;
  --bg-code: #14171a;
  --bg-hover: #24282d;
  --line: #2a2e34;
  --line-soft: #22262b;
  --tx: #e8eaec;
  --tx-2: #b0b6bd;
  --tx-3: #838b93;
  --accent: #5cc7cd;
  --accent-2: #8bdbdf;
  --accent-dim: #16323a;
  --amber: #e6ad5f;
  --amber-dim: #2f2618;
  --red: #e8796d;
  --red-dim: #331d1c;
  --green: #55c98a;
  --green-dim: #162c22;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--hd-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--tx);
  font: 15px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 8px; top: 8px; z-index: 50; background: var(--bg-raised); padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; }

/* ── header ─────────────────────────────────────────────────────────── */
.hd {
  position: sticky; top: 0; z-index: 30;
  height: var(--hd-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 18px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--tx); font-weight: 650; letter-spacing: -0.2px; }
.brand:hover { text-decoration: none; }
.brandmark { flex: none; }
.brand__d { color: var(--tx-3); font-weight: 500; margin-left: 6px; }
.ver { font: 500 11px/1 var(--mono); color: var(--tx-3); border: 1px solid var(--line); border-radius: 999px; padding: 4px 8px; }
.search { position: relative; margin-left: auto; display: flex; align-items: center; gap: 7px; width: min(340px, 42vw); padding: 0 10px; height: 32px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg-sunken); color: var(--tx-3); }
.search input { flex: 1; min-width: 0; border: 0; background: none; color: var(--tx); font: 13px var(--sans); outline: none; }
.results { position: absolute; top: 38px; right: 0; width: min(460px, 84vw); max-height: 60vh; overflow: auto; background: var(--bg-raised); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; }
.results a { display: block; padding: 8px 10px; border-radius: 8px; color: var(--tx); }
.results a:hover, .results a.on { background: var(--bg-hover); text-decoration: none; }
.results b { display: block; font-size: 13.5px; font-weight: 600; }
.results span { display: block; font-size: 12px; color: var(--tx-3); }
.results .none { padding: 12px; font-size: 13px; color: var(--tx-3); }
.ib { display: inline-grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg-sunken); color: var(--tx-2); cursor: pointer; }
.ib:hover { background: var(--bg-hover); color: var(--tx); }
.ib--menu { display: none; }
.ic-moon { display: none; }
:root[data-theme="dark"] .ic-sun { display: none; }
:root[data-theme="dark"] .ic-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ic-sun { display: none; }
  :root:not([data-theme="light"]) .ic-moon { display: block; }
}

/* ── shell ──────────────────────────────────────────────────────────── */
.shell { display: flex; align-items: flex-start; }
.side {
  position: sticky; top: var(--hd-h);
  width: var(--side-w); flex: none;
  height: calc(100vh - var(--hd-h));
  overflow-y: auto;
  padding: 20px 12px 60px 18px;
  border-right: 1px solid var(--line);
}
.navgrp { margin-bottom: 18px; }
.navgrp__t { margin: 0 0 6px 8px; font: 600 11px/1 var(--sans); letter-spacing: 0.06em; text-transform: uppercase; color: var(--tx-3); }
.navgrp ul { list-style: none; margin: 0; padding: 0; }
.navgrp li a { display: block; padding: 5px 9px; border-radius: 7px; color: var(--tx-2); font-size: 13.5px; }
.navgrp li a:hover { background: var(--bg-hover); color: var(--tx); text-decoration: none; }
.navgrp li a.on { background: var(--accent-dim); color: var(--accent); font-weight: 600; }

.main { flex: 1; min-width: 0; display: flex; gap: 30px; align-items: flex-start; padding: 34px 30px 80px; }
.doc { flex: 1; min-width: 0; max-width: 860px; }
.toc { position: sticky; top: calc(var(--hd-h) + 34px); width: var(--toc-w); flex: none; max-height: calc(100vh - var(--hd-h) - 70px); overflow-y: auto; }
.toc__t { margin: 0 0 8px; font: 600 11px/1 var(--sans); letter-spacing: 0.06em; text-transform: uppercase; color: var(--tx-3); }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc li a { display: block; padding: 4px 10px; font-size: 12.5px; color: var(--tx-3); }
.toc li a:hover { color: var(--tx); text-decoration: none; }
.toc li.lv3 a { padding-left: 22px; font-size: 12px; }
.toc li a.on { color: var(--accent); box-shadow: -1px 0 0 0 var(--accent); }

/* ── prose ──────────────────────────────────────────────────────────── */
.doc h1 { margin: 0 0 10px; font-size: 33px; line-height: 1.2; letter-spacing: -0.7px; font-weight: 680; }
.doc h2 { margin: 42px 0 12px; padding-top: 14px; border-top: 1px solid var(--line-soft); font-size: 22px; line-height: 1.3; letter-spacing: -0.35px; font-weight: 660; }
.doc h3 { margin: 28px 0 8px; font-size: 16.5px; font-weight: 640; }
.doc h4 { margin: 22px 0 6px; font-size: 14px; font-weight: 640; color: var(--tx-2); }
.doc p { margin: 0 0 14px; color: var(--tx-2); }
.doc h1 + p { font-size: 16.5px; color: var(--tx-2); }
.doc strong { color: var(--tx); font-weight: 630; }
.doc ul, .doc ol { margin: 0 0 16px; padding-left: 22px; color: var(--tx-2); }
.doc li { margin: 4px 0; }
.doc li > ul { margin: 4px 0 6px; }
.doc hr { height: 1px; border: 0; background: var(--line); margin: 30px 0; }
.anchor { margin-left: 8px; color: var(--tx-3); opacity: 0; font-weight: 400; }
h2:hover .anchor, h3:hover .anchor, h4:hover .anchor { opacity: 1; }
.doc code { font: 0.875em var(--mono); background: var(--bg-code); border: 1px solid var(--line-soft); border-radius: 5px; padding: 1.5px 5px; color: var(--tx); white-space: nowrap; }
.doc blockquote { margin: 0 0 16px; padding: 2px 0 2px 16px; border-left: 3px solid var(--line); color: var(--tx-3); }
.doc blockquote p:last-child { margin-bottom: 0; }

.code { position: relative; margin: 0 0 18px; background: var(--bg-code); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.code[data-lang]::before { content: attr(data-lang); position: absolute; top: 0; right: 0; padding: 3px 9px; font: 500 10.5px/1.4 var(--mono); color: var(--tx-3); background: var(--bg-sunken); border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); border-bottom-left-radius: 8px; text-transform: lowercase; }
.code pre { margin: 0; padding: 14px 16px; overflow-x: auto; }
/* Specific enough that a skin restyling `.doc code` cannot leak its chip
   background onto every line inside a block. */
.code pre code { font: 12.5px/1.65 var(--mono); background: none; border: 0; padding: 0; white-space: pre; color: var(--tx); }

/* A heading that is entirely a filename (`.worktreemanager.json`) must not
   render as a chip at heading size — it stays type, in the heading's own
   colour. */
.doc h1 code, .doc h2 code, .doc h3 code, .doc h4 code {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font-size: 0.88em;
  font-weight: inherit;
}

.tablewrap { margin: 0 0 18px; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th, td { text-align: left; padding: 9px 13px; border-bottom: 1px solid var(--line-soft); vertical-align: top; color: var(--tx-2); }
th { background: var(--bg-sunken); color: var(--tx); font-weight: 620; font-size: 12.5px; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
td code, th code { white-space: nowrap; }

.callout { margin: 0 0 18px; padding: 13px 16px; border: 1px solid var(--line); border-left-width: 3px; border-radius: 8px; background: var(--bg-sunken); }
.callout p { margin: 0 0 8px; }
.callout p:last-child { margin-bottom: 0; }
.callout__t { font: 620 12px/1 var(--sans); letter-spacing: 0.03em; text-transform: uppercase; }
.callout--note { border-left-color: var(--accent); background: var(--accent-dim); }
.callout--note .callout__t { color: var(--accent-2); }
.callout--tip { border-left-color: var(--green); background: var(--green-dim); }
.callout--tip .callout__t { color: var(--green); }
.callout--warn { border-left-color: var(--amber); background: var(--amber-dim); }
.callout--warn .callout__t { color: var(--amber); }
.callout--danger { border-left-color: var(--red); background: var(--red-dim); }
.callout--danger .callout__t { color: var(--red); }
.callout code { background: color-mix(in srgb, var(--bg) 55%, transparent); }

/* ── screenshots ────────────────────────────────────────────────────── */
.shot { margin: 4px 0 22px; }
/* width/height come from the file's own dimensions (halved for the 2× capture),
   so a small surface shows at its real size and a large one is capped here */
.shot__img { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-sunken); box-shadow: var(--shadow); }
.shot__img--dark { display: none; }
:root[data-theme="dark"] .shot__img--light { display: none; }
:root[data-theme="dark"] .shot__img--dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .shot__img--light { display: none; }
  :root:not([data-theme="light"]) .shot__img--dark { display: block; }
}
/* a figure with only a light capture keeps showing it in dark mode rather than
   collapsing to nothing */
.shot:not(:has(.shot__img--dark)) .shot__img--light { display: block !important; }
.shot figcaption { margin-top: 8px; font-size: 12.5px; color: var(--tx-3); }
.shot--pending .shot__ph { display: grid; place-items: center; height: 180px; border: 1px dashed var(--line); border-radius: 10px; color: var(--tx-3); font-size: 13px; background: var(--bg-sunken); }

/* ── prev / next, footer ────────────────────────────────────────────── */
.pnrow { display: flex; gap: 12px; margin-top: 46px; }
.pn { flex: 1; padding: 12px 15px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-raised); }
.pn:hover { border-color: var(--accent); text-decoration: none; }
.pn span { display: block; font-size: 11.5px; color: var(--tx-3); }
.pn b { color: var(--tx); font-size: 14px; font-weight: 600; }
.pn--next { text-align: right; }
.foot { margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--line-soft); }
.foot p { font-size: 12.5px; color: var(--tx-3); margin: 0; }

/* ── the landing page ───────────────────────────────────────────────── */
.doc--home { max-width: 940px; }
.doc--home h1 { font-size: 42px; line-height: 1.1; letter-spacing: -1.2px; margin-bottom: 14px; }
.doc--home h1 + p { font-size: 18px; line-height: 1.6; max-width: 660px; }
.doc--home h2 { margin-top: 52px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 18px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg-raised); color: var(--tx);
  font-size: 14.5px; font-weight: 600;
}
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.btn--primary:hover { background: var(--accent-2); border-color: var(--accent-2); color: var(--bg); }
.hero-note { font-size: 13px; color: var(--tx-3); margin: 0 0 26px; }
/* the landing page has room for a 2-up grid; four cards in a 3+1 row read
   like one of them was left over */
.doc--home .cards { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

/* ── home page bits ─────────────────────────────────────────────────── */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(228px, 1fr)); gap: 12px; margin: 0 0 22px; }
.card { display: block; padding: 15px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-raised); }
.card:hover { border-color: var(--accent); text-decoration: none; }
.card b { display: block; color: var(--tx); font-size: 14.5px; margin-bottom: 3px; }
.card span { display: block; color: var(--tx-3); font-size: 12.5px; line-height: 1.5; }

@media (max-width: 1180px) { .toc { display: none; } }
@media (max-width: 860px) {
  .ib--menu { display: inline-grid; }
  .side { position: fixed; top: var(--hd-h); left: 0; bottom: 0; background: var(--bg); z-index: 25; transform: translateX(-100%); transition: transform 0.18s ease; }
  .side.open { transform: none; box-shadow: var(--shadow); }
  .main { padding: 24px 18px 60px; }
  .search { width: auto; flex: 1; }
  .ver { display: none; }
}


/* ── skin: studio ─────────────────────────────────── */
/* Skin: studio — the modern product-docs look.
 *
 * Big tight-tracked headings, generous whitespace, high contrast, coloured
 * callout cards, and a soft teal wash behind the header. Closer to how a
 * product markets itself than to how a manual reads. Canopy's teal still does
 * the accenting, so it stays recognisably the same product. */

@font-face {
  font-family: "Inter Variable";
  src: url("assets/fonts/inter-variable-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono Variable";
  src: url("assets/fonts/jetbrains-mono-variable-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --sans: "Inter Variable", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono Variable", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --bg: #ffffff;
  --bg-sunken: #f7f9fa;
  --bg-raised: #ffffff;
  --bg-code: #0f1419;      /* code blocks stay dark in both themes */
  --bg-hover: #eef2f4;
  --line: #e6ebee;
  --line-soft: #f0f3f5;
  --tx: #0b0f14;
  --tx-2: #4a555f;
  --tx-3: #7b868f;
  --accent: #0b8f97;
  --accent-2: #067279;
  --accent-dim: #e0f5f6;
  --amber: #a06a08;
  --amber-dim: #fdf4e3;
  --red: #b8382b;
  --red-dim: #fdeeec;
  --green: #12764a;
  --green-dim: #e7f7ef;
  --shadow: 0 1px 3px rgba(11, 15, 20, 0.06), 0 12px 32px rgba(11, 15, 20, 0.08);
  --hd-h: 60px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1117;
    --bg-sunken: #10161d;
    --bg-raised: #151c24;
    --bg-code: #0a0e13;
    --bg-hover: #1d2630;
    --line: #232d38;
    --line-soft: #1a232c;
    --tx: #f2f6f9;
    --tx-2: #aeb9c4;
    --tx-3: #7d8994;
    --accent: #4fd1d9;
    --accent-2: #8ce4ea;
    --accent-dim: rgba(79, 209, 217, 0.12);
    --amber: #edb765;
    --amber-dim: rgba(237, 183, 101, 0.12);
    --red: #ef8375;
    --red-dim: rgba(239, 131, 117, 0.12);
    --green: #57cd90;
    --green-dim: rgba(87, 205, 144, 0.12);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.5), 0 16px 40px rgba(0, 0, 0, 0.5);
  }
}
:root[data-theme="dark"] {
  --bg: #0d1117;
  --bg-sunken: #10161d;
  --bg-raised: #151c24;
  --bg-code: #0a0e13;
  --bg-hover: #1d2630;
  --line: #232d38;
  --line-soft: #1a232c;
  --tx: #f2f6f9;
  --tx-2: #aeb9c4;
  --tx-3: #7d8994;
  --accent: #4fd1d9;
  --accent-2: #8ce4ea;
  --accent-dim: rgba(79, 209, 217, 0.12);
  --amber: #edb765;
  --amber-dim: rgba(237, 183, 101, 0.12);
  --red: #ef8375;
  --red-dim: rgba(239, 131, 117, 0.12);
  --green: #57cd90;
  --green-dim: rgba(87, 205, 144, 0.12);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.5), 0 16px 40px rgba(0, 0, 0, 0.5);
}

body { font-size: 15.5px; line-height: 1.7; letter-spacing: -0.006em; }

/* a tinted header, the one piece of brand colour on the page */
.hd {
  background: linear-gradient(180deg, var(--accent-dim), color-mix(in srgb, var(--bg) 92%, transparent));
  border-bottom: 1px solid var(--line);
}
.brand { font-size: 16px; font-weight: 680; letter-spacing: -0.02em; }
.ver { border-radius: 999px; background: var(--accent-dim); color: var(--accent-2); border-color: transparent; font-weight: 600; }
.search { border-radius: 10px; height: 36px; box-shadow: var(--shadow); background: var(--bg-raised); }
.ib { border-radius: 10px; width: 36px; height: 36px; background: var(--bg-raised); box-shadow: var(--shadow); }

.side { padding-top: 26px; }
.navgrp__t { font-size: 11px; letter-spacing: 0.08em; font-weight: 700; }
.navgrp li a { border-radius: 8px; font-size: 14px; padding: 6px 11px; font-weight: 500; }
.navgrp li a.on { background: var(--accent-dim); color: var(--accent-2); font-weight: 650; }

/* headings do the work: large, tight, no rules */
.doc h1 { font-size: 44px; line-height: 1.08; letter-spacing: -0.035em; font-weight: 720; margin-bottom: 16px; }
.doc h1 + p { font-size: 19px; line-height: 1.6; color: var(--tx-2); margin-bottom: 34px; }
.doc h2 { font-size: 28px; letter-spacing: -0.025em; font-weight: 690; border-top: 0; padding-top: 0; margin-top: 56px; }
.doc h3 { font-size: 19px; letter-spacing: -0.015em; font-weight: 660; margin-top: 34px; }
.doc p { margin-bottom: 17px; }

/* code blocks are always dark, like a product screenshot of a terminal */
.code { border-radius: 12px; border-color: transparent; box-shadow: var(--shadow); }
.code pre { padding: 18px 20px; }
.code pre code { color: #dbe3ea; font-size: 13px; line-height: 1.7; }
.code[data-lang]::before {
  background: rgba(255, 255, 255, 0.06); color: #93a1ad; border: 0;
  border-radius: 0 12px 0 10px; padding: 5px 12px; font-weight: 600;
}
.doc code { border-radius: 6px; padding: 2px 6px; background: var(--accent-dim); color: var(--accent-2); border: 0; font-weight: 500; }

.tablewrap { border-radius: 12px; box-shadow: var(--shadow); border-color: var(--line-soft); }
th { font-size: 12.5px; letter-spacing: 0.02em; text-transform: uppercase; color: var(--tx-3); }
th, td { padding: 12px 16px; }
table { font-size: 14.5px; }

/* callouts as filled cards with a soft edge */
.callout { border-radius: 12px; border: 1px solid transparent; border-left-width: 4px; padding: 16px 18px; }
.callout__t { font-size: 12px; letter-spacing: 0.05em; font-weight: 700; }
.callout p { font-size: 14.5px; }

.shot__img { border-radius: 12px; box-shadow: var(--shadow); border-color: var(--line-soft); }
.shot figcaption { text-align: center; font-size: 13px; }

.cards { gap: 14px; }
.card { border-radius: 14px; padding: 18px 20px; box-shadow: var(--shadow); border-color: var(--line-soft); }
.card:hover { transform: translateY(-1px); border-color: var(--accent); }
.card b { font-size: 16px; font-weight: 660; letter-spacing: -0.01em; }
.card span { font-size: 13.5px; }
.pn { border-radius: 12px; box-shadow: var(--shadow); border-color: var(--line-soft); }
.pn b { font-size: 15px; font-weight: 640; }

/* ── landing page ─────────────────────────────────────────────────── */
.doc--home h1 { font-size: 56px; line-height: 1.03; letter-spacing: -0.04em; font-weight: 730; }
.doc--home h1 + p { font-size: 21px; line-height: 1.55; }
.btn { border-radius: 12px; padding: 12px 22px; box-shadow: var(--shadow); font-size: 15px; }
.btn--primary { box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 35%, transparent); }
.hero-note { font-size: 13.5px; }
