/* ============================================================
   Vollo Developer Docs — shared stylesheet
   Brand: Vollo Red #E53935 · Vollo Black #111315 · Cloud #F7F8FA
   Voice gradient: linear-gradient(90deg,#E53935,#FF7043,#FFB300)
   ============================================================ */

:root {
  --red: #E53935;
  --black: #111315;
  --cloud: #F7F8FA;
  --grad: linear-gradient(90deg, #E53935, #FF7043, #FFB300);

  --bg: #F7F8FA;
  --surface: #FFFFFF;
  --surface-2: #EFF1F4;
  --text: #111315;
  --text-2: #4C5257;
  --muted: #6B7278;
  --border: #E3E6EA;
  --border-strong: #CFD4D9;
  --accent: #E53935;
  --accent-ink: #C62828;
  --accent-soft: rgba(229, 57, 53, 0.08);
  --link: #C62828;

  --note-bg: #F0F6FF;
  --note-border: #B9D4F8;
  --note-ink: #1D4F91;
  --warn-bg: #FFF6E8;
  --warn-border: #F2D9AC;
  --warn-ink: #8A5A00;
  --danger-bg: #FDEEEE;
  --danger-border: #F2C4C2;
  --danger-ink: #A32521;

  --code-bg: #111315;
  --code-head: #1B1E22;
  --code-border: #2A2E33;
  --code-text: #E8EAED;
  --inline-code-bg: #EDEFF3;
  --inline-code-ink: #1F2326;

  --dg-box: #FFFFFF;
  --dg-box-2: #EFF1F4;
  --dg-line: #9AA1A8;

  --shadow: 0 1px 2px rgba(17, 19, 21, 0.05), 0 4px 16px rgba(17, 19, 21, 0.05);
  --radius: 10px;
  --header-h: 3.5rem;

  --sans: "Inter", -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0C0E10;
    --surface: #15181B;
    --surface-2: #1C2024;
    --text: #F1F3F5;
    --text-2: #B4BAC0;
    --muted: #8D949B;
    --border: #262B30;
    --border-strong: #363C42;
    --accent: #EF5350;
    --accent-ink: #FF8A80;
    --accent-soft: rgba(239, 83, 80, 0.12);
    --link: #FF8A80;

    --note-bg: #10233B;
    --note-border: #1F406E;
    --note-border: #1F4068;
    --note-ink: #9CC3F5;
    --warn-bg: #2B2110;
    --warn-border: #56421B;
    --warn-ink: #E8B75C;
    --danger-bg: #331716;
    --danger-border: #5C2725;
    --danger-ink: #F1948F;

    --code-bg: #101214;
    --code-head: #191C1F;
    --code-border: #2A2E33;
    --inline-code-bg: #23272C;
    --inline-code-ink: #E4E7EA;

    --dg-box: #1C2024;
    --dg-box-2: #24292E;
    --dg-line: #737B83;

    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.3);
  }
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1.25rem);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.9375rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; height: auto; }

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--accent); color: #fff; padding: 0.5rem 1rem; border-radius: 0 0 6px 0;
}
.skip-link:focus { left: 0; }

::selection { background: rgba(229, 57, 53, 0.22); }

/* ---------- header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 1rem;
  height: var(--header-h);
  padding: 0 1.25rem;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 2px; background: var(--grad); opacity: 0.9;
}

.brand { display: flex; align-items: baseline; gap: 0.55rem; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand .logo { height: 1.25rem; width: auto; display: block; align-self: center; }
.logo-dark { display: none; }
@media (prefers-color-scheme: dark) {
  .logo-light { display: none; }
  .logo-dark { display: block; }
}
.brand-docs {
  font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted);
  border-left: 1px solid var(--border-strong); padding-left: 0.55rem;
}

.header-links { margin-left: auto; display: flex; align-items: center; gap: 1.1rem; }
.header-links a { color: var(--text-2); font-size: 0.85rem; font-weight: 500; }
.header-links a:hover { color: var(--text); text-decoration: none; }
.header-cta {
  color: #fff !important; background: var(--red);
  padding: 0.36rem 0.85rem; border-radius: 999px; font-weight: 600 !important;
}
.header-cta:hover { background: #C62828; }

/* hamburger */
.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.nav-btn {
  display: none; flex-direction: column; justify-content: center; gap: 4px;
  width: 2.1rem; height: 2.1rem; padding: 0.45rem;
  border: 1px solid var(--border); border-radius: 8px; cursor: pointer;
  background: var(--surface);
}
.nav-btn span { display: block; height: 2px; border-radius: 2px; background: var(--text); }

/* ---------- layout ---------- */

.layout {
  display: grid;
  grid-template-columns: 16.25rem minmax(0, 1fr) 13.5rem;
  gap: 2.5rem;
  max-width: 90rem;
  margin: 0 auto;
  padding: 0 2rem;
}

.scrim { display: none; }

/* ---------- sidebar ---------- */

.sidebar {
  position: sticky; top: var(--header-h);
  align-self: start;
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: 1.75rem 1rem 2.5rem 0;
  border-right: 1px solid var(--border);
  font-size: 0.875rem;
  scrollbar-width: thin;
}
.nav-group { margin-bottom: 1.6rem; }
.nav-group-title {
  font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 0.45rem 0.65rem;
}
.sidebar a {
  display: block; padding: 0.32rem 0.65rem; margin: 1px 0;
  color: var(--text-2); border-radius: 7px; border-left: 2px solid transparent;
}
.sidebar a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.sidebar a[aria-current="page"] {
  color: var(--accent-ink); font-weight: 600;
  background: var(--accent-soft); border-left-color: var(--accent);
  border-radius: 0 7px 7px 0;
}

/* ---------- on this page ---------- */

.toc {
  position: sticky; top: var(--header-h);
  align-self: start;
  max-height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: 1.9rem 0 2.5rem 0;
  font-size: 0.8125rem;
  scrollbar-width: thin;
}
.toc-title {
  font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 0.6rem;
}
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.toc li a {
  display: block; padding: 0.22rem 0 0.22rem 0.85rem; color: var(--muted);
  border-left: 2px solid transparent; margin-left: -1px; line-height: 1.4;
}
.toc li li a { padding-left: 1.7rem; font-size: 0.78rem; }
.toc li a:hover { color: var(--text); text-decoration: none; border-left-color: var(--border-strong); }
.toc ol ol { border-left: none; }

/* ---------- content ---------- */

.content {
  min-width: 0;
  padding: 2.25rem 0 4rem;
}

.content > *:first-child { margin-top: 0; }

.eyebrow {
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  color: transparent; margin: 0 0 0.5rem;
}

h1 {
  font-size: 2.1rem; line-height: 1.15; font-weight: 800; letter-spacing: -0.022em;
  margin: 0 0 0.6rem;
}
.lede { font-size: 1.05rem; color: var(--text-2); margin: 0 0 2rem; max-width: 46rem; }

h2 {
  font-size: 1.4rem; font-weight: 700; letter-spacing: -0.015em; line-height: 1.25;
  margin: 2.9rem 0 0.85rem; padding-top: 1.4rem; border-top: 1px solid var(--border);
}
h2:first-of-type { border-top: none; padding-top: 0; }
h3 { font-size: 1.08rem; font-weight: 650; letter-spacing: -0.008em; margin: 2rem 0 0.6rem; }
h4 { font-size: 0.95rem; font-weight: 650; margin: 1.5rem 0 0.5rem; }

h2, h3, h4 { position: relative; }
.anchor {
  position: absolute; left: -1.3rem; top: 0; bottom: 0;
  display: flex; align-items: center;
  color: var(--muted); font-weight: 400; opacity: 0;
  transition: opacity 0.12s ease;
}
h2:hover .anchor, h3:hover .anchor, h4:hover .anchor, .anchor:focus { opacity: 1; text-decoration: none; }
h2 .anchor { align-items: flex-end; padding-bottom: 0.35rem; }

p { margin: 0 0 1rem; }
ul, ol { margin: 0 0 1rem; padding-left: 1.4rem; }
li { margin-bottom: 0.3rem; }
li > ul, li > ol { margin-top: 0.3rem; margin-bottom: 0.4rem; }
hr { border: none; border-top: 1px solid var(--border); margin: 2.5rem 0; }
strong { font-weight: 650; }

/* inline code */
code {
  font-family: var(--mono); font-size: 0.83em;
  background: var(--inline-code-bg); color: var(--inline-code-ink);
  padding: 0.12em 0.38em; border-radius: 5px;
  overflow-wrap: anywhere;
}
h1 code, h2 code, h3 code { font-size: 0.85em; }
a code { color: inherit; }

/* ---------- tables ---------- */

.tbl-wrap { overflow-x: auto; margin: 0 0 1.4rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 0.85rem; }
th {
  text-align: left; font-weight: 650; font-size: 0.75rem; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--muted);
  padding: 0.6rem 0.9rem; border-bottom: 1px solid var(--border); background: var(--surface-2);
  white-space: nowrap;
}
td { padding: 0.55rem 0.9rem; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:last-child td { border-bottom: none; }
td code { white-space: nowrap; }
td.wrap code { white-space: normal; }

.req { color: var(--accent-ink); font-size: 0.72rem; font-weight: 650; }
.opt { color: var(--muted); font-size: 0.72rem; }

/* method badges */
.mth {
  display: inline-block; font-family: var(--mono); font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.03em; padding: 0.14rem 0.5rem; border-radius: 5px; line-height: 1.4;
  white-space: nowrap;
}
.mth.get { background: rgba(34, 197, 94, 0.14); color: #15803D; }
.mth.post { background: rgba(59, 130, 246, 0.14); color: #1D4ED8; }
.mth.patch { background: rgba(245, 158, 11, 0.16); color: #92600A; }
.mth.put { background: rgba(245, 158, 11, 0.16); color: #92600A; }
.mth.delete { background: rgba(229, 57, 53, 0.13); color: #C62828; }
@media (prefers-color-scheme: dark) {
  .mth.get { color: #4ADE80; }
  .mth.post { color: #7FADF8; }
  .mth.patch, .mth.put { color: #E8B75C; }
  .mth.delete { color: #F1948F; }
}

/* ---------- code blocks ---------- */

.code {
  margin: 0 0 1.4rem; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--code-border); background: var(--code-bg);
  box-shadow: var(--shadow);
}
.code-head {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.45rem 1rem; background: var(--code-head);
  border-bottom: 1px solid var(--code-border);
}
.code-lang {
  font-family: var(--mono); font-size: 0.66rem; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: #8D949B;
}
.code-title { font-size: 0.75rem; color: #B4BAC0; }
.code pre {
  margin: 0; padding: 0.95rem 1.1rem; overflow-x: auto;
  font-family: var(--mono); font-size: 0.8rem; line-height: 1.62;
  color: var(--code-text);
  scrollbar-width: thin;
}
.code code { background: none; padding: 0; color: inherit; font-size: inherit; border-radius: 0; overflow-wrap: normal; }

/* token colors (hand-applied classes) */
.code .c { color: #7B848D; font-style: italic; }
.code .s { color: #A5D6A7; }
.code .p { color: #FFCA6E; }
.code .k { color: #FF8A80; }
.code .n { color: #90CAF9; }
.code .v { color: #CE93D8; }
.code .fn { color: #82B1FF; }

/* ---------- tabs (CSS only) ---------- */

.tabs { margin: 0 0 1.4rem; }
.tabs > input { position: absolute; opacity: 0; pointer-events: none; }
.tabs > label {
  display: inline-block; cursor: pointer;
  font-size: 0.8rem; font-weight: 550; color: var(--muted);
  padding: 0.34rem 0.9rem; margin: 0 0.25rem 0 0;
  border: 1px solid var(--border); border-bottom: none;
  border-radius: 8px 8px 0 0; background: var(--surface-2);
  position: relative; top: 1px;
}
.tabs > input:checked + label {
  color: var(--text); background: var(--code-bg); border-color: var(--code-border);
}
@media (prefers-color-scheme: light) {
  .tabs > input:checked + label { color: #E8EAED; }
}
.tabs > input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 1px; }
.tab-panels { border-top: 1px solid var(--code-border); }
.tab-panels > .panel { display: none; }
.tab-panels .code { margin-bottom: 0; border-top-left-radius: 0; }
.tabs > input:nth-of-type(1):checked ~ .tab-panels > .panel:nth-child(1),
.tabs > input:nth-of-type(2):checked ~ .tab-panels > .panel:nth-child(2),
.tabs > input:nth-of-type(3):checked ~ .tab-panels > .panel:nth-child(3) { display: block; }

/* ---------- callouts ---------- */

.note, .warn, .danger {
  padding: 0.85rem 1.1rem; border-radius: var(--radius); margin: 0 0 1.4rem;
  font-size: 0.875rem; border: 1px solid;
}
.note { background: var(--note-bg); border-color: var(--note-border); }
.warn { background: var(--warn-bg); border-color: var(--warn-border); }
.danger { background: var(--danger-bg); border-color: var(--danger-border); }
.note > .callout-title { color: var(--note-ink); }
.warn > .callout-title { color: var(--warn-ink); }
.danger > .callout-title { color: var(--danger-ink); }
.callout-title {
  display: block; font-weight: 700; font-size: 0.72rem; letter-spacing: 0.07em;
  text-transform: uppercase; margin-bottom: 0.25rem;
}
.note p:last-child, .warn p:last-child, .danger p:last-child { margin-bottom: 0; }

/* ---------- cards / steps ---------- */

.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; margin: 0 0 1.6rem; }
.card {
  display: block; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.1rem 1.2rem; color: inherit;
  transition: border-color 0.12s ease, transform 0.12s ease;
}
a.card:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-1px); }
.card h3 { margin: 0 0 0.3rem; font-size: 0.95rem; }
.card p { margin: 0; color: var(--muted); font-size: 0.83rem; line-height: 1.5; }

.steps { list-style: none; counter-reset: step; margin: 0 0 1.6rem; padding: 0; }
.steps > li {
  counter-increment: step; position: relative;
  padding: 0 0 1.6rem 3rem; margin: 0;
}
.steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0.05rem;
  width: 1.9rem; height: 1.9rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 700; color: #fff; background: var(--red);
}
.steps > li::after {
  content: ""; position: absolute; left: 0.9rem; top: 2.35rem; bottom: 0.3rem;
  width: 2px; background: var(--border);
}
.steps > li:last-child { padding-bottom: 0; }
.steps > li:last-child::after { display: none; }
.steps h3 { margin: 0 0 0.4rem; font-size: 1rem; }

/* key–value facts strip */
.facts { display: flex; flex-wrap: wrap; gap: 1rem; margin: 0 0 1.8rem; }
.fact {
  flex: 1 1 12rem; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.8rem 1rem;
}
.fact dt { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.2rem; }
.fact dd { margin: 0; font-family: var(--mono); font-size: 0.8rem; overflow-wrap: anywhere; }

/* category chips (node reference) */
.chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.72rem; font-weight: 650; letter-spacing: 0.02em;
  border: 1px solid var(--border); border-radius: 999px; padding: 0.14rem 0.65rem 0.14rem 0.45rem;
  color: var(--text-2); background: var(--surface);
}
.chip .dot { width: 0.55rem; height: 0.55rem; border-radius: 50%; display: inline-block; }

.handles { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.4rem 0 0.9rem; }
.handle {
  font-family: var(--mono); font-size: 0.72rem;
  border: 1px dashed var(--border-strong); border-radius: 6px; padding: 0.1rem 0.5rem;
  color: var(--text-2); background: var(--surface);
}

.node-head { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; }
.node-type { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); }

/* ---------- diagrams ---------- */

.diagram {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem; margin: 0 0 1.6rem; overflow-x: auto;
}
.diagram svg { display: block; margin: 0 auto; min-width: 34rem; }
.diagram .dg-box { fill: var(--dg-box); stroke: var(--border-strong); rx: 8px; }
.diagram .dg-box2 { fill: var(--dg-box-2); stroke: var(--border-strong); }
.diagram .dg-accent { fill: var(--accent-soft); stroke: var(--accent); }
.diagram .dg-title { fill: var(--text); font: 600 12.5px var(--sans); }
.diagram .dg-label { fill: var(--text-2); font: 500 11px var(--sans); }
.diagram .dg-small { fill: var(--muted); font: 400 10px var(--sans); }
.diagram .dg-mono { fill: var(--muted); font: 500 10px var(--mono); }
.diagram .dg-line { stroke: var(--dg-line); stroke-width: 1.4; fill: none; }
.diagram .dg-line-accent { stroke: var(--accent); stroke-width: 1.6; fill: none; }
.diagram .dg-dash { stroke-dasharray: 4 4; }
.diagram-caption { font-size: 0.8rem; color: var(--muted); text-align: center; margin: -0.9rem 0 1.6rem; }

/* ---------- prev / next footer ---------- */

.pager {
  display: flex; justify-content: space-between; gap: 1rem;
  margin-top: 3.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border);
}
.pager a {
  flex: 0 1 48%; display: block; padding: 0.8rem 1rem;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
}
.pager a:hover { text-decoration: none; border-color: var(--accent); }
.pager .dir { display: block; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.15rem; }
.pager .pager-next { text-align: right; margin-left: auto; }

.site-footer {
  margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border);
  font-size: 0.78rem; color: var(--muted);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem;
}
.site-footer a { color: var(--muted); }

/* ---------- changelog ---------- */

.release { border-left: 2px solid var(--border); padding: 0 0 0.5rem 1.5rem; position: relative; margin-bottom: 1rem; }
.release::before {
  content: ""; position: absolute; left: -0.42rem; top: 0.45rem;
  width: 0.75rem; height: 0.75rem; border-radius: 50%;
  background: var(--grad); border: 2px solid var(--bg);
}
.release time { font-size: 0.78rem; font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.release h2 { border-top: none; padding-top: 0; margin-top: 0.2rem; }

/* ---------- responsive ---------- */

@media (max-width: 74rem) {
  .layout { grid-template-columns: 15rem minmax(0, 1fr); gap: 2rem; }
  .toc { display: none; }
}

@media (max-width: 56rem) {
  .layout { grid-template-columns: minmax(0, 1fr); padding: 0 1.25rem; }
  .nav-btn { display: flex; }
  .header-links a:not(.header-cta) { display: none; }

  .sidebar {
    position: fixed; left: 0; top: var(--header-h); bottom: 0; z-index: 50;
    width: 17rem; max-width: 85vw; height: auto;
    background: var(--surface); border-right: 1px solid var(--border);
    padding: 1.5rem 1rem 2.5rem 1rem;
    transform: translateX(-105%);
    transition: transform 0.18s ease;
    box-shadow: none;
  }
  .nav-toggle:checked ~ .layout .sidebar {
    transform: translateX(0);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.25);
  }
  .scrim {
    display: block; position: fixed; inset: var(--header-h) 0 0 0; z-index: 45;
    background: rgba(17, 19, 21, 0.45); opacity: 0; pointer-events: none;
    transition: opacity 0.18s ease;
  }
  .nav-toggle:checked ~ .layout .scrim { opacity: 1; pointer-events: auto; }

  h1 { font-size: 1.7rem; }
  .content { padding-top: 1.6rem; }
  .pager { flex-direction: column; }
  .pager a { flex-basis: auto; }
  .pager .pager-next { margin-left: 0; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sidebar, .scrim, .card, .anchor { transition: none; }
}
