:root {
  --bg-top: #f2eee3;
  --bg-bottom: #d8e5d2;
  --paper: rgba(255, 250, 242, 0.82);
  --paper-strong: rgba(255, 250, 242, 0.93);
  --line: rgba(55, 51, 39, 0.14);
  --text: #1f2a1d;
  --muted: #4f5c4b;
  --accent: #1d5f50;
  --accent-soft: #d4ebe0;
  --shadow: 0 24px 70px rgba(58, 72, 52, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'IBM Plex Sans', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.78), transparent 28%),
    radial-gradient(circle at 85% 15%, rgba(27, 95, 80, 0.14), transparent 18%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: 0.28;
}

img {
  max-width: 100%;
  display: block;
  border-radius: 18px;
  border: 1px solid rgba(29, 95, 80, 0.14);
  box-shadow: 0 18px 40px rgba(22, 39, 34, 0.14);
}

a {
  color: var(--accent);
}

code,
pre {
  font-family: 'IBM Plex Mono', monospace;
}

.docs-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 24px;
  width: min(1400px, calc(100% - 32px));
  margin: 16px auto;
  padding: 12px 0 24px;
}

.docs-sidebar,
.docs-main {
  backdrop-filter: blur(18px);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.docs-sidebar {
  position: sticky;
  top: 16px;
  align-self: start;
  padding: 24px;
}

.docs-home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--accent);
  color: #f6fbf8;
  text-decoration: none;
  font-weight: 600;
}

.eyebrow {
  margin: 0 0 8px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.76rem;
  color: var(--muted);
}

.docs-sidebar h1,
.docs-hero h2,
.docs-content h1,
.docs-content h2,
.docs-content h3 {
  font-family: 'Fraunces', serif;
  line-height: 1.05;
}

.docs-sidebar h1 {
  margin: 0;
  font-size: clamp(2rem, 3vw, 2.8rem);
}

.sidebar-copy,
.sidebar-note,
.docs-summary {
  color: var(--muted);
}

.docs-nav {
  display: grid;
  gap: 8px;
  margin: 28px 0;
}

.docs-nav-link {
  display: block;
  padding: 12px 14px;
  border-radius: 14px;
  text-decoration: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.36);
  border: 1px solid transparent;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.docs-nav-link:hover,
.docs-nav-link:focus-visible {
  transform: translateX(3px);
  border-color: rgba(29, 95, 80, 0.24);
}

.docs-nav-link.active {
  background: var(--accent-soft);
  border-color: rgba(29, 95, 80, 0.25);
  font-weight: 600;
}

.sidebar-note {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.45);
}

.sidebar-note-title {
  margin: 0 0 8px;
  font-weight: 600;
  color: var(--text);
}

.docs-main {
  padding: 24px clamp(18px, 4vw, 42px) 32px;
}

.docs-hero {
  padding: 12px 0 28px;
  border-bottom: 1px solid var(--line);
}

.docs-hero h2 {
  margin: 0;
  font-size: clamp(2.1rem, 4vw, 4rem);
}

.docs-content {
  max-width: 860px;
  padding-top: 24px;
  animation: fade-up 220ms ease;
}

.docs-content h2 {
  margin-top: 2.5rem;
  font-size: 2rem;
}

.docs-content h3 {
  margin-top: 1.75rem;
  font-size: 1.35rem;
}

.docs-content p,
.docs-content li,
.docs-content td,
.docs-content th,
.docs-content blockquote {
  font-size: 1.03rem;
  line-height: 1.75;
}

.docs-content ul,
.docs-content ol {
  padding-left: 1.4rem;
}

.docs-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  background: var(--paper-strong);
  border-radius: 18px;
  overflow: hidden;
}

.docs-content th,
.docs-content td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.docs-content blockquote,
.callout {
  margin: 1.5rem 0;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.48);
  border-left: 4px solid var(--accent);
  border-radius: 16px;
}

.callout.error {
  border-left-color: #9f3c2d;
}

.docs-content hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2rem 0;
}

.docs-content pre {
  padding: 18px;
  overflow: auto;
  border-radius: 18px;
  background: #1d2622;
  color: #edf4ef;
}

.docs-content figure {
  margin: 1.8rem 0;
}

.docs-content figcaption {
  margin-top: 0.6rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.loading-state {
  color: var(--muted);
}

.docs-footer {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .docs-shell {
    grid-template-columns: 1fr;
    width: min(980px, calc(100% - 20px));
    gap: 16px;
  }

  .docs-sidebar {
    position: static;
  }
}

@media (max-width: 640px) {
  .docs-main,
  .docs-sidebar {
    border-radius: 22px;
    padding: 18px;
  }

  .docs-content p,
  .docs-content li,
  .docs-content td,
  .docs-content th,
  .docs-content blockquote {
    font-size: 0.98rem;
    line-height: 1.65;
  }
}
