:root {
  --bg: #f5f1e8;
  --bg-alt: #edf6ff;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-strong: #ffffff;
  --line: rgba(16, 42, 70, 0.14);
  --ink: #102c49;
  --ink-soft: #4a6789;
  --brand: #0b5cad;
  --brand-strong: #083b6f;
  --teal: #00a2a1;
  --shadow-lg: 0 20px 56px rgba(12, 34, 59, 0.16);
  --shadow-sm: 0 10px 24px rgba(12, 34, 59, 0.1);
}

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

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  color: var(--ink);
  font-family: "Manrope", sans-serif;
  line-height: 1.6;
  background:
    radial-gradient(circle at 8% 8%, rgba(239, 139, 65, 0.22), transparent 30%),
    radial-gradient(circle at 92% 18%, rgba(11, 92, 173, 0.22), transparent 34%),
    linear-gradient(160deg, var(--bg), var(--bg-alt));
}

.docs-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
  opacity: 0.3;
  background-image: linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 42, 70, 0.02) 1px, transparent 1px);
  background-size: 22px 22px;
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 120;
  background: rgba(8, 26, 45, 0.06);
  pointer-events: none;
}

.scroll-progress span {
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: left center;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--brand), var(--teal));
  box-shadow: 0 0 24px rgba(0, 162, 161, 0.4);
}

.pointer-glow {
  position: fixed;
  left: 0;
  top: 0;
  width: 240px;
  height: 240px;
  z-index: 1;
  pointer-events: none;
  opacity: 0.26;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(11, 92, 173, 0.16), rgba(11, 92, 173, 0) 68%);
}

.docs-header {
  position: sticky;
  top: 0.8rem;
  z-index: 30;
  width: min(1240px, calc(100% - 1.8rem));
  margin: 0.8rem auto 0;
  padding: 0.62rem 0.78rem;
  border: 1px solid var(--line);
  border-radius: 0.95rem;
  background: color-mix(in srgb, var(--surface) 92%, white 8%);
  box-shadow: 0 14px 34px rgba(12, 34, 59, 0.12);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.docs-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.66rem;
  text-decoration: none;
  color: inherit;
  margin-right: 0.42rem;
}

.brand-logo-wrap {
  width: 2.08rem;
  height: 2.08rem;
  border-radius: 0.66rem;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, white 88%, var(--bg-alt) 12%);
  border: 1px solid color-mix(in srgb, var(--line) 70%, var(--brand) 30%);
  overflow: hidden;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.72),
    0 6px 14px rgba(12, 34, 59, 0.13);
}

.brand-logo {
  width: 1.58rem;
  height: 1.58rem;
  object-fit: contain;
  filter: drop-shadow(0 2px 5px rgba(17, 5, 47, 0.28));
}

.docs-brand span:last-child {
  font-size: 0.95rem;
  font-weight: 800;
}

.docs-nav {
  flex: 1;
  display: inline-flex;
  gap: 0.92rem;
}

.docs-nav a {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.88rem;
  font-weight: 650;
}

.docs-nav a.is-active {
  color: var(--ink);
}

.docs-nav a:hover,
.docs-nav a:focus-visible {
  color: var(--ink);
}

.docs-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.54rem;
}

.docs-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 700;
  border-radius: 0.74rem;
  border: 1px solid color-mix(in srgb, var(--line) 72%, var(--brand) 28%);
  padding: 0.5rem 0.74rem;
  color: var(--brand-strong);
  background: color-mix(in srgb, white 82%, var(--bg-alt) 18%);
  --mx: 0px;
  --my: 0px;
  transform: translate3d(var(--mx), var(--my), 0);
  transition:
    transform 240ms cubic-bezier(0.2, 0.85, 0.2, 1),
    background-color 180ms ease;
}

.docs-button:hover,
.docs-button:focus-visible {
  transform: translate3d(var(--mx), calc(var(--my) - 1px), 0);
  background: color-mix(in srgb, white 74%, var(--bg-alt) 26%);
}

.docs-layout {
  width: min(1240px, calc(100% - 1.8rem));
  margin: 1rem auto 2rem;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) 220px;
  gap: 0.88rem;
  align-items: start;
  position: relative;
  z-index: 2;
}

.docs-sidebar,
.docs-main,
.docs-toc {
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: color-mix(in srgb, var(--surface) 92%, white 8%);
  box-shadow: var(--shadow-sm);
}

.docs-sidebar {
  position: sticky;
  top: 5.7rem;
  padding: 0.88rem;
}

.docs-sidebar h2 {
  margin: 0 0 0.6rem;
  font-size: 0.85rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--brand-strong);
  font-family: "IBM Plex Mono", monospace;
}

.docs-sidebar nav {
  display: grid;
  gap: 0.2rem;
}

.docs-sidebar a {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.9rem;
  border-radius: 0.62rem;
  padding: 0.43rem 0.5rem;
  font-weight: 600;
}

.docs-sidebar a:hover,
.docs-sidebar a:focus-visible {
  color: var(--ink);
  background: color-mix(in srgb, white 72%, var(--bg-alt) 28%);
}

.docs-sidebar a.is-active {
  color: var(--ink);
  background: color-mix(in srgb, white 68%, var(--bg-alt) 32%);
  border: 1px solid color-mix(in srgb, var(--line) 70%, var(--brand) 30%);
}

.docs-main {
  padding: 1.3rem 1.4rem;
  box-shadow: var(--shadow-lg);
}

.docs-breadcrumb {
  margin: 0 0 0.85rem;
  color: var(--ink-soft);
  font-size: 0.83rem;
}

.docs-main h1 {
  margin: 0 0 0.95rem;
  font-size: clamp(1.8rem, 2.6vw, 2.45rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.docs-main h2 {
  margin: 2rem 0 0.75rem;
  font-size: 1.32rem;
  line-height: 1.22;
}

.docs-main p {
  margin: 0 0 0.8rem;
  color: var(--ink-soft);
}

.docs-main ul {
  margin: 0 0 0.9rem;
  padding-left: 1.2rem;
  color: var(--ink-soft);
}

.docs-main li {
  margin-bottom: 0.36rem;
}

.callout {
  border: 1px solid color-mix(in srgb, var(--line) 65%, var(--brand) 35%);
  border-radius: 0.86rem;
  padding: 0.8rem 0.9rem;
  margin-bottom: 1rem;
  background: color-mix(in srgb, white 78%, var(--bg-alt) 22%);
}

.callout strong {
  color: var(--ink);
}

pre {
  margin: 0 0 0.9rem;
  padding: 0.9rem 0.95rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, #12273f, #0b1c31);
  overflow: auto;
}

code {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.83rem;
}

pre code {
  color: #d3e8ff;
}

:not(pre) > code {
  color: var(--brand-strong);
  background: color-mix(in srgb, white 80%, var(--bg-alt) 20%);
  border: 1px solid color-mix(in srgb, var(--line) 72%, var(--brand) 28%);
  border-radius: 0.5rem;
  padding: 0.12rem 0.38rem;
}

.docs-copy {
  margin-top: -0.3rem;
  margin-bottom: 0.95rem;
}

.copy-button {
  border: 1px solid color-mix(in srgb, var(--line) 68%, var(--brand) 32%);
  border-radius: 0.7rem;
  background: color-mix(in srgb, white 82%, var(--bg) 18%);
  color: var(--brand-strong);
  font-size: 0.82rem;
  font-weight: 700;
  font-family: inherit;
  padding: 0.42rem 0.7rem;
  cursor: pointer;
  --mx: 0px;
  --my: 0px;
  transform: translate3d(var(--mx), var(--my), 0);
  transition:
    transform 240ms cubic-bezier(0.2, 0.85, 0.2, 1),
    background-color 180ms ease;
}

.copy-button:hover,
.copy-button:focus-visible {
  transform: translate3d(var(--mx), calc(var(--my) - 1px), 0);
  background: color-mix(in srgb, white 74%, var(--bg-alt) 26%);
}

.copy-button[data-copied="true"] {
  color: color-mix(in srgb, var(--teal) 80%, var(--ink) 20%);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  margin-top: 0.7rem;
}

.doc-card {
  border: 1px solid var(--line);
  border-radius: 0.86rem;
  background: color-mix(in srgb, white 82%, var(--bg-alt) 18%);
  padding: 0.85rem;
  transition:
    transform 260ms cubic-bezier(0.18, 0.89, 0.28, 1.01),
    box-shadow 220ms ease,
    border-color 220ms ease;
  box-shadow: var(--shadow-sm);
}

.doc-card:hover {
  border-color: color-mix(in srgb, var(--line) 56%, var(--brand) 44%);
  box-shadow: 0 14px 30px rgba(12, 34, 59, 0.14);
}

.doc-card h3 {
  margin: 0 0 0.4rem;
  font-size: 0.98rem;
}

.doc-card p {
  margin: 0;
  font-size: 0.9rem;
}

.docs-toc {
  position: sticky;
  top: 5.7rem;
  padding: 0.9rem 0.85rem;
}

.docs-toc h2 {
  margin: 0 0 0.62rem;
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand-strong);
  font-family: "IBM Plex Mono", monospace;
}

.docs-toc a {
  display: block;
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.86rem;
  padding: 0.32rem 0;
}

.docs-toc a:hover,
.docs-toc a:focus-visible,
.docs-toc a.is-active {
  color: var(--ink);
}

.sidebar-toggle {
  display: none;
  margin-bottom: 0.95rem;
  border: 1px solid color-mix(in srgb, var(--line) 68%, var(--brand) 32%);
  border-radius: 0.72rem;
  background: color-mix(in srgb, white 84%, var(--bg) 16%);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  padding: 0.48rem 0.74rem;
}

@media (pointer: coarse) {
  .pointer-glow {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .doc-card,
  .docs-button,
  .copy-button {
    transition: none;
  }
}

@media (max-width: 1080px) {
  .docs-layout {
    grid-template-columns: 250px minmax(0, 1fr);
  }

  .docs-toc {
    display: none;
  }
}

@media (max-width: 860px) {
  .docs-header {
    border-radius: 0.9rem;
    flex-wrap: wrap;
  }

  .docs-nav {
    display: none;
  }

  .docs-layout {
    grid-template-columns: 1fr;
  }

  .sidebar-toggle {
    display: inline-flex;
  }

  .docs-sidebar {
    position: static;
    display: none;
    margin-bottom: 0.88rem;
  }

  .docs-sidebar.is-open {
    display: block;
  }

  .docs-main {
    padding: 1.1rem;
  }
}

@media (max-width: 720px) {
  .docs-header,
  .docs-layout {
    width: calc(100% - 1rem);
  }

  .card-grid {
    grid-template-columns: 1fr;
  }
}
