/* ==========================================================================
   Praetor — shared styles
   Black / grey surface with gold highlights. Monospace typography borrowed
   from dots.frazier.software; full-page sectioning inspired by CASL.
   ========================================================================== */

:root {
  --bg: #0a0a0a;
  --bg-soft: #0f0f0e;
  --panel: #151513;
  --panel-2: #1b1a17;
  --fg: #ece6d6;
  --muted: #9c9686;
  --rule: #26241f;
  --code-bg: #0c0c0b;
  --code-border: #2a2822;
  --gold: #f9b12e;
  --gold-soft: #ffd15c;
  --gold-deep: #e08b12;
  --gold-dim: rgba(249, 177, 46, 0.14);
  --gold-glow: rgba(249, 177, 46, 0.30);
  --ok: #5fd08a;
  --danger: #e07a6a;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --maxw: 1080px;
  --nav-h: 60px;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 20px); }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 640px at 50% -10%, #1c1810 0%, rgba(28, 24, 16, 0) 62%) no-repeat fixed,
    var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

img { max-width: 100%; display: block; }
a { color: var(--gold-soft); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--gold); }

h1, h2, h3, h4 { font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
h2 { font-size: clamp(22px, 3vw, 30px); margin: 0 0 14px; }
h3 { font-size: 18px; margin: 28px 0 10px; }
p { margin: 0 0 14px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; width: 100%; }

.label {
  display: inline-block;
  font-size: 12px;
  color: var(--gold);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 0 0 12px;
}

/* --- top navigation ------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: rgba(10, 10, 10, 0.72);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--fg); letter-spacing: -0.01em; }
.brand:hover { color: var(--fg); }
.brand img { height: 30px; width: auto; }
.brand span { font-size: 17px; }
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a {
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
}
.nav-links a:hover { color: var(--fg); background: var(--panel); }
.nav-links a.active { color: var(--gold); }
.nav-gh { display: inline-flex; align-items: center; gap: 7px; }
.nav-gh svg { width: 16px; height: 16px; fill: currentColor; }

/* --- buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  padding: 12px 22px;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.1s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(180deg, var(--gold-soft), var(--gold-deep));
  color: #1a1305;
  box-shadow: 0 10px 30px rgba(249, 177, 46, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
.btn-primary:hover { color: #1a1305; filter: brightness(1.06); }
.btn-ghost {
  background: var(--panel);
  border-color: var(--rule);
  color: var(--fg);
}
.btn-ghost:hover { border-color: var(--gold); color: var(--fg); }
.btn svg { width: 16px; height: 16px; fill: currentColor; }

/* --- generic sections ----------------------------------------------------- */
.section { padding: 76px 0; border-top: 1px solid var(--rule); }
.section:first-of-type { border-top: 0; }
.section-lead { color: var(--muted); max-width: 62ch; font-size: 16px; }
.center { text-align: center; }
.center .section-lead { margin-left: auto; margin-right: auto; }

/* --- hero ----------------------------------------------------------------- */
.hero {
  min-height: calc(100vh - var(--nav-h));
  min-height: calc(100svh - var(--nav-h));
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: clamp(16px, 3vh, 40px) 0 clamp(32px, 5vh, 64px);
  text-align: center;
}
.hero-logo {
  width: clamp(120px, 26vw, 176px);
  height: auto;
  margin: 0 auto 18px;
  filter: drop-shadow(0 12px 40px rgba(249, 177, 46, 0.28));
}
.hero h1 {
  font-size: clamp(40px, 8vw, 72px);
  line-height: 1;
  margin: 0 0 12px;
  background: linear-gradient(180deg, #fbf4dd, var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-tagline { font-size: clamp(16px, 2.6vw, 21px); color: var(--fg); margin: 0 auto 10px; max-width: 30ch; }
.hero-sub { color: var(--muted); max-width: 56ch; margin: 0 auto 30px; font-size: 15px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* flow pill: claims + rules + action -> allow / deny */
.flow {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 10px;
  margin: 34px auto 0;
  padding: 14px 18px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--panel);
  font-size: 13px;
  color: var(--muted);
}
.flow b { color: var(--fg); font-weight: 600; }
.flow .arrow { color: var(--gold); }
.flow .allow { color: var(--ok); font-weight: 700; }
.flow .deny { color: var(--danger); font-weight: 700; }

/* --- semantics cards ------------------------------------------------------ */
.split { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.rulecard { border: 1px solid var(--rule); border-left: 3px solid var(--gold); background: var(--panel); border-radius: 12px; padding: 20px; }
.rulecard h3 { margin: 0 0 6px; font-size: 16px; color: var(--gold-soft); }
.rulecard p { margin: 0; color: var(--muted); font-size: 14px; }

/* --- final CTA ------------------------------------------------------------ */
.cta-final { text-align: center; }
.cta-final h2 { margin-bottom: 22px; }

/* --- footer --------------------------------------------------------------- */
footer { border-top: 1px solid var(--rule); padding: 34px 0; color: var(--muted); font-size: 13px; }
footer .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
footer a { color: var(--muted); }
footer a:hover { color: var(--gold); }
.heart { color: var(--danger); }

/* --- code blocks + copy --------------------------------------------------- */
.codeblock { position: relative; margin: 0 0 16px; }
.codeblock pre {
  margin: 0;
  padding: 16px 18px;
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: 12px;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.6;
}
.codeblock pre code { font-family: var(--mono); background: none; padding: 0; }
.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--panel-2);
  color: var(--muted);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 5px 10px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.codeblock:hover .copy-btn, .copy-btn:focus-visible { opacity: 1; }
.copy-btn:hover { color: var(--gold); border-color: var(--gold-deep); }
.copy-btn.copied { color: var(--ok); border-color: var(--ok); opacity: 1; }
:not(pre) > code {
  font-family: var(--mono);
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 0.9em;
  color: var(--gold-soft);
}

/* ==========================================================================
   Getting Started — sidebar + scrollspy layout
   ========================================================================== */
.docs { max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.docs-grid { display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: 44px; align-items: start; }

.docs-sidebar {
  position: sticky;
  top: var(--nav-h);
  align-self: start;
  max-height: calc(100vh - var(--nav-h));
  overflow-y: auto;
  padding: 32px 0;
}
.docs-sidebar .side-label { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); margin: 0 0 12px; }
.docs-sidebar nav { display: flex; flex-direction: column; gap: 2px; border-left: 1px solid var(--rule); }
.docs-sidebar nav a {
  color: var(--muted);
  font-size: 13.5px;
  padding: 6px 14px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  line-height: 1.4;
}
.docs-sidebar nav a:hover { color: var(--fg); }
.docs-sidebar nav a.active { color: var(--gold); border-left-color: var(--gold); background: var(--gold-dim); }
.docs-sidebar nav a.sub { padding-left: 28px; font-size: 12.5px; }

/* content */
.docs-content { padding: 32px 0 96px; min-width: 0; }
.docs-content > section { scroll-margin-top: calc(var(--nav-h) + 20px); padding-bottom: 20px; }
.docs-content h1 { font-size: clamp(30px, 5vw, 42px); margin: 0 0 8px; }
.docs-content .doc-intro { color: var(--muted); font-size: 17px; margin-bottom: 8px; }
.docs-content h2 { margin-top: 8px; padding-top: 24px; border-top: 1px solid var(--rule); }
.docs-content section:first-child h2 { border-top: 0; padding-top: 0; }
.docs-content p, .docs-content li { color: #d8d2c2; }
.docs-content ul, .docs-content ol { padding-left: 22px; margin: 0 0 16px; }
.docs-content li { margin: 6px 0; }
.docs-content li b, .docs-content strong { color: var(--fg); }

/* callouts */
.callout {
  border: 1px solid var(--rule);
  border-left: 3px solid var(--gold);
  background: var(--gold-dim);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 0 0 16px;
  font-size: 14px;
  color: #e0dac9;
}
.callout b { color: var(--gold-soft); }

/* --- mobile menu button (hidden on desktop) ------------------------------- */
.menu-btn { display: none; background: var(--panel); border: 1px solid var(--rule); color: var(--fg); border-radius: 8px; padding: 7px 12px; font: inherit; font-size: 13px; cursor: pointer; align-items: center; gap: 8px; }
.menu-btn svg { width: 15px; height: 15px; fill: currentColor; }
.scrim { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); z-index: 40; }

/* ==========================================================================
   Syntax highlighting
   A standard dark highlight.js theme is loaded per-page from a CDN and supplies
   the token colors. Keep code blocks on the site's own surface color rather
   than the theme's background so the panels stay consistent.
   ========================================================================== */
.codeblock pre code.hljs { background: transparent; padding: 0; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
  .docs-grid { grid-template-columns: 1fr; gap: 0; }
  .menu-btn { display: inline-flex; }

  .docs-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(80vw, 300px);
    max-height: none;
    background: var(--bg-soft);
    border-right: 1px solid var(--rule);
    padding: calc(var(--nav-h) + 20px) 20px 24px;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    z-index: 45;
  }
  .docs-sidebar.open { transform: translateX(0); box-shadow: 0 0 60px rgba(0, 0, 0, 0.6); }
  .docs-sidebar.open + .scrim { display: block; }
  .docs-content { padding-top: 20px; }
}

@media (max-width: 620px) {
  .section { padding: 56px 0; }
  .nav-links a:not(.nav-gh) { display: none; }
  .nav-links .nav-gh { padding: 8px 10px; }
  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta .btn { justify-content: center; }
  .menu-btn-label { display: none; }
  .menu-btn { padding: 7px 9px; }
  footer .wrap { flex-direction: column; text-align: center; }
}
