/* ============================================================
   UniLog Toolkit — shared stylesheet
   Used by: index.html, tutorial.html, user-guide.html
   ============================================================ */

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

html { scroll-behavior: smooth; scroll-padding-top: 96px; }
html, body { margin: 0; padding: 0; }

:root {
  --bg-0:      #070a14;
  --bg-1:      #0b0f1e;
  --bg-2:      #111827;
  --surface:   #141a2b;
  --surface-2: #1a2138;

  --border:        rgba(148, 163, 184, 0.12);
  --border-strong: rgba(148, 163, 184, 0.24);

  --text:       #e6ecf5;
  --text-muted: #94a3b8;
  --text-dim:   #64748b;

  --cyan:   #22d3ee;
  --violet: #a78bfa;
  --amber:  #fbbf24;
  --green:  #34d399;
  --rose:   #fb7185;

  --font-serif: 'Iowan Old Style', 'Palatino Linotype', Palatino,
                'Book Antiqua', Georgia, serif;
  --font-sans:  -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
                'Helvetica Neue', Arial, sans-serif;
  --font-mono:  ui-monospace, 'SF Mono', Menlo, Consolas,
                'Liberation Mono', monospace;

  --radius:    16px;
  --radius-sm: 10px;
  --sidebar-w: 300px;
  --header-h:  64px;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-1);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================================
   Header & navigation
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  background: rgba(11, 15, 30, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand-mark { display: block; flex-shrink: 0; }
.brand-name { font-size: 15px; }

.brand-version {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(34, 211, 238, 0.35);
  color: var(--cyan);
  background: rgba(34, 211, 238, 0.08);
  letter-spacing: 0.02em;
}

.brand-sep {
  width: 1px;
  height: 18px;
  background: var(--border-strong);
  margin: 0 4px;
}

.brand-page {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 14px;
}
.header-nav a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}
.header-nav a:hover { color: var(--cyan); text-decoration: none; }
.header-nav a.active { color: var(--cyan); }

.sidebar-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.sidebar-toggle:hover { border-color: var(--border-strong); }

@media (max-width: 720px) {
  .brand-name, .brand-sep, .brand-page { display: none; }
  .header-nav { gap: 14px; font-size: 13px; }
}
@media (max-width: 640px) {
  .brand-name { display: none; }
}

/* ============================================================
   Landing page hero
   ============================================================ */
.hero {
  position: relative;
  padding: 72px 0 96px;
  overflow: hidden;
  background:
    radial-gradient(ellipse 900px 460px at 22% -10%,
      rgba(34, 211, 238, 0.10), transparent 62%),
    radial-gradient(ellipse 800px 500px at 82% 25%,
      rgba(167, 139, 250, 0.08), transparent 62%),
    var(--bg-1);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(148, 163, 184, 0.07) 1px, transparent 1px);
  background-size: 24px 24px;
  -webkit-mask-image: radial-gradient(ellipse 900px 520px at 50% 45%,
                        black 20%, transparent 78%);
          mask-image: radial-gradient(ellipse 900px 520px at 50% 45%,
                        black 20%, transparent 78%);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 56px;
  align-items: center;
}
@media (max-width: 940px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero { padding: 56px 0 72px; }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 22px;
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--cyan);
  display: inline-block;
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(34px, 4.8vw, 58px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: #fff;
  margin: 0 0 22px;
}
.hero h1 em {
  font-style: italic;
  color: var(--cyan);
  font-weight: 500;
}

.hero-lede {
  font-size: 17px;
  color: var(--text-muted);
  max-width: 540px;
  margin: 0 0 28px;
}

.formula {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border);
  color: var(--text);
  max-width: 100%;
  overflow-x: auto;
  white-space: nowrap;
}
.formula-label {
  color: var(--text-dim);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.formula code { color: var(--cyan); }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 30px;
}
.chip {
  font-size: 12.5px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.02);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.chip .dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--cyan);
  display: inline-block;
}
.chip:nth-child(2) .dot { background: var(--violet); }
.chip:nth-child(3) .dot { background: var(--amber); }
.chip:nth-child(4) .dot { background: var(--green); }

.hero-art {
  display: flex;
  justify-content: center;
  align-items: center;
}
.hero-art svg {
  width: 100%;
  max-width: 560px;
  height: auto;
  display: block;
}

/* Hero SVG animations */
@keyframes pulse {
  0%, 100% { opacity: 0.35; transform: scale(1); }
  50%      { opacity: 0.9;  transform: scale(1.06); }
}
.node-halo {
  transform-origin: center;
  transform-box: fill-box;
  animation: pulse 4.5s ease-in-out infinite;
}
.node-halo.d1 { animation-delay: 0.4s; }
.node-halo.d2 { animation-delay: 0.8s; }
.node-halo.d3 { animation-delay: 1.2s; }
.node-halo.d4 { animation-delay: 1.6s; }
.node-halo.d5 { animation-delay: 2.0s; }
.node-halo.d6 { animation-delay: 2.4s; }
.node-halo.d7 { animation-delay: 2.8s; }
.node-halo.d8 { animation-delay: 3.2s; }
.node-halo.d9 { animation-delay: 3.6s; }

@keyframes dash {
  to { stroke-dashoffset: -22; }
}
.spoke {
  stroke-dasharray: 2 5;
  animation: dash 3s linear infinite;
}

/* ============================================================
   Cards section (landing page)
   ============================================================ */
.cards-section {
  padding: 40px 0 100px;
  border-top: 1px solid var(--border);
  background: var(--bg-0);
}

.cards-heading {
  text-align: center;
  margin-bottom: 52px;
}
.cards-heading .eyebrow {
  justify-content: center;
  margin-bottom: 18px;
}
.cards-heading .eyebrow::before,
.cards-heading .eyebrow::after {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--cyan);
}
.cards-heading h2 {
  font-family: var(--font-serif);
  font-size: clamp(26px, 3.4vw, 38px);
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0 0 14px;
  color: #fff;
}
.cards-heading p {
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 auto;
  font-size: 16px;
}

.cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 780px) {
  .cards { grid-template-columns: 1fr; }
}

.card {
  --accent: var(--cyan);
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 40px 36px 34px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: transform 0.28s ease,
              border-color 0.28s ease,
              background 0.28s ease,
              box-shadow 0.28s ease;
}
.card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg,
    transparent, var(--accent) 30%, var(--accent) 70%, transparent);
  opacity: 0.85;
}
.card::after {
  content: "";
  position: absolute;
  top: -40%; right: -20%;
  width: 340px; height: 340px;
  background: radial-gradient(circle,
    color-mix(in srgb, var(--accent) 22%, transparent) 0%,
    transparent 65%);
  opacity: 0.35;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  background: var(--surface-2);
  box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.6);
}
.card:hover::after { opacity: 0.6; }

.card.tutorial  { --accent: var(--cyan); }
.card.userguide { --accent: var(--violet); }

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 26px;
  position: relative;
  z-index: 1;
}
.card-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  color: var(--accent);
}
.card-icon svg { width: 28px; height: 28px; }

.card-index {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}
.card h3 {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 600;
  margin: 0 0 6px;
  letter-spacing: -0.015em;
  color: #fff;
  position: relative;
  z-index: 1;
}
.card-tagline {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 20px;
  position: relative;
  z-index: 1;
}
.card > p {
  color: var(--text-muted);
  font-size: 15px;
  margin: 0 0 26px;
  position: relative;
  z-index: 1;
}
.card-features {
  list-style: none;
  padding: 22px 0 0;
  margin: 0 0 30px;
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 1;
}
.card-features li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 10px;
  font-size: 14.5px;
  color: var(--text-muted);
}
.card-features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 11px;
  width: 12px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}
.card-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
  margin-top: auto;
  position: relative;
  z-index: 1;
}
.card-cta svg { transition: transform 0.28s ease; }
.card:hover .card-cta svg { transform: translateX(5px); }

.card-meta {
  display: flex;
  gap: 18px;
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 1;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}
.card-meta span { display: inline-flex; align-items: center; gap: 6px; }

/* ============================================================
   Families strip (landing page)
   ============================================================ */
.families {
  padding: 70px 0 90px;
  border-top: 1px solid var(--border);
}
.families h2 {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 600;
  text-align: center;
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}
.families > .container > p {
  text-align: center;
  color: var(--text-muted);
  margin: 0 0 34px;
  font-size: 15px;
}
.families-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 900px;
  margin: 0 auto;
}
.family {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 15px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
  transition: border-color 0.2s ease, color 0.2s ease;
}
.family:hover {
  border-color: var(--border-strong);
  color: var(--text);
}
.family-glyph {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--cyan);
  min-width: 14px;
  text-align: center;
}
.family:nth-child(2n) .family-glyph { color: var(--violet); }

/* ============================================================
   Documentation layout (tutorial + user guide)
   ============================================================ */
.layout {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  gap: 56px;
}
@media (max-width: 1000px) {
  .layout { grid-template-columns: 1fr; gap: 0; }
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: 32px 4px 64px 0;
  font-size: 13.5px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 3px;
}
@media (max-width: 1000px) {
  .sidebar {
    position: fixed;
    top: var(--header-h);
    left: 0;
    width: 310px;
    height: calc(100vh - var(--header-h));
    background: var(--bg-2);
    border-right: 1px solid var(--border);
    padding: 24px 20px 64px;
    transform: translateX(-104%);
    transition: transform 0.28s ease;
    z-index: 90;
    box-shadow: 24px 0 60px -20px rgba(0,0,0,0.6);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-toggle { display: inline-flex; }
}

.sidebar h4 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  font-weight: 600;
  margin: 26px 0 10px;
}
.sidebar h4:first-child { margin-top: 0; }
.sidebar ol {
  list-style: none;
  padding: 0;
  margin: 0;
}
.sidebar li { margin: 0; }
.sidebar a {
  display: block;
  padding: 6px 12px;
  color: var(--text-muted);
  border-radius: 6px;
  border-left: 2px solid transparent;
  text-decoration: none;
  transition: color 0.15s ease, background 0.15s ease,
              border-color 0.15s ease;
}
.sidebar a:hover {
  color: var(--text);
  background: rgba(255,255,255,0.03);
  text-decoration: none;
}
.sidebar a.active {
  color: var(--cyan);
  border-left-color: var(--cyan);
  background: rgba(34, 211, 238, 0.06);
  font-weight: 500;
}
.sidebar a.sub {
  padding-left: 24px;
  font-size: 12.5px;
  color: var(--text-dim);
}
.sidebar a.sub:hover { color: var(--text-muted); }
.sidebar a.sub.active { color: var(--cyan); }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: var(--header-h) 0 0 0;
  background: rgba(0,0,0,0.5);
  z-index: 89;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.open { display: block; }

/* ---------- Main content ---------- */
main {
  padding: 44px 0 100px;
  min-width: 0;
  max-width: 800px;
}

/* ---------- Document hero ---------- */
.guide-hero {
  margin-bottom: 52px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
}
.guide-hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 18px;
}
.guide-hero .eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--cyan);
}
.guide-hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(34px, 4.4vw, 48px);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: #fff;
  margin: 0 0 18px;
}
.guide-hero .lede {
  font-size: 17px;
  color: var(--text-muted);
  margin: 0 0 26px;
  max-width: 640px;
}

/* user guide variant (violet accent) */
.user-guide .guide-hero .eyebrow { color: var(--violet); }
.user-guide .guide-hero .eyebrow::before { background: var(--violet); }
.user-guide .guide-hero .lede { margin: 0; }

/* ---------- Meta grid (tutorial hero) ---------- */
.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
  padding-top: 8px;
}
.meta-item {
  border-left: 2px solid var(--border-strong);
  padding-left: 14px;
}
.meta-item .label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  display: block;
  margin-bottom: 4px;
}
.meta-item .value {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
}

/* ============================================================
   Section headings
   ============================================================ */
section { scroll-margin-top: 88px; margin-bottom: 68px; }

.part {
  margin: 88px 0 44px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.part:first-of-type { margin-top: 0; }
.part-label {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.part h2 {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: #fff;
  margin: 8px 0 10px;
}
.part p {
  color: var(--text-muted);
  margin: 0;
  max-width: 640px;
}

h3 {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #fff;
  margin: 0 0 14px;
  display: flex;
  align-items: baseline;
  gap: 14px;
}
h3 .num {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--cyan);
  font-weight: 500;
  letter-spacing: 0.04em;
}
h4 {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  margin: 28px 0 10px;
}
h5 {
  font-family: var(--font-sans);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
  margin: 22px 0 8px;
}

p { color: var(--text-muted); margin: 0 0 16px; }
p strong { color: var(--text); font-weight: 600; }
ul, ol { color: var(--text-muted); padding-left: 22px; margin: 0 0 16px; }
li { margin-bottom: 6px; }
li strong { color: var(--text); }

/* ============================================================
   Code
   ============================================================ */
code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: rgba(34, 211, 238, 0.08);
  color: var(--cyan);
  padding: 2px 6px;
  border-radius: 4px;
}
pre {
  background: #05070e;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 22px;
  overflow-x: auto;
  margin: 0 0 20px;
  font-size: 13px;
  line-height: 1.6;
  position: relative;
}
pre code {
  background: none;
  color: #cbd5e1;
  padding: 0;
  font-size: inherit;
  border-radius: 0;
}
pre::-webkit-scrollbar { height: 8px; }
pre::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
}

/* UniLang sample variant */
pre.unilang {
  background:
    linear-gradient(180deg, rgba(34,211,238,0.04), transparent 40%),
    #05070e;
}
pre.unilang code { color: #bae6fd; }

/* ============================================================
   Callouts
   ============================================================ */
.callout {
  --accent: var(--cyan);
  position: relative;
  padding: 16px 20px 16px 44px;
  margin: 0 0 20px;
  background: color-mix(in srgb, var(--accent) 6%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  color: var(--text-muted);
}
.callout::before {
  content: "▸";
  position: absolute;
  left: 18px;
  top: 15px;
  color: var(--accent);
  font-size: 14px;
  line-height: 1.68;
}
.callout strong { color: var(--text); }
.callout.warn { --accent: var(--amber); }
.callout.tip  { --accent: var(--green); }
.callout.note { --accent: var(--violet); }

/* ============================================================
   Tables
   ============================================================ */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 22px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
thead { background: rgba(255,255,255,0.03); }
th {
  text-align: left;
  padding: 11px 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
}
td {
  padding: 11px 14px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,0.02); }
td code, th code { font-size: 12.5px; }

/* ============================================================
   Anchor link on headings
   ============================================================ */
.heading-anchor {
  color: var(--text-dim);
  font-size: 0.7em;
  opacity: 0;
  margin-left: 6px;
  transition: opacity 0.15s ease, color 0.15s ease;
  text-decoration: none;
}
h3:hover .heading-anchor,
h4:hover .heading-anchor { opacity: 1; }
.heading-anchor:hover { color: var(--cyan); text-decoration: none; }

/* ============================================================
   Pager (prev / next)
   ============================================================ */
.pager {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 60px;
  padding-top: 30px;
  border-top: 1px solid var(--border);
}
.pager a {
  flex: 1;
  padding: 18px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease, background 0.2s ease,
              transform 0.2s ease;
}
.pager a:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
  transform: translateY(-2px);
  text-decoration: none;
}
.pager .dir {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  display: block;
  margin-bottom: 6px;
}
.pager .title {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 600;
  color: #fff;
}
.pager .next { text-align: right; }
.pager .prev .dir { color: var(--cyan); }
.pager .next .dir { color: var(--violet); }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  padding: 40px 0;
  border-top: 1px solid var(--border);
  background: var(--bg-0);
  margin-top: 60px;
}
.footer-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 13px;
  color: var(--text-dim);
}
.footer-links {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}
.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}
.footer-links a:hover { color: var(--cyan); text-decoration: none; }

/* ============================================================
   Reading progress bar (docs pages)
   ============================================================ */
.progress-bar {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  height: 2px;
  background: transparent;
  z-index: 99;
  pointer-events: none;
}
.progress-bar .fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  transition: width 0.08s linear;
}

/* ============================================================
   Accessibility
   ============================================================ */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 3px;
}
a { text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .node-halo, .spoke { animation: none; }
  .card, .pager a { transition: none; }
}