/* Shared styles for the Nekudot info site + usage book. */
:root {
  --bg: #1c1d20;
  --panel: #242629;
  --border: #34373c;
  --text: #d7d9dd;
  --muted: #9aa0a8;
  --faint: #6f757d;
  --accent: #2563eb;
  --accent-text: #fff;
  --code-bg: #2b2e33;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
a { color: #6ea8ff; text-decoration: none; }
a:hover { text-decoration: underline; }

.topnav {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 22px;
  background: rgba(28, 29, 32, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(6px);
  z-index: 10;
}
.topnav .brand { font-weight: 700; letter-spacing: 0.02em; color: var(--text); }
.topnav .brand span { color: var(--accent); }
.topnav a.nav { color: var(--muted); font-size: 14px; }
.topnav a.nav svg { width: 15px; height: 15px; vertical-align: -3px; margin-right: 6px; }
.topnav a.nav:hover { color: var(--text); text-decoration: none; }
.topnav .spacer { flex: 1; }
.topnav .cta {
  background: var(--accent); color: var(--accent-text);
  padding: 6px 14px; border-radius: 999px; font-size: 14px; font-weight: 600;
}
.topnav .cta:hover { text-decoration: none; filter: brightness(1.08); }

main { max-width: 820px; margin: 0 auto; padding: 36px 22px 80px; }
.hero { padding: 60px 22px 30px; text-align: center; max-width: 820px; margin: 0 auto; }
.hero h1 { font-size: 44px; margin: 0 0 10px; letter-spacing: -0.02em; }
.hero p.lead { font-size: 19px; color: var(--muted); margin: 0 auto; max-width: 620px; }

h1 { font-size: 32px; letter-spacing: -0.01em; }
h2 { font-size: 22px; margin-top: 38px; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
h3 { font-size: 17px; margin-top: 26px; color: var(--text); }
p, li { color: var(--text); }
.muted { color: var(--muted); }
.lead { font-size: 18px; color: var(--muted); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin: 22px 0; }
.card {
  display: block; padding: 16px 18px; background: var(--panel);
  border: 1px solid var(--border); border-radius: 12px; color: var(--text);
}
.card:hover { border-color: var(--accent); text-decoration: none; }
.card h3 { margin: 0 0 4px; }
.card p { margin: 0; font-size: 14px; color: var(--muted); }
.card .kbd { float: right; }

/* Icon badges - the brush/connection glyph from the app, shown on pages + cards
   so the book reads visually, not just as text. */
.page-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 11px; margin-right: 14px;
  background: var(--panel); border: 1px solid var(--border);
  color: var(--text); font-size: 24px; line-height: 1; vertical-align: middle;
}
.page-icon svg { width: 26px; height: 26px; }
.section-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 8px; margin-right: 10px;
  background: var(--panel); border: 1px solid var(--border);
  color: var(--text); font-size: 16px; line-height: 1; vertical-align: middle;
}
.section-icon svg { width: 17px; height: 17px; }
.card-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px; margin-bottom: 8px;
  background: var(--bg); border: 1px solid var(--border);
  color: var(--text); font-size: 17px; line-height: 1;
}
.card-icon svg { width: 18px; height: 18px; }

kbd, .kbd {
  font: 12px ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--code-bg); border: 1px solid var(--border);
  border-radius: 5px; padding: 1px 7px; color: var(--text);
}
code { font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--code-bg); padding: 1px 5px; border-radius: 4px; }
pre {
  background: var(--code-bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 14px 16px; overflow: auto; line-height: 1.5;
  font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text);
}
pre code { background: none; padding: 0; font-size: inherit; }
.filetree { white-space: pre; }

dl.settings { margin: 14px 0; }
dl.settings dt { font-weight: 600; margin-top: 12px; }
dl.settings dd { margin: 2px 0 0; color: var(--muted); }

.keys { margin: 8px 0 20px; }
.keys .row {
  display: flex; align-items: baseline; gap: 16px;
  padding: 7px 2px; border-bottom: 1px solid var(--border);
}
.keys .row .k { flex: 0 0 150px; }
.keys .row .d { color: var(--muted); }
.keys .row .k .kbd + .kbd { margin-left: 3px; }
.keys .row .k .sep { color: var(--faint); margin: 0 2px; }

.note {
  margin: 20px 0; padding: 12px 16px; background: var(--panel);
  border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; color: var(--muted);
}
.tip {
  margin: 20px 0; padding: 12px 16px; background: var(--panel);
  border-left: 3px solid #6fbf73; border-radius: 0 8px 8px 0; color: var(--muted);
}
.tip .tip-label {
  display: block; margin-bottom: 3px; color: #6fbf73;
  font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
}
.tip strong { color: var(--text); }
.tag {
  display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px;
  border-radius: 999px; background: var(--code-bg); border: 1px solid var(--border);
  color: var(--muted); margin-left: 8px; vertical-align: middle;
}
/* Example figures (texture renders etc.). */
.book-figs { display: flex; flex-wrap: wrap; gap: 16px; margin: 18px 0; }
.book-figs figure { margin: 0; flex: 1 1 200px; max-width: 300px; text-align: center; }
.book-figs img {
  display: block; width: 100%; height: auto; background: #fff;
  border: 1px solid var(--border); border-radius: 10px;
}
.book-figs figcaption { margin-top: 6px; font-size: 13px; color: var(--muted); }
/* Book layout: sticky contents sidebar + content (injected by book-nav.js). */
.book-shell { display: flex; gap: 34px; max-width: 1140px; margin: 0 auto; padding: 0 22px; align-items: flex-start; }
.book-shell main { margin: 0; max-width: none; flex: 1; min-width: 0; padding: 36px 0 80px; }
.book-sidebar {
  width: 230px; flex-shrink: 0; align-self: flex-start;
  position: sticky; top: 57px; max-height: calc(100vh - 57px);
  overflow: auto; padding: 34px 0;
}
.book-nav-group {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--faint); margin: 16px 0 4px; padding: 0 10px;
}
/* Nested section header (e.g. Brushes / Connections under Drawing tools). */
.book-nav-subgroup {
  font-size: 12px; font-weight: 600; color: var(--muted);
  margin: 6px 0 2px; padding: 0 10px;
}
.book-nav-link {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px; border-radius: 6px; color: var(--muted);
  font-size: 14px; border-left: 2px solid transparent;
}
.book-nav-icon {
  flex: 0 0 16px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; line-height: 1; color: var(--faint);
}
.book-nav-icon svg { width: 14px; height: 14px; }
.book-nav-link:hover .book-nav-icon, .book-nav-link.active .book-nav-icon { color: inherit; }
.book-nav-link:hover { color: var(--text); background: var(--panel); text-decoration: none; }
.book-nav-link.active {
  color: var(--text); background: var(--panel);
  border-left-color: var(--accent); font-weight: 600;
}
@media (max-width: 720px) {
  .book-shell { flex-direction: column; gap: 0; }
  .book-sidebar { position: static; width: auto; max-height: none; padding: 12px 0 0; }
  .book-shell main { padding-top: 16px; }
}

footer { max-width: 820px; margin: 0 auto; padding: 30px 22px 60px; color: var(--faint); font-size: 13px; border-top: 1px solid var(--border); }
.crumbs { font-size: 13px; color: var(--faint); margin-bottom: 6px; }
.crumbs a { color: var(--muted); }
.conn-glyph { display: inline-flex; vertical-align: middle; color: var(--muted); }
