:root {
  --blue: #0c79cd;
  --blue-d: #085a96;
  --ink: #14181d;
  --muted: #5c6770;
  --line: #d9d4cc;
  --paper: #f3f1ec;
  --dark: #10161c;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Barlow", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
a { color: var(--blue-d); }
img { max-width: 100%; display: block; }
code {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.9em;
  background: #e7e2d8;
  padding: 0 0.3em;
}

/* Home: one screen */
body.home {
  height: 100dvh;
  overflow: hidden;
  background: #1a1a1a;
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
}
.panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 36px 32px 24px;
  color: #f4f7fa;
}
.panel-top { display: flex; gap: 16px; align-items: center; }
.mark {
  width: 84px;
  height: 84px;
  border-radius: 18px;
  flex: none;
}
.kicker {
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #c5cdd4;
}
.kicker img { width: 16px; height: 16px; }
.panel h1 {
  margin: 0;
  font-size: clamp(34px, 4vw, 48px);
  line-height: 0.92;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.line {
  margin: 0;
  max-width: 28ch;
  font-size: 18px;
  line-height: 1.4;
  color: #c5d0da;
}
.actions { display: grid; gap: 10px; }
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  text-decoration: none;
  font-weight: 650;
  font-size: 16px;
  padding: 14px 16px;
  border: 2px solid transparent;
}
.btn .ico { width: 18px; height: 18px; flex: none; }
.btn-dl { background: var(--blue); color: #fff; }
.btn-dl:hover { background: var(--blue-d); }
.btn-docs { background: transparent; color: #fff; border-color: #8ea0b2; }
.btn-docs:hover { border-color: #fff; }
.studio {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  text-decoration: none;
  color: #8ea0b2;
  font-size: 13px;
}
.studio img { height: 34px; width: auto; max-width: 168px; flex: none; background: #fff; padding: 7px 10px; border-radius: 12px; }
.art {
  position: relative;
  min-width: 0;
  height: 100dvh;
  background-color: #1a1a1a;
  background-image: radial-gradient(90% 80% at 86% 58%, #1a4668 0%, #1a1a1a 58%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6vh 4vw;
  overflow: hidden;
}
.art img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 88vh;
  -webkit-mask-image: radial-gradient(ellipse 90% 78% at 50% 50%, #000 58%, transparent 100%);
  mask-image: radial-gradient(ellipse 90% 78% at 50% 50%, #000 58%, transparent 100%);
}

/* Docs */
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
  padding: 0 22px;
  background: var(--dark);
  color: #fff;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.brand img { width: 34px; height: 34px; border-radius: 8px; }
.bar .studio-link { background: #fff; padding: 5px 8px; line-height: 0; border-radius: 10px; overflow: hidden; }
.bar .studio-link img { height: 22px; width: auto; border-radius: 6px; }
.docs-nav {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 0 12px;
  position: sticky;
  top: 0;
  z-index: 2;
}
.docs-nav a {
  color: var(--ink);
  text-decoration: none;
  padding: 14px 12px 12px;
  font-weight: 600;
  font-size: 14.5px;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
}
.docs-nav a:hover { color: var(--blue-d); }
.docs-nav a[aria-current="page"] {
  color: var(--blue-d);
  border-bottom-color: var(--blue);
}
.doc {
  width: min(860px, calc(100% - 40px));
  margin: 0 auto;
  padding: 32px 0 72px;
}
.doc h1 {
  font-size: clamp(32px, 4vw, 44px);
  line-height: 1;
  letter-spacing: -0.03em;
  margin: 0 0 12px;
}
.doc h2 { font-size: 24px; margin: 32px 0 8px; letter-spacing: -0.02em; }
.doc p, .doc li { font-size: 17.5px; line-height: 1.55; }
.doc .deck { font-size: 19px; color: #2c353c; margin-top: 0; }
.toc { list-style: none; padding: 0; margin: 22px 0 0; border-top: 1px solid var(--line); }
.toc a {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
}
.toc a:hover strong { color: var(--blue-d); }
.toc span { color: var(--muted); }
ol.steps { padding-left: 1.2em; }
ol.steps li { margin: 0 0 12px; }
ol.steps li strong { display: block; }
figure { margin: 18px 0; }
figure img { border: 1px solid var(--line); background: #fff; }
figcaption { color: var(--muted); font-size: 14px; margin-top: 6px; }
.note {
  border-left: 4px solid var(--blue);
  background: #fff;
  padding: 12px 14px;
  margin: 16px 0;
}
.note.warn { border-left-color: #b26a00; }
table { width: 100%; border-collapse: collapse; background: #fff; margin: 12px 0 20px; }
th, td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 15.5px; }
th { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.flow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 14px 0 18px;
}
.flow b {
  background: #fff;
  border: 1px solid var(--line);
  padding: 8px 10px;
  font-weight: 650;
}
.flow i { font-style: normal; color: var(--blue); font-weight: 700; }
label.slug { display: block; font-weight: 700; margin-bottom: 6px; }
input.slug {
  width: min(420px, 100%);
  font: inherit;
  padding: 10px 12px;
  border: 1px solid #b9b3a8;
  background: #fff;
}
#slug-out { color: var(--muted); }
.foot {
  border-top: 1px solid var(--line);
  padding: 18px 22px 28px;
  color: var(--muted);
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.foot a { color: var(--ink); }

.shell { display: grid; grid-template-columns: 272px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  background: #1a1a1a;
  color: #d5dbe2;
  padding: 18px 0 32px;
}
.side-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  padding: 0 16px 14px;
}
.side-brand img.mark { width: 36px; height: 36px; border-radius: 8px; }
.side-brand small { display: block; font-weight: 500; color: #9aa6b2; font-size: 12px; }
.side p {
  margin: 16px 16px 6px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8b97a3;
}
.side a.topic {
  display: block;
  color: #d5dbe2;
  text-decoration: none;
  padding: 7px 16px;
  font-size: 14.5px;
  border-left: 3px solid transparent;
}
.side a.topic:hover { color: #fff; background: #242424; }
.side a.topic.on { color: #fff; background: #242424; border-left-color: var(--blue); }
.maincol { min-width: 0; }
.wp-row { display: inline-flex; align-items: center; gap: 8px; }
.wp-row img { width: 18px; height: 18px; }
.menu-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: #fff;
  border: 1px solid #4a5560;
  padding: 8px 12px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
.nav-shade { display: none; }

@media (max-width: 860px) {
  .shell { display: block; }
  .menu-toggle { display: inline-flex; }
  .bar { position: sticky; top: 0; z-index: 40; height: auto; min-height: 58px; padding: 10px 12px; }
  .bar .wp-row { display: none; }
  .brand { font-size: 15px; }
  .side {
    position: fixed;
    top: 0;
    left: 0;
    width: min(300px, 86vw);
    height: 100dvh;
    max-height: none;
    z-index: 50;
    transform: translateX(-110%);
    transition: transform 0.2s ease;
    box-shadow: none;
  }
  body.nav-open .side { transform: none; }
  body.nav-open .nav-shade {
    display: block;
  }
  .nav-shade {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 45;
    border: 0;
    padding: 0;
  }
  .doc { width: min(860px, calc(100% - 28px)); padding-top: 22px; }
  .doc h1 { font-size: 32px; }
  table { display: block; overflow-x: auto; }
}

@media (max-width: 800px) {
  body.home {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) 38dvh;
  }
  .art { order: -1; height: 38dvh; padding: 12px; }
  .art img { max-height: calc(38dvh - 24px); }
  .panel { padding: 18px 18px 14px; gap: 12px; }
  .mark { width: 56px; height: 56px; }
  .panel h1 { font-size: 32px; }
  .line { font-size: 15px; }
  .btn { padding: 11px 12px; }
  .toc a { grid-template-columns: 1fr; gap: 2px; }
}
