/* docs.draftify.lol: the app's tokens (src/client/styles.css), dark first. */
:root {
  --bg: #09090b;
  --panel: #0c0c0e;
  --panel-2: #111113;
  --hover: #18181b;
  --line: #27272a;
  --line-strong: #3f3f46;
  --text: #fafafa;
  --text-2: #e4e4e7;
  --muted: #a1a1aa;
  --subtle: #71717a;
  --gold: #c8aa6e;
  --link: #e3c88f;
  --blue: oklch(0.68 0.14 250);
  --red: oklch(0.66 0.18 22);
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --top-h: 56px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #fafafa;
    --panel: #ffffff;
    --panel-2: #f4f4f5;
    --hover: #f4f4f5;
    --line: #e4e4e7;
    --line-strong: #d4d4d8;
    --text: #09090b;
    --text-2: #27272a;
    --muted: #52525b;
    --subtle: #71717a;
    --gold: #8a6a2c;
    --link: #7a5c1f;
    --blue: oklch(0.52 0.15 250);
    --red: oklch(0.55 0.19 22);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--top-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text-2);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: underline; text-decoration-color: color-mix(in oklab, var(--link) 40%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--link); }

/* ---- top bar */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  height: var(--top-h); padding: 0 24px;
  background: color-mix(in oklab, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.logo { width: 24px; height: 24px; flex: none; }
.brand-name { font-weight: 600; font-size: 16px; letter-spacing: -0.01em; }
.brand-name span { color: var(--subtle); font-weight: 500; }
.brand-tag {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--gold); border: 1px solid color-mix(in oklab, var(--gold) 45%, transparent); padding: 1px 6px;
}
.top-spacer { flex: 1; }
.top-link {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--muted); text-decoration: none; white-space: nowrap;
}
.top-link:hover { color: var(--text); }
.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.nav-button { display: none; }

/* ---- layout */
.layout {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  max-width: 1160px;
  margin: 0 auto;
}
.side {
  position: sticky; top: var(--top-h);
  align-self: start;
  max-height: calc(100vh - var(--top-h));
  overflow-y: auto;
  padding: 32px 20px 32px 24px;
}
.side-label, .content th {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--subtle);
}
.side ul { list-style: none; margin: 10px 0 0; padding: 0; }
.side li { margin: 0; }
.side a {
  display: block; padding: 6px 10px; margin-left: -10px;
  color: var(--muted); text-decoration: none; font-size: 14px; line-height: 1.4;
  border-left: 2px solid transparent;
}
.side a:hover { color: var(--text); background: var(--hover); }
.side a[aria-current="page"] { color: var(--text); font-weight: 500; border-left-color: var(--gold); background: var(--hover); }
.side .toc { margin: 2px 0 8px 2px; padding-left: 10px; border-left: 1px solid var(--line); }
.side .toc a { font-size: 13px; padding: 4px 10px; color: var(--subtle); }
.side .toc a:hover { color: var(--text); }

.content { min-width: 0; padding: 40px 48px 72px; max-width: 868px; border-left: 1px solid var(--line); min-height: calc(100vh - var(--top-h)); }

/* ---- typography */
.content h1 { font-size: 34px; line-height: 1.15; letter-spacing: -0.025em; color: var(--text); margin: 0 0 12px; font-weight: 600; }
.content h1 + p { font-size: 18px; color: var(--muted); margin-top: 0; }
.content h2 {
  font-size: 22px; line-height: 1.3; letter-spacing: -0.015em; color: var(--text); font-weight: 600;
  margin: 48px 0 12px; padding-top: 24px; border-top: 1px solid var(--line);
}
.content h3 { font-size: 17px; color: var(--text); font-weight: 600; margin: 32px 0 8px; }
.content h4 { font-size: 15px; color: var(--text); margin: 24px 0 6px; }
.content .anchor {
  margin-left: 8px; color: var(--subtle); text-decoration: none; font-weight: 400; opacity: 0;
}
.content :is(h2, h3, h4):hover .anchor, .content .anchor:focus { opacity: 1; }
.content p, .content ul, .content ol { margin: 0 0 16px; }
.content ul, .content ol { padding-left: 22px; }
.content li { margin: 4px 0; }
.content li > ul, .content li > ol { margin: 4px 0 0; }
.content strong { color: var(--text); font-weight: 600; }
.content hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }
.content img { max-width: 100%; height: auto; }

.content code {
  font-family: var(--mono); font-size: 0.86em;
  background: var(--panel-2); border: 1px solid var(--line); padding: 1px 5px;
  overflow-wrap: anywhere;
}
.content pre {
  background: var(--panel); border: 1px solid var(--line);
  padding: 14px 16px; overflow-x: auto; margin: 0 0 20px;
  font-size: 13px; line-height: 1.6;
}
.content pre code { background: none; border: 0; padding: 0; font-size: inherit; overflow-wrap: normal; }

.content blockquote {
  margin: 0 0 20px; padding: 12px 16px;
  background: var(--panel); border: 1px solid var(--line); border-left: 2px solid var(--gold);
  color: var(--text-2);
}
.content blockquote p:last-child { margin-bottom: 0; }

.table-wrap { overflow-x: auto; margin: 0 0 20px; border: 1px solid var(--line); }
.content table { border-collapse: collapse; width: 100%; font-size: 14px; line-height: 1.5; }
.content th, .content td { text-align: left; vertical-align: top; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.content th { background: var(--panel); font-weight: 500; white-space: nowrap; }
.content tr:last-child td { border-bottom: 0; }
.content td code { white-space: nowrap; }

.legal {
  border-top: 1px solid var(--line);
  padding: 20px 24px 28px;
  font-size: 12px; line-height: 1.6; color: var(--subtle);
  text-align: center;
}

/* ---- phones and small tablets: the nav folds into the top bar */
@media (max-width: 900px) {
  .layout { display: block; }
  .nav-button {
    display: grid; place-content: center; gap: 4px;
    width: 40px; height: 40px; margin-right: -8px; cursor: pointer;
  }
  .nav-button span { display: block; width: 18px; height: 2px; background: var(--text); }
  .side {
    display: none;
    position: fixed; top: var(--top-h); left: 0; right: 0; z-index: 15;
    max-height: calc(100vh - var(--top-h));
    padding: 16px;
    background: var(--bg);
    border-right: 0; border-bottom: 1px solid var(--line);
  }
  .side a { margin-left: 0; }
  .nav-toggle:checked ~ .layout .side { display: block; }
  .nav-toggle:focus-visible ~ .top .nav-button { outline: 2px solid var(--gold); }
  .top { padding: 0 16px; gap: 12px; }
  .content { padding: 28px 16px 56px; border-left: 0; min-height: 0; }
  .content h1 { font-size: 28px; }
  .content h2 { font-size: 20px; margin-top: 40px; }
  .legal { padding: 20px 16px 28px; }
}
@media (max-width: 420px) {
  .top-link { display: none; }
}
