/* MyLocals site — dark-first, shared tokens */
:root {
  --bg: #0c0c0e;
  --bg-elevated: #141416;
  --bg-card: #18181b;
  --bg-card-hover: #1c1c1f;
  --border: #2a2a2e;
  --border-subtle: #222226;
  --text: #e8e8ea;
  --text-secondary: #a1a1a6;
  --text-muted: #6e6e73;
  --accent: #2dd4bf;
  --accent-dim: #14b8a6;
  --accent-bg: rgba(45, 212, 191, 0.12);
  --accent-border: rgba(45, 212, 191, 0.35);
  --btn-text: #0a0a0b;
  --warn-bg: rgba(251, 191, 36, 0.08);
  --warn-border: rgba(251, 191, 36, 0.28);
  --warn-text: #fbbf24;
  --radius: 10px;
  --radius-sm: 6px;
  --font: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SF Mono", "Menlo", "Consolas", "PingFang SC", monospace;
  --max: 1440px;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  position: relative;
  isolation: isolate;
  overflow-x: hidden;
}

/* Animated page background — aurora orbs + grid */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

body::before {
  background:
    radial-gradient(ellipse 55% 40% at 15% 10%, rgba(45, 212, 191, 0.22), transparent 55%),
    radial-gradient(ellipse 45% 50% at 85% 20%, rgba(56, 189, 248, 0.16), transparent 50%),
    radial-gradient(ellipse 50% 45% at 50% 85%, rgba(20, 184, 166, 0.14), transparent 55%),
    radial-gradient(ellipse 35% 30% at 70% 60%, rgba(167, 139, 250, 0.1), transparent 50%),
    var(--bg);
  background-size: 140% 140%, 160% 160%, 150% 150%, 130% 130%, auto;
  background-position: 0% 0%, 100% 0%, 50% 100%, 80% 50%, center;
  animation: bg-aurora 22s ease-in-out infinite alternate;
  filter: saturate(1.15);
}

body::after {
  background-image:
    linear-gradient(rgba(232, 232, 234, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232, 232, 234, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 50% 0%, rgba(45, 212, 191, 0.08), transparent 45%);
  background-size: 48px 48px, 48px 48px, 100% 70%;
  background-position: 0 0, 0 0, center top;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 20%, transparent 75%);
  animation: bg-grid 28s linear infinite;
  opacity: 0.85;
}

@keyframes bg-aurora {
  0% {
    background-position: 0% 10%, 100% 0%, 40% 100%, 70% 40%, center;
    filter: saturate(1.1) hue-rotate(0deg);
  }
  50% {
    background-position: 30% 0%, 70% 25%, 60% 80%, 40% 60%, center;
    filter: saturate(1.25) hue-rotate(8deg);
  }
  100% {
    background-position: 10% 30%, 90% 10%, 50% 70%, 85% 50%, center;
    filter: saturate(1.15) hue-rotate(-6deg);
  }
}

@keyframes bg-grid {
  0% { background-position: 0 0, 0 0, center top; }
  100% { background-position: 48px 48px, 48px 48px, center top; }
}

@media (prefers-reduced-motion: reduce) {
  body::before,
  body::after {
    animation: none;
  }
  body::before {
    background-position: 20% 10%, 80% 15%, 50% 90%, 70% 55%, center;
    filter: none;
  }
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

code,
.mono {
  font-family: var(--mono);
  font-size: 0.9em;
}

/* Top bar */
.topbar {
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(12, 12, 14, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}

.logo:hover {
  text-decoration: none;
  color: var(--text);
}

.logo-mark {
  width: 30px;
  height: 30px;
  border-radius: 22%;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
  background: transparent;
}

.logo img.logo-mark {
  width: 30px;
  height: 30px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav a {
  display: inline-block;
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: color 0.12s ease, background 0.12s ease;
}

.nav a:hover {
  color: var(--text-secondary);
  text-decoration: none;
  background: var(--bg-elevated);
}

.nav a[aria-current="page"] {
  color: var(--text);
  background: var(--bg-elevated);
}

.nav-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Main */
.main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 3.5rem;
  position: relative;
  z-index: 1;
}

.hero {
  margin-bottom: 2.25rem;
}

.hero h1 {
  margin: 0 0 0.65rem;
  font-size: clamp(1.65rem, 4vw, 2rem);
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.25;
}

.hero-blurb {
  margin: 0;
  max-width: 40rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-top: 1.35rem;
}

.hero-actions .btn {
  min-width: 7.5rem;
}

.version-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1rem;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  background: var(--accent-bg);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 500;
}

.hero .version-pill {
  margin-top: 1.1rem;
}

/* Platform grid */
.platforms {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2.75rem;
}

@media (max-width: 840px) {
  .platforms {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.2rem 1.35rem;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: #333338;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.card-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.card-arch {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.os-badge {
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.card-unavailable {
  opacity: 0.72;
}

.card-unavailable:hover {
  background: var(--bg-card);
  border-color: var(--border);
}

.os-badge-muted {
  color: var(--text-muted);
  border-color: var(--border-subtle);
}

.btn-disabled,
.btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.55;
  pointer-events: none;
  background: var(--bg-elevated);
  color: var(--text-muted);
  border-color: var(--border);
}

.btn-disabled:hover,
.btn[aria-disabled="true"]:hover {
  background: var(--bg-elevated);
  color: var(--text-muted);
  border-color: var(--border);
}

.meta {
  list-style: none;
  margin: 0 0 1.15rem;
  padding: 0;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.meta li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

.meta li:last-child {
  border-bottom: none;
}

.meta .label {
  color: var(--text-muted);
  flex-shrink: 0;
}

.meta .value {
  text-align: right;
  word-break: break-all;
}

.meta .filename {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.card-actions {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 560;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: background 0.12s ease, border-color 0.12s ease, opacity 0.12s ease;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--btn-text);
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-dim);
  border-color: var(--accent-dim);
  color: var(--btn-text);
}

.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--bg-elevated);
  color: var(--text);
  border-color: #3a3a40;
}

.link-hint {
  margin: 0.15rem 0 0;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
}

/* Sections */
.section {
  margin-bottom: 2.25rem;
  padding-top: 0.25rem;
}

.section h2 {
  margin: 0 0 0.9rem;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.section p {
  margin: 0 0 0.75rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.section ul,
.section ol {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.section li {
  margin-bottom: 0.45rem;
}

.section li:last-child {
  margin-bottom: 0;
}

.note-box {
  margin-top: 0.9rem;
  padding: 0.85rem 1rem;
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.note-box strong {
  color: var(--warn-text);
  font-weight: 560;
}

.cmd-block {
  margin: 0.75rem 0;
  padding: 0.75rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow-x: auto;
}

.cmd-block code {
  color: var(--accent);
  font-size: 0.82rem;
  white-space: nowrap;
}

.steps-list {
  counter-reset: step;
  list-style: none;
  padding-left: 0;
}

.steps-list li {
  position: relative;
  padding-left: 2rem;
  margin-bottom: 0.65rem;
}

.steps-list li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.1rem;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: var(--accent-bg);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Homepage: features */
.features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 2.75rem;
}

@media (max-width: 640px) {
  .features {
    grid-template-columns: 1fr;
  }
}

.feature {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.15rem 1.2rem;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.feature:hover {
  background: var(--bg-card-hover);
  border-color: #333338;
}

.feature-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--accent-bg);
  border: 1px solid var(--accent-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
  color: var(--accent);
}

.feature-icon svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feature h3 {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.feature p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Homepage: workflow */
.workflow {
  margin-bottom: 2.75rem;
}

.workflow h2 {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.workflow-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (max-width: 640px) {
  .workflow-steps {
    grid-template-columns: 1fr;
  }
}

.workflow-steps li {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.workflow-num {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--accent-bg);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.workflow-steps h3 {
  margin: 0 0 0.25rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.workflow-steps p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* Homepage: audience */
.audience {
  margin-bottom: 2.75rem;
  padding: 1.15rem 1.25rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
}

.audience h2 {
  margin: 0 0 0.65rem;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.audience ul {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--text-secondary);
  font-size: 0.88rem;
}

.audience li {
  margin-bottom: 0.35rem;
}

.audience li:last-child {
  margin-bottom: 0;
}

/* Homepage: CTA band */
.cta-band {
  margin-bottom: 1rem;
  padding: 1.5rem 1.35rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.cta-band h2 {
  margin: 0 0 0.3rem;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.cta-band p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
  max-width: 28rem;
}

.cta-band .btn {
  flex-shrink: 0;
  min-width: 8rem;
}

/* Footer */
.footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2.5rem;
  border-top: 1px solid var(--border-subtle);
  position: relative;
  z-index: 1;
}

.footer p {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.footer .sep {
  margin: 0 0.35rem;
  opacity: 0.5;
}

.footer a {
  color: var(--text-muted);
}

.footer a:hover {
  color: var(--accent);
}

/* About page */
.about-principles {
  margin-bottom: 2.75rem;
}

.about-principles > h2 {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.about-principles .features {
  margin-bottom: 0;
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 840px) {
  .about-principles .features {
    grid-template-columns: 1fr;
  }
}

.about-author {
  margin-bottom: 2.25rem;
}

.about-author-text {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Visually hidden (accessible page title) */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Full-bleed hero carousel */
.hero-carousel {
  position: relative;
  width: 100%;
  max-width: none;
  height: min(28vh, 260px);
  min-height: 140px;
  overflow: hidden;
  background: #0a0a0b;
  z-index: 1;
  outline: none;
}

.hero-carousel:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.hero-carousel-track {
  position: relative;
  width: 100%;
  height: 100%;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.55s ease, visibility 0.55s ease;
  pointer-events: none;
}

.hero-slide.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 1;
}

.hero-slide-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transform: scale(1.02);
}

.hero-slide-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(8, 10, 12, 0.88) 0%, rgba(8, 10, 12, 0.62) 42%, rgba(8, 10, 12, 0.28) 72%, rgba(8, 10, 12, 0.45) 100%),
    linear-gradient(0deg, rgba(8, 10, 12, 0.55) 0%, transparent 45%);
  pointer-events: none;
}

.hero-slide-content {
  position: relative;
  z-index: 2;
  height: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.1rem 4.5rem 2.25rem; /* clears 2.5rem arrow btn + inset */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.hero-slide-title {
  margin: 0 0 0.65rem;
  max-width: 28rem;
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: #f2f4f5;
  text-shadow: 0 1px 18px rgba(0, 0, 0, 0.35);
}

.hero-slide-blurb {
  margin: 0 0 1.25rem;
  max-width: 28rem;
  font-size: clamp(0.8rem, 1.3vw, 0.92rem);
  line-height: 1.5;
  color: rgba(232, 232, 234, 0.88);
}

.hero-slide-cta {
  min-width: 7rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.hero-carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 2.5rem;
  height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(232, 232, 234, 0.18);
  border-radius: 999px;
  background: rgba(12, 12, 14, 0.55);
  color: var(--text);
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.hero-carousel-btn:hover {
  background: rgba(45, 212, 191, 0.18);
  border-color: var(--accent-border);
  color: var(--accent);
}

.hero-carousel-prev {
  left: 0.85rem;
}

.hero-carousel-next {
  right: 0.85rem;
}

.hero-carousel-dots {
  position: absolute;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.hero-carousel-dot {
  width: 0.5rem;
  height: 0.5rem;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(232, 232, 234, 0.35);
  cursor: pointer;
  transition: background 0.15s ease, width 0.15s ease;
}

.hero-carousel-dot:hover {
  background: rgba(232, 232, 234, 0.6);
}

.hero-carousel-dot.is-active {
  width: 1.35rem;
  background: var(--accent);
}

/* Compact CTA strip under carousel */
.hero-cta-strip {
  margin-bottom: 1.75rem;
  margin-top: 0.15rem;
}

.hero-cta-strip .hero-actions {
  margin-top: 0;
  align-items: center;
}

.hero-cta-strip .version-pill {
  margin-top: 0;
}

@media (max-width: 640px) {
  .hero-carousel {
    height: min(24vh, 190px);
    min-height: 120px;
  }

  .hero-slide-content {
    padding: 0.9rem 3.5rem 2rem;
  }

  .hero-carousel-btn {
    width: 2.15rem;
    height: 2.15rem;
  }

  .hero-carousel-prev {
    left: 0.5rem;
  }

  .hero-carousel-next {
    right: 0.5rem;
  }

  .hero-cta-strip .hero-actions {
    gap: 0.55rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-slide {
    transition: none;
  }
}

/* Docs pages (docs/index.html and chapter pages) */
.docs-main {
  max-width: 46rem;
}

.docs-hero {
  margin-bottom: 1.75rem;
}

.docs-crumb {
  margin: 0 0 0.6rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.docs-crumb a {
  color: var(--text-secondary);
}

.docs-crumb a:hover {
  color: var(--accent);
}

.docs-hero h1 {
  margin: 0 0 0.55rem;
}

/* Prose body for chapter content */
.docs-prose {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.docs-prose h2 {
  margin: 1.9rem 0 0.85rem;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

.docs-prose h3 {
  margin: 1.5rem 0 0.6rem;
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text);
}

.docs-prose h4 {
  margin: 1.2rem 0 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.docs-prose p {
  margin: 0 0 0.85rem;
}

.docs-prose ul,
.docs-prose ol {
  margin: 0 0 1rem;
  padding-left: 1.4rem;
}

.docs-prose li {
  margin-bottom: 0.4rem;
}

.docs-prose li:last-child {
  margin-bottom: 0;
}

.docs-prose ul ul,
.docs-prose ul ol,
.docs-prose ol ul,
.docs-prose ol ol {
  margin: 0.4rem 0 0;
}

.docs-prose a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.docs-prose strong {
  color: var(--text);
  font-weight: 600;
}

.docs-prose code {
  padding: 0.1rem 0.35rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  font-size: 0.84em;
  color: var(--accent);
  word-break: break-word;
}

.docs-prose pre {
  margin: 0.75rem 0 1.1rem;
  padding: 0.85rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow-x: auto;
}

.docs-prose pre code {
  padding: 0;
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.82rem;
  white-space: pre;
}

.docs-prose blockquote {
  margin: 0 0 1rem;
  padding: 0.6rem 1rem;
  border-left: 3px solid var(--accent-border);
  background: var(--accent-bg);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
}

.docs-prose blockquote p {
  margin: 0;
}

.docs-prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0 1.1rem;
  font-size: 0.85rem;
}

.docs-prose th,
.docs-prose td {
  padding: 0.5rem 0.65rem;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
  vertical-align: top;
}

.docs-prose thead th {
  color: var(--text);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

.docs-prose tbody tr:last-child td {
  border-bottom: none;
}

/* Docs index (chapter list) */
.docs-index {
  margin-bottom: 1rem;
}

.docs-index-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

@media (max-width: 840px) {
  .docs-index-list {
    grid-template-columns: 1fr;
  }
}

.docs-index-item {
  margin: 0;
}

.docs-index-link {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.9rem 1.05rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
  height: 100%;
  width: 100%;
}

.docs-index-link:hover {
  background: var(--bg-card-hover);
  border-color: #333338;
  text-decoration: none;
}

.docs-index-num {
  flex-shrink: 0;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--accent-bg);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.docs-index-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.docs-index-title {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.docs-index-link:hover .docs-index-title {
  color: var(--accent);
}

.docs-index-blurb {
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

/* Prev / next / index chapter navigation */
.docs-nav {
  margin-top: 2.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-subtle);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.6rem;
  align-items: stretch;
}

@media (max-width: 640px) {
  .docs-nav {
    grid-template-columns: 1fr;
  }
}

.docs-nav-link {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.75rem 0.9rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.docs-nav-link:hover {
  background: var(--bg-card-hover);
  border-color: #333338;
  text-decoration: none;
}

.docs-nav-prev {
  text-align: left;
}

.docs-nav-next {
  text-align: right;
}

.docs-nav-index {
  text-align: center;
}

.docs-nav-label {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.docs-nav-title {
  font-size: 0.85rem;
  color: var(--text);
  font-weight: 500;
}

.docs-nav-link:hover .docs-nav-title {
  color: var(--accent);
}

.docs-nav-disabled {
  opacity: 0.5;
  pointer-events: none;
}

.docs-note {
  margin-bottom: 2rem;
}
