/* eqixiac.com. Palette: optical-fibre jacket colours (aqua OM3, yellow OS2, violet OM4) on slate. */
:root {
  --bg: #f8fafb;
  --surface: #ffffff;
  --ink: #15212b;
  --muted: #4f5e6b;
  --line: #d7dfe5;
  --line-soft: #e8edf1;
  --accent: #0a6770;
  --accent-soft: #dff1f2;
  --yellow: #8a6100;
  --yellow-soft: #fff3cf;
  --yellow-line: #e6b422;
  --violet: #65399e;
  --violet-soft: #f0e9fa;
  --code-bg: #f0f3f6;
  --code-ink: #1b2a36;
  --tok-c: #586671;
  --tok-s: #7a4b00;
  --tok-k: #65399e;
  --tok-t: #0a6770;
  --tok-n: #a03b1a;
  --tok-a: #586671;
  --shadow: 0 8px 28px rgba(21, 33, 43, 0.14);
  --serif: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --sans: "Avenir Next", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --top-h: 56px;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0e161c;
  --surface: #141e26;
  --ink: #dde5eb;
  --muted: #9dabb7;
  --line: #2a3843;
  --line-soft: #1f2b34;
  --accent: #62cbd2;
  --accent-soft: #11343a;
  --yellow: #f0c552;
  --yellow-soft: #33290c;
  --yellow-line: #b88d1c;
  --violet: #c0a6ee;
  --violet-soft: #2a2141;
  --code-bg: #0a1116;
  --code-ink: #d5dee5;
  --tok-c: #8696a2;
  --tok-s: #e9c176;
  --tok-k: #c0a6ee;
  --tok-t: #62cbd2;
  --tok-n: #f0a184;
  --tok-a: #8696a2;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--top-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.65;
}
a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--surface); padding: 8px 12px; border: 1px solid var(--line); font-family: var(--sans); }
.skip:focus { top: 8px; }

/* ---- top bar */
.top {
  position: sticky; top: 0; z-index: 40;
  height: var(--top-h);
  display: flex; align-items: center; gap: 20px;
  padding: 0 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  font-family: var(--sans);
}
.brand { display: flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand-name { font-weight: 700; font-size: 19px; letter-spacing: -0.01em; }
.brand-sub { font-size: 13px; color: var(--muted); padding-left: 10px; border-left: 1px solid var(--line); }
.mark-a { fill: none; stroke: var(--accent); stroke-width: 1.8; }
.mark-b { fill: var(--accent); stroke: var(--accent); stroke-width: 1.8; }
.mark-l { stroke: var(--yellow-line); stroke-width: 2.2; fill: none; stroke-linecap: round; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 4px; color: var(--ink); width: 36px; height: 36px; align-items: center; justify-content: center; cursor: pointer; }
.top-links { display: flex; align-items: center; gap: 18px; margin-left: auto; font-size: 14px; flex: none; }
.top-links a { color: var(--ink); text-decoration: none; }
.top-links a:hover { color: var(--accent); }
.theme-toggle { font: inherit; font-size: 13px; background: none; border: 1px solid var(--line); border-radius: 4px; color: var(--ink); padding: 5px 10px; cursor: pointer; min-width: 58px; }
.theme-toggle:hover { border-color: var(--accent); }

/* ---- search */
.search { position: relative; flex: 0 1 340px; min-width: 0; margin-left: 12px; }
.search-box { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 4px; background: var(--bg); color: var(--muted); }
.search-box:focus-within { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 1px; }
.search-box input { flex: 1; min-width: 0; border: 0; background: none; color: var(--ink); font: 15px var(--sans); outline: none; }
.search-box input::-webkit-search-cancel-button { display: none; }
.search-box kbd { font: 12px var(--mono); border: 1px solid var(--line); border-radius: 3px; padding: 0 5px; color: var(--muted); }
.search-results { position: absolute; top: 42px; left: 0; width: min(560px, 92vw); max-height: 70vh; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow); padding: 6px; }
.search-results a { display: block; padding: 8px 10px; border-radius: 4px; color: var(--ink); text-decoration: none; }
.search-results a[aria-selected="true"], .search-results a:hover { background: var(--accent-soft); }
.search-results .sr-title { font-weight: 600; font-size: 14px; }
.search-results .sr-page { color: var(--muted); font-size: 12px; }
.search-results .sr-text { color: var(--muted); font-size: 13px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.search-results mark { background: var(--yellow-soft); color: inherit; }
.search-empty { padding: 10px; color: var(--muted); font-size: 14px; }

/* ---- shell */
.shell { display: grid; grid-template-columns: 272px minmax(0, 1fr); max-width: 1440px; margin: 0 auto; }
.sidebar {
  position: sticky; top: var(--top-h);
  height: calc(100vh - var(--top-h));
  overflow-y: auto;
  padding: 20px 14px 40px 20px;
  border-right: 1px solid var(--line);
  font-family: var(--sans); font-size: 14px;
}
.nav-group { margin-bottom: 6px; }
.nav-group summary { cursor: pointer; padding: 6px 8px; font-weight: 600; color: var(--ink); list-style: none; border-radius: 4px; display: flex; align-items: center; gap: 8px; }
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary::before { content: ""; width: 7px; height: 7px; border: 1.5px solid var(--muted); border-radius: 1.5px; flex: none; }
.nav-group[open] summary::before { background: var(--accent); border-color: var(--accent); }
.nav-group summary:hover { background: var(--line-soft); }
.nav-group ul { list-style: none; margin: 2px 0 8px 11px; padding: 0 0 0 12px; border-left: 1px solid var(--line); }
.nav-group li a { display: block; padding: 4px 8px; margin-left: -13px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; line-height: 1.4; }
.nav-group li a:hover { color: var(--ink); }
.nav-group li a[aria-current="page"] { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }

.main { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 48px; padding: 40px 40px 80px 56px; }
.layout-home .main { grid-template-columns: minmax(0, 1fr); padding-right: 56px; }
.doc { min-width: 0; max-width: 780px; }
.layout-home .doc { max-width: 1040px; }

/* ---- typography */
.page-head { margin-bottom: 32px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
h1, h2, h3, h4 { font-family: var(--sans); color: var(--ink); line-height: 1.25; letter-spacing: -0.012em; }
h1 { font-size: 34px; font-weight: 700; margin: 0 0 10px; }
h2 { font-size: 24px; font-weight: 650; margin: 48px 0 12px; }
h3 { font-size: 18.5px; font-weight: 650; margin: 32px 0 8px; }
h4 { font-size: 16px; font-weight: 650; margin: 24px 0 6px; }
.lede { font-size: 19px; color: var(--muted); margin: 0; max-width: 62ch; }
p { margin: 0 0 16px; }
.doc > p, .doc li { max-width: 72ch; }
ul, ol { margin: 0 0 16px; padding-left: 24px; }
li { margin: 4px 0; }
li > ul, li > ol { margin: 4px 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }
strong { font-weight: 650; }
.anchor { margin-left: 8px; color: var(--line); text-decoration: none; font-weight: 400; opacity: 0; }
h2:hover .anchor, h3:hover .anchor, h4:hover .anchor, .anchor:focus { opacity: 1; color: var(--accent); }
code { font-family: var(--mono); font-size: 0.84em; background: var(--code-bg); color: var(--code-ink); padding: 1px 5px; border-radius: 3px; overflow-wrap: anywhere; }
h1 code, h2 code, h3 code { font-size: 0.9em; }

.badge { display: inline-block; font: 600 11.5px/1 var(--sans); padding: 4px 7px; border-radius: 3px; vertical-align: 0.12em; white-space: nowrap; letter-spacing: 0; }
h1 .badge { vertical-align: 0.5em; margin-left: 8px; }
.badge-beta { background: var(--violet-soft); color: var(--violet); }
.badge-new { background: var(--accent-soft); color: var(--accent); }
.badge-planned { background: var(--yellow-soft); color: var(--yellow); }
.sidebar .badge { font-size: 10.5px; padding: 2px 5px; margin-left: 4px; }

/* ---- code */
.code { margin: 0 0 20px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 4px; background: var(--code-bg); overflow: hidden; }
.code-bar { display: flex; justify-content: space-between; align-items: center; padding: 0 6px 0 14px; height: 30px; border-bottom: 1px solid var(--line); font-family: var(--sans); font-size: 12px; color: var(--muted); }
.copy { font: inherit; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 4px 8px; border-radius: 3px; }
.copy:hover { color: var(--accent); background: var(--accent-soft); }
pre { margin: 0; padding: 14px 16px; overflow-x: auto; font: 13.5px/1.6 var(--mono); color: var(--code-ink); tab-size: 4; }
pre code { background: none; padding: 0; font-size: inherit; overflow-wrap: normal; }
.tok-c { color: var(--tok-c); font-style: italic; }
.tok-s { color: var(--tok-s); }
.tok-k { color: var(--tok-k); }
.tok-t { color: var(--tok-t); }
.tok-n { color: var(--tok-n); }
.tok-a { color: var(--tok-a); }

/* ---- tables */
.table-wrap { overflow-x: auto; margin: 0 0 20px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-family: var(--sans); font-size: 14px; line-height: 1.45; }
th, td { text-align: left; vertical-align: top; padding: 8px 12px; border-bottom: 1px solid var(--line-soft); }
th { font-weight: 650; background: var(--code-bg); border-bottom: 1px solid var(--line); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---- callouts */
.callout { margin: 0 0 20px; padding: 12px 16px 2px; border: 1px solid var(--line); border-left: 3px solid var(--muted); border-radius: 4px; background: var(--surface); font-size: 16px; }
.callout-title { font: 650 13.5px var(--sans); margin-bottom: 4px; color: var(--muted); }
.callout-warn, .callout-limit { border-left-color: var(--yellow-line); }
.callout-warn .callout-title, .callout-limit .callout-title, .callout-planned .callout-title { color: var(--yellow); }
.callout-planned { border-left-color: var(--yellow-line); border-left-style: dashed; }
.callout-beta { border-left-color: var(--violet); }
.callout-beta .callout-title { color: var(--violet); }
.callout-new { border-left-color: var(--accent); }
.callout-new .callout-title { color: var(--accent); }

/* ---- figures */
.figure { margin: 8px 0 24px; padding: 16px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); }
.figure figcaption { font: 13.5px/1.45 var(--sans); color: var(--muted); margin-top: 10px; }
.diagram { display: block; width: 100%; height: auto; font-family: var(--sans); }
.d-box { fill: var(--surface); stroke: var(--ink); stroke-width: 1.2; }
.d-router { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.6; }
.d-cloud { fill: var(--violet-soft); stroke: var(--violet); }
.d-device { fill: var(--yellow-soft); stroke: var(--yellow-line); }
.d-ext { fill: var(--bg); stroke: var(--muted); stroke-dasharray: 4 3; }
.d-store { fill: var(--code-bg); stroke: var(--muted); }
.d-text { fill: var(--ink); font-size: 13px; font-weight: 600; }
.d-sub { font-weight: 400; font-size: 11.5px; fill: var(--muted); }
.d-link { stroke: var(--muted); stroke-width: 1.4; fill: none; }
.d-dashed { stroke-dasharray: 5 4; }
.d-arrow { fill: var(--muted); }
.d-label { fill: var(--ink); font-size: 11px; }
.d-label-bg { fill: var(--surface); stroke: var(--line); stroke-width: 0.8; }
.d-group { fill: none; stroke: var(--line); stroke-width: 1.2; stroke-dasharray: 2 3; }
.d-group-label, .d-note { fill: var(--muted); font-size: 11.5px; }

/* ---- toc */
.toc { position: sticky; top: calc(var(--top-h) + 40px); align-self: start; max-height: calc(100vh - var(--top-h) - 80px); overflow-y: auto; font-family: var(--sans); font-size: 13px; }
.toc-title { font-weight: 650; margin: 0 0 8px; color: var(--ink); }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc li { margin: 0; }
.toc a { display: block; padding: 3px 0 3px 12px; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; line-height: 1.4; }
.toc a:hover { color: var(--ink); }
.toc a.active { color: var(--accent); border-left-color: var(--accent); }
.toc .toc-3 a { padding-left: 24px; }

/* ---- prev/next + footer */
.prev-next { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); font-family: var(--sans); }
.pn { display: block; padding: 12px 14px; border: 1px solid var(--line); border-radius: 4px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: 15px; background: var(--surface); }
.pn:hover { border-color: var(--accent); color: var(--accent); }
.pn span { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
.pn-next { text-align: right; }
.foot { border-top: 1px solid var(--line); padding: 24px 40px 40px; font: 13.5px/1.55 var(--sans); color: var(--muted); background: var(--surface); }
.foot p { max-width: 96ch; margin: 0 auto 6px; }
.foot strong { color: var(--ink); }

/* ---- home */
.hero { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 40px; align-items: center; padding: 8px 0 40px; border-bottom: 1px solid var(--line); margin-bottom: 40px; }
.hero h1 { font-size: 40px; line-height: 1.12; letter-spacing: -0.022em; margin-bottom: 16px; }
.hero p { font-size: 18.5px; color: var(--muted); max-width: 46ch; }
.hero .figure { margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; font-family: var(--sans); }
.btn { display: inline-block; padding: 10px 16px; border-radius: 4px; border: 1px solid var(--accent); background: var(--accent); color: var(--surface); font-weight: 600; font-size: 15px; text-decoration: none; }
[data-theme="dark"] .btn { color: #0e161c; }
.btn:hover { filter: brightness(1.08); }
.btn-quiet { background: none; color: var(--accent); }
[data-theme="dark"] .btn-quiet { color: var(--accent); }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 0 0 40px; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); font-family: var(--sans); }
.facts li { margin: 0; padding: 14px 16px; border-right: 1px solid var(--line-soft); font-size: 13.5px; color: var(--muted); line-height: 1.4; max-width: none; }
.facts li:last-child { border-right: 0; }
.facts b { display: block; font-size: 15px; color: var(--ink); font-weight: 650; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 0 0 32px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.grid a { display: block; padding: 16px 18px 18px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; background: var(--surface); }
.grid a:hover { background: var(--accent-soft); }
.grid b { display: block; font: 650 16px var(--sans); margin-bottom: 4px; color: var(--accent); }
.grid span { font-size: 15px; color: var(--muted); line-height: 1.45; display: block; }

/* ---- responsive */
@media (max-width: 1180px) {
  .main { grid-template-columns: minmax(0, 1fr); padding: 32px 32px 64px 40px; }
  .toc { display: none; }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .hero h1 { font-size: 34px; }
}
@media (max-width: 900px) {
  .brand-sub { display: none; }
  .nav-toggle { display: inline-flex; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: var(--top-h); z-index: 30; width: min(300px, 86vw); background: var(--surface); transform: translateX(-100%); visibility: hidden; transition: transform 0.18s ease, visibility 0.18s; box-shadow: var(--shadow); }
  .sidebar.open { transform: none; visibility: visible; }
  .main, .layout-home .main { padding: 24px 20px 56px; }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .hero h1 { font-size: 31px; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts li:nth-child(2) { border-right: 0; }
  .facts li:nth-child(-n+2) { border-bottom: 1px solid var(--line-soft); }
  .grid { grid-template-columns: minmax(0, 1fr); }
  h1 { font-size: 28px; }
  .top { gap: 10px; padding: 0 12px; }
  .top-links a { display: none; }
  .search { margin-left: 0; flex: 1 1 0; }
  .brand { flex: none; }
  .search-results { position: fixed; top: calc(var(--top-h) + 4px); left: 8px; right: 8px; width: auto; }
  .search-box kbd { display: none; }
  .foot { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print {
  .top, .sidebar, .toc, .prev-next, .copy, .foot a[href*="edit"] { display: none !important; }
  .shell, .main { display: block; padding: 0; }
  body { background: #fff; font-size: 11pt; }
}
