/* Vectis documentation site (docs home + manual chapter pages). Look follows the approved portal mockup.
   The @font-face rules below are also used by the PDF build (build.py rewrites the url() paths). */
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/IBMPlexSans-Regular.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: italic; font-weight: 400; font-display: swap; src: url("fonts/IBMPlexSans-Italic.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/IBMPlexSans-Medium.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/IBMPlexSans-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/IBMPlexSans-Bold.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/IBMPlexMono-Regular.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/IBMPlexMono-Medium.woff2") format("woff2"); }
/* ☰ and ⌫ only (not in Plex): a subset of Noto Sans Symbols 2, so no system font is ever used for them.
   One face for all weights: a synthesised bold would reach the PDF as a Type3 font. */
@font-face { font-family: "Noto Sans Symbols 2"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("fonts/NotoSansSymbols2-Subset.woff2") format("woff2"); }

:root {
  --bg: #f6f6fb; --surface: #ffffff; --fg: #1d1b33; --muted: #5d5b78; --line: #e2e1ee;
  --accent: #4b45c8; --accent-ink: #ffffff; --accent-soft: #ecebfb;
  --tape: #fbfaf4; --tape-ink: #3b3a2f; --mark: #fff1b8;
  --warn: #c62828; --warn-soft: #fdecea;
  --font-sans: "IBM Plex Sans", "Noto Sans Symbols 2", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", "Noto Sans Symbols 2", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --header-h: 60px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12111c; --surface: #1b1a29; --fg: #ecebf7; --muted: #a6a4c2; --line: #2e2c42;
    --accent: #8f89ff; --accent-ink: #12111c; --accent-soft: #26244a;
    --tape: #22211c; --tape-ink: #dcd9c8; --mark: #4a3f12; --warn: #ff8a80; --warn-soft: #3a1d22;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 12px); }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font-sans); font-size: 16px; line-height: 1.55; }
a { color: var(--accent); }
.wrap { max-width: 1040px; margin: 0 auto; padding-inline: 16px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 10; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 6px; }
.skip:focus { top: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* header */
header.site { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 4; }
header.site .wrap { display: flex; align-items: center; gap: 12px 16px; padding-block: 11px; flex-wrap: wrap; min-height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; letter-spacing: .01em; color: var(--fg); text-decoration: none; margin-right: auto; }
.brand .mark { width: 28px; height: 28px; border-radius: 7px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-family: var(--font-mono); font-size: 15px; }
.brand small { font-weight: 400; color: var(--muted); font-size: 14px; }
.langs { display: flex; gap: 4px; }
.langs a { font: 500 13px var(--font-mono); padding: 6px 10px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 6px; text-decoration: none; }
.langs a[aria-current="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* search (header of chapter pages, intro of the home) */
.search { position: relative; flex: 0 1 380px; min-width: 0; }
.search input { width: 100%; font: inherit; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--fg); }
header .search input { font-size: 15px; padding-block: 6px; }
.intro .search { max-width: 520px; margin-top: 8px; }
.intro .search input { padding: 10px 12px; }
.hits { position: absolute; top: calc(100% + 4px); left: 0; width: max(100%, min(520px, calc(100vw - 32px))); z-index: 6; list-style: none; margin: 0; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgb(0 0 0 / .14); max-height: min(70vh, 560px); overflow: auto; }
.hits[hidden] { display: none; }
.hits a { display: grid; gap: 2px; padding: 8px 10px; border-radius: 6px; text-decoration: none; color: var(--fg); }
.hits a:hover, .hits a:focus { background: var(--accent-soft); }
.hits .hc { font: 500 12px var(--font-mono); color: var(--muted); }
.hits .hh { font-weight: 600; }
.hits .hx { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.hits mark { background: var(--mark); color: inherit; border-radius: 2px; }
.hits .none { padding: 8px 10px; color: var(--muted); }

/* home */
.intro { padding-block: 40px 24px; display: grid; gap: 12px; }
.intro h1 { font-size: clamp(28px, 4vw, 38px); line-height: 1.15; margin: 0; text-wrap: balance; letter-spacing: -.01em; }
.intro p { margin: 0; color: var(--muted); max-width: 62ch; }
.products { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 16px; padding-block: 8px 32px; }
.product { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 24px; display: grid; gap: 16px; align-content: start; min-width: 0; }
.product h2 { margin: 0; font-size: 22px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.product.soon { background: transparent; border-style: dashed; }
.product p { margin: 0; color: var(--muted); }
.status { font: 500 12px var(--font-mono); text-transform: uppercase; letter-spacing: .06em; padding: 3px 8px; border-radius: 999px; }
.status.live { background: var(--accent-soft); color: var(--accent); }
.status.soon { background: var(--line); color: var(--muted); }
.row { display: grid; gap: 8px; }
.row-label { font: 500 12px var(--font-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.btns { display: flex; flex-wrap: wrap; gap: 8px; }
.btn { font: 500 15px var(--font-sans); padding: 9px 14px; border-radius: 8px; border: 1px solid var(--accent); text-decoration: none; display: inline-flex; gap: 8px; align-items: baseline; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn .meta, .crumbs .meta { font: 400 12px var(--font-mono); opacity: .8; }
.btn[aria-disabled="true"] { border-color: var(--line); color: var(--muted); cursor: default; }
.tape { background: var(--tape); color: var(--tape-ink); font: 13px/1.6 var(--font-mono); border: 1px dashed var(--line); border-radius: 6px; padding: 10px 12px; display: grid; gap: 2px; }
.tape div { display: flex; justify-content: space-between; gap: 12px; }
section.chapters { padding-block: 8px 40px; }
section.chapters h2 { font-size: 20px; margin: 0 0 12px; }
.chapter-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 0 24px; border-top: 1px solid var(--line); }
.chapter-list li { border-bottom: 1px solid var(--line); }
.chapter-list a { display: flex; gap: 12px; padding-block: 10px; color: var(--fg); text-decoration: none; }
.chapter-list a:hover span:last-child { color: var(--accent); }
.chapter-list .n { font: 500 13px var(--font-mono); color: var(--muted); min-width: 2.5em; font-variant-numeric: tabular-nums; padding-top: 2px; }

/* chapter page: sidebar + text */
.page-doc .wrap { max-width: 1280px; }
.layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 40px; align-items: start; }
.side { position: sticky; top: var(--header-h); max-height: calc(100vh - var(--header-h)); overflow: auto; padding-block: 24px; font-size: 14px; }
.side summary { display: none; }
.side ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.side a { display: flex; gap: 8px; padding: 5px 8px; border-radius: 6px; color: var(--muted); text-decoration: none; }
.side a:hover { color: var(--fg); background: var(--accent-soft); }
.side .n { font: 500 12px var(--font-mono); min-width: 1.9em; padding-top: 2px; font-variant-numeric: tabular-nums; }
.side li.cur > a { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.side .secs { margin: 4px 0 8px 22px; padding-left: 8px; border-left: 1px solid var(--line); }
.side .secs a { padding: 3px 8px; font-size: 13.5px; }
main.doc { min-width: 0; padding-block: 24px 48px; }
.crumbs { font: 12px var(--font-mono); color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.crumbs a { color: var(--muted); }
.crumbs a.pdf { margin-left: auto; color: var(--accent); border: 1px solid var(--accent); border-radius: 6px; padding: 3px 8px; text-decoration: none; font-weight: 500; }
.doc article { max-width: 780px; overflow-wrap: break-word; }
.doc article h1 { font-size: clamp(26px, 3.4vw, 34px); line-height: 1.2; margin: 14px 0 16px; letter-spacing: -.01em; text-wrap: balance; }
.doc article h2 { font-size: 22px; line-height: 1.3; margin: 40px 0 10px; padding-top: 16px; border-top: 1px solid var(--line); }
.doc article h3 { font-size: 18px; line-height: 1.35; margin: 26px 0 8px; }
.doc article code { font-family: var(--font-mono); font-size: .88em; background: var(--accent-soft); padding: 1px 4px; border-radius: 4px; }
.doc article pre { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.doc article pre code { background: none; padding: 0; }
.doc article li { margin: 4px 0; }
.table-wrap { overflow-x: auto; margin: 12px 0 20px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.table-wrap table { border-collapse: collapse; width: 100%; font-size: 14.5px; overflow-wrap: normal; }
.table-wrap th, .table-wrap td { border-bottom: 1px solid var(--line); padding: 7px 10px; text-align: left; vertical-align: top; }
.table-wrap th + th, .table-wrap td + td { border-left: 1px solid var(--line); }
.table-wrap th { background: var(--accent-soft); font-weight: 600; }
.table-wrap tr:last-child td { border-bottom: 0; }
.shot { display: block; margin: 12px 0 20px; }
.shot img { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; }
.shot.phone img { max-width: min(340px, 100%); }
.cap { display: block; font-size: 13.5px; color: var(--muted); margin-top: 6px; }
.callout { border-left: 4px solid var(--accent); background: var(--accent-soft); padding: 8px 14px; border-radius: 0 8px 8px 0; margin: 14px 0; }
.callout.caution { border-left-color: var(--warn); background: var(--warn-soft); }
.callout p { margin: 4px 0; }
.pager { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--line); max-width: 780px; }
.pager a { display: grid; gap: 2px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); text-decoration: none; max-width: 100%; }
.pager a:hover { border-color: var(--accent); }
.pager small { font: 500 12px var(--font-mono); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.pager .next { margin-left: auto; text-align: right; }

footer.site { border-top: 1px solid var(--line); padding-block: 20px; color: var(--muted); font-size: 14px; }
footer.site .wrap { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }
footer.site nav { display: flex; gap: 16px; }

@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .side { position: static; max-height: none; overflow: visible; padding-block: 16px 0; }
  .side details { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
  .side summary { display: flex; gap: 8px; align-items: baseline; padding: 10px 12px; cursor: pointer; font-weight: 600; list-style: none; }
  .side summary::-webkit-details-marker { display: none; }
  .side summary::after { content: "▾"; margin-left: auto; color: var(--muted); font-weight: 400; }
  .side details[open] summary::after { content: "▴"; }
  .side summary .cur-name { font-weight: 400; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .side details > ol { padding: 6px; border-top: 1px solid var(--line); }
  main.doc { padding-top: 16px; }
}
@media (max-width: 640px) {
  :root { --header-h: 0px; }
  header.site { position: static; }
  header.site .search { order: 3; flex-basis: 100%; }
  .hits { width: 100%; }
}
@media (prefers-reduced-motion: no-preference) {
  .btn { transition: background-color .15s, color .15s; }
}
