/* DexVantage website, ported from Vantage's site stylesheet: the app's own palette and type (IBM Plex, self-hosted),
   dark first, light when the reader's system asks. */
@font-face { font-family: "Plex Sans"; src: url("../fonts/IBMPlexSans-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url("../fonts/IBMPlexSans-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url("../fonts/IBMPlexSans-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("../fonts/IBMPlexMono-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("../fonts/IBMPlexMono-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }

:root {
  --bg: #0f0f0e; --bg2: #141413; --panel: #1a1a19; --raised: #222220; --sel: #2c2c2a;
  --hair: #2a2a28; --strong: #3a3a37;
  --ink: #f0efec; --ink2: #c3c2b7; --muted: #8f8d86;
  --accent: #3987e5; --accent-ink: #8ec0f7; --good: #2fb36f; --warn: #fab219; --crit: #e0524f;
  --c1: #3987e5; --c2: #d95926; --c3: #199e70; --c4: #c98500; --c5: #d55181; --c6: #2d9b2d;
  --shadow: 0 30px 80px rgba(0,0,0,.55), 0 8px 24px rgba(0,0,0,.35);
  --radius: 12px; --maxw: 1180px;
  --sans: "Plex Sans", "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Plex Mono", "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f4f3ef; --bg2: #eceae5; --panel: #fcfcfb; --raised: #f3f2ef; --sel: #e1e0d9;
    --hair: #e1e0d9; --strong: #c9c7bf;
    --ink: #0e0e0d; --ink2: #4a4945; --muted: #7d7b75;
    --accent: #2a78d6; --accent-ink: #1c5cab;
    --shadow: 0 24px 60px rgba(30,30,25,.18), 0 6px 18px rgba(30,30,25,.10);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f4f3ef; --bg2: #eceae5; --panel: #fcfcfb; --raised: #f3f2ef; --sel: #e1e0d9;
  --hair: #e1e0d9; --strong: #c9c7bf; --ink: #0e0e0d; --ink2: #4a4945; --muted: #7d7b75;
  --accent: #2a78d6; --accent-ink: #1c5cab; --shadow: 0 24px 60px rgba(30,30,25,.18), 0 6px 18px rgba(30,30,25,.10);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, video { max-width: 100%; display: block; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
code, kbd, pre { font-family: var(--mono); }
code { font-size: .88em; background: var(--raised); border: 1px solid var(--hair); border-radius: 5px; padding: .08em .38em; }
kbd {
  font-size: .8em; background: var(--raised); border: 1px solid var(--strong); border-bottom-width: 2px;
  border-radius: 5px; padding: .05em .45em; white-space: nowrap;
}
::selection { background: color-mix(in srgb, var(--accent) 40%, transparent); }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; z-index: 100; background: var(--panel); padding: 8px 12px; border-radius: 6px; }

/* ---------------------------------------------------------------- navigation */
.nav {
  position: sticky; top: 0; z-index: 50; backdrop-filter: saturate(140%) blur(14px);
  background: color-mix(in srgb, var(--bg) 82%, transparent); border-bottom: 1px solid var(--hair);
}
.nav .wrap { display: flex; align-items: center; gap: 28px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 600; font-size: 17px; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand img { width: 26px; height: 26px; border-radius: 6px; }
.nav-links { display: flex; gap: 22px; margin-left: auto; align-items: center; }
.nav-links a { color: var(--ink2); font-size: 14.5px; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); text-decoration: none; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--strong); color: var(--ink); border-radius: 8px; padding: 6px 10px; font: inherit; }
@media (max-width: 1140px) {
  .nav-toggle { display: block; }
  .nav-links { display: none; position: absolute; top: 60px; left: 0; right: 0; flex-direction: column; align-items: flex-start;
    gap: 2px; padding: 10px 24px 18px; background: var(--bg); border-bottom: 1px solid var(--hair); }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 8px 0; font-size: 16px; }
}

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 9px;
  font: 500 15px/1 var(--sans); border: 1px solid var(--strong); color: var(--ink); background: transparent;
  transition: background .15s, border-color .15s, transform .15s;
}
.btn:hover { text-decoration: none; background: var(--raised); border-color: var(--ink2); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.primary:hover { background: var(--ink2); border-color: var(--ink2); }
.btn svg { width: 17px; height: 17px; }

/* ---------------------------------------------------------------- hero */
.hero { position: relative; padding: 72px 0 40px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -30% -10% auto; height: 620px; pointer-events: none;
  background: radial-gradient(60% 60% at 30% 40%, color-mix(in srgb, var(--c1) 22%, transparent), transparent 70%),
              radial-gradient(40% 50% at 75% 30%, color-mix(in srgb, var(--c5) 14%, transparent), transparent 70%),
              radial-gradient(40% 50% at 60% 70%, color-mix(in srgb, var(--c3) 12%, transparent), transparent 70%);
  filter: blur(10px); opacity: .9;
}
.hero .wrap { position: relative; }
.eyebrow { font: 500 12.5px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--accent-ink); }
.hero h1 { font-size: clamp(38px, 6vw, 66px); line-height: 1.04; letter-spacing: -.035em; margin: 18px 0 18px; font-weight: 600; max-width: 20ch; }
.nowrap { white-space: nowrap; }
.hero .lede { font-size: clamp(17px, 1.6vw, 20px); color: var(--ink2); max-width: 62ch; margin: 0 0 30px; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-media { margin-top: 52px; }
.frame {
  position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--strong);
  background: #0c0c0b; box-shadow: var(--shadow);
}
.frame video, .frame img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.frame.natural video, .frame.natural img { aspect-ratio: auto; object-fit: contain; }
.frame .chip {
  position: absolute; left: 14px; bottom: 14px; font: 500 12px/1 var(--mono); color: #f0efec;
  background: rgba(18,18,17,.78); border: 1px solid rgba(255,255,255,.12); padding: 7px 10px; border-radius: 6px;
  backdrop-filter: blur(6px);
}
.frame .play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: transparent;
  border: 0; cursor: pointer; color: #fff; opacity: 0; transition: opacity .2s;
}
.frame:hover .play, .frame.paused .play { opacity: 1; }
.frame .play span {
  width: 64px; height: 64px; border-radius: 50%; background: rgba(15,15,14,.7); border: 1px solid rgba(255,255,255,.25);
  display: flex; align-items: center; justify-content: center; backdrop-filter: blur(6px);
}
.frame .play svg { width: 24px; height: 24px; margin-left: 3px; }
.frame .expand {
  position: absolute; right: 12px; top: 12px; width: 34px; height: 34px; border-radius: 8px; border: 1px solid rgba(255,255,255,.2);
  background: rgba(15,15,14,.7); color: #fff; cursor: pointer; opacity: 0; transition: opacity .2s; display: flex;
  align-items: center; justify-content: center;
}
.frame:hover .expand, .frame .expand:focus-visible { opacity: 1; }
.caption { color: var(--muted); font-size: 13.5px; margin-top: 12px; }
@media (max-width: 560px) { .frame .chip { display: none; } }

.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin-top: 46px; background: var(--hair);
  border: 1px solid var(--hair); border-radius: var(--radius); overflow: hidden; }
.fact { background: var(--bg2); padding: 20px 22px; }
.fact b { display: block; font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.fact span { color: var(--muted); font-size: 14px; }
@media (max-width: 860px) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------------------------------------------------------------- sections */
section { padding: 88px 0; }
section.alt { background: var(--bg2); border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); }
.head { max-width: 760px; margin-bottom: 44px; }
.head h2 { font-size: clamp(28px, 3.6vw, 42px); line-height: 1.12; letter-spacing: -.028em; margin: 12px 0 14px; font-weight: 600; }
.head p { color: var(--ink2); font-size: 18px; margin: 0; }

.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; counter-reset: step; }
.step { background: var(--panel); border: 1px solid var(--hair); border-radius: var(--radius); padding: 22px; position: relative; }
.step::before { counter-increment: step; content: "0" counter(step); font: 500 13px/1 var(--mono); color: var(--accent-ink); }
.step h3 { margin: 12px 0 8px; font-size: 18px; letter-spacing: -.01em; }
.step p { margin: 0; color: var(--ink2); font-size: 14.5px; }
@media (max-width: 960px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }

.feature { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; align-items: center; padding: 56px 0; border-top: 1px solid var(--hair); }
.feature:first-of-type { border-top: 0; }
.feature.flip { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.feature.flip .text { order: 2; }
.feature h3 { font-size: clamp(24px, 2.6vw, 31px); letter-spacing: -.022em; line-height: 1.18; margin: 12px 0 14px; font-weight: 600; }
.feature p { color: var(--ink2); margin: 0 0 16px; }
.feature ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; }
.feature li { position: relative; padding-left: 24px; color: var(--ink2); font-size: 15.2px; }
.feature li::before { content: ""; position: absolute; left: 3px; top: .62em; width: 8px; height: 8px; border-radius: 2px; background: var(--dot, var(--accent)); }
.feature li b { color: var(--ink); font-weight: 500; }
.feature .more { display: inline-block; margin-top: 16px; font-size: 14.5px; }
@media (max-width: 960px) {
  .feature, .feature.flip { grid-template-columns: 1fr; gap: 26px; }
  .feature.flip .text { order: 0; }
}
.note { margin-top: 14px; font-size: 13.5px; color: var(--muted); border-left: 2px solid var(--strong); padding-left: 12px; }

.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 960px) { .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .grid3 { grid-template-columns: 1fr; } }
.card { min-width: 0; background: var(--panel); border: 1px solid var(--hair); border-radius: var(--radius); padding: 22px; }
.card h4 { margin: 0 0 10px; font-size: 16px; letter-spacing: -.005em; }
.card p { margin: 0; color: var(--ink2); font-size: 14.5px; }
.card ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.card li { display: flex; justify-content: space-between; gap: 12px; font-size: 14.2px; color: var(--ink2); }
.card li span:last-child { font: 400 12.5px/1.7 var(--mono); color: var(--muted); white-space: nowrap; }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; margin-top: 30px; }
.tiles figure { margin: 0; }
.tiles figcaption { color: var(--muted); font-size: 13.5px; margin-top: 10px; }
@media (max-width: 860px) { .tiles { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- terminal */
.term { background: #0b0b0a; border: 1px solid var(--strong); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.term .bar { display: flex; gap: 7px; padding: 12px 14px; border-bottom: 1px solid #222220; }
.term .bar i { width: 11px; height: 11px; border-radius: 50%; background: #3a3a37; }
.term pre { margin: 0; padding: 18px 20px; color: #d8d7d2; font-size: 13.2px; line-height: 1.7; overflow-x: auto; }
.term .c { color: #8f8d86; } .term .p { color: #8ec0f7; } .term .g { color: #4fd18b; } .term .w { color: #fab219; }

/* ---------------------------------------------------------------- downloads */
.dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1000px) { .dl { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .dl { grid-template-columns: 1fr; } }
.dl .card { display: flex; flex-direction: column; gap: 12px; }
.dl pre { margin: 0; background: var(--raised); border: 1px solid var(--hair); border-radius: 8px; padding: 12px; font-size: 12.4px;
  line-height: 1.6; overflow-x: auto; color: var(--ink2); }
.dl .os { font: 500 12px/1 var(--mono); color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }

/* ---------------------------------------------------------------- footer */
footer { border-top: 1px solid var(--hair); padding: 40px 0 56px; color: var(--muted); font-size: 14px; }
footer .wrap { display: flex; gap: 32px; justify-content: space-between; flex-wrap: wrap; }
footer .links { display: flex; gap: 20px; flex-wrap: wrap; }
footer a { color: var(--ink2); }
footer .fine { max-width: 640px; font-size: 13px; line-height: 1.6; }

/* ---------------------------------------------------------------- lightbox */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(5,5,5,.88); display: none; align-items: center; justify-content: center; padding: 3vw; }
.lightbox.open { display: flex; }
.lightbox video, .lightbox img { max-width: min(1600px, 94vw); max-height: 88vh; width: auto; height: auto; border-radius: 10px; box-shadow: var(--shadow); }
.lightbox button { position: absolute; top: 18px; right: 22px; background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px; padding: 8px 12px; font: 500 14px var(--sans); cursor: pointer; }

/* ---------------------------------------------------------------- docs */
.docs { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 56px; padding: 48px 24px 96px; max-width: 1240px; margin: 0 auto; }
.toc { position: sticky; top: 84px; align-self: start; max-height: calc(100vh - 110px); overflow: auto; font-size: 14px; padding-right: 8px; }
.toc p { font: 500 11.5px/1 var(--mono); color: var(--muted); letter-spacing: .1em; text-transform: uppercase; margin: 22px 0 10px; }
.toc p:first-child { margin-top: 0; }
.toc a { display: block; color: var(--ink2); padding: 5px 10px; border-left: 2px solid var(--hair); }
.toc a:hover { color: var(--ink); text-decoration: none; border-left-color: var(--strong); }
.toc a.active { color: var(--ink); border-left-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.doc { min-width: 0; }
.doc h1 { font-size: 40px; letter-spacing: -.03em; line-height: 1.1; margin: 8px 0 14px; }
.doc .intro { font-size: 18px; color: var(--ink2); max-width: 70ch; margin: 0 0 12px; }
.doc h2 { font-size: 27px; letter-spacing: -.02em; margin: 64px 0 14px; padding-top: 18px; border-top: 1px solid var(--hair); scroll-margin-top: 80px; }
.doc h3 { font-size: 19px; margin: 32px 0 10px; letter-spacing: -.01em; scroll-margin-top: 80px; }
.doc p, .doc li { color: var(--ink2); max-width: 78ch; }
.doc li { margin: 4px 0; }
.doc b, .doc strong { color: var(--ink); font-weight: 500; }
.doc pre { background: var(--panel); border: 1px solid var(--hair); border-radius: 10px; padding: 16px 18px; overflow-x: auto; font-size: 13.2px;
  line-height: 1.65; position: relative; color: var(--ink2); }
.doc pre code { background: none; border: 0; padding: 0; font-size: inherit; }
.copy { position: absolute; top: 8px; right: 8px; background: var(--raised); border: 1px solid var(--strong); color: var(--ink2);
  border-radius: 6px; font: 500 12px var(--sans); padding: 4px 8px; cursor: pointer; opacity: 0; transition: opacity .15s; }
.doc pre:hover .copy, .copy:focus-visible { opacity: 1; }
.doc table { border-collapse: collapse; width: 100%; margin: 14px 0 20px; font-size: 14.5px; display: block; overflow-x: auto; }
.doc th, .doc td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--hair); vertical-align: top; color: var(--ink2); }
.doc th { color: var(--ink); font-weight: 500; background: var(--panel); border-bottom-color: var(--strong); white-space: nowrap; }
.doc td code { white-space: nowrap; }
.doc .callout { border: 1px solid var(--hair); border-left: 3px solid var(--accent); background: var(--panel); border-radius: 8px; padding: 14px 18px; margin: 18px 0; }
.doc .callout.warn { border-left-color: var(--warn); }
.doc .callout p { margin: 0; }
.doc figure { margin: 22px 0; }
.doc figcaption { color: var(--muted); font-size: 13.5px; margin-top: 8px; }
@media (max-width: 960px) {
  .docs { grid-template-columns: 1fr; gap: 0; }
  .toc { position: static; max-height: none; margin-bottom: 18px; border: 1px solid var(--hair); border-radius: 10px; padding: 14px; }
}

/* ---------------------------------------------------------------- DexVantage additions */
.toc a.sub { padding-left: 22px; font-size: 13.5px; }
.doc .crumbs { color: var(--muted); font-size: 13.5px; margin: 8px 0 0; }
.doc h4 { font-size: 15.5px; margin: 24px 0 8px; color: var(--ink); }
.doc blockquote { margin: 16px 0; padding: 4px 16px; border-left: 3px solid var(--strong); background: var(--panel); border-radius: 0 8px 8px 0; }
.doc hr { border: 0; border-top: 1px solid var(--hair); margin: 32px 0; }
.doc ul.index { list-style: none; padding: 0; margin: 18px 0; display: grid; gap: 0; max-width: none; }
.doc ul.index li { display: grid; grid-template-columns: minmax(180px, 300px) 1fr; gap: 6px 22px; padding: 12px 0;
  border-bottom: 1px solid var(--hair); margin: 0; max-width: none; }
.doc ul.index li span { color: var(--muted); font-size: 14.5px; }
@media (max-width: 760px) { .doc ul.index li { grid-template-columns: 1fr; } }
.doc table.val { display: table; table-layout: fixed; }
.doc .val th:nth-child(1) { width: 21%; } .doc .val th:nth-child(3), .doc .val th:nth-child(4) { width: 15%; } .doc .val th:nth-child(5) { width: 8%; }
.doc .val td { font-size: 13.8px; overflow-wrap: anywhere; }
.doc .val td code { white-space: normal; }
@media (max-width: 760px) { .doc table.val { display: block; table-layout: auto; } }
.doc .val td.num { font-family: var(--mono); font-size: 13px; white-space: nowrap; overflow-wrap: normal; font-variant-numeric: tabular-nums; }
.doc .val td.num .unit { display: block; white-space: normal; color: var(--muted); font-size: 12px; }
.doc .val .ok { color: var(--good); white-space: nowrap; }
.doc .val .no { color: var(--crit); white-space: nowrap; }
.doc .muted { color: var(--muted); font-size: 13px; }
.doc .refs li { font-size: 14.5px; }
.facts.small { margin: 18px 0 22px; }
.facts.small .fact b { font-family: var(--mono); font-weight: 500; font-size: 20px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--hair); border-radius: var(--radius); }
table.figures { border-collapse: collapse; width: 100%; font-size: 14.2px; }
table.figures th, table.figures td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--hair); vertical-align: top; color: var(--ink2); }
table.figures th { color: var(--ink); font-weight: 500; background: var(--panel); border-bottom-color: var(--strong); }
table.figures td.num { font-family: var(--mono); font-size: 13.2px; color: var(--ink); }
table.figures tr:last-child td { border-bottom: 0; }
