/* ========================================================================
   Essarion Documentation — shared styles
   Matches the essarion_static editorial theme.
   ======================================================================== */

:root {
  --bg: #06070A;
  --ink: #0B0D11;
  --line: rgba(255,255,255,.06);
  --line-2: rgba(255,255,255,.10);
  --line-3: rgba(255,255,255,.14);
  --text: #EDEFF3;
  --muted: #8A8F9A;
  --dim: #56596A;
  --warm: #F1E3CC;
  --moss: #B8D4C5;
  --rust: #E8B89A;
  --max: 1240px;
  --doc-max: 1180px;
  --read: 760px;
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'ss01','cv11';
}
html { scroll-behavior: smooth; }
body { overflow-x: hidden; }

::selection { background: rgba(241,227,204,.18); color: #fff; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

.mono {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
}
.serif {
  font-family: 'Instrument Serif', ui-serif, Georgia;
  font-style: italic;
  font-weight: 400;
}

/* ====== ATMOSPHERIC BACKDROP ====== */
.ambient { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.ambient .haze {
  position: absolute; inset: -20%;
  background:
    radial-gradient(40% 35% at 78% 18%, rgba(241,227,204,.10), transparent 60%),
    radial-gradient(50% 50% at 12% 90%, rgba(184,212,197,.07), transparent 60%),
    radial-gradient(60% 60% at 50% 50%, rgba(255,255,255,.02), transparent 70%);
  filter: blur(40px);
  transition: transform 1.2s ease-out;
}
.ambient .grain {
  position: absolute; inset: 0; opacity: .5; mix-blend-mode: overlay;
  background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,.08) 1px, transparent 0);
  background-size: 3px 3px;
}
.ambient .noise {
  position: absolute; inset: 0; opacity: .04;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 1.2 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ====== NAV ====== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 80;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 32px;
  transition: background .3s, border-color .3s, backdrop-filter .3s;
}
.nav.scrolled {
  background: rgba(6,7,10,.72);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.nav .brand {
  font-size: 15px; font-weight: 500; letter-spacing: -0.01em;
  display: inline-flex; align-items: center; gap: 9px;
}
.nav .brand .mark {
  width: 7px; height: 7px; border-radius: 99px;
  background: var(--warm); box-shadow: 0 0 12px rgba(241,227,204,.6);
}
.nav .brand .tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--muted); margin-left: 4px;
}
.nav .links { display: flex; gap: 30px; }
.nav .links a { font-size: 13px; color: var(--muted); transition: color .2s; }
.nav .links a:hover, .nav .links a.active { color: #fff; }
.nav .cta { font-size: 13px; color: var(--text); display: inline-flex; align-items: center; gap: 8px; }
.nav .cta .arr { display: inline-block; width: 14px; height: 1px; background: currentColor; position: relative; transition: width .25s; }
.nav .cta .arr::after { content: ""; position: absolute; right: 0; top: -3px; width: 6px; height: 6px; border-top: 1px solid currentColor; border-right: 1px solid currentColor; transform: rotate(45deg); }
.nav .cta:hover .arr { width: 22px; }

/* nav trail = search + cta cluster on the right */
.nav-trail {
  display: flex; align-items: center; gap: 18px;
}

/* header search field */
.nav-search {
  position: relative;
  display: inline-flex; align-items: center; gap: 10px;
  height: 34px; min-width: 240px;
  padding: 0 10px 0 12px;
  border: 1px solid var(--line-2);
  border-radius: 5px;
  background: rgba(255,255,255,.02);
  color: var(--muted);
  transition: border-color .2s, background .2s, color .2s, min-width .25s;
}
.nav-search:hover { border-color: var(--line-3); color: #C7CAD3; }
.nav-search:focus-within {
  border-color: var(--warm);
  background: rgba(255,255,255,.035);
  color: #fff;
  min-width: 280px;
}
.nav-search svg { flex-shrink: 0; opacity: .7; }
.nav-search input {
  flex: 1; min-width: 0;
  background: transparent; border: 0; outline: 0;
  font: inherit; color: #fff;
  font-size: 13px;
  padding: 0;
}
.nav-search input::placeholder { color: var(--dim); }
.nav-search input::-webkit-search-cancel-button { display: none; }
.nav-search .kbd {
  flex-shrink: 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; letter-spacing: .12em;
  color: var(--muted);
  border: 1px solid var(--line-2);
  border-radius: 3px; padding: 1px 6px;
  background: rgba(255,255,255,.02);
  transition: opacity .2s;
}
.nav-search:focus-within .kbd { opacity: 0; }

/* search results panel (anchored beneath the header) */
.search-panel {
  position: fixed;
  top: 68px;
  right: 32px;
  width: 520px;
  max-width: calc(100vw - 64px);
  max-height: min(560px, calc(100vh - 110px));
  background: rgba(11,13,17,.94);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5), 0 1px 0 rgba(255,255,255,.03) inset;
  z-index: 95;
  display: none;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .18s ease, transform .18s ease;
}
.search-panel.open {
  display: flex;
  opacity: 1;
  transform: none;
}
.search-panel .head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--dim);
}
.search-panel .head .count { color: var(--muted); }
.search-panel .body {
  overflow-y: auto;
  padding: 6px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--line-3) transparent;
}
.search-panel .body::-webkit-scrollbar { width: 6px; }
.search-panel .body::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; }

.search-empty, .search-none {
  padding: 28px 20px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.6;
  text-align: center;
}
.search-empty .hint {
  display: block;
  margin-top: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--dim);
}

.search-group {
  padding: 8px 0 4px;
}
.search-group .group-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--dim);
  padding: 6px 18px 4px;
}

.search-result {
  display: block;
  padding: 10px 18px;
  border-left: 2px solid transparent;
  transition: background .15s, border-color .15s;
  cursor: pointer;
}
.search-result + .search-result { border-top: 1px solid var(--line); }
.search-result:hover, .search-result.active {
  background: rgba(241,227,204,.04);
  border-left-color: var(--warm);
}
.search-result .row1 {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 4px;
  font-size: 10.5px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--dim);
}
.search-result .pill {
  border: 1px solid var(--line-2);
  border-radius: 3px;
  padding: 2px 7px;
  color: var(--muted);
  background: rgba(255,255,255,.02);
}
.search-result .row1 .arr {
  margin-left: auto;
  opacity: 0;
  transition: opacity .2s, transform .2s;
  color: var(--warm);
}
.search-result:hover .row1 .arr,
.search-result.active .row1 .arr {
  opacity: 1;
  transform: translateX(2px);
}
.search-result .title {
  font-size: 14.5px;
  color: #fff;
  font-weight: 400;
  letter-spacing: -0.012em;
  line-height: 1.3;
}
.search-result .title em {
  font-family: 'Instrument Serif', ui-serif, Georgia;
  font-style: italic;
  color: var(--warm);
}
.search-result .title .heading-sep {
  color: var(--dim);
  margin: 0 6px;
  font-style: normal;
}
.search-result .snippet {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.search-result mark {
  background: rgba(241,227,204,.18);
  color: #fff;
  padding: 0 2px;
  border-radius: 2px;
}

.search-foot {
  display: flex; gap: 18px; align-items: center;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--dim);
}
.search-foot .key {
  border: 1px solid var(--line-2);
  border-radius: 3px;
  padding: 1px 6px;
  color: var(--muted);
  margin-right: 6px;
}

/* ====== PROGRESS RAIL ====== */
.prg {
  position: fixed; top: 0; left: 0;
  height: 1px; background: linear-gradient(90deg, transparent, var(--warm));
  width: 0; z-index: 90;
}

/* ====== DOC LAYOUT ====== */
.doc-shell {
  max-width: var(--doc-max);
  margin: 0 auto;
  padding: 130px 32px 120px;
  display: grid;
  grid-template-columns: 240px 1fr 200px;
  gap: 56px;
  align-items: start;
}

/* sidebar */
.doc-side {
  position: sticky; top: 110px;
  align-self: start;
  font-size: 13px;
  max-height: calc(100vh - 130px);
  overflow-y: auto;
  padding-right: 16px;
}
.doc-side::-webkit-scrollbar { width: 4px; }
.doc-side::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 2px; }
.doc-side .group { margin-bottom: 26px; }
.doc-side .group-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--dim); margin-bottom: 12px;
}
.doc-side ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.doc-side li a {
  display: block; padding: 6px 10px;
  color: var(--muted); border-radius: 4px;
  border-left: 1px solid transparent;
  transition: color .2s, border-color .2s, background .2s;
  font-size: 13px;
}
.doc-side li a:hover { color: #fff; border-left-color: var(--line-2); }
.doc-side li a.active {
  color: #fff;
  border-left-color: var(--warm);
  background: rgba(241,227,204,.04);
}

/* main column */
.doc-main { min-width: 0; max-width: var(--read); }
.doc-main .crumb {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 18px;
  display: flex; align-items: center; gap: 12px;
}
.doc-main .crumb span.sep { width: 18px; height: 1px; background: rgba(255,255,255,.18); display: inline-block; }
.doc-main .crumb a { color: var(--muted); }
.doc-main .crumb a:hover { color: var(--warm); }

.doc-main h1 {
  font-weight: 400;
  font-size: clamp(38px, 4.4vw, 58px);
  line-height: 1.04;
  letter-spacing: -0.03em;
  margin: 0 0 18px;
  color: #fff;
  text-wrap: balance;
}
.doc-main h1 em { font-family: 'Instrument Serif'; font-style: italic; font-weight: 400; color: var(--warm); }

.doc-main .lede {
  font-size: 19px;
  line-height: 1.55;
  color: #C7CAD3;
  margin: 0 0 40px;
  max-width: 60ch;
  font-weight: 300;
  letter-spacing: -0.005em;
}

.doc-main h2 {
  margin: 64px 0 18px;
  font-weight: 400;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -0.022em;
  color: #fff;
  scroll-margin-top: 110px;
}
.doc-main h2 em { font-family: 'Instrument Serif'; font-style: italic; color: var(--moss); }
.doc-main h2 .anchor {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; color: var(--dim); margin-right: 14px;
  letter-spacing: .18em;
}

.doc-main h3 {
  margin: 38px 0 12px;
  font-weight: 500;
  font-size: 19px;
  letter-spacing: -0.012em;
  color: #fff;
  scroll-margin-top: 110px;
}
.doc-main h4 {
  margin: 26px 0 8px;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.005em;
  color: #fff;
}

.doc-main p {
  margin: 0 0 18px;
  font-size: 15.5px;
  line-height: 1.7;
  color: #C2C5CE;
  font-weight: 300;
}
.doc-main p strong { color: #fff; font-weight: 500; }
.doc-main p em.q { font-family: 'Instrument Serif'; font-style: italic; color: var(--moss); font-weight: 400; }

.doc-main ul, .doc-main ol {
  margin: 0 0 22px;
  padding-left: 22px;
  color: #C2C5CE;
  font-size: 15px;
  line-height: 1.7;
}
.doc-main ul li, .doc-main ol li { margin: 6px 0; }
.doc-main ul li::marker { color: var(--dim); }
.doc-main ol li::marker { color: var(--dim); font-family: 'JetBrains Mono', monospace; font-size: 13px; }

.doc-main hr {
  border: 0; border-top: 1px solid var(--line);
  margin: 56px 0;
}

/* inline code */
.doc-main code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  background: rgba(255,255,255,.04);
  padding: 2px 7px;
  border-radius: 3px;
  border: 1px solid var(--line);
  color: var(--warm);
}

/* code blocks */
.doc-main pre {
  margin: 16px 0 24px;
  padding: 18px 20px;
  background: rgba(255,255,255,.02);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.6;
  color: #D6D9E0;
}
.doc-main pre code {
  background: none; border: 0; padding: 0; color: inherit; font-size: inherit;
}
.doc-main pre::-webkit-scrollbar { height: 6px; }
.doc-main pre::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; }

/* code label */
.code-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--dim); margin: 24px 0 8px;
  display: flex; align-items: center; gap: 12px;
}
.code-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* call-outs */
.note, .warn, .tip {
  margin: 22px 0;
  padding: 16px 20px 16px 18px;
  border-left: 2px solid var(--warm);
  background: rgba(241,227,204,.04);
  border-radius: 0 4px 4px 0;
  font-size: 14.5px;
  line-height: 1.65;
  color: #D6D9E0;
}
.note .label, .warn .label, .tip .label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--warm); margin-right: 10px;
}
.warn { border-left-color: var(--rust); background: rgba(232,184,154,.06); }
.warn .label { color: var(--rust); }
.tip { border-left-color: var(--moss); background: rgba(184,212,197,.05); }
.tip .label { color: var(--moss); }

/* method/endpoint blocks */
.endpoint {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px;
  background: rgba(255,255,255,.02);
  border: 1px solid var(--line);
  border-radius: 5px;
  margin: 14px 0 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13.5px;
  flex-wrap: wrap;
}
.endpoint .verb {
  font-weight: 600;
  letter-spacing: .12em;
  font-size: 11.5px;
  padding: 4px 10px;
  border-radius: 3px;
}
.endpoint .verb.get  { color: #B8D4C5; background: rgba(184,212,197,.10); }
.endpoint .verb.post { color: #F1E3CC; background: rgba(241,227,204,.10); }
.endpoint .verb.put  { color: #E8B89A; background: rgba(232,184,154,.10); }
.endpoint .verb.del  { color: #E89A9A; background: rgba(232,154,154,.10); }
.endpoint .path { color: #fff; word-break: break-all; }

/* parameter table */
.param-table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0 28px;
  font-size: 14px;
}
.param-table th, .param-table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.param-table th {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--dim);
  font-weight: 400;
  border-bottom-color: var(--line-2);
}
.param-table td.k {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--warm);
  white-space: nowrap;
}
.param-table td.t {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--moss);
  white-space: nowrap;
}
.param-table td.r {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--dim);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.param-table td.d {
  color: #C2C5CE;
  font-size: 14px;
  line-height: 1.6;
}

/* TOC right column */
.doc-toc {
  position: sticky; top: 110px;
  align-self: start;
  font-size: 12.5px;
  max-height: calc(100vh - 130px);
  overflow-y: auto;
}
.doc-toc .toc-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--dim); margin-bottom: 14px;
  border-left: 1px solid var(--line); padding-left: 14px;
}
.doc-toc ul { list-style: none; padding: 0 0 0 14px; margin: 0;
  border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.doc-toc li a {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
  transition: color .2s;
  display: block;
}
.doc-toc li a:hover, .doc-toc li a.active { color: var(--warm); }
.doc-toc li.indent { padding-left: 14px; }

/* footer next-prev */
.doc-pager {
  margin: 80px 0 0;
  padding-top: 32px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 24px;
}
.doc-pager a {
  display: flex; flex-direction: column; gap: 4px;
  color: var(--muted); font-size: 14px;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 16px 20px;
  flex: 1; max-width: 320px;
  transition: border-color .25s, background .25s, color .25s;
}
.doc-pager a:hover { border-color: var(--line-3); background: rgba(255,255,255,.02); color: #fff; }
.doc-pager a .k {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--dim);
}
.doc-pager a .t { font-size: 16px; color: #fff; }
.doc-pager a.next { text-align: right; align-items: flex-end; margin-left: auto; }

/* footer */
footer.site {
  padding: 60px 32px 36px;
  border-top: 1px solid var(--line);
}
footer.site .row {
  max-width: var(--max);
  margin: 0 auto;
  display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; align-items: flex-end;
}
footer.site .b { display: inline-flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 500; }
footer.site .b .mark {
  width: 7px; height: 7px; border-radius: 99px;
  background: var(--warm); box-shadow: 0 0 10px rgba(241,227,204,.5);
}
footer.site .links { display: flex; gap: 30px; font-size: 13px; color: var(--muted); }
footer.site .links a:hover { color: #fff; }
footer.site .meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--dim);
}

/* ====== INDEX (landing) PAGE ====== */
.idx-hero {
  position: relative;
  padding: 180px 32px 100px;
}
.idx-hero .container { max-width: var(--max); margin: 0 auto; }
.idx-hero .crumb {
  display: inline-flex; align-items: center; gap: 14px; margin-bottom: 44px;
}
.idx-hero .crumb span { display: inline-block; width: 28px; height: 1px; background: rgba(255,255,255,.2); }
.idx-hero .crumb em {
  font-style: normal; color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: .22em; text-transform: uppercase;
}
.idx-hero h1 {
  font-weight: 400;
  font-size: clamp(48px, 8vw, 120px);
  line-height: .96;
  letter-spacing: -0.04em;
  margin: 0; max-width: 13ch;
  color: #fff;
}
.idx-hero h1 em { font-family: 'Instrument Serif'; font-style: italic; font-weight: 400; color: var(--warm); }
.idx-hero p {
  margin-top: 32px;
  max-width: 580px;
  font-size: 17px; line-height: 1.6; color: #B6BAC4;
}

/* search bar (decorative) */
.idx-search {
  margin: 48px 0 0;
  max-width: 580px;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  background: rgba(255,255,255,.015);
  transition: border-color .25s;
}
.idx-search:focus-within { border-color: var(--warm); }
.idx-search svg { flex-shrink: 0; opacity: .55; }
.idx-search input {
  flex: 1;
  background: transparent; border: 0;
  font: inherit; color: #fff;
  font-size: 14.5px; outline: none;
}
.idx-search input::placeholder { color: var(--dim); }
.idx-search .kbd {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; letter-spacing: .12em;
  color: var(--muted);
  border: 1px solid var(--line-2);
  border-radius: 3px; padding: 2px 7px;
}

.idx-section {
  position: relative;
  padding: 100px 32px;
  border-top: 1px solid var(--line);
}
.idx-section .container { max-width: var(--max); margin: 0 auto; }
.idx-section .section-head {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 40px;
  margin-bottom: 60px; flex-wrap: wrap;
}
.idx-section .section-head .k {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted);
}
.idx-section .section-head h2 {
  margin: 8px 0 0;
  font-weight: 400;
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1.04;
  letter-spacing: -0.028em;
  max-width: 18ch;
  color: #fff;
}
.idx-section .section-head h2 em {
  font-family: 'Instrument Serif'; font-style: italic; font-weight: 400; color: var(--warm);
}
.idx-section .section-head p {
  max-width: 420px; color: var(--muted); font-size: 14.5px; line-height: 1.6; margin: 0;
}

/* card grid */
.card-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px;
}
.card-grid.three { grid-template-columns: repeat(3, 1fr); }
.card-grid.four  { grid-template-columns: repeat(4, 1fr); }
.card {
  display: flex; flex-direction: column; gap: 14px;
  padding: 30px 28px 26px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255,255,255,.012);
  transition: border-color .3s, background .3s, transform .3s;
  position: relative;
  overflow: hidden;
  min-height: 220px;
}
.card:hover { border-color: var(--line-3); background: rgba(255,255,255,.025); transform: translateY(-2px); }
.card .num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: .22em; color: var(--dim);
}
.card h3 {
  margin: 0;
  font-weight: 400;
  font-size: 22px; line-height: 1.1;
  letter-spacing: -0.018em;
  color: #fff;
}
.card h3 em { font-family: 'Instrument Serif'; font-style: italic; font-weight: 400; color: var(--moss); }
.card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; flex: 1; }
.card .arr-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--muted);
}
.card .arr {
  width: 28px; height: 28px; border-radius: 99px;
  border: 1px solid var(--line-2);
  display: grid; place-items: center;
  color: var(--muted);
  transition: background .3s, color .3s, border-color .3s, transform .3s;
}
.card:hover .arr { background: var(--warm); color: #0B0D11; border-color: var(--warm); transform: translate(3px,-3px); }

/* link-list (used by section pages, etc.) */
.link-list {
  list-style: none; padding: 0; margin: 0;
}
.link-list li {
  border-top: 1px solid var(--line);
}
.link-list li:last-child { border-bottom: 1px solid var(--line); }
.link-list a {
  display: grid;
  grid-template-columns: 88px 1fr 1.4fr 36px;
  gap: 32px; align-items: center;
  padding: 24px 0;
  transition: padding .3s;
  position: relative;
}
.link-list a:hover { padding-left: 14px; }
.link-list a::before {
  content: ""; position: absolute; left: 0; top: 50%;
  width: 0; height: 1px; background: var(--warm);
  transition: width .3s; transform: translateY(-50%);
}
.link-list a:hover::before { width: 6px; }
.link-list .num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px; letter-spacing: .18em; color: var(--dim);
  transition: color .3s;
}
.link-list a:hover .num { color: var(--warm); }
.link-list h4 {
  margin: 0;
  font-weight: 400;
  font-size: 19px; line-height: 1.15;
  letter-spacing: -0.015em;
  color: #fff;
}
.link-list h4 em { font-family: 'Instrument Serif'; font-style: italic; color: var(--warm); }
.link-list p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.link-list .arr {
  justify-self: end;
  width: 32px; height: 32px; border-radius: 99px;
  border: 1px solid var(--line-2);
  display: grid; place-items: center; color: var(--muted);
  transition: all .3s;
}
.link-list a:hover .arr { background: var(--warm); color: #0B0D11; border-color: var(--warm); transform: translate(3px,-3px); }

/* ====== REVEAL ====== */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 1s ease, transform 1s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ====== RESPONSIVE ====== */
@media (max-width: 1100px) {
  .doc-shell { grid-template-columns: 220px 1fr; }
  .doc-toc { display: none; }
}
@media (max-width: 1040px) {
  .nav-search { min-width: 200px; }
  .nav-search .kbd { display: none; }
}
@media (max-width: 880px) {
  .doc-shell { grid-template-columns: 1fr; gap: 24px; padding-top: 110px; }
  .doc-side {
    position: static; max-height: none;
    border-bottom: 1px solid var(--line);
    padding-bottom: 18px; margin-bottom: 8px;
  }
  .nav .links { display: none; }
  .nav .cta { display: none; }
  .nav-search { min-width: 0; flex: 1; max-width: 360px; }
  .card-grid, .card-grid.three, .card-grid.four { grid-template-columns: 1fr; }
  .link-list a { grid-template-columns: 50px 1fr 32px; gap: 16px; }
  .link-list a p { grid-column: 2; margin-top: 4px; }
  .search-panel { right: 16px; left: 16px; width: auto; }
}
@media (max-width: 600px) {
  .idx-hero { padding: 140px 24px 60px; }
  .idx-section { padding: 80px 24px; }
  .doc-shell { padding: 100px 24px 80px; }
  .nav { padding: 18px 20px; }
  .search-panel { top: 64px; }
}
@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
