/* Semoce EDA Documentation: same fonts, colours and header as the main site; white pages; print. */

:root {
  --signal: #ff4d12;
  --font-display: "Inter Tight", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  /* the shared site header floats over a black strip of --site-h; the docs bar sits under it */
  --site-h: 86px;
  --bar-h: 56px;
  /* same container as the main site's .wrap, so the docs line up with the site header */
  --maxw: 1320px;
  --gutter: clamp(16px, 4vw, 48px);
  --head-h: calc(var(--site-h) + var(--bar-h));
  /* white pages, with the site's paper tone for soft fills */
  --bg: #ffffff;
  --bg-2: #f4f2ee;
  --panel: #ffffff;
  --text: #0b0b0c;
  --text-dim: #4a4a50;
  --text-faint: #7b7b82;
  --line: rgba(11, 11, 12, 0.1);
  --line-strong: rgba(11, 11, 12, 0.18);
  --code-bg: #0f0f11;
  --code-text: #e8e6e1;
  --link: #c7380a;
  --ok: #138a4c;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--head-h) + 16px); }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-body); font-size: 16px; line-height: 1.65; -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: var(--signal); color: #0b0b0c; }

/* ---------- site header + docs bar: one black top section ---------- */
.dh {
  /* the bar uses the site's dark palette; everything inside (title, search, its results,
     the Sections button) follows from these */
  --bg: #0b0b0c; --bg-2: #1b1b1e; --panel: #141416;
  --text: #f4f2ee; --text-dim: rgba(244, 242, 238, 0.7); --text-faint: rgba(244, 242, 238, 0.45);
  --line: rgba(255, 255, 255, 0.08); --line-strong: rgba(255, 255, 255, 0.16);
  color-scheme: dark;
  position: sticky; top: 0; z-index: 30; height: var(--head-h); padding-top: var(--site-h);
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.dh-in { height: var(--bar-h); max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); display: flex; align-items: center; gap: 16px; }
.dh-home { display: flex; align-items: center; color: var(--text); text-decoration: none !important; }
.dh-title-m { display: none; font-family: var(--font-display); font-weight: 600; font-size: 16px; letter-spacing: -0.01em; }
.dh-title { font-family: var(--font-display); font-weight: 600; font-size: 16px; letter-spacing: -0.01em; white-space: nowrap; }
.chip { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em; color: var(--signal); border: 1px solid color-mix(in srgb, var(--signal) 45%, transparent); background: color-mix(in srgb, var(--signal) 8%, transparent); padding: 4px 9px; border-radius: 6px; white-space: nowrap; }
.dh-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.chip-m { display: none; }
.side-toggle { display: none; align-items: center; gap: 6px; height: 36px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--panel); color: var(--text); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.side-toggle svg { width: 16px; height: 16px; }

/* search */
.search { position: relative; }
.search input { width: 260px; height: 36px; padding: 0 34px 0 12px; font: inherit; font-size: 14px; color: var(--text); background: var(--panel); border: 1px solid var(--line-strong); border-radius: 6px; outline: none; }
.search input:focus { border-color: var(--signal); }
.search input::placeholder { color: var(--text-faint); }
.search kbd { position: absolute; right: 8px; top: 8px; font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); border: 1px solid var(--line-strong); border-radius: 4px; padding: 0 5px; line-height: 18px; }
.search-results { position: absolute; right: 0; top: 42px; width: min(420px, 90vw); max-height: 60vh; overflow: auto; margin: 0; padding: 6px; list-style: none; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.35); }
.search-results a { display: block; padding: 8px 10px; border-radius: 6px; color: var(--text); text-decoration: none; }
.search-results a:hover, .search-results a.focus { background: var(--bg-2); }
.search-results small { display: block; font-size: 12px; color: var(--text-faint); }
.search-results .empty { padding: 10px; color: var(--text-faint); font-size: 14px; }

/* ---------- three-column layout ---------- */
.dl { max-width: var(--maxw); margin: 0 auto; display: grid; grid-template-columns: 230px minmax(0, 1fr) 200px; gap: 0 40px; padding: 0 var(--gutter); }
.side nav { position: sticky; top: var(--head-h); max-height: calc(100vh - var(--head-h)); overflow: auto; padding: 28px 0 40px; }
.side-group { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); margin: 22px 0 6px; }
.side-group:first-child { margin-top: 0; }
.side ul { list-style: none; margin: 0; padding: 0; }
.side a { display: block; padding: 6px 12px; margin-left: -12px; border-radius: 6px; color: var(--text-dim); font-size: 15px; text-decoration: none; }
.side a:hover { color: var(--text); background: var(--bg-2); }
.side a[aria-current="page"] { color: var(--text); background: var(--bg-2); box-shadow: inset 2px 0 0 var(--signal); font-weight: 500; }
.toc { padding-top: 28px; }
.toc > * { position: sticky; }
.toc p { position: sticky; top: calc(var(--head-h) + 28px); margin: 0 0 8px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); }
.toc ul { position: sticky; top: calc(var(--head-h) + 56px); list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); max-height: calc(100vh - var(--head-h) - 90px); overflow: auto; }
.toc a { display: block; padding: 4px 0 4px 14px; margin-left: -1px; border-left: 2px solid transparent; font-size: 13px; color: var(--text-faint); text-decoration: none; }
.toc li.l3 a { padding-left: 26px; }
.toc a:hover { color: var(--text); }
.toc a.active { color: var(--text); border-left-color: var(--signal); }

/* ---------- content ---------- */
.dc { min-width: 0; padding: 28px 0 64px; }
.dc-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.crumb { margin: 0; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--signal); }
.pdf-btn { font: inherit; font-size: 13px; color: var(--text-dim); background: var(--panel); border: 1px solid var(--line-strong); border-radius: 6px; padding: 6px 12px; cursor: pointer; }
.pdf-btn:hover { color: var(--text); border-color: var(--text-faint); }
.dc h1 { font-family: var(--font-display); font-size: clamp(32px, 4vw, 46px); font-weight: 600; letter-spacing: -0.025em; line-height: 1.1; margin: 14px 0 0; }
.dc-lead { font-size: 18px; color: var(--text-dim); margin: 14px 0 32px; max-width: 70ch; }
.print-head { display: none; }

.prose { max-width: 780px; }
.prose h2 { font-family: var(--font-display); font-size: 26px; font-weight: 600; letter-spacing: -0.015em; margin: 48px 0 12px; padding-top: 8px; border-top: 1px solid var(--line); }
.prose h3 { font-family: var(--font-display); font-size: 19px; font-weight: 600; margin: 32px 0 8px; }
.prose p, .prose li { color: var(--text-dim); }
.prose p { margin: 0 0 16px; }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 16px; }
.prose li { margin: 4px 0; }
.prose strong, .prose b { color: var(--text); font-weight: 600; }
.prose code { font-family: var(--font-mono); font-size: 0.87em; background: var(--bg-2); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; color: var(--text); overflow-wrap: break-word; white-space: nowrap; }

/* code blocks scroll inside themselves */
.codeblock { margin: 12px 0 20px; border-radius: 10px; overflow: hidden; background: var(--code-bg); border: 1px solid rgba(255, 255, 255, 0.06); }
.code-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px 6px 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.07); font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(232, 230, 225, 0.5); }
.copy { font: inherit; font-size: 11px; letter-spacing: 0.06em; color: rgba(232, 230, 225, 0.75); background: transparent; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 5px; padding: 3px 9px; cursor: pointer; text-transform: uppercase; }
.copy:hover { color: #fff; border-color: rgba(255, 255, 255, 0.35); }
.copy.done { color: #3ad08a; border-color: #3ad08a; }
.codeblock pre { margin: 0; padding: 14px 16px; overflow-x: auto; font-family: var(--font-mono); font-size: 13.5px; line-height: 1.7; color: var(--code-text); }
.codeblock code { font-family: inherit; font-size: inherit; background: none; border: 0; padding: 0; color: inherit; border-radius: 0; overflow-wrap: normal; white-space: inherit; }
.codeblock .k { color: #ff7a45; }
.codeblock .o { color: #ffc27a; }
.codeblock .c { color: rgba(232, 230, 225, 0.42); }
.codeblock .p { color: rgba(232, 230, 225, 0.5); }

/* tables scroll inside themselves */
.doc-table { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; margin: 12px 0 20px; background: var(--panel); }
.doc-table table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.doc-table th { text-align: left; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); font-weight: 400; padding: 10px 14px; background: var(--bg-2); }
.doc-table td { padding: 10px 14px; border-top: 1px solid var(--line); color: var(--text-dim); vertical-align: top; }
.doc-table td:first-child { color: var(--text); }

/* status, callouts, cards */
.st { font-style: normal; display: inline-flex; align-items: center; gap: 7px; font-size: 14px; color: var(--text-dim); }
.st::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #f5a623; }
.st-ok::before { background: var(--ok); }
.status-line { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 14px; color: var(--text-faint); padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.callout { margin: 0 0 24px; padding: 14px 18px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--signal) 40%, transparent); background: color-mix(in srgb, var(--signal) 7%, transparent); color: var(--text-dim); }
.callout b { color: var(--text); }
.caps { list-style: none; padding: 0 !important; display: grid; gap: 8px; margin: 18px 0 8px !important; }
.caps li { position: relative; padding-left: 20px; margin: 0; }
.caps li::before { content: ""; position: absolute; left: 2px; top: 9px; width: 8px; height: 8px; background: var(--signal); clip-path: polygon(0 0, 100% 0, 100% 45%, 55% 100%, 0 100%); }
.cards, .pdk-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 20px 0 8px; }
.card, .pdk-card { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--text); text-decoration: none !important; }
a.card:hover { border-color: var(--signal); }
.card b, .pdk-card b { font-family: var(--font-display); font-size: 22px; font-weight: 600; }
.card span, .pdk-card span { font-size: 14px; color: var(--text-dim); }
.pdk-card span { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); }
.card .st, .pdk-card .st { margin-top: 6px; }
.card small { font-size: 12.5px; color: var(--text-faint); line-height: 1.45; }
.pdk-card.more { border-style: dashed; }
.flowlist { list-style: none; counter-reset: step; padding: 0 !important; display: grid; gap: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.flowlist li { counter-increment: step; display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 4px; padding: 12px 16px 12px 8px; margin: 0; border-top: 1px solid var(--line); }
.flowlist li:first-child { border-top: 0; }
.flowlist li::before { content: counter(step, decimal-leading-zero); grid-row: span 2; font-family: var(--font-mono); font-size: 12px; color: var(--signal); padding-top: 3px; text-align: center; }
.flowlist b { color: var(--text); }
.flowlist i { font-style: normal; font-family: var(--font-mono); font-size: 12px; color: var(--text-faint); margin-left: 8px; }
.flowlist span { grid-column: 2; font-size: 14.5px; }
.cmd { padding-top: 4px; }
.cmd h3 code { font-size: 0.95em; }

/* pager + footer */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 780px; margin: 56px 0 0; }
.pager a { display: block; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); text-decoration: none; background: var(--panel); }
.pager a:hover { border-color: var(--signal); }
.pager small { display: block; font-size: 12px; color: var(--text-faint); }
.pager .next { text-align: right; }
.df { max-width: 780px; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.df img { height: 13px; width: auto; }
.df p { margin: 0; font-size: 13px; color: var(--text-faint); }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .dl { grid-template-columns: 230px minmax(0, 1fr); }
  .toc { display: none; }
  .search input { width: 200px; }
}
@media (max-width: 860px) {
  :root { --site-h: 82px; --bar-h: 54px; }
  .dh-in { gap: 10px; }
  .dh-title, .dh .chip, .search kbd { display: none; }
  .dh-title-m { display: inline; }
  .chip-m { display: inline-block; }
  .search input { width: 100%; }
  .search { flex: 1; min-width: 0; }
  /* phones: results span the screen just under the bar (the sticky bar is their containing block) */
  .search { position: static; }
  .search-results { left: var(--gutter); right: var(--gutter); width: auto; top: calc(var(--head-h) + 6px); }
  .dh-tools { flex: 1; justify-content: flex-end; min-width: 0; }
  .side-toggle { display: inline-flex; }
  .dl { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset: var(--head-h) 0 0 0; z-index: 25; background: var(--bg); padding: 0 var(--gutter); display: none; overflow: auto; }
  .side nav { position: static; max-height: none; }
  .side-open .side { display: block; }
  .cards, .pdk-grid { grid-template-columns: minmax(0, 1fr); }
  .pager { grid-template-columns: minmax(0, 1fr); }
  .dc h1 { font-size: 32px; }
  .dc-lead { font-size: 16.5px; }
}


/* ---------- print: a clean, logo-headed document ---------- */
@media print {
  :root { --bg: #fff; --bg-2: #f4f4f4; --panel: #fff; --text: #000; --text-dim: #222; --text-faint: #555; --line: #ddd; --line-strong: #bbb; --link: #000; }
  @page { margin: 18mm 16mm; }
  body { background: #fff; font-size: 11pt; }
  .site-header, .dh, .side, .toc, .pager, .pdf-btn, .copy, .search-results { display: none !important; }
  .dl { display: block; padding: 0; max-width: none; }
  .dc { padding: 0; }
  .print-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 10px; margin-bottom: 18px; border-bottom: 2px solid #ff4d12; font-family: var(--font-mono); font-size: 9pt; color: #555; }
  .print-head img { height: 16px; width: auto; }
  .prose { max-width: none; }
  .prose h2 { break-after: avoid; }
  .codeblock, .doc-table, .cards, .flowlist { break-inside: avoid; }
  .codeblock { border: 1px solid #ccc; background: #f7f7f7; }
  .code-head { color: #555; border-bottom-color: #ddd; }
  .codeblock pre { color: #000; white-space: pre-wrap; }
  .codeblock .k { color: #b8300a; } .codeblock .o { color: #7a4b00; } .codeblock .c, .codeblock .p { color: #777; }
  a { text-decoration: none; }
}

