:root {
  --bg: #f4f1ea; --surface: #fbfaf6; --ink: #1b1a17; --muted: #6b675e; --line: #d9d3c5; --accent: #2c6e9b; --accent-soft: #d6e4ee; --warm: #c45f1e; --ok: #3f7d4e;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace; --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif; --radius: 8px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bg: #141412; --surface: #1d1c19; --ink: #ece8de; --muted: #9c978b; --line: #34322c; --accent: #6ab0e0; --accent-soft: #15283a; --warm: #e0803e; --ok: #7cbf8a; } }
:root[data-theme="dark"] { --bg: #141412; --surface: #1d1c19; --ink: #ece8de; --muted: #9c978b; --line: #34322c; --accent: #6ab0e0; --accent-soft: #15283a; --warm: #e0803e; --ok: #7cbf8a; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
.wrap { width: min(1320px, 100% - 32px); margin: 0 auto; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.012em; margin: 0 0 10px; font-weight: 600; }
h1 { font-size: clamp(24px, 3.2vw, 34px); }
h2 { font-size: 20px; }
h3 { font-size: 15px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.eyebrow { font: 500 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin: 0 0 10px; }
.btn { display: inline-block; padding: 8px 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 500; font-size: 14px; cursor: pointer; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn:hover { border-color: var(--accent); }
.pill { display: inline-block; font: 500 10px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; padding: 4px 7px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.pill.free { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.pill.soon { border-color: var(--warm); color: var(--warm); }
.pill.ok { border-color: var(--ok); color: var(--ok); }
code.mono { font-size: 12.5px; background: var(--surface); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; }
/* header */
.site-head { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 20; }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: 17px; white-space: nowrap; }
.brand img { width: 26px; height: 26px; }
.brand small { font: 500 10px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-left: 6px; }
.nav nav { display: flex; align-items: center; gap: 4px; }
.nav nav a { text-decoration: none; color: var(--ink); font-size: 14px; padding: 6px 10px; border-radius: var(--radius); }
.nav nav a:hover { background: var(--surface); }
.nav nav a.btn { margin-left: 6px; }
.theme { width: 34px; height: 30px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); cursor: pointer; display: grid; place-items: center; }
.theme svg { width: 16px; height: 16px; }
@media (max-width: 760px) { .nav nav a:not(.btn):not(.keep) { display: none; } .brand small { display: none; } }
/* strip */
.strip { padding: 18px 0 14px; border-bottom: 1px solid var(--line); }
.strip h1 { font-size: clamp(20px, 2.6vw, 26px); margin: 0 0 4px; }
.strip p { margin: 0; color: var(--muted); font-size: 14px; max-width: 90ch; }
.strip .links { margin-top: 8px; display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; }
/* catalog layout */
.catalog { display: grid; grid-template-columns: 230px 1fr; gap: 24px; padding: 18px 0 40px; align-items: start; }
.side { position: sticky; top: 62px; display: flex; flex-direction: column; gap: 14px; }
.side input[type=search] { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); font: 14px var(--sans); }
.tree { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.tree h4 { margin: 0; padding: 9px 12px; font: 500 10px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); }
.tree button { display: flex; justify-content: space-between; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 8px 12px; font: 14px var(--sans); color: var(--ink); cursor: pointer; }
.tree button:last-child { border-bottom: 0; }
.tree button.sub { padding-left: 24px; font-size: 13px; color: var(--muted); }
.tree button.on { background: var(--accent-soft); color: var(--accent); }
.tree button .n { font: 11px var(--mono); color: var(--muted); }
.tree .chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px; }
.tree .chips button { width: auto; border: 1px solid var(--line); border-radius: 999px; padding: 4px 9px; font: 500 11px var(--mono); }
.tree .chips button.on { border-color: var(--accent); }
.main .bar { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.main .bar h2 { margin: 0; font-size: 16px; }
.main .bar .mono { font-size: 12px; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: inherit; display: flex; flex-direction: column; padding: 8px 10px 10px; transition: border-color .12s; min-height: 170px; }
.tile:hover { border-color: var(--accent); }
.tile .fig { height: 72px; display: grid; place-items: center; margin-bottom: 6px; }
.tile .fig svg { width: 100%; height: 72px; }
.tile b { font-size: 13px; font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile .sz { font: 11px var(--mono); color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .row { margin-top: auto; padding-top: 6px; display: flex; gap: 4px; flex-wrap: wrap; }
.tile .pill { font-size: 9px; padding: 3px 6px; }
.empty { color: var(--muted); padding: 30px 0; }
@media (max-width: 820px) { .grid { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; } .tile { min-height: 150px; padding: 6px 8px 8px; } .tile .fig, .tile .fig svg { height: 58px; } .tile b { font-size: 12px; } .catalog { grid-template-columns: 1fr; } .side { position: static; } .tree .list { display: none; } .tree.open .list { display: block; } .tree h4 { cursor: pointer; } .tree h4::after { content: " ▾"; } }
/* diagrams */
.dg { stroke: var(--ink); fill: none; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.dim { stroke: var(--accent); fill: none; stroke-width: 1; }
.dimt { font: 10px var(--mono); fill: var(--accent); }
.lbl { font: 11px var(--mono); fill: var(--muted); }
.ghost { stroke: var(--line); fill: none; stroke-width: 1; stroke-dasharray: 3 3; }
/* object page */
.obj { display: grid; grid-template-columns: 1fr 360px; gap: 28px; padding: 22px 0 40px; align-items: start; }
.obj-fig { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.obj-fig svg { width: 100%; height: auto; display: block; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin: 12px 0 0; }
.kv div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.kv dt { font: 500 10px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.kv dd { margin: 3px 0 0; font: 500 16px var(--mono); }
.obj h2 { font-size: 16px; margin-top: 22px; }
.obj ul { padding-left: 18px; margin: 0; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
td { padding: 8px; border-top: 1px solid var(--line); vertical-align: top; }
table.sizes th { text-align: left; font: 500 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 6px 8px; }
table.sizes td { font-family: var(--mono); font-size: 12.5px; padding: 6px 8px; }
.files { border: 1px solid var(--line); border-radius: var(--radius); max-height: 380px; overflow: auto; }
.files table { margin: 0; }
.crumbs { font: 12px var(--mono); color: var(--muted); margin: 14px 0 0; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
@media (max-width: 860px) { .obj { grid-template-columns: 1fr; } }
/* prose pages */
.prose { max-width: 76ch; padding: 22px 0 40px; }
.prose h2 { margin-top: 26px; font-size: 18px; }
.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.tier { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.tier .price { font: 500 22px var(--mono); margin: 6px 0 8px; }
.tier ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 14px; }
@media (max-width: 760px) { .tiers { grid-template-columns: 1fr; } }
pre { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; overflow: auto; font: 12.5px/1.5 var(--mono); margin: 0 0 12px; }
details { border-top: 1px solid var(--line); padding: 10px 0; }
details:last-of-type { border-bottom: 1px solid var(--line); }
summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--accent); }
details[open] summary::after { content: "–"; }
details p { margin: 6px 0 0; color: var(--muted); }
/* stats */
.stats table td:first-child a { text-decoration: none; color: inherit; }
.stats .bar { height: 6px; background: var(--accent-soft); border-radius: 3px; overflow: hidden; }
.stats .bar i { display: block; height: 100%; background: var(--accent); }
/* footer */
.site-foot { padding: 22px 0 34px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.site-foot .row { display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: space-between; }
.site-foot a { color: inherit; }
#to-top { position: fixed; right: 16px; bottom: 16px; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; display: grid; place-items: center; opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 30; }
#to-top.show { opacity: 1; pointer-events: auto; }
.views { font: 11px var(--mono); color: var(--muted); }
/* renders + related */
.tile .fig img, .ofig img { width: 100%; height: 72px; object-fit: contain; display: block; }
.ofig img { height: auto; max-height: 260px; }
.grid.rel { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.grid.rel .tile { min-height: 140px; }
.grid.rel .tile .fig, .grid.rel .tile .fig svg, .grid.rel .tile .fig img { height: 56px; }

.les { border-left: 3px solid var(--accent); background: var(--surface); padding: 8px 12px; border-radius: 0 var(--radius) var(--radius) 0; font-size: 14px; margin: 6px 0 0; }
