/* Leveldot site. Dark by default like the editor; light when the system asks for it. */
:root {
  --bg: #121418;
  --bg-raised: #1a1d23;
  --bg-sunken: #0d0f12;
  --fill: #23272f;
  --fill-hover: #2c313a;
  --line: #2a2e36;
  --text: #e8eaee;
  --text-muted: #9aa1ad;
  --accent: #1a82ff;
  --accent-hover: #3d95ff;
  --accent-ink: #ffffff;
  --accent-soft: rgba(26, 130, 255, 0.16);
  --pill: #f5a524;
  --pill-ink: #1d1404;
  --key-bg: #2a2f38;
  --key-edge: #0b0d10;
  --code-bg: #1f232a;
  --radius: 10px;
  --max: 1180px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --mono: "Cascadia Code", "JetBrains Mono", Consolas, ui-monospace, monospace;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f7f9;
    --bg-raised: #ffffff;
    --bg-sunken: #eceef2;
    --fill: #e9ecf1;
    --fill-hover: #dfe3ea;
    --line: #dde1e7;
    --text: #15181d;
    --text-muted: #5b6370;
    --accent: #0a6fe8;
    --accent-hover: #075bc0;
    --accent-soft: rgba(10, 111, 232, 0.12);
    --key-bg: #ffffff;
    --key-edge: #c3c9d3;
    --code-bg: #eef0f4;
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 76px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
code, kbd { font-family: var(--mono); font-size: .88em; font-variant-ligatures: none; }
code { background: var(--code-bg); padding: .1em .35em; border-radius: 5px; }
kbd {
  display: inline-block; min-width: 1.9em; text-align: center;
  font: 600 12.5px/1 var(--font);
  background: var(--key-bg); color: var(--text);
  padding: 5px 7px 6px; border-radius: 6px;
  box-shadow: inset 0 -2px 0 var(--key-edge), 0 0 0 1px var(--key-edge);
  white-space: nowrap; vertical-align: 1px;
}
.keys { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; vertical-align: middle; }
.combo { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.plus, .or { color: var(--text-muted); font-size: 12px; }
.muted { color: var(--text-muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.icon { width: 18px; height: 18px; flex: none; }
.icon.big { width: 28px; height: 28px; }

/* ---- header */
.top {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 var(--line);
}
.top-inner {
  max-width: var(--max); margin: 0 auto; padding: 12px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { position: relative; display: inline-block; padding: 8px 54px 0 0; margin-top: -8px; }
.brand:hover { text-decoration: none; }
.brand img { width: 144px; height: auto; }
.pill {
  position: absolute; top: 0; right: 0;
  background: var(--pill); color: var(--pill-ink);
  font: 700 10.5px/1 var(--font); letter-spacing: .06em; text-transform: uppercase;
  padding: 4px 7px; border-radius: 999px;
}
.tag-exp {
  display: inline-block; vertical-align: middle; margin-left: 6px;
  background: var(--pill); color: var(--pill-ink);
  font: 700 10.5px/1 var(--font); letter-spacing: .06em; text-transform: uppercase;
  padding: 4px 7px; border-radius: 999px;
}
.top-nav { display: flex; align-items: center; gap: 4px; }
.nav-link {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--text); padding: 7px 11px; border-radius: 8px; font-size: 15px;
}
.nav-link:hover { background: var(--fill); text-decoration: none; }
.nav-link[aria-current="page"] { background: var(--fill); }

/* ---- buttons */
.button {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 11px 18px; border-radius: 9px;
  background: var(--fill); color: var(--text);
  font-weight: 600; font-size: 15px;
}
.button:hover { background: var(--fill-hover); text-decoration: none; }
.button.primary { background: var(--accent); color: var(--accent-ink); }
.button.primary:hover { background: var(--accent-hover); }
.button.small { padding: 7px 13px; margin-left: 6px; }

/* ---- home */
main { display: block; }
section { max-width: var(--max); margin: 0 auto; padding: 72px 24px 0; }
section > h2 { font-size: 28px; margin-bottom: 24px; }
.hero { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 48px; align-items: center; padding-top: 64px; }
.eyebrow { color: var(--accent); font-weight: 600; margin: 0 0 10px; letter-spacing: .02em; }
.hero h1 { font-size: clamp(32px, 4.4vw, 50px); letter-spacing: -.02em; }
.lead { font-size: 18px; color: var(--text-muted); margin: 0 0 28px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.fine { font-size: 14px; color: var(--text-muted); margin-top: 20px; }
.hero-shot { margin: 0; }
.hero-shot img, .shots img {
  border-radius: var(--radius);
  box-shadow: 0 0 0 1px var(--line), 0 24px 60px -20px rgba(0, 0, 0, .55);
}

.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.feature { background: var(--bg-raised); border-radius: var(--radius); padding: 22px 22px 18px; box-shadow: 0 0 0 1px var(--line); }
.feature h3 { font-size: 18px; }
.feature p { margin: 0; color: var(--text-muted); }
.feature .exp-line { margin-top: 10px; }
.exp-line .tag-exp { margin: 0 6px 0 0; }

.shots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.shots figure { margin: 0; }
.shots figcaption { color: var(--text-muted); font-size: 15px; margin-top: 10px; }

.zoom { display: block; cursor: zoom-in; }
.section-lead { color: var(--text-muted); margin: -12px 0 20px; max-width: 70ch; }

/* theme switcher */
.theme-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.theme-tab {
  font: 600 14px/1 var(--font); color: var(--text); background: var(--fill);
  border: 0; border-radius: 999px; padding: 9px 14px; cursor: pointer;
}
.theme-tab:hover { background: var(--fill-hover); }
.theme-tab[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }
.theme-shot { margin: 0; }
.theme-shot img { border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line), 0 24px 60px -20px rgba(0, 0, 0, .55); }

/* lightbox */
.lightbox {
  border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh;
  width: 100vw; height: 100vh; overflow: hidden;
}
.lightbox::backdrop { background: rgba(5, 6, 8, .88); }
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; pointer-events: none; }
.lightbox img { max-width: calc(100vw - 140px); max-height: calc(100vh - 90px); width: auto; border-radius: 8px; }
.lightbox figcaption { color: #d7dbe2; font-size: 15px; }
.lightbox button {
  position: absolute; display: grid; place-items: center; width: 44px; height: 44px;
  border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff;
  font: 400 30px/1 var(--font); cursor: pointer;
}
.lightbox button:hover, .lightbox button:focus-visible { background: rgba(255, 255, 255, .28); outline: none; }
.lightbox:focus { outline: none; }
@media (max-width: 760px) {
  .lightbox img { max-width: calc(100vw - 24px); max-height: calc(100vh - 150px); }
  .lightbox .lb-prev, .lightbox .lb-next { top: auto; bottom: 20px; transform: none; }
  .lightbox .lb-prev { left: calc(50% - 56px); }
  .lightbox .lb-next { right: calc(50% - 56px); }
}
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }

.step-list { list-style: none; padding: 0; margin: 0; counter-reset: step; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.step-list li { counter-increment: step; background: var(--bg-raised); border-radius: var(--radius); padding: 22px; box-shadow: 0 0 0 1px var(--line); }
.step-list li::before {
  content: counter(step);
  display: inline-grid; place-items: center; width: 30px; height: 30px; margin-bottom: 12px;
  border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700;
}
.step-list h3 { font-size: 18px; }
.step-list p { margin: 0; color: var(--text-muted); }

.community-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.community-card {
  display: flex; align-items: center; gap: 16px; padding: 20px 22px;
  background: var(--bg-raised); border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line); color: var(--text);
}
.community-card:hover { background: var(--fill); text-decoration: none; }
.community-card > span { display: flex; flex-direction: column; }
.community-card .muted { font-size: 14px; }

/* ---- footer */
.foot { margin-top: 88px; box-shadow: 0 -1px 0 var(--line); background: var(--bg-sunken); }
.foot-inner {
  max-width: var(--max); margin: 0 auto; padding: 24px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; color: var(--text-muted); font-size: 14px;
}
.foot-inner nav { margin-left: auto; display: flex; gap: 18px; }
.foot-inner nav a { color: var(--text-muted); }
.foot-inner nav a:hover { color: var(--text); }

/* ---- docs layout */
.docs-layout {
  max-width: 1320px; margin: 0 auto; padding: 0 24px;
  display: grid; grid-template-columns: 200px minmax(0, 1fr) 200px; gap: 48px;
}
.docs-layout.wide { grid-template-columns: 200px minmax(0, 1fr); }
.sidebar, .toc { position: sticky; top: 76px; align-self: start; max-height: calc(100vh - 92px); overflow-y: auto; padding: 32px 0 24px; }
.side-title, .toc-title { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin: 0 0 10px; font-weight: 600; }
.sidebar a { display: block; color: var(--text); padding: 7px 12px; border-radius: 8px; font-size: 15px; }
.sidebar a:hover { background: var(--fill); text-decoration: none; }
.sidebar a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc a { display: block; color: var(--text-muted); padding: 4px 10px; border-radius: 6px; font-size: 14px; }
.toc a:hover { color: var(--text); background: var(--fill); text-decoration: none; }
.toc a.active { color: var(--text); background: var(--fill); }

/* ---- docs content */
.doc { padding: 32px 0 0; min-width: 0; max-width: 800px; }
.docs-layout.wide .doc { max-width: none; }
.doc h1 { font-size: 36px; letter-spacing: -.015em; margin-bottom: 10px; }
.doc .lead { font-size: 18px; margin-bottom: 8px; }
.doc h2 { font-size: 22px; margin: 2.2em 0 .7em; }
.doc h3 { font-size: 17px; margin-top: 1.6em; }
.doc p { margin: 0 0 1em; }
.doc ul { padding-left: 1.2em; margin: 0 0 1em; }
.doc li { margin: .45em 0; }
.doc li::marker { color: var(--text-muted); }

/* numbered steps */
.doc ol { list-style: none; padding: 0; margin: 0 0 1.2em; counter-reset: step; display: grid; gap: 8px; }
.doc ol > li {
  counter-increment: step; position: relative; margin: 0;
  background: var(--bg-raised); border-radius: var(--radius); padding: 12px 16px 12px 54px;
  box-shadow: 0 0 0 1px var(--line);
}
.doc ol > li::before {
  content: counter(step); position: absolute; left: 14px; top: 11px;
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 14px;
}

/* tables */
.doc table { border-collapse: collapse; width: 100%; font-size: 15px; margin: 4px 0 1.2em; }
.doc th, .doc td { text-align: left; vertical-align: middle; padding: 9px 12px; box-shadow: inset 0 -1px 0 var(--line); }
.doc th { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); font-weight: 600; }
.doc tbody tr:hover td { background: var(--bg-raised); }
/* tables of the same kind line up under each other */
.doc table:has(th:nth-child(3)) { table-layout: fixed; }
.doc table:has(th:nth-child(3)) th:nth-child(1) { width: 26%; }
.doc table:has(th:nth-child(3)) th:nth-child(2) { width: 30%; }

.doc pre { background: var(--code-bg); border-radius: 8px; padding: 14px 16px; overflow-x: auto; font-size: 14px; line-height: 1.5; }
.doc pre code { background: none; padding: 0; }

/* cards, notes */
.cards { display: grid; gap: 12px; margin: 0 0 1.2em; }
.cards.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card { background: var(--bg-raised); border-radius: var(--radius); padding: 14px 16px; box-shadow: 0 0 0 1px var(--line); }
.card p { margin: 0; color: var(--text-muted); font-size: 15px; }
.card .card-title { color: var(--text); font-weight: 600; margin-bottom: 2px; }
.note { background: var(--accent-soft); border-radius: var(--radius); padding: 14px 16px; margin: 0 0 1.2em; }
.note p { margin: 0; }

/* diagram: boxes and arrows */
.flow { display: flex; align-items: stretch; margin: 8px 0 1.4em; }
.flow .node {
  flex: 1 1 0; min-width: 0; background: var(--bg-raised); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: 0 0 0 1px var(--line);
}
.flow .node.accent { background: var(--accent-soft); box-shadow: none; }
.flow .node p { margin: 0; }
.node-kicker { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); font-weight: 600; }
.node-title { font-weight: 600; margin-top: 4px !important; }
.node-text { color: var(--text-muted); font-size: 14px; margin-top: 2px !important; }
.flow .edge {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; padding: 0 10px; max-width: 130px; text-align: center; color: var(--text-muted); font-size: 13px;
}
.flow .edge::after { content: "→"; font-size: 22px; line-height: 1; color: var(--accent); }

/* diagram: file tree */
.tree pre { background: var(--bg-raised); box-shadow: 0 0 0 1px var(--line); font-size: 14px; }
.tree pre span { color: var(--text-muted); font-family: var(--font); }

/* screenshot of the window with numbered pins */
.annotated { margin: 8px 0 14px; }
.annotated-img { position: relative; border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line), 0 18px 40px -18px rgba(0, 0, 0, .5); }
.annotated-img img { border-radius: var(--radius); }
.pin {
  position: absolute; transform: translate(-50%, -50%);
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--pill); color: var(--pill-ink); font: 700 14px/1 var(--font);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, .45);
}
.doc ol.legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 24px; counter-reset: pin; }
.doc ol.legend > li { counter-increment: pin; background: none; box-shadow: none; padding: 4px 0 4px 38px; }
.doc ol.legend > li::before {
  content: counter(pin); left: 0; top: 4px; background: var(--pill); color: var(--pill-ink);
}

/* a strip of the app's own UI */
.ui-strip { margin: 6px 0 14px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ui-strip img { width: auto; max-width: 100%; border-radius: 8px; box-shadow: 0 0 0 1px var(--line), 0 10px 24px -14px rgba(0, 0, 0, .6); }
.ui-strip figcaption { color: var(--text-muted); font-size: 14px; }

/* key cards and chips */
.keycards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 8px 0 1em; }
.keycard {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 8px;
  background: var(--bg-raised); border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line);
}
.keycard kbd { font-size: 16px; min-width: 2.2em; padding: 8px 10px 9px; }
.keycard > span:last-child { font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 1em; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px;
  background: var(--bg-raised); border-radius: 999px; box-shadow: 0 0 0 1px var(--line); font-size: 15px;
}

/* problems */
.doc details { background: var(--bg-raised); border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line); margin: 0 0 8px; }
.doc summary { cursor: pointer; padding: 12px 16px; font-weight: 600; list-style-position: inside; }
.doc summary:hover { background: var(--fill); border-radius: var(--radius); }
.doc details[open] summary { background: var(--fill); border-radius: var(--radius) var(--radius) 0 0; }
.doc details > p { margin: 0; padding: 12px 16px 14px; }
.doc details table { margin: 0; font-size: 14px; }
.doc details td:first-child { font-family: var(--mono); white-space: nowrap; }

/* previous / next */
.pager { display: flex; gap: 12px; margin-top: 56px; }
.pager a {
  flex: 1 1 0; display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  background: var(--bg-raised); border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line); color: var(--text); font-weight: 600;
}
.pager a:hover { background: var(--fill); text-decoration: none; }
.pager small { display: block; color: var(--text-muted); font-weight: 400; font-size: 13px; }
.pager-next { justify-content: flex-end; text-align: right; margin-left: auto; }
.pager a:only-child.pager-prev { flex: 0 1 50%; }
.pager a:only-child.pager-next { flex: 0 1 50%; }

/* shortcuts cheat sheet */
.sc-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin: 20px 0 8px; }
.filter { flex: 1 1 320px; max-width: 520px; }
.filter input {
  width: 100%; padding: 11px 14px; border-radius: 9px; border: 0;
  background: var(--fill); color: var(--text); font: inherit;
}
.filter input::placeholder { color: var(--text-muted); }
.toggle { display: inline-flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 15px; cursor: pointer; }
.toggle input { accent-color: var(--accent); width: 16px; height: 16px; }
.sc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 20px; align-items: start; margin-top: 20px; }
.sc-card {
  margin: 0; max-width: none; width: 100%; padding: 6px 0 4px;
  background: var(--bg-raised); border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line);
}
.sc-card h2 { font-size: 15px; margin: 0; padding: 10px 16px 8px; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); }
.sc-list { list-style: none; margin: 0; padding: 0; }
.sc {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 7px 16px; font-size: 15px; cursor: default;
}
.sc:hover { background: var(--fill); }
.sc-name { min-width: 0; }
.sc .mode { margin-left: 8px; font-size: 11.5px; color: var(--text-muted); background: var(--fill); padding: 2px 7px; border-radius: 999px; white-space: nowrap; }
.sc:hover .mode { background: var(--fill-hover); }
.sc .keys { justify-content: flex-end; flex: none; max-width: 55%; }
.nokey { color: var(--text-muted); font-size: 13px; }
.sc.unbound .sc-name { color: var(--text-muted); }

/* ---- narrow screens */
@media (max-width: 1100px) {
  .docs-layout { grid-template-columns: 180px minmax(0, 1fr); gap: 40px; }
  .toc { display: none; }
}
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 32px; padding-top: 40px; }
  .feature-grid, .step-list, .community-links { grid-template-columns: 1fr; }
  .shots { grid-template-columns: 1fr; }
  section { padding-top: 56px; }
}
@media (max-width: 760px) {
  .top-inner { padding: 10px 16px; }
  .brand img { width: 112px; }
  .brand { padding-right: 50px; }
  .nav-link span { display: none; }
  .nav-link { padding: 8px; }
  .button.small span { display: none; }
  .button.small { padding: 8px; }
  section { padding-left: 16px; padding-right: 16px; }
  .docs-layout, .docs-layout.wide { grid-template-columns: 1fr; padding: 0 16px; gap: 0; }
  .sidebar { position: static; max-height: none; padding: 16px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
  .side-title { width: 100%; }
  .sidebar a { background: var(--fill); }
  .doc h1 { font-size: 30px; }
  .foot-inner nav { margin-left: 0; width: 100%; }
  .cards.three { grid-template-columns: 1fr; }
  .keycards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow { flex-direction: column; }
  .flow .edge { max-width: none; padding: 6px 0; }
  .flow .edge::after { content: "↓"; }
  .doc ol.legend { grid-template-columns: 1fr; }
  .pin { width: 20px; height: 20px; font-size: 11px; box-shadow: 0 0 0 2px rgba(0, 0, 0, .45); }
  .doc table { display: block; overflow-x: auto; }
  .sc .keys { max-width: 50%; }
  .pager { flex-direction: column; }
  .pager a:only-child.pager-prev, .pager a:only-child.pager-next { flex: 1 1 auto; }
}
.shader-demo { margin: 8px 0 18px; }
.shader-demo img { display: block; width: 100%; max-width: 640px; height: auto; border-radius: 8px; box-shadow: 0 0 0 1px var(--line), 0 10px 24px -14px rgba(0, 0, 0, .6); }
.shader-demo figcaption { color: var(--text-muted); font-size: 14px; margin-top: 6px; }
