/* herdr-virtualboard documentation.
 *
 * The palette is VirtualBoard's own design token set, lifted verbatim from
 * virtualboard.dev so this page reads as part of the same family as
 * virtualboard.github.io/vb-cli and /template-base. The tokens are oklch
 * because that is how upstream defines them; converting to hex would drift.
 *
 * Board-status colours (backlog / in-progress / blocked / review / done) are
 * the one addition: they come from the TUI itself, so a column name on this
 * page is the colour that column is on screen.
 */
:root {
  /* --- VirtualBoard brand tokens (virtualboard.dev) --------------------- */
  --background:       oklch(11% .015 250);
  --foreground:       oklch(93% .005 250);
  --card:             oklch(14% .012 250);
  --sidebar:          oklch(13% .012 250);
  --surface-elevated: oklch(16% .012 250);
  --muted:            oklch(17% .01 250);
  --secondary:        oklch(18% .012 250);
  --border:           oklch(19% .012 250);
  --border-strong:    oklch(26% .014 250);
  --muted-foreground: oklch(55% .015 250);
  --primary:          oklch(68% .16 230);
  --accent:           oklch(72% .19 165);
  --warning:          oklch(70% .14 70);
  --glow-primary:     oklch(68% .16 230/.15);
  --glow-accent:      oklch(72% .19 165/.12);

  /* --- board status colours (from the TUI) ------------------------------ */
  --st-backlog:  oklch(70% .02 250);
  --st-progress: oklch(68% .16 230);
  --st-blocked:  oklch(70% .14 60);
  --st-review:   oklch(68% .16 300);
  --st-done:     oklch(72% .19 165);

  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif;
  --measure: 72ch;
  --nav-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 1rem); }

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ---- top navigation ---------------------------------------------------- */

.topnav {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  display: flex; align-items: center; gap: 1.5rem;
  padding: 0 1.5rem;
  background: color-mix(in oklab, var(--background) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topnav .brand {
  font-weight: 600; font-size: 1rem;
  color: var(--foreground); text-decoration: none;
  white-space: nowrap;
  display: flex; align-items: center; gap: 0.5rem;
}
.topnav .brand .mark {
  width: 22px; height: 22px; border-radius: 6px; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--primary), var(--accent));
}
.topnav .brand .name { white-space: nowrap; }
.topnav .brand .accent { color: var(--primary); }
.topnav .ver {
  font-family: var(--mono); font-size: 0.66rem;
  color: var(--primary);
  border: 1px solid color-mix(in oklab, var(--primary) 35%, transparent);
  background: color-mix(in oklab, var(--primary) 10%, transparent);
  border-radius: 5px; padding: 0.1rem 0.35rem;
}
.topnav nav {
  margin-left: auto;
  display: flex; gap: 1.35rem; align-items: center;
  overflow-x: auto; scrollbar-width: none;
}
.topnav nav::-webkit-scrollbar { display: none; }
.topnav nav a {
  color: var(--muted-foreground); text-decoration: none;
  font-size: 0.9rem; white-space: nowrap;
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.topnav nav a:hover { color: var(--foreground); text-decoration: none; }
.topnav nav a.active { color: var(--foreground); border-bottom-color: var(--primary); }

/* ---- hero -------------------------------------------------------------- */

.hero {
  position: relative; text-align: center;
  padding: 5rem 1.5rem 3.5rem;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute; inset: -40% 0 auto 50%;
  transform: translateX(-50%);
  width: min(1100px, 130%); aspect-ratio: 2 / 1;
  background:
    radial-gradient(closest-side, var(--glow-primary), transparent 72%),
    radial-gradient(closest-side, var(--glow-accent), transparent 68%);
  background-position: 35% 40%, 68% 55%;
  background-repeat: no-repeat;
  background-size: 70% 100%, 60% 90%;
  pointer-events: none;
}
.hero > * { position: relative; }
.hero .logo {
  width: 68px; height: 68px; margin: 0 auto 1.5rem;
  border-radius: 16px;
  background: linear-gradient(140deg, var(--primary), var(--accent));
  display: grid; place-items: center;
  box-shadow: 0 0 44px var(--glow-primary);
}
.hero .logo svg { width: 34px; height: 34px; display: block; }
.wordmark {
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  font-weight: 600; letter-spacing: -0.02em;
  margin: 0 0 1rem; color: var(--foreground);
}
.wordmark .accent { color: var(--primary); }
.hero .lede {
  color: var(--muted-foreground); font-size: 1.06rem;
  max-width: 62ch; margin: 0 auto 1.75rem;
}
.hero .lede strong { color: var(--foreground); font-weight: 600; }

/* ---- badge pills ------------------------------------------------------- */

.badges { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; margin: 0 0 2rem; }
.badge {
  font-family: var(--mono); font-size: 0.68rem;
  letter-spacing: 0.055em; text-transform: uppercase;
  padding: 0.3rem 0.65rem; border-radius: 6px;
  border: 1px solid var(--border-strong);
  color: var(--muted-foreground);
  background: color-mix(in oklab, var(--card) 70%, transparent);
  white-space: nowrap;
}
.badge.blue  { color: var(--primary); border-color: color-mix(in oklab, var(--primary) 38%, transparent); background: color-mix(in oklab, var(--primary) 9%, transparent); }
.badge.green { color: var(--accent);  border-color: color-mix(in oklab, var(--accent) 38%, transparent);  background: color-mix(in oklab, var(--accent) 9%, transparent); }
.badge.amber { color: var(--warning); border-color: color-mix(in oklab, var(--warning) 38%, transparent); background: color-mix(in oklab, var(--warning) 9%, transparent); }

/* ---- buttons ----------------------------------------------------------- */

.cta { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.62rem 1.25rem; border-radius: 9px;
  font-size: 0.93rem; font-weight: 600;
  text-decoration: none; border: 1px solid transparent;
  transition: filter .15s, background .15s;
}
.btn.primary {
  background: var(--primary); color: oklch(15% .02 250);
  box-shadow: 0 0 28px var(--glow-primary);
}
.btn.primary:hover { filter: brightness(1.08); text-decoration: none; }
.btn.secondary {
  background: var(--secondary); color: var(--foreground);
  border-color: var(--border-strong);
}
.btn.secondary:hover { background: var(--surface-elevated); text-decoration: none; }

/* ---- content ----------------------------------------------------------- */

main { max-width: 900px; margin: 0 auto; padding: 3rem 1.5rem 6rem; }

h2, h3, h4 { color: var(--foreground); line-height: 1.3; font-weight: 600; letter-spacing: -0.01em; }
h2 { font-size: 1.55rem; margin: 4rem 0 1.1rem; padding-top: 2rem; border-top: 1px solid var(--border); }
h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
h3 { font-size: 1.12rem; margin: 2.25rem 0 0.6rem; }
h4 { font-size: 0.97rem; margin: 1.5rem 0 0.4rem; }

p { margin: 0 0 1.05rem; max-width: var(--measure); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
a code { color: inherit; border-color: color-mix(in oklab, currentColor 30%, transparent); }

ul, ol { max-width: var(--measure); padding-left: 1.3rem; margin: 0 0 1.05rem; }
li { margin-bottom: 0.45rem; }
li::marker { color: var(--muted-foreground); }
strong { color: var(--foreground); font-weight: 600; }
em { color: var(--foreground); }

/* ---- code -------------------------------------------------------------- */

code {
  font-family: var(--mono); font-size: 0.855em;
  background: var(--muted); border: 1px solid var(--border);
  border-radius: 5px; padding: 0.08em 0.36em; color: var(--foreground);
}
pre {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 1.05rem 1.2rem;
  overflow-x: auto; margin: 0 0 1.35rem; line-height: 1.6;
}
pre code { background: none; border: 0; padding: 0; font-size: 0.83rem; }
pre .c { color: var(--muted-foreground); }
pre .k { color: var(--primary); }
pre .s { color: var(--accent); }
pre .f { color: var(--warning); }

.term { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin: 0 0 1.35rem; background: var(--card); }
.term-bar {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.55rem 0.8rem;
  background: var(--sidebar); border-bottom: 1px solid var(--border);
}
.term-bar i { width: 10px; height: 10px; border-radius: 50%; display: block; }
.term-bar i:nth-child(1) { background: oklch(64% .18 25); }
.term-bar i:nth-child(2) { background: oklch(76% .15 85); }
.term-bar i:nth-child(3) { background: oklch(72% .17 145); }
.term-bar span { font-family: var(--mono); font-size: 0.7rem; color: var(--muted-foreground); margin-left: 0.5rem; }
.term pre { border: 0; border-radius: 0; margin: 0; background: none; }

/* ---- figures ----------------------------------------------------------- */

figure { margin: 1.75rem 0 2.25rem; }
figure img {
  width: 100%; height: auto; display: block;
  border-radius: 10px; border: 1px solid var(--border-strong);
  background: var(--card);
  box-shadow: 0 18px 48px oklch(0% 0 0 / .45);
}
figcaption {
  font-size: 0.85rem; color: var(--muted-foreground);
  margin-top: 0.75rem; line-height: 1.6; max-width: var(--measure);
}
figcaption b { color: var(--foreground); font-weight: 600; }

/* ---- tables ------------------------------------------------------------ */

.table-wrap { overflow-x: auto; margin: 0 0 1.5rem; }
table { border-collapse: collapse; width: 100%; font-size: 0.89rem; }
th, td { text-align: left; padding: 0.55rem 0.9rem 0.55rem 0; border-bottom: 1px solid var(--border); vertical-align: top; }
th {
  color: var(--muted-foreground); font-weight: 600;
  font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase;
  border-bottom-color: var(--border-strong);
}
td code { font-size: 0.8em; }

/* ---- callouts ---------------------------------------------------------- */

.note {
  border: 1px solid var(--border); border-left: 3px solid var(--border-strong);
  background: var(--card); padding: 0.9rem 1.15rem;
  border-radius: 0 9px 9px 0; margin: 0 0 1.5rem;
  max-width: var(--measure); font-size: 0.94rem;
}
.note p:last-child { margin-bottom: 0; }
.note.key  { border-left-color: var(--primary); }
.note.good { border-left-color: var(--accent); }
.note.warn { border-left-color: var(--warning); }
.note-label {
  display: block; font-family: var(--mono); font-size: 0.66rem;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted-foreground); margin-bottom: 0.35rem;
}
.note.key  .note-label { color: var(--primary); }
.note.good .note-label { color: var(--accent); }
.note.warn .note-label { color: var(--warning); }

/* ---- lifecycle diagram ------------------------------------------------- */

.lifecycle {
  font-family: var(--mono); font-size: 0.8rem;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 1.35rem; margin: 0 0 1.35rem;
  overflow-x: auto; line-height: 1.85; white-space: pre;
  color: var(--muted-foreground);
}
.lifecycle .b { color: var(--st-backlog); }
.lifecycle .p { color: var(--st-progress); }
.lifecycle .x { color: var(--st-blocked); }
.lifecycle .r { color: var(--st-review); }
.lifecycle .d { color: var(--st-done); }

/* ---- footer ------------------------------------------------------------ */

footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem 3rem; text-align: center;
  font-size: 0.85rem; color: var(--muted-foreground);
}
footer a { color: var(--muted-foreground); }
footer a:hover { color: var(--foreground); }

/* ---- responsive -------------------------------------------------------- */

@media (max-width: 760px) {
  .topnav { gap: 0.75rem; padding: 0 1rem; }
  .topnav .ver { display: none; }
  .topnav nav { gap: 1rem; }
  .hero { padding: 3rem 1rem 2.5rem; }
  main { padding: 2rem 1rem 4rem; }
  h2 { font-size: 1.3rem; margin-top: 2.75rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
