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

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top left, #1e293b 0, #020617 55%);
  color: var(--text);
  font-family: var(--font-sans);
}

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

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

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  background: linear-gradient(to bottom,
      rgba(2, 6, 23, 0.92),
      rgba(2, 6, 23, 0.8));
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.site-header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-title {
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: none;
}

.site-title a {
  color: var(--muted);
  text-decoration: none;
}

.site-header-nav a {
  margin-left: 1rem;
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: none;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease;
}

.site-header-nav a:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

/* Layout */

.layout {
  max-width: 1080px;
  margin: 1.25rem auto 2rem;
  padding: 0 1.25rem;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 1.5rem;
}


/* Sidebar */

.sidebar {
  position: sticky;
  top: 3.5rem;
  align-self: start;
  background: var(--sidebar-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 1rem 0.75rem;
  box-shadow: var(--shadow-soft);
}

.sidebar-section+.sidebar-section {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed rgba(148, 163, 184, 0.18);
}

.sidebar-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.sidebar-link {
  display: block;
  padding: 0.25rem 0.4rem;
  margin: 0.05rem 0;
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--muted);
  border-radius: var(--radius-md);
  transition: background 0.15s ease, color 0.15s ease, padding-left 0.15s ease;
}

.sidebar-link:hover {
  background: rgba(15, 23, 42, 0.9);
  color: var(--text);
  padding-left: 0.6rem;
}

/* Content */

.content {
  background: rgba(15, 23, 42, 0.95);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow-soft);
}

.content section {
  scroll-margin-top: 40px;
}

.content section+section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

h1,
h2,
h3 {
  font-weight: 600;
  letter-spacing: 0.02em;
}

h1 {
  font-size: 1.6rem;
  margin: 0 0 0.75rem;
}

h2 {
  font-size: 1.25rem;
  margin: 0 0 0.75rem;
}

h3 {
  font-size: 1rem;
  margin: 1.25rem 0 0.5rem;
}

p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--muted);
}

ol {
  padding-left: 1.25rem;
}

code {
  font-family: var(--font-mono);
}

/* Code blocks */

pre {
  margin: 0.75rem 0;
  padding: 0.85rem 0.9rem;
  background: var(--code-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--code-border);
  overflow-x: auto;
  font-size: 0.85rem;
}

pre code {
  font-family: var(--font-mono);
}

/* Tables */

.param-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0 0.5rem;
  font-size: 0.85rem;
}

.param-table th,
.param-table td {
  padding: 0.5rem 0.55rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
  text-align: left;
}

.param-table thead th {
  font-weight: 500;
  color: var(--muted);
  background: rgba(15, 23, 42, 0.9);
}

.param-table tbody tr:hover {
  background: rgba(15, 23, 42, 0.85);
}

/* Code tabs */

.code-tabs {
  margin-top: 0.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--code-border);
  background: rgba(15, 23, 42, 0.9);
  overflow: hidden;
}

.code-tabs-labels {
  display: flex;
  padding: 0.35rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  gap: 0.25rem;
}

.code-tabs-labels button {
  flex: 0 0 auto;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.8rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.code-tabs-labels button:hover {
  background: rgba(15, 23, 42, 0.9);
  color: var(--text);
}

.code-tabs-labels button.active {
  background: var(--accent-soft);
  color: var(--accent);
  transform: translateY(-1px);
}

.code-tabs-panels {
  padding: 0.5rem 0.5rem 0.6rem;
}

.code-tab-panel {
  display: none;
}

.code-tab-panel.active {
  display: block;
}

/* Responsive */

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

  .sidebar {
    position: static;
    order: -1;
  }
}

@media (max-width: 600px) {
  .content {
    padding: 1.1rem 1.1rem;
  }

  .site-header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }

  .site-header-nav a {
    margin-left: 0;
    margin-right: 0.6rem;
  }
}