/* dexterm.xyz (task-1300). Palette = dexterm/marketing/brand/tokens.css (the app's cyberspace theme).
   Rules: monospace only (system stack, nothing loaded), near-black backgrounds, rain in the gutters never over
   text, coral for anything Claude and for "coming", every text colour >= 4.5:1 on its background, motion off
   under prefers-reduced-motion, no layout shift (every image has width/height). */

:root {
  --dx-bg: #020507;
  --dx-panel: #03090c;
  --dx-panelAlt: #051017;
  --dx-border: #0c3a24;
  --dx-borderFocus: #39ff14;
  --dx-text: #eafff0;
  --dx-muted: #62c98a;
  --dx-dim: #3aa866;
  --dx-accent: #00f0ff;
  --dx-up: #5dff6e;
  --dx-down: #ff3b6b;
  --dx-warn: #f5ff2d;
  --dx-coral: #d97757;
  --dx-magenta: #ff2bd6;
  --dx-phosphor: #39ff14;
  --dx-font-mono: 'JetBrains Mono', 'SF Mono', Menlo, Monaco, 'Cascadia Code', 'DejaVu Sans Mono', monospace;
  --max: 1120px;
  --max-wide: 1480px;
  --pad: clamp(16px, 4vw, 40px);
  --radius: 6px;
  --top-h: 56px;
}

* { box-sizing: border-box; }
html { background: var(--dx-bg); color: var(--dx-text); font: 15px/1.6 var(--dx-font-mono); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; min-height: 100vh; position: relative; overflow-x: clip; }
img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--dx-accent); text-decoration: underline; text-decoration-color: rgba(0, 240, 255, .4); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--dx-accent); }
:focus-visible { outline: 2px solid var(--dx-borderFocus); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(26px, 4vw, 40px); }
h2 { font-size: clamp(20px, 2.8vw, 27px); color: var(--dx-phosphor); scroll-margin-top: calc(var(--top-h) + 16px); }
h3 { font-size: 17px; scroll-margin-top: calc(var(--top-h) + 16px); }
h4 { font-size: 15px; }
p { margin: 0 0 1em; }
code, pre, kbd { font-family: var(--dx-font-mono); }
code { color: var(--dx-text); background: var(--dx-panelAlt); border: 1px solid var(--dx-border); border-radius: 4px; padding: 0 .35em; font-size: .93em; overflow-wrap: anywhere; }
pre { margin: 0; overflow: auto; }
pre code { display: block; background: none; border: 0; padding: 0; overflow-wrap: normal; }
kbd { display: inline-block; border: 1px solid var(--dx-dim); border-bottom-width: 2px; border-radius: 4px; padding: 0 .45em; font-size: .9em; line-height: 1.5; color: var(--dx-text); background: var(--dx-panel); white-space: nowrap; }
hr { border: 0; border-top: 1px solid var(--dx-border); margin: 40px 0; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--dx-border); }
th { color: var(--dx-muted); font-weight: 700; }
tbody th { color: var(--dx-text); }
tbody tr:hover { background: var(--dx-panel); }
.tbl { overflow-x: auto; margin: 0 0 1.2em; border: 1px solid var(--dx-border); border-radius: var(--radius); background: var(--dx-panel); }
.tbl table { margin: 0; }
.tbl td code, .tbl th code { white-space: nowrap; }
table.compact td, table.compact th { padding: 5px 10px; font-size: 13.5px; }
table.keys td:first-child { white-space: nowrap; }
table.keys .ev { color: var(--dx-dim); font-size: 12px; }
table.flags td:first-child { white-space: nowrap; min-width: 180px; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); position: relative; }
.wrap.wide { max-width: var(--max-wide); }
.muted { color: var(--dx-muted); }
.coral { color: var(--dx-coral); }
.small { font-size: 13px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -40px; background: var(--dx-phosphor); color: #020507; padding: 6px 10px; border-radius: 4px; z-index: 50; text-decoration: none; }
.skip:focus { top: 8px; }

/* rain lives behind everything, in the gutters; the content column sits on an opaque sheet */
#rain { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.page { position: relative; z-index: 1; }
.sheet { background: var(--dx-bg); box-shadow: 0 0 0 1px var(--dx-border), 0 0 80px rgba(2, 5, 7, .9); min-height: 60vh; }
@media (min-width: 1240px) { .sheet { margin: 0 auto; max-width: calc(var(--max) + 2 * var(--pad)); } .sheet.wide { max-width: calc(var(--max-wide) + 2 * var(--pad)); } }

/* top bar */
.top { position: sticky; top: 0; z-index: 5; background: rgba(2, 5, 7, .94); border-bottom: 1px solid var(--dx-border); backdrop-filter: blur(6px); }
.top .wrap { display: flex; align-items: center; gap: 14px 18px; min-height: var(--top-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--dx-text); font-weight: 700; }
.brand .cursor { color: var(--dx-phosphor); }
.nav { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; }
.nav a { color: var(--dx-muted); text-decoration: none; padding: 4px 0; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--dx-text); }
.nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--dx-phosphor); }
.navtoggle { font: inherit; font-size: 13px; background: var(--dx-panelAlt); color: var(--dx-text); border: 1px solid var(--dx-border); border-radius: 4px; padding: 4px 10px; cursor: pointer; margin-left: auto; }
.search { margin-left: auto; position: relative; flex: 0 1 260px; min-width: 140px; }
.search input { width: 100%; font: inherit; font-size: 13px; color: var(--dx-text); background: var(--dx-panelAlt); border: 1px solid var(--dx-border); border-radius: 4px; padding: 5px 10px; }
.search input::placeholder { color: var(--dx-dim); }
.search input:focus { border-color: var(--dx-phosphor); outline: none; }
.results { position: absolute; top: calc(100% + 6px); right: 0; width: min(520px, 92vw); max-height: 70vh; overflow: auto; margin: 0; padding: 6px; list-style: none; background: var(--dx-panel); border: 1px solid var(--dx-border); border-radius: var(--radius); box-shadow: 0 10px 40px rgba(0, 0, 0, .6); z-index: 20; }
.results li { padding: 0; }
.results a { display: block; padding: 8px 10px; border-radius: 4px; text-decoration: none; color: var(--dx-text); }
.results a:hover, .results li[aria-selected="true"] a { background: var(--dx-panelAlt); }
.results .t { display: block; font-weight: 700; }
.results .t .sec { color: var(--dx-dim); font-weight: 400; font-size: 12px; }
.results .s { display: block; color: var(--dx-muted); font-size: 12.5px; }
.results mark { background: rgba(57, 255, 20, .22); color: var(--dx-text); border-radius: 2px; }
.results .none { color: var(--dx-muted); padding: 8px 10px; font-size: 13px; }

/* hero (placeholder index + features head) */
.hero { padding: clamp(36px, 7vw, 80px) 0 24px; }
.hero.compact { padding-bottom: 8px; }
.hero .wordmark { width: min(520px, 86vw); height: auto; margin-bottom: 20px; }
.hero h1 { color: var(--dx-text); }
.hero .lede, .lede { font-size: clamp(15.5px, 1.8vw, 18px); max-width: 70ch; color: var(--dx-muted); }
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 24px; padding: 0; list-style: none; }
.badges li { border: 1px solid var(--dx-border); border-radius: 999px; padding: 3px 12px; font-size: 13px; color: var(--dx-text); background: var(--dx-panel); }
.badges li::before { content: '●'; color: var(--dx-phosphor); margin-right: 8px; font-size: 10px; vertical-align: 1px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.btn { display: inline-block; padding: 10px 18px; border-radius: var(--radius); border: 1px solid var(--dx-phosphor); color: var(--dx-phosphor); text-decoration: none; font-weight: 700; background: var(--dx-panel); }
.btn:hover { background: rgba(57, 255, 20, .08); }
.btn.primary { background: var(--dx-phosphor); color: #020507; }
.btn.primary:hover { background: #5dff6e; }
.btn.ghost { border-color: var(--dx-border); color: var(--dx-text); }
.video { border: 1px solid var(--dx-border); border-radius: 10px; overflow: hidden; background: #000; margin: 24px 0; }
.video video { width: 100%; aspect-ratio: 16 / 9; }
.video figcaption, .figcap { color: var(--dx-muted); font-size: 13px; padding: 10px 12px; }
.sample-tag { display: inline-block; border: 1px solid var(--dx-dim); color: var(--dx-text); border-radius: 4px; padding: 0 8px; font-size: 12px; margin-right: 8px; }

/* status strip */
.strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 16px 0 0; padding: 0; list-style: none; }
.strip li { border: 1px solid var(--dx-border); border-radius: var(--radius); padding: 12px 14px; background: var(--dx-panel); }
.strip .n { font-size: 28px; font-weight: 700; display: block; }
.strip a { text-decoration: none; color: inherit; }
.strip .live .n { color: var(--dx-up); }
.strip .in_progress .n { color: var(--dx-warn); }
.strip .coming .n { color: var(--dx-coral); }

/* badges / legend / filter */
.badge { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .08em; padding: 1px 8px; border-radius: 3px; white-space: nowrap; }
.badge.live { background: var(--dx-up); color: #02140a; }
.badge.in_progress { background: var(--dx-warn); color: #141400; }
.badge.coming { background: var(--dx-coral); color: #1a0a05; }
button.badge { font-family: inherit; border: 0; cursor: pointer; opacity: .55; }
button.badge[aria-pressed="true"], button.badge:hover { opacity: 1; }
.legend { display: flex; flex-wrap: wrap; gap: 10px 22px; font-size: 13px; color: var(--dx-muted); margin: 18px 0 10px; padding: 0; list-style: none; }
.legend .badge { margin-right: 8px; }
.filterbar { margin-bottom: 8px; }

/* features matrix */
.areanav ol { display: flex; flex-wrap: wrap; gap: 6px 14px; list-style: none; margin: 0 0 8px; padding: 0; font-size: 13px; }
.areanav a { color: var(--dx-muted); }
.area { padding: 36px 0 4px; }
.area-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; }
.area-head h2 { margin-bottom: 2px; }
.area .counts { color: var(--dx-muted); font-size: 13px; margin: 0; }
.area .lede { margin-bottom: 14px; }
.matrix th:first-child { width: 22%; }
.matrix td:nth-child(2) { width: 1%; white-space: nowrap; }
.matrix td:last-child { white-space: nowrap; }
.matrix tr[data-status="coming"] th { color: var(--dx-coral); }
.matrix .ev { color: var(--dx-dim); font-size: 12px; margin: 6px 0 0; }
.shotd { margin-top: 8px; font-size: 13px; }
.shotd summary { cursor: pointer; color: var(--dx-muted); }
.shotd img { border: 1px solid var(--dx-border); border-radius: 4px; margin-top: 8px; max-width: 900px; }

/* commands and code */
.cmd { position: relative; border: 1px solid var(--dx-border); border-radius: 4px; background: #000; margin: 10px 0 16px; }
.cmd pre { padding: 10px 92px 10px 12px; font-size: 13.5px; color: var(--dx-text); }
.cmd[data-label]::before, pre.block[data-label]::before { content: attr(data-label); display: block; color: var(--dx-dim); font-size: 11.5px; padding: 6px 12px 0; }
.cmd .copy { position: absolute; top: 6px; right: 6px; font: inherit; font-size: 12px; background: var(--dx-panelAlt); color: var(--dx-muted); border: 1px solid var(--dx-border); border-radius: 4px; padding: 2px 10px; cursor: pointer; }
.cmd .copy:hover { color: var(--dx-text); border-color: var(--dx-dim); }
.cmd .copy[data-done="1"] { color: var(--dx-up); border-color: var(--dx-up); }
pre.block { border: 1px solid var(--dx-border); border-radius: 4px; background: #000; padding: 10px 12px; font-size: 13px; margin: 10px 0 16px; color: var(--dx-text); line-height: 1.45; }
.note { border-left: 3px solid var(--dx-coral); padding: 8px 14px; background: var(--dx-panel); color: var(--dx-text); margin: 14px 0; font-size: 14px; }
.note.ok { border-left-color: var(--dx-up); }
.note.warn { border-left-color: var(--dx-warn); }

/* figures */
figure.shot { margin: 16px 0 22px; }
figure.shot img { border: 1px solid var(--dx-border); border-radius: 6px; width: 100%; }
figure.shot figcaption { color: var(--dx-muted); font-size: 13px; padding: 8px 2px 0; }
figure.shot figcaption::before { content: '◌ sample data · '; color: var(--dx-dim); }

/* docs layout */
.docs { display: grid; grid-template-columns: 220px minmax(0, 1fr) 220px; gap: 32px; padding: 28px 0 40px; max-width: var(--max-wide); margin: 0 auto; padding-left: var(--pad); padding-right: var(--pad); }
.docnav { position: sticky; top: calc(var(--top-h) + 20px); align-self: start; font-size: 13.5px; max-height: calc(100vh - var(--top-h) - 40px); overflow: auto; }
.docnav-title { margin: 0 0 8px; font-weight: 700; }
.docnav-title a { color: var(--dx-text); text-decoration: none; }
.docnav ol { list-style: none; margin: 0; padding: 0; counter-reset: d; }
.docnav li { margin: 0; }
.docnav a { display: block; padding: 5px 10px 5px 12px; color: var(--dx-muted); text-decoration: none; border-left: 2px solid var(--dx-border); }
.docnav a::before { counter-increment: d; content: counter(d, decimal-leading-zero) ' '; color: var(--dx-dim); }
.docnav a:hover { color: var(--dx-text); }
.docnav a[aria-current="page"] { color: var(--dx-phosphor); border-left-color: var(--dx-phosphor); }
.toc { position: sticky; top: calc(var(--top-h) + 20px); align-self: start; font-size: 12.5px; max-height: calc(100vh - var(--top-h) - 40px); overflow: auto; }
.toc-title { margin: 0 0 6px; color: var(--dx-dim); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: 11px; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc li.l3 { padding-left: 12px; }
.toc a { display: block; padding: 3px 0 3px 10px; color: var(--dx-muted); text-decoration: none; border-left: 2px solid var(--dx-border); }
.toc a:hover { color: var(--dx-text); }
.toc a[aria-current="true"] { color: var(--dx-text); border-left-color: var(--dx-phosphor); }
.doc { min-width: 0; }
.crumbs { color: var(--dx-dim); font-size: 13px; margin: 0 0 4px; }
.crumbs a { color: var(--dx-muted); }
.prose { max-width: 82ch; }
.prose h1 { margin-bottom: 6px; }
.prose h2 { margin-top: 44px; }
.prose h3 { margin-top: 30px; color: var(--dx-text); }
.prose h4 { margin-top: 20px; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin-bottom: .4em; }
.prose li ul { margin-top: .3em; }
.prose .anchor { color: var(--dx-dim); text-decoration: none; margin-left: 8px; font-weight: 400; opacity: 0; }
.prose h2:hover .anchor, .prose h3:hover .anchor, .prose h4:hover .anchor, .prose .anchor:focus { opacity: 1; }
.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 48px; padding-top: 18px; border-top: 1px solid var(--dx-border); }
.pager a { text-decoration: none; color: var(--dx-text); font-weight: 700; border: 1px solid var(--dx-border); border-radius: var(--radius); padding: 10px 14px; background: var(--dx-panel); max-width: 48%; }
.pager a span { display: block; color: var(--dx-dim); font-size: 12px; font-weight: 400; }
.pager a:hover { border-color: var(--dx-dim); }
.pager .next { text-align: right; margin-left: auto; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 12px; margin: 10px 0 30px; }
.card { display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--dx-border); border-radius: var(--radius); padding: 12px 14px; background: var(--dx-panel); text-decoration: none; color: var(--dx-text); font-size: 13.5px; }
.card .n { color: var(--dx-phosphor); font-size: 12px; }
.card strong { font-size: 15px; }
.card span:last-child { color: var(--dx-muted); }
.card:hover { border-color: var(--dx-dim); }
.helpcard { margin: 10px 0; border: 1px solid var(--dx-border); border-radius: var(--radius); background: var(--dx-panel); }
.helpcard summary { cursor: pointer; padding: 8px 12px; font-weight: 700; color: var(--dx-borderFocus); }
.helpcard .tbl { border: 0; border-top: 1px solid var(--dx-border); border-radius: 0; margin: 0; }
.search-page ol { padding-left: 1.4em; }

/* single long pages (trust, changelog, roadmap, faq, legal) */
.single { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 32px; padding: 28px var(--pad) 40px; max-width: var(--max-wide); margin: 0 auto; }
.single .prose { max-width: 86ch; }

/* trust page */
.glance { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin: 0 0 20px; padding: 0 !important; list-style: none; }
.glance li { border: 1px solid var(--dx-border); border-radius: var(--radius); padding: 12px 14px; background: var(--dx-panel); font-size: 14px; }
.glance strong { display: block; color: var(--dx-up); margin-bottom: 4px; }
.glance li.plan strong { color: var(--dx-coral); }
.sample-banner { border: 1px dashed var(--dx-coral); color: var(--dx-text); background: rgba(217, 119, 87, .08); padding: 10px 14px; border-radius: var(--radius); margin: 0 0 18px; font-size: 14px; }
.sample-banner strong { color: var(--dx-coral); }
.scan { border: 1px solid var(--dx-border); border-radius: var(--radius); background: var(--dx-panel); padding: 14px 16px; margin-bottom: 14px; }
.scan h4 { margin: 0 0 8px; font-size: 15px; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.status { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .08em; padding: 1px 8px; border-radius: 3px; }
.status.clean, .status.pass { background: var(--dx-up); color: #02140a; }
.status.flagged, .status.fail { background: var(--dx-down); color: #fff; }
.status.pending, .status.warn { background: var(--dx-warn); color: #141400; }
.status.error { background: var(--dx-magenta); color: #fff; }
.scan dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 8px 0 0; font-size: 13.5px; }
.scan dt { color: var(--dx-muted); }
.scan dd { margin: 0; overflow-wrap: anywhere; }
.endpoints td:first-child { white-space: normal; min-width: 160px; }
.endpoints td:first-child code { white-space: normal; }

/* footer */
footer { border-top: 1px solid var(--dx-border); margin-top: 48px; padding: 32px 0 48px; color: var(--dx-muted); font-size: 13px; }
footer .wrap { display: grid; gap: 14px; }
footer .disc { color: var(--dx-text); }
footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
footer nav a { color: var(--dx-muted); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (max-width: 1100px) {
  .docs { grid-template-columns: 200px minmax(0, 1fr); }
  .docs .toc { display: none; }
  .single { grid-template-columns: minmax(0, 1fr); }
  .single .toc { position: static; max-height: none; border: 1px solid var(--dx-border); border-radius: var(--radius); padding: 10px 12px; background: var(--dx-panel); order: -1; }
  .single .toc ol { display: flex; flex-wrap: wrap; gap: 4px 14px; }
  .single .toc a { border: 0; padding: 2px 0; }
}
@media (max-width: 860px) {
  .docs { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .docnav { position: static; max-height: none; border: 1px solid var(--dx-border); border-radius: var(--radius); padding: 8px 10px; background: var(--dx-panel); }
  .docnav ol { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 10px; }
  .navtoggle[hidden] { display: inline-block; }
  .nav { display: none; width: 100%; order: 3; padding: 6px 0 8px; }
  .nav.open { display: flex; }
  .search { flex: 1 1 160px; margin-left: 0; order: 2; }
  .top .wrap { flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
  .matrix td:last-child, .matrix td:nth-child(2) { white-space: normal; }
  .pager { flex-direction: column; }
  .pager a { max-width: none; }
  .pager .next { text-align: left; margin-left: 0; }
}
@media (max-width: 640px) {
  .cmd pre { padding-right: 12px; padding-top: 34px; }
  .matrix, .matrix thead, .matrix tbody, .matrix tr, .matrix td, .matrix th { display: block; }
  .matrix thead { display: none; }
  .matrix tr { border-bottom: 1px solid var(--dx-border); padding: 10px 0; }
  .matrix td, .matrix th { border: 0; padding: 3px 10px; width: auto; }
  .matrix th:first-child { width: auto; font-size: 15px; }
  .matrix td:last-child::before { content: 'see: '; color: var(--dx-muted); }
  .endpoints, .endpoints thead, .endpoints tbody, .endpoints tr, .endpoints td, .endpoints th { display: block; }
  .endpoints thead { display: none; }
  .endpoints td { border: 0; padding: 4px 10px; }
  .endpoints tr { border-bottom: 1px solid var(--dx-border); padding: 8px 0; }
  .endpoints td::before { content: attr(data-l) ': '; color: var(--dx-muted); }
  .strip .n { font-size: 22px; }
  table.keys td:first-child { white-space: normal; }
  table.flags td:first-child { min-width: 0; white-space: normal; }
}
