/* ═══════════════════════════════════════════
   PNYMA — Enterprise Design System
   Constitutional Intelligence
═══════════════════════════════════════════ */

/* ─── Design tokens ─────────────────────── */
:root {
  color-scheme: dark;

  /* Background */
  --bg:            #04080f;
  --bg-2:          #070d1a;

  /* Surfaces */
  --surface:       rgba(10, 16, 32, 0.7);
  --surface-solid: #0a1020;
  --surface-hover: rgba(15, 24, 50, 0.85);

  /* Text */
  --text:          #eef2ff;
  --text-secondary:#8896b8;
  --text-muted:    #5a6a8a;

  /* Brand */
  --brand:         #4f8eff;
  --brand-light:   #7ab0ff;
  --brand-2:       #22d9c4;
  --brand-glow:    rgba(79, 142, 255, 0.18);

  /* Borders */
  --border:        rgba(100, 140, 220, 0.14);
  --border-hover:  rgba(100, 140, 220, 0.28);

  /* Shadows */
  --shadow-sm:     0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md:     0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-lg:     0 24px 64px rgba(0, 0, 0, 0.6);
  --shadow-glow:   0 0 40px rgba(79, 142, 255, 0.12);

  /* Layout */
  --radius-sm:     0.5rem;
  --radius-md:     0.875rem;
  --radius-lg:     1.25rem;
  --radius-full:   999px;
  --container:     min(1180px, 92vw);
  --header-h:      68px;

  /* Easing */
  --ease-out:      cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out:   cubic-bezier(0.45, 0, 0.55, 1);
}

/* ─── Reset ─────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 15% -10%, rgba(31, 62, 140, 0.55) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 90% 5%,  rgba(15, 80, 100, 0.4) 0%, transparent 55%),
    radial-gradient(ellipse 40% 30% at 50% 80%, rgba(20, 40, 90, 0.3) 0%, transparent 60%);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a   { color: inherit; text-decoration: none; }
button { cursor: pointer; font: inherit; }

/* ─── Background layers ──────────────────── */
.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black 20%, transparent 75%);
  opacity: 0.5;
}

.bg-glow {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  border-radius: 50%;
  filter: blur(80px);
}
.bg-glow--1 {
  width: 600px;
  height: 600px;
  top: -180px;
  left: -100px;
  background: radial-gradient(circle, rgba(30, 70, 180, 0.22) 0%, transparent 70%);
}
.bg-glow--2 {
  width: 500px;
  height: 500px;
  top: -100px;
  right: -80px;
  background: radial-gradient(circle, rgba(10, 100, 120, 0.18) 0%, transparent 70%);
}

/* ─── Layout helpers ─────────────────────── */
.container {
  width: var(--container);
  margin-inline: auto;
  position: relative;
  z-index: 1;
}

.section {
  padding-block: clamp(4rem, 7vw, 7rem);
}

/* ─── Typography ─────────────────────────── */
h1, h2, h3, h4 {
  margin: 0 0 0.75rem;
  line-height: 1.1;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

h1 { font-size: clamp(2.6rem, 6.5vw, 4.8rem); }
h2 { font-size: clamp(1.9rem, 4vw,  3.2rem); }
h3 { font-size: clamp(1.1rem, 2vw,  1.35rem); font-weight: 600; }

p  { margin: 0; color: var(--text-secondary); }

.eyebrow {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brand-2);
  margin-bottom: 1rem;
}

.gradient-text {
  background: linear-gradient(135deg, var(--brand-light) 0%, var(--brand-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.section-lede {
  font-size: 1.1rem;
  max-width: 56ch;
  color: var(--text-secondary);
  margin-top: 0.75rem;
}

/* ─── Buttons ────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: var(--radius-full);
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  transition: all 0.2s var(--ease-out);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn--primary {
  background: linear-gradient(135deg, var(--brand) 0%, #3a7fff 50%, var(--brand-2) 100%);
  background-size: 200% 200%;
  background-position: 0% 50%;
  color: #020c1b;
  box-shadow: 0 0 0 1px rgba(79, 142, 255, 0.3), var(--shadow-sm);
}
.btn--primary:hover {
  background-position: 100% 50%;
  box-shadow: 0 0 0 1px rgba(79, 142, 255, 0.5), 0 4px 20px rgba(79, 142, 255, 0.3);
  transform: translateY(-1px);
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-hover);
}
.btn--ghost:hover {
  background: rgba(79, 142, 255, 0.08);
  border-color: rgba(79, 142, 255, 0.4);
  color: var(--brand-light);
}

.btn--sm  { padding: 0.5rem 1rem; font-size: 0.82rem; }
.btn--lg  { padding: 0.9rem 2rem; font-size: 1rem; }

/* ─── Drawer ─────────────────────────────── */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 18, 0.7);
  backdrop-filter: blur(4px);
  z-index: 80;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.drawer-open .drawer-overlay {
  opacity: 1;
  visibility: visible;
}

.site-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(340px, 88vw);
  z-index: 90;
  background: rgba(7, 12, 28, 0.98);
  border-left: 1px solid var(--border);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s var(--ease-out);
  overflow-y: auto;
}
.drawer-open .site-drawer {
  transform: translateX(0);
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.4rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.drawer-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}

.drawer-close {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  transition: all 0.15s ease;
}
.drawer-close:hover {
  background: var(--surface);
  color: var(--text);
}

.drawer-nav {
  flex: 1;
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.drawer-section-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.9rem 0.6rem 0.3rem;
  margin-top: 0.25rem;
}

.drawer-link {
  display: block;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.15s ease;
}
.drawer-link:hover {
  color: var(--text);
  background: rgba(79, 142, 255, 0.1);
}

.drawer-footer {
  padding: 1.25rem 1.4rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.drawer-cta { width: 100%; justify-content: center; }

/* ─── Site header ────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: rgba(4, 8, 15, 0.88);
  backdrop-filter: blur(16px);
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.site-header__inner {
  width: var(--container);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  display: grid;
  place-items: center;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: #021020;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(79, 142, 255, 0.35);
}
.brand-name {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  color: var(--text);
}

.header-nav {
  display: none;
  align-items: center;
  gap: 0.25rem;
}
.header-nav a {
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.87rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.15s ease;
}
.header-nav a:hover {
  color: var(--text);
  background: rgba(79, 142, 255, 0.08);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

/* Hamburger fab */
.menu-fab {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  transition: all 0.15s ease;
  padding: 0;
  flex-shrink: 0;
}
.menu-fab:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
}
.menu-fab__bar {
  display: block;
  width: 18px;
  height: 1.5px;
  background: currentColor;
  border-radius: 2px;
  transition: all 0.25s var(--ease-out);
}
.drawer-open .menu-fab .menu-fab__bar:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}
.drawer-open .menu-fab .menu-fab__bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.drawer-open .menu-fab .menu-fab__bar:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* ─── Hero ───────────────────────────────── */
.hero {
  padding-top: clamp(4rem, 8vw, 8rem);
  padding-bottom: clamp(3rem, 5vw, 5rem);
  position: relative;
  z-index: 1;
}

.hero__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
}

.hero__headline {
  margin-bottom: 1.25rem;
}

.hero__lede {
  font-size: clamp(1rem, 2vw, 1.15rem);
  max-width: 55ch;
  color: var(--text-secondary);
  line-height: 1.7;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

/* Hero visual — concentric rings orb */
.hero__visual {
  display: flex;
  align-items: center;
  justify-content: center;
}

.orb-frame {
  position: relative;
  width: 320px;
  height: 320px;
  flex-shrink: 0;
}

.orb-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid var(--border);
  animation: orb-rotate 20s linear infinite;
}
.orb-ring--1 {
  inset: 0;
  border-color: rgba(79, 142, 255, 0.25);
  animation-duration: 28s;
}
.orb-ring--2 {
  inset: 28px;
  border-color: rgba(34, 217, 196, 0.2);
  animation-direction: reverse;
  animation-duration: 22s;
}
.orb-ring--3 {
  inset: 58px;
  border-color: rgba(79, 142, 255, 0.15);
  animation-duration: 18s;
}
.orb-ring--4 {
  inset: 90px;
  border-color: rgba(34, 217, 196, 0.12);
  animation-direction: reverse;
  animation-duration: 14s;
}

@keyframes orb-rotate {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.orb-core {
  position: absolute;
  inset: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  display: grid;
  place-items: center;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: #020c1b;
  box-shadow: 0 0 40px rgba(79, 142, 255, 0.4), 0 0 80px rgba(79, 142, 255, 0.15);
  z-index: 2;
}

.orb-pulse {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1px solid rgba(79, 142, 255, 0.5);
  animation: pulse-ring 3s ease-out infinite;
}
@keyframes pulse-ring {
  0%   { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(1.8); opacity: 0; }
}

.orb-node {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand-2);
  box-shadow: 0 0 10px var(--brand-2);
  z-index: 3;
}
.orb-node--a { top: 18px;  left: 50%; transform: translateX(-50%); }
.orb-node--b { bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--brand); box-shadow: 0 0 10px var(--brand); }
.orb-node--c { left: 18px; top: 50%; transform: translateY(-50%); }
.orb-node--d { right: 18px; top: 50%; transform: translateY(-50%); background: var(--brand-light); box-shadow: 0 0 10px var(--brand-light); }

.orb-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  animation: orb-rotate 60s linear infinite reverse;
}

/* Trust bar */
.trust-bar {
  margin-top: clamp(2.5rem, 4vw, 4rem);
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: flex-start;
}
.trust-bar__label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.04em;
}
.trust-bar__items {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
}
.trust-bar__dot {
  display: inline-block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--border-hover);
}

/* ─── Pillars ────────────────────────────── */
.pillars-section {
  position: relative;
  z-index: 1;
}

.section-head {
  margin-bottom: clamp(2rem, 3.5vw, 3rem);
}
.section-head h2 {
  margin-top: 0.25rem;
}

.pillars-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.pillar-card {
  padding: 1.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  backdrop-filter: blur(12px);
  transition: all 0.25s var(--ease-out);
  position: relative;
  overflow: hidden;
}
.pillar-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(79, 142, 255, 0.04) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.25s ease;
  border-radius: inherit;
}
.pillar-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-glow);
  transform: translateY(-3px);
}
.pillar-card:hover::before { opacity: 1; }

.pillar-card__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(79, 142, 255, 0.08);
  color: var(--brand);
  margin-bottom: 1.25rem;
  transition: all 0.25s ease;
}
.pillar-card:hover .pillar-card__icon {
  background: rgba(79, 142, 255, 0.15);
  border-color: rgba(79, 142, 255, 0.3);
  color: var(--brand-light);
}

.pillar-card h3 {
  margin-bottom: 0.6rem;
}
.pillar-card p {
  font-size: 0.92rem;
  line-height: 1.65;
}

/* ─── Docs section ───────────────────────── */
.docs-section {
  position: relative;
  z-index: 1;
}

.docs-section__head {
  margin-bottom: clamp(2rem, 3.5vw, 3rem);
}

.docs-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

/* Featured top cards */
.doc-card {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: all 0.22s var(--ease-out);
  position: relative;
}
.doc-card:hover {
  border-color: var(--border-hover);
  background: var(--surface-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.doc-card--featured {
  padding: 2rem;
}
.doc-card--featured h3 {
  font-size: 1.2rem;
  margin-top: 0.25rem;
}
.doc-card--featured p {
  font-size: 0.92rem;
  line-height: 1.65;
  flex: 1;
}

.doc-card__tag {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-2);
  opacity: 0.9;
}

.doc-card h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
}

.doc-card__link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--brand-light);
  margin-top: auto;
  padding-top: 0.5rem;
  transition: gap 0.15s ease, color 0.15s ease;
}
.doc-card__link:hover {
  gap: 0.65rem;
  color: var(--brand-2);
}

/* ─── CTA section ────────────────────────── */
.cta-section {
  position: relative;
  z-index: 1;
}

.cta-block {
  position: relative;
  padding: clamp(3rem, 6vw, 5rem) clamp(2rem, 5vw, 4.5rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: linear-gradient(135deg, rgba(79, 142, 255, 0.08) 0%, rgba(34, 217, 196, 0.05) 100%);
  text-align: center;
}

.cta-block__glow {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(79, 142, 255, 0.12) 0%, transparent 60%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.cta-block__content {
  position: relative;
  z-index: 1;
}
.cta-block__content h2 {
  margin: 0.5rem 0 1rem;
}
.cta-block__content p {
  max-width: 52ch;
  margin: 0 auto 2rem;
  font-size: 1.05rem;
  line-height: 1.7;
}

/* ─── Footer ─────────────────────────────── */
.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding-block: 2.5rem;
}

.site-footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  text-align: center;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 0.1rem;
}
.footer-nav a {
  padding: 0.35rem 0.7rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-radius: var(--radius-full);
  transition: color 0.15s ease;
}
.footer-nav a:hover { color: var(--text-secondary); }

.site-footer__copy {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ─── Scroll reveal ──────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Responsive — tablet ────────────────── */
@media (min-width: 640px) {
  .pillars-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .docs-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .trust-bar {
    flex-direction: row;
    align-items: center;
    gap: 1.5rem;
  }
}

/* ─── Responsive — desktop ───────────────── */
@media (min-width: 900px) {
  .header-nav { display: flex; }

  .hero__inner {
    grid-template-columns: 1.1fr 0.9fr;
    gap: 5rem;
  }

  .orb-frame {
    width: 380px;
    height: 380px;
  }

  .docs-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .site-footer__inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

@media (min-width: 1100px) {
  .docs-grid {
    grid-template-columns: repeat(5, 1fr);
  }
  .doc-card--featured {
    grid-column: span 2;
  }
}

/* ─── Reduced motion ─────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ═══════════════════════════════════════════
   DOC PAGE LAYOUT
═══════════════════════════════════════════ */

/* ─── Active drawer link ─────────────────── */
.drawer-link--active {
  color: var(--text);
  background: rgba(79, 142, 255, 0.12);
  font-weight: 600;
}

/* ─── Doc wrap ───────────────────────────── */
.doc-wrap {
  position: relative;
  z-index: 1;
  padding-block: 2.5rem clamp(4rem, 7vw, 7rem);
  min-height: calc(100vh - var(--header-h));
}

/* ─── Doc layout (sidebar + content) ─────── */
.doc-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: start;
}

/* ─── Sidebar ────────────────────────────── */
.doc-sidebar {
  display: none;
}

.doc-sidebar__inner {
  position: sticky;
  top: calc(var(--header-h) + 1.5rem);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  backdrop-filter: blur(12px);
}

.doc-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: color 0.15s ease;
}
.doc-back-link:hover { color: var(--brand-light); }

.doc-sidebar__meta {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding-top: 0.25rem;
  border-top: 1px solid var(--border);
}

.doc-sidebar__label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.doc-sidebar__file {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.76rem;
  color: var(--brand-2);
  background: rgba(34, 217, 196, 0.06);
  border: 1px solid rgba(34, 217, 196, 0.15);
  border-radius: 4px;
  padding: 0.3rem 0.5rem;
  word-break: break-all;
}

/* Sidebar nav */
.doc-sidenav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 0.25rem;
  border-top: 1px solid var(--border);
}

.doc-sidenav__section {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.8rem 0.4rem 0.2rem;
  margin-top: 0.15rem;
}

.doc-sidenav__link {
  display: block;
  padding: 0.42rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.3;
  transition: all 0.15s ease;
}
.doc-sidenav__link:hover {
  color: var(--text);
  background: rgba(79, 142, 255, 0.08);
}
.doc-sidenav__link--active {
  color: var(--brand-light);
  background: rgba(79, 142, 255, 0.12);
  font-weight: 600;
}

/* ─── Doc main ───────────────────────────── */
.doc-main {
  min-width: 0;
}

/* Breadcrumb */
.doc-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}
.doc-breadcrumb a {
  color: var(--text-muted);
  transition: color 0.15s ease;
}
.doc-breadcrumb a:hover { color: var(--text-secondary); }
.doc-breadcrumb span:last-child {
  color: var(--text-secondary);
  font-weight: 500;
}

/* Doc hero */
.doc-hero {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}
.doc-hero__title {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  margin-top: 0.5rem;
  margin-bottom: 0;
  line-height: 1.15;
}

/* ─── Doc content typography ─────────────── */
.doc-content {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.75;
  max-width: 72ch;
}

.doc-content > * + * { margin-top: 1.25rem; }

/* Strip the repeated h1 that duplicates the hero title */
.doc-content > h1:first-child { display: none; }

.doc-content h2 {
  font-size: clamp(1.2rem, 3vw, 1.55rem);
  color: var(--text);
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.doc-content h3 {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--text);
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}

.doc-content h4 {
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 600;
  margin-top: 1.25rem;
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.doc-content p { margin: 0; }
.doc-content p + p { margin-top: 1rem; }

.doc-content strong {
  color: var(--text);
  font-weight: 600;
}

.doc-content em { font-style: italic; }

.doc-content a {
  color: var(--brand-light);
  text-decoration: underline;
  text-decoration-color: rgba(79, 142, 255, 0.3);
  text-underline-offset: 3px;
  transition: all 0.15s ease;
}
.doc-content a:hover {
  color: var(--brand-2);
  text-decoration-color: var(--brand-2);
}

/* Lists */
.doc-content ul,
.doc-content ol {
  padding-left: 0;
  margin: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.doc-content ul > li {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}
.doc-content ul > li::before {
  content: '';
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brand-2);
  margin-top: 0.62em;
  flex-shrink: 0;
}

.doc-content ol {
  counter-reset: list-counter;
}
.doc-content ol > li {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  counter-increment: list-counter;
}
.doc-content ol > li::before {
  content: counter(list-counter);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  background: rgba(79, 142, 255, 0.12);
  border: 1px solid rgba(79, 142, 255, 0.25);
  color: var(--brand-light);
  font-size: 0.72rem;
  font-weight: 700;
  margin-top: 0.18em;
  flex-shrink: 0;
}

/* Nested lists */
.doc-content li ul,
.doc-content li ol {
  margin-top: 0.4rem;
  padding-left: 1.2rem;
}

/* Code */
.doc-content code {
  font-family: 'SF Mono', 'Fira Code', 'Fira Mono', monospace;
  font-size: 0.84em;
  color: var(--brand-2);
  background: rgba(34, 217, 196, 0.07);
  border: 1px solid rgba(34, 217, 196, 0.18);
  border-radius: 4px;
  padding: 0.15em 0.45em;
}

.doc-content pre {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}
.doc-content pre code {
  background: transparent;
  border: none;
  padding: 0;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

/* Blockquote */
.doc-content blockquote {
  border-left: 3px solid var(--brand);
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  background: rgba(79, 142, 255, 0.05);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--text-secondary);
  font-style: italic;
}

/* Tables */
.doc-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}
.doc-content th {
  text-align: left;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--border-hover);
  color: var(--text);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.doc-content td {
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.doc-content tr:last-child td { border-bottom: none; }

/* ─── Doc footer nav ─────────────────────── */
.doc-foot-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

/* ─── Doc layout responsive ──────────────── */
@media (min-width: 900px) {
  .doc-layout {
    grid-template-columns: 220px 1fr;
    gap: 3rem;
  }

  .doc-sidebar {
    display: block;
  }
}

@media (min-width: 1100px) {
  .doc-layout {
    grid-template-columns: 240px 1fr;
    gap: 4rem;
  }
}
