/* SPDX-License-Identifier: Apache-2.0
 * The Moorage website: the console's palette and the logo's colours, a harbour-blue hero, light and dark themes (the
 * visitor's choice, else the system's), the home page, and the documentation's three columns. */

:root {
  --navy: #08264c;
  --navy-2: #0a3a5c;
  --harbour: #0b5a63;
  --teal: #0e8786;
  --mint: #7fd8cf;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --radius: 10px;
  --radius-lg: 16px;
  --header-h: 64px;
  --container: 1200px;

  color-scheme: light;
  --bg: #ffffff;
  --bg-alt: #f5f7f9;
  --surface: #ffffff;
  --sunk: #eef1f4;
  --text: #171b22;
  --muted: #555f6e;
  --heading: #0c1c30;
  --line: #dde1e7;
  --line-strong: #c6ccd5;
  --link: #0b7372;
  --accent: #0b7372;
  --accent-hover: #095c5b;
  --on-accent: #ffffff;
  --accent-soft: #e0f1f0;
  --code-bg: #f3f5f8;
  --code-text: #171b22;
  --t-comment: #5d6876;
  --t-key: #0b7372;
  --t-string: #8a4b00;
  --t-head: #2a5fa3;
  --shadow: 0 1px 2px rgb(20 28 40 / 6%), 0 10px 30px rgb(20 28 40 / 8%);
  --shadow-lg: 0 2px 4px rgb(8 38 76 / 10%), 0 24px 60px rgb(8 38 76 / 18%);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0d1218; --bg-alt: #11171f; --surface: #161c25; --sunk: #1c232d; --text: #e6eaef; --muted: #a6b0bc; --heading: #f4f6f8;
    --line: #29313c; --line-strong: #3a4552; --link: #5fcfc4; --accent: #2fb5a9; --accent-hover: #4cc4b8; --on-accent: #06211f;
    --accent-soft: #12322f; --code-bg: #141a22; --code-text: #e6eaef; --t-comment: #8d98a5; --t-key: #5fcfc4; --t-string: #e3b267; --t-head: #8ab8ef;
    --shadow: 0 1px 2px rgb(0 0 0 / 35%), 0 10px 30px rgb(0 0 0 / 30%); --shadow-lg: 0 2px 4px rgb(0 0 0 / 35%), 0 24px 60px rgb(0 0 0 / 45%);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1218; --bg-alt: #11171f; --surface: #161c25; --sunk: #1c232d; --text: #e6eaef; --muted: #a6b0bc; --heading: #f4f6f8;
  --line: #29313c; --line-strong: #3a4552; --link: #5fcfc4; --accent: #2fb5a9; --accent-hover: #4cc4b8; --on-accent: #06211f;
  --accent-soft: #12322f; --code-bg: #141a22; --code-text: #e6eaef; --t-comment: #8d98a5; --t-key: #5fcfc4; --t-string: #e3b267; --t-head: #8ab8ef;
  --shadow: 0 1px 2px rgb(0 0 0 / 35%), 0 10px 30px rgb(0 0 0 / 30%); --shadow-lg: 0 2px 4px rgb(0 0 0 / 35%), 0 24px 60px rgb(0 0 0 / 45%);
}

/* Whatever comes in two themes: the logo, and screenshots. */
.logo-dark, .shot img.shot-dark { display: none; }
.icon-sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-light, :root:not([data-theme="light"]) .shot img.shot-light { display: none; }
  :root:not([data-theme="light"]) .logo-dark, :root:not([data-theme="light"]) .shot img.shot-dark { display: block; }
  :root:not([data-theme="light"]) .icon-moon { display: none; }
  :root:not([data-theme="light"]) .icon-sun { display: block; }
}
:root[data-theme="dark"] .logo-light, :root[data-theme="dark"] .shot img.shot-light { display: none; }
:root[data-theme="dark"] .logo-dark, :root[data-theme="dark"] .shot img.shot-dark { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }
:root[data-theme="dark"] .icon-sun { display: block; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.65 var(--font); overflow-wrap: break-word; }
img, svg { max-width: 100%; }
img { height: auto; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; border-radius: 3px; }
.hero :focus-visible, .final :focus-visible { outline-color: #fff; }
h1, h2, h3, h4 { color: var(--heading); line-height: 1.2; letter-spacing: -.012em; }
code { font-family: var(--mono); font-size: .88em; }
p code, li code, td code, th code, figcaption code { padding: .12em .34em; background: var(--code-bg); border: 1px solid var(--line); border-radius: 5px; }
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; padding: 8px 14px; background: var(--surface); border-radius: 6px; }
.skip-link:focus { left: 8px; }

/* The header. */
.site-header { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.site-header .container { display: flex; align-items: center; gap: 28px; height: var(--header-h); max-width: 1400px; }
.brand { display: inline-flex; flex: none; }
.brand img { height: 30px; width: auto; }
.site-nav { display: flex; gap: 22px; flex: 1; }
.site-nav a { color: var(--muted); font-size: .95rem; font-weight: 500; white-space: nowrap; }
.site-nav a:hover { color: var(--text); text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--text); font-weight: 600; }
.header-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; padding: 0; color: var(--muted); background: none; border: 0; border-radius: 8px; cursor: pointer; }
.icon-button:hover { color: var(--text); background: var(--sunk); }
.icon-button svg { width: 20px; height: 20px; }
.nav-toggle { display: none; }
.search-button { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 8px 0 10px; color: var(--muted); font: inherit; font-size: .88rem; background: var(--sunk); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; margin-right: 6px; }
.search-button:hover { color: var(--text); border-color: var(--line-strong); }
.search-button svg { width: 16px; height: 16px; }
.search-button kbd { padding: 0 6px; font: 600 .74rem var(--mono); background: var(--surface); border: 1px solid var(--line); border-radius: 4px; }

/* Buttons. */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; color: var(--text); font-size: 1rem; font-weight: 600; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 9px; }
.btn:hover { text-decoration: none; border-color: var(--text); }
.btn-primary { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* The hero. */
.hero { position: relative; color: #fff; background: linear-gradient(165deg, var(--navy) 0%, var(--navy-2) 55%, var(--harbour) 100%); overflow: hidden; padding: 72px 0 0; }
.hero::after { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 50% at 80% 0%, rgb(127 216 207 / 16%), transparent 70%); pointer-events: none; }
.hero .container { position: relative; z-index: 1; }
.hero-text { max-width: 980px; margin: 0 auto; text-align: center; }
.eyebrow { display: inline-flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; color: #cfe2ea; font-size: .92rem; }
.eyebrow:hover { color: #fff; text-decoration: none; }
.pill { padding: 2px 10px; color: #06211f; font-size: .8rem; font-weight: 700; background: var(--mint); border-radius: 99px; }
.hero h1 { margin: 20px 0 18px; color: #fff; font-size: clamp(2.3rem, 5.6vw, 4rem); font-weight: 780; line-height: 1.06; letter-spacing: -.028em; }
.hero h1 .accent { display: block; color: var(--mint); }
.hero p code { color: #fff; background: rgb(255 255 255 / 12%); border-color: rgb(255 255 255 / 22%); }
.lede { margin: 0 auto 26px; max-width: 700px; color: #d6e4ec; font-size: clamp(1.06rem, 1.6vw, 1.22rem); line-height: 1.55; }
.hero .btn { color: #fff; background: rgb(255 255 255 / 8%); border-color: rgb(255 255 255 / 32%); }
.hero .btn:hover { background: rgb(255 255 255 / 15%); border-color: #fff; }
.hero .btn-primary { color: #06211f; background: var(--mint); border-color: var(--mint); }
.hero .btn-primary:hover { background: #a2e6df; border-color: #a2e6df; }
.hero .btn-row { justify-content: center; }
.hero-meta { margin: 20px 0 0; color: #b6cbd7; font-size: .92rem; }
.hero-shot { margin: 48px auto -2px; max-width: 1080px; }
.hero-shot .shot-window { border-color: rgb(255 255 255 / 18%); border-bottom: 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0; box-shadow: 0 30px 80px rgb(2 12 26 / 55%); }

/* Install box. */
.install { max-width: 760px; margin: 28px auto 0; text-align: left; }
.tabs { display: flex; gap: 4px; margin-bottom: -1px; }
.tabs button { padding: 7px 14px; color: #c9dbe6; font: inherit; font-size: .88rem; font-weight: 600; background: none; border: 1px solid transparent; border-bottom: 0; border-radius: 8px 8px 0 0; cursor: pointer; }
.tabs button[aria-selected="true"] { color: #fff; background: rgb(3 15 32 / 55%); border-color: rgb(255 255 255 / 16%); }
.install .code { margin: 0; background: rgb(3 15 32 / 55%); border-color: rgb(255 255 255 / 16%); border-radius: 0 10px 10px 10px; }
.install .code pre { padding-right: 44px; white-space: pre-wrap; overflow-wrap: anywhere; }
.install .code pre code { color: #e8f1f6; }
.install .copy-button { color: #c9dbe6; background: rgb(255 255 255 / 10%); border-color: rgb(255 255 255 / 18%); }
.install [hidden] { display: none; }

/* Sections. */
.section { padding: 84px 0; }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--line); }
.section-head { max-width: 760px; margin: 0 auto 52px; text-align: center; }
.section-head h2 { margin: 8px 0 14px; font-size: clamp(1.8rem, 3.4vw, 2.6rem); font-weight: 750; letter-spacing: -.022em; }
.section-head p { margin: 0; color: var(--muted); font-size: 1.1rem; }
.kicker { color: var(--accent); font-size: .84rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }

/* Three steps. */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; counter-reset: step; }
.step { min-width: 0; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); counter-increment: step; }
.step h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; font-size: 1.12rem; }
.step h3::before { content: counter(step); display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; color: var(--on-accent); font-size: .85rem; background: var(--accent); border-radius: 50%; }
.step p { margin: 0 0 14px; color: var(--muted); font-size: .96rem; }
.step .code { margin: 0; }

/* A terminal. */
.terminal { max-width: 900px; margin: 40px auto 0; background: #0c1219; border: 1px solid #27303b; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; }
.terminal-bar { display: flex; align-items: center; gap: 7px; padding: 11px 16px; background: #161d26; border-bottom: 1px solid #27303b; }
.terminal-bar span { width: 11px; height: 11px; background: #3a4552; border-radius: 50%; }
.terminal-bar b { margin-left: 8px; color: #9aa6b4; font: 500 .8rem var(--mono); }
.terminal pre { margin: 0; padding: 18px 20px; overflow-x: auto; color: #d7dee6; font: .86rem/1.6 var(--mono); }
.terminal .p { color: #7fd8cf; }
.terminal .d { color: #8d98a5; }
.terminal .ok { color: #6ee7a8; font-weight: 700; }

/* Features. */
.feature { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 52px; align-items: center; }
.feature + .feature { margin-top: 88px; }
.feature.reverse .feature-text { order: 2; }
.feature h3 { margin: 6px 0 12px; font-size: clamp(1.45rem, 2.4vw, 1.9rem); font-weight: 720; letter-spacing: -.018em; }
.feature p { margin: 0 0 14px; color: var(--muted); font-size: 1.04rem; }
.feature figure { margin: 0; min-width: 0; }
.checklist { margin: 0 0 16px; padding: 0; list-style: none; }
.checklist li { position: relative; padding: 3px 0 3px 26px; color: var(--muted); font-size: .98rem; }
.checklist li::before { content: ""; position: absolute; left: 3px; top: 11px; width: 12px; height: 7px; border-left: 2.5px solid var(--accent); border-bottom: 2.5px solid var(--accent); transform: rotate(-45deg) translateY(-2px); }
.more-link { font-weight: 600; }
.more-link::after { content: " →"; }

/* Screenshots. */
.shot { position: relative; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; cursor: zoom-in; }
.shot img { width: 100%; }
.shot img.shot-light { display: block; }
.shot-diagram { background: none; box-shadow: none; border: 1px solid var(--line); }
.shot-phone { max-width: 300px; margin: 0 auto; border-radius: 22px; }
.shot-bar { display: flex; gap: 6px; padding: 10px 14px; background: var(--sunk); border-bottom: 1px solid var(--line); }
.shot-bar span { width: 10px; height: 10px; background: var(--line-strong); border-radius: 50%; }
.lightbox { padding: 0; max-width: 96vw; max-height: 96vh; background: none; border: 0; cursor: zoom-out; overflow: auto; }
.lightbox::backdrop { background: rgb(4 10 18 / 82%); }
.lightbox img { display: block; max-width: 96vw; max-height: 96vh; width: auto; height: auto; border-radius: 8px; }
.lightbox-close { position: fixed; top: 12px; right: 12px; z-index: 1; padding: 7px 14px; color: #fff; font: 600 .9rem var(--font); background: rgb(4 10 18 / 80%); border: 1px solid rgb(255 255 255 / 35%); border-radius: 8px; cursor: pointer; }

/* Small cards. */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.card { padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.card h3 { margin: 0 0 8px; font-size: 1.05rem; }
.card p { margin: 0; color: var(--muted); font-size: .96rem; }
.card a { color: inherit; }

/* Fit, and where it stands. */
.fit { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.fit > div { padding: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.fit h3 { margin: 0 0 12px; font-size: 1.2rem; }
.fit ul { margin: 0; padding-left: 20px; color: var(--muted); }
.fit li { margin: 7px 0; }
.status { max-width: 860px; margin: 28px auto 0; padding: 22px 26px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); }
.status h3 { margin: 0 0 8px; font-size: 1.08rem; }
.status p { margin: 0 0 10px; color: var(--muted); }
.status p:last-child { margin-bottom: 0; }

.platforms { width: 100%; max-width: 860px; margin: 0 auto; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }

.questions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.questions > div { padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.questions h3 { margin: 0 0 8px; font-size: 1.08rem; }
.questions p { margin: 0; color: var(--muted); font-size: .98rem; }
.final { text-align: center; color: #fff; background: linear-gradient(165deg, var(--navy), var(--harbour)); }
.final h2 { margin: 0 0 12px; color: #fff; font-size: clamp(1.8rem, 3.4vw, 2.6rem); font-weight: 750; }
.final p { margin: 0 auto 26px; max-width: 620px; color: #d6e4ec; font-size: 1.1rem; }
.final .btn-row { justify-content: center; }
.final .btn { color: #fff; background: rgb(255 255 255 / 8%); border-color: rgb(255 255 255 / 32%); }
.final .btn-primary { color: #06211f; background: var(--mint); border-color: var(--mint); }

/* Code. */
.code { position: relative; margin: 16px 0; background: var(--code-bg); border: 1px solid var(--line); border-radius: var(--radius); }
.code pre { margin: 0; padding: 14px 16px; overflow-x: auto; }
.code pre code { color: var(--code-text); font: .86rem/1.6 var(--mono); }
.copy-button { position: absolute; top: 7px; right: 7px; display: inline-flex; padding: 5px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; cursor: pointer; opacity: 0; transition: opacity .12s; }
.code:hover .copy-button, .copy-button:focus-visible, .copy-button.copied { opacity: 1; }
@media (hover: none) {
  .copy-button { opacity: 1; }
  .code pre { padding-right: 44px; }
}
.copy-button svg { width: 15px; height: 15px; }
.copy-button .icon-check { display: none; color: var(--accent); }
.copy-button.copied .icon-copy { display: none; }
.copy-button.copied .icon-check { display: block; }
.t-c { color: var(--t-comment); }
.t-k { color: var(--t-key); font-weight: 600; }
.t-s { color: var(--t-string); }
.t-h { color: var(--t-head); font-weight: 600; }

/* The documentation. */
.docs-layout { display: grid; grid-template-columns: 264px minmax(0, 1fr) 232px; gap: 44px; max-width: 1400px; margin: 0 auto; padding: 0 24px; }
.docs-sidebar { position: sticky; top: var(--header-h); align-self: start; max-height: calc(100vh - var(--header-h)); overflow-y: auto; padding: 26px 8px 40px 0; }
.docs-menu-toggle { display: none; }
.docs-group + .docs-group { margin-top: 22px; }
.docs-group h2 { margin: 0 0 6px; padding: 0 10px; color: var(--heading); font-size: .82rem; font-weight: 700; letter-spacing: 0; }
.docs-group ul { margin: 0; padding: 0; list-style: none; }
.docs-group a { display: block; padding: 4px 10px; color: var(--muted); font-size: .92rem; line-height: 1.4; border-radius: 6px; }
.docs-group a:hover { color: var(--text); background: var(--sunk); text-decoration: none; }
.docs-group a[aria-current="page"] { color: var(--accent); font-weight: 600; background: var(--accent-soft); }

.doc { min-width: 0; max-width: 800px; padding: 36px 0 72px; }
.doc h1 { margin: 0 0 10px; font-size: clamp(2rem, 3.6vw, 2.6rem); font-weight: 760; letter-spacing: -.022em; }
.doc-lede { margin: 0 0 30px; color: var(--muted); font-size: 1.16rem; line-height: 1.5; }
.doc h2 { margin: 46px 0 12px; padding-top: 8px; font-size: 1.55rem; font-weight: 720; }
.doc h3 { margin: 32px 0 8px; font-size: 1.2rem; font-weight: 680; }
.doc h4 { margin: 24px 0 6px; font-size: 1.02rem; }
.doc h2:first-of-type { margin-top: 30px; }
.doc p, .doc li { font-size: 1rem; }
.doc ul, .doc ol { padding-left: 24px; }
.doc li { margin: 5px 0; }
.doc li > .code, .doc li > ul, .doc li > ol { margin-top: 8px; }
.doc a { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--link) 40%, transparent); text-underline-offset: 2px; }
.doc a:hover { text-decoration-color: currentColor; }
.doc figure { margin: 24px 0; }
.doc figcaption { margin-top: 9px; color: var(--muted); font-size: .9rem; text-align: center; }
.doc blockquote { margin: 18px 0; padding: 12px 18px; background: var(--bg-alt); border-left: 4px solid var(--accent); border-radius: 0 var(--radius) var(--radius) 0; }
.doc blockquote p { margin: 6px 0; }
.anchor { margin-left: 8px; color: var(--muted); font-weight: 400; text-decoration: none !important; opacity: 0; }
h2:hover > .anchor, h3:hover > .anchor, h4:hover > .anchor, .anchor:focus-visible { opacity: 1; }
.anchor-target { display: block; height: 0; }
.table-wrap { margin: 18px 0; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(to right, var(--bg) 30%, transparent) left / 40px 100% no-repeat local, linear-gradient(to left, var(--bg) 30%, transparent) right / 40px 100% no-repeat local, linear-gradient(to right, rgb(20 28 40 / 16%), transparent) left / 12px 100% no-repeat scroll, linear-gradient(to left, rgb(20 28 40 / 16%), transparent) right / 12px 100% no-repeat scroll; }
table { width: 100%; border-collapse: collapse; font-size: .94rem; }
th, td { padding: 9px 13px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { color: var(--heading); font-size: .86rem; font-weight: 650; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td code { white-space: nowrap; }
td:nth-child(n+2) code { white-space: normal; }
.doc-edit { margin: 44px 0 0; font-size: .88rem; }
.doc-edit a { color: var(--muted); }
.doc-pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.doc-pager a { display: block; padding: 12px 16px; color: var(--text); font-weight: 600; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; }
.doc-pager a:hover { border-color: var(--accent); }
.doc-pager a span { display: block; color: var(--muted); font-size: .8rem; font-weight: 500; }
.doc-pager-next { grid-column: 2; text-align: right; }

.toc-inline { display: none; margin: 0 0 24px; padding: 10px 14px; background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius); }
.toc-inline summary { font-size: .92rem; font-weight: 600; cursor: pointer; }
.toc-inline ul { margin: 8px 0 2px; padding: 0; list-style: none; }
.toc-inline li { margin: 4px 0; font-size: .92rem; }
.toc-inline .toc-3 { padding-left: 16px; }
.doc .toc-inline a { text-decoration: none; }
.toc { position: sticky; top: var(--header-h); align-self: start; max-height: calc(100vh - var(--header-h)); overflow-y: auto; padding: 36px 0 40px; }
.toc h2 { margin: 0 0 8px; color: var(--heading); font-size: .82rem; font-weight: 700; }
.toc ul { margin: 0; padding: 0; list-style: none; border-left: 1px solid var(--line); }
.toc a { display: block; margin-left: -1px; padding: 3px 0 3px 12px; color: var(--muted); font-size: .85rem; line-height: 1.4; border-left: 2px solid transparent; }
.toc code { font-size: .92em; }
.toc-3 a { padding-left: 24px; font-size: .82rem; }
.toc a:hover { color: var(--text); text-decoration: none; }
.toc a.is-current { color: var(--accent); font-weight: 600; border-left-color: var(--accent); }

/* The API reference. */
.api-list { display: grid; gap: 8px; margin: 14px 0 0; }
.api-op { padding: 12px 15px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.api-op p { margin: 6px 0 0; color: var(--muted); font-size: .94rem; }
.api-route { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.api-route code { font-size: .88rem; font-weight: 600; word-break: break-all; }
.api-method { flex: none; min-width: 58px; padding: 1px 7px; color: #fff; font: 700 .72rem/1.7 var(--mono); text-align: center; border-radius: 5px; }
.api-get { background: #2a6aa3; }
.api-post { background: #17744a; }
.api-put, .api-patch { background: #8a5a00; }
.api-delete { background: #b3261e; }
.api-details { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 8px; color: var(--muted); font-size: .84rem; }
.api-details b { color: var(--text); font-weight: 600; }

/* The footer. */
.site-footer { padding: 52px 0 34px; background: var(--bg-alt); border-top: 1px solid var(--line); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 36px; }
.footer-about p { margin: 12px 0 0; max-width: 360px; color: var(--muted); font-size: .93rem; }
.site-footer h2 { margin: 0 0 10px; font-size: .86rem; font-weight: 700; }
.site-footer ul { margin: 0; padding: 0; list-style: none; }
.site-footer li { margin: 5px 0; }
.site-footer li a { color: var(--muted); font-size: .93rem; }
.footer-note { margin: 30px 0 0; padding-top: 18px; color: var(--muted); font-size: .86rem; border-top: 1px solid var(--line); }
.footer-note a { color: inherit; text-decoration: underline; }

.not-found { min-height: 50vh; padding: 100px 0; text-align: center; }

/* Search. */
.search-dialog { width: min(680px, 94vw); max-height: 76vh; margin: 9vh auto auto; padding: 0; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; }
.search-dialog::backdrop { background: rgb(4 10 18 / 55%); }
.search-box { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.search-box svg { flex: none; width: 19px; height: 19px; color: var(--muted); }
.search-box input { flex: 1; min-width: 0; color: inherit; font: inherit; font-size: 1.05rem; background: none; border: 0; outline: 0; }
.search-box input::-webkit-search-cancel-button { display: none; }
.search-close { padding: 2px 8px; color: var(--muted); font: 600 .74rem var(--mono); background: var(--sunk); border: 1px solid var(--line); border-radius: 5px; cursor: pointer; }
.search-results { max-height: calc(76vh - 60px); margin: 0; padding: 6px; overflow-y: auto; list-style: none; }
.search-results:empty { display: none; }
.search-results a { display: block; padding: 9px 12px; color: var(--text); border-radius: 8px; }
.search-results a:hover, .search-results a.is-selected { background: var(--accent-soft); text-decoration: none; }
.search-results b { font-weight: 650; }
.search-results span { color: var(--muted); font-size: .84rem; }
.search-results small { display: block; margin-top: 2px; color: var(--muted); font-size: .86rem; line-height: 1.4; }
.search-results mark { color: inherit; background: color-mix(in srgb, var(--accent) 28%, transparent); border-radius: 2px; }
.search-none { padding: 16px; color: var(--muted); }

/* Narrower. */
@media (max-width: 1240px) {
  .docs-layout { grid-template-columns: 250px minmax(0, 1fr); }
  .toc { display: none; }
  .toc-inline { display: block; }
}
@media (max-width: 1040px) {
  .site-nav { position: absolute; top: var(--header-h); left: 0; right: 0; display: none; flex-direction: column; gap: 0; padding: 8px 24px 16px; background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 10px 0; font-size: 1rem; }
  .nav-toggle { display: inline-flex; }
  .feature, .feature.reverse { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .feature.reverse .feature-text { order: 0; }
  .steps, .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer-about { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .docs-layout { display: block; padding: 0 16px; }
  .docs-sidebar { position: static; max-height: none; padding: 14px 0 0; }
  .docs-menu-toggle { display: block; width: 100%; padding: 10px 14px; color: var(--text); font: inherit; font-weight: 600; text-align: left; background: var(--sunk); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
  .docs-menu-toggle::after { content: "▾"; float: right; color: var(--muted); }
  .docs-nav { display: none; padding-top: 14px; }
  .docs-sidebar.is-open .docs-nav { display: block; }
  .doc { padding-top: 22px; }
  .container { padding: 0 16px; }
  .site-nav { padding-inline: 16px; }
  .fit, .steps, .cards, .questions { grid-template-columns: minmax(0, 1fr); }
  .search-button span, .search-button kbd { display: none; }
  .search-button { padding: 0 9px; margin: 0; }
}
@media (max-width: 560px) {
  .section { padding: 60px 0; }
  .hero { padding-top: 48px; }
  .site-header .container { gap: 10px; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .btn-row .btn { flex: 1 1 auto; justify-content: center; }
  .terminal pre { font-size: .76rem; }
  .install .code pre { white-space: pre; overflow-wrap: normal; }
  .doc-pager { grid-template-columns: minmax(0, 1fr); }
  .doc-pager-next { grid-column: 1; }
}
