/* solel.dev, Look C "Workbench". Colours and type from the Solel brand ("White heat"):
   Paper #FBF5EF, Ink #1A120D, Flare #FF5B1F; Unbounded, Instrument Sans, IBM Plex Mono.
   Fonts: SIL Open Font License 1.1, see fonts/OFL-*.txt */
@font-face {
  font-family: "Unbounded";
  src: url("fonts/Unbounded.woff2") format("woff2");
  font-weight: 200 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("fonts/InstrumentSans.woff2") format("woff2");
  font-weight: 400 700; font-stretch: 75% 100%; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/IBMPlexMono-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/IBMPlexMono-Medium.woff2") format("woff2");
  font-weight: 500 700; font-style: normal; font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #FBF5EF;
  --paper-2: #F3ECE2;
  --white: #FFFFFF;
  --ink: #1A120D;
  --ink-2: #5E4C40;
  --ink-3: #7A5E4E;
  --line: rgba(26, 18, 13, 0.10);
  --line-2: rgba(26, 18, 13, 0.14);
  --field: #8E8279;
  --flare: #FF5B1F;
  --ember: #B83A0A;
  --tint: #FFE1CE;
  --wash: rgba(255, 91, 31, 0.14);
  --display: "Unbounded", system-ui, sans-serif;
  --sans: "Instrument Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --top: 74px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top) + 16px); }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.5; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--ember); text-decoration: none; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; border-radius: 4px; }
::placeholder { color: var(--ink-3); opacity: 1; }
::selection { background: var(--tint); color: var(--ink); }
[hidden] { display: none !important; }
.i { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.skip { position: absolute; left: 12px; top: -48px; z-index: 50; background: var(--ink); color: var(--paper); padding: 8px 12px; border-radius: 8px; font-weight: 600; }
.skip:focus { top: 12px; color: var(--paper); }

/* wordmarks, drawn from the sprite in the colour of the text around them */
.wm { display: inline-block; height: 0.8em; width: auto; vertical-align: -0.03em; fill: currentColor; overflow: visible; }
h1 .wm, h2 .wm, h3 .wm { height: 0.86em; }
.nw { white-space: nowrap; }
.wm-io { aspect-ratio: 445.9 / 84.3; } .wm-os { aspect-ratio: 483 / 84.3; } .wm-dev { aspect-ratio: 558.3 / 84.3; } .wm-org { aspect-ratio: 538.1 / 84.3; }
.wm-sdk { aspect-ratio: 561.7 / 84.3; } .wm-ai { aspect-ratio: 442.4 / 84.3; } .wm-id { aspect-ratio: 450.2 / 84.3; }

/* ---------- the bar along the top ---------- */
.top { position: sticky; top: 0; z-index: 30; height: var(--top); display: flex; align-items: center; gap: 28px; padding: 0 40px; background: var(--white); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; flex: none; }
.brand img { height: 26px; width: auto; display: block; }
.menu { display: none; align-items: center; justify-content: center; width: 40px; height: 40px; margin-left: -8px; border: 0; border-radius: 9px; background: transparent; color: var(--ink); cursor: pointer; }
.menu:hover { background: var(--paper-2); }

.search { position: relative; }
.top .search { margin-left: auto; width: 260px; }
.field { display: flex; align-items: center; gap: 10px; background: var(--paper); border: 1px solid var(--field); border-radius: 9px; padding: 8px 14px; font-size: 14px; color: var(--ink-3); cursor: text; }
.field:focus-within { outline: 2px solid var(--ember); outline-offset: 2px; }
.field input { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; color: var(--ink); font: inherit; padding: 0; }
.field input::-webkit-search-cancel-button { display: none; }
kbd { font-family: var(--mono); font-size: 12px; color: var(--ink-3); border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 6px; white-space: nowrap; }

.results { position: absolute; top: calc(100% + 8px); right: 0; width: max(100%, 440px); max-height: min(70vh, 560px); overflow-y: auto; background: var(--white); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 18px 48px rgba(26, 18, 13, 0.14); padding: 6px; z-index: 40; }
.search-big .results { left: 0; right: auto; width: 100%; }
.result { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 8px; color: var(--ink); }
.result:hover { color: var(--ink); background: var(--paper); }
.result[aria-selected="true"] { background: var(--wash); }
.result-crumb { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.result-title { font-size: 15px; font-weight: 600; }
.result-desc { font-size: 13.5px; line-height: 1.45; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.result mark { background: var(--tint); color: inherit; border-radius: 3px; }
.results-empty { padding: 14px 12px; font-size: 14px; color: var(--ink-2); }

/* ---------- docs pages: sidebar, page, on this page ---------- */
.layout { flex: 1 0 auto; display: flex; align-items: stretch; }
.side { flex: 0 0 272px; border-right: 1px solid var(--line); }
.side nav { position: sticky; top: var(--top); max-height: calc(100vh - var(--top)); overflow-y: auto; padding: 24px 16px 28px 24px; display: flex; flex-direction: column; gap: 2px; font-size: 14px; line-height: 1.35; overscroll-behavior: contain; }
.row { display: flex; align-items: center; border-radius: 7px; }
.row a { flex: 1 1 auto; padding: 5px 10px; color: var(--ink-2); }
.row a:hover { color: var(--ink); }
.row.l1 a { padding-left: 24px; } .row.l2 a { padding-left: 38px; } .row.l3 a { padding-left: 52px; } .row.l4 a { padding-left: 66px; }
.row.open a { color: var(--ink); font-weight: 600; }
.row.active { background: var(--wash); }
.row.active a { color: var(--ink); font-weight: 600; }
.tog { flex: none; display: flex; align-items: center; justify-content: center; width: 28px; height: 26px; margin-right: 2px; border: 0; border-radius: 6px; background: transparent; color: var(--ink-3); cursor: pointer; }
.tog:hover { background: var(--paper-2); color: var(--ink); }
.tog .i { transition: transform 0.15s ease; }
.tog[aria-expanded="true"] .i { transform: rotate(90deg); }
.kids { display: flex; flex-direction: column; gap: 2px; }
.kids-top { border-left: 1px solid var(--line); margin: 2px 0 6px 10px; }
.scrim { display: none; }

.main { flex: 1 1 0; min-width: 0; display: flex; align-items: flex-start; }
.article { flex: 1 1 0; min-width: 0; max-width: 820px; padding: 36px 48px 48px; display: flex; flex-direction: column; gap: 18px; }
.crumbrow { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.crumbs { font-size: 13px; color: var(--ink-3); }
.crumbs a { color: var(--ink-3); }
.crumbs a:hover { color: var(--ink); }
.tag { font-family: var(--mono); font-size: 11.5px; font-weight: 500; color: var(--ink-2); border: 1px solid var(--field); border-radius: 5px; padding: 0 6px; }
.article h1 { margin: 0; font-family: var(--display); font-weight: 500; font-size: clamp(30px, 4vw, 40px); line-height: 1.1; letter-spacing: -0.02em; text-wrap: balance; }

/* the page's own words */
.prose { color: var(--ink-2); font-size: 16px; line-height: 1.6; }
.prose > * { margin: 0; }
.prose > * + * { margin-top: 16px; }
.prose p, .prose ul, .prose ol { max-width: 640px; text-wrap: pretty; }
.prose p.lead { font-size: 18px; color: var(--ink-2); }
.prose h2 { margin-top: 34px; font-size: 20px; font-weight: 600; line-height: 1.3; color: var(--ink); }
.prose h3 { margin-top: 26px; font-size: 17px; font-weight: 600; line-height: 1.35; color: var(--ink); }
.prose h2 + *, .prose h3 + * { margin-top: 10px; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a { text-decoration: underline; text-decoration-color: rgba(184, 58, 10, 0.35); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: currentColor; }
.prose code { font-family: var(--mono); font-size: 0.88em; color: var(--ink); background: var(--paper-2); border-radius: 5px; padding: 1px 5px; overflow-wrap: anywhere; }
.prose pre { background: var(--ink); color: var(--paper); border-radius: 10px; padding: 12px 14px; font-family: var(--mono); font-size: 13px; line-height: 1.55; overflow-x: auto; white-space: pre; }
.prose pre code { background: none; color: inherit; padding: 0; font-size: inherit; overflow-wrap: normal; }
.prose ul { padding-left: 20px; }
.prose ul li::marker { color: var(--ink-3); }
.prose li + li { margin-top: 6px; }
.prose li > ul, .prose li > ol, .prose li > p { margin-top: 6px; }
.prose ol { list-style: none; padding: 0; counter-reset: step; }
.prose ol > li { position: relative; counter-increment: step; padding-left: 42px; min-height: 28px; }
.prose ol > li + li { margin-top: 12px; }
.prose ol > li::before { content: counter(step); position: absolute; left: 0; top: -1px; width: 28px; height: 28px; border-radius: 999px; background: var(--ink); color: var(--paper); font-family: var(--mono); font-size: 13px; font-weight: 500; display: flex; align-items: center; justify-content: center; }
.prose ol > li > ul { padding-left: 20px; }
.table { overflow-x: auto; background: var(--white); border: 1px solid var(--line); border-radius: 14px; }
.table table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
.table th, .table td { text-align: left; vertical-align: top; padding: 10px 14px; border-top: 1px solid var(--line); }
.table thead th { border-top: 0; background: var(--paper-2); color: var(--ink); font-size: 14px; font-weight: 600; }
.table td:first-child { color: var(--ink); font-weight: 500; }
.prose hr { border: 0; border-top: 1px solid var(--line); }
.prose blockquote { border-left: 2px solid var(--flare); padding-left: 14px; }

/* what an index page lists */
.boxes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; margin-top: 6px; }
.box { background: var(--white); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.box h2 { margin: 0; padding: 14px 16px 12px; font-size: 16px; font-weight: 600; }
.box h2 a { color: var(--ink); }
.box h2 a:hover { color: var(--ember); }
.item { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border-top: 1px solid rgba(26, 18, 13, 0.08); color: var(--ink); }
.item:hover { color: var(--ink); background: var(--paper); }
.item-title { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 500; }
.item-desc { font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.admins { margin-left: auto; font-family: var(--mono); font-size: 12px; font-weight: 400; color: var(--ink-3); }

.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 14px; }
.pager .prev { color: var(--ink-2); }
.pager .next { font-weight: 600; text-align: right; margin-left: auto; }

.toc { flex: 0 0 220px; position: sticky; top: var(--top); padding: 40px 24px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; line-height: 1.35; }
.toc .label { font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.toc a { color: var(--ink-2); border-left: 2px solid var(--line); padding: 1px 0 1px 10px; }
.toc a:hover { color: var(--ink); }
.toc a.here { color: var(--ink); font-weight: 600; border-left-color: var(--flare); }

/* ---------- the docs home ---------- */
.home { flex: 1 0 auto; width: 100%; max-width: 1440px; margin: 0 auto; padding: 44px 64px 64px; display: flex; flex-direction: column; gap: 30px; }
.hero { display: flex; flex-direction: column; gap: 14px; max-width: 760px; }
.hero h1 { margin: 0; font-family: var(--display); font-weight: 500; font-size: clamp(32px, 4vw, 40px); line-height: 1.1; letter-spacing: -0.02em; }
.hero p { margin: 0; font-size: 18px; line-height: 1.55; color: var(--ink-2); text-wrap: pretty; }
.search-big { margin-top: 4px; }
.search-big .field { background: var(--white); border-radius: 12px; padding: 13px 16px; font-size: 16px; gap: 12px; }
.search-big .field .i { width: 18px; height: 18px; }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; align-items: start; }
.col { display: flex; flex-direction: column; gap: 16px; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.card h2 { margin: 0; font-size: 20px; font-weight: 600; line-height: 1.25; }
.card h2 a { color: var(--ink); }
.card h2 a:hover { color: var(--ember); }
.card p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 14px; color: var(--ink-2); background: var(--paper); border: 1px solid var(--line); border-radius: 7px; padding: 4px 9px; }
.chip:hover { color: var(--ink); border-color: var(--field); }
.all { font-size: 14px; font-weight: 600; }
.lost .hero { margin: 6vh auto 0; max-width: 640px; }
.lost .all { margin-top: 6px; }

.foot { display: flex; justify-content: space-between; gap: 16px; padding: 20px 40px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-3); background: var(--paper); }
.foot a { color: var(--ink-3); }
.foot a:hover { color: var(--ink); }

/* ---------- narrower screens ---------- */
@media (max-width: 1240px) {
  .toc { display: none; }
}
@media (max-width: 1100px) {
  .home { padding: 36px 32px 56px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .col { display: contents; }
  .o0 { order: 0; } .o1 { order: 1; } .o2 { order: 2; } .o3 { order: 3; } .o4 { order: 4; } .o5 { order: 5; } .o6 { order: 6; } .o7 { order: 7; } .o8 { order: 8; } .o9 { order: 9; }
}
@media (max-width: 900px) {
  :root { --top: 60px; }
  .top { gap: 12px; padding: 0 16px; }
  .brand img { height: 22px; }
  .menu { display: flex; }
  .top .search { width: auto; flex: 1 1 auto; max-width: 320px; min-width: 0; }
  .top kbd { display: none; }
  .side { position: fixed; z-index: 25; top: var(--top); bottom: 0; left: 0; width: min(320px, 86vw); background: var(--paper); transform: translateX(-100%); transition: transform 0.2s ease; visibility: hidden; }
  .side nav { position: static; max-height: none; height: 100%; padding: 18px 12px 28px 16px; }
  .nav-open .side { transform: none; visibility: visible; box-shadow: 0 18px 48px rgba(26, 18, 13, 0.18); }
  .nav-open .scrim { display: block; position: fixed; z-index: 20; inset: var(--top) 0 0 0; background: rgba(26, 18, 13, 0.28); }
  .article { padding: 24px 16px 40px; }
  .boxes { grid-template-columns: minmax(0, 1fr); }
  .results { position: fixed; top: calc(var(--top) + 6px); left: 12px; right: 12px; width: auto; }
  .search-big .results { position: absolute; top: calc(100% + 8px); left: 0; right: 0; }
  .foot { padding: 18px 16px; }
}
@media (max-width: 640px) {
  .home { padding: 28px 16px 48px; gap: 24px; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .hero p { font-size: 17px; }
  .prose p.lead { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  .side, .tog .i { transition: none; }
}
