/* ============================================================
   Draftory Developer Portal — styles.css
   Sole stylesheet for the entire documentation site.
   ============================================================ */

/* ------------------------------------------------------------
   1. Reset & CSS Variables
   ------------------------------------------------------------ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Core palette */
  --bg: #0a0a0f;
  --surface: #12121a;
  --border: #1e1e2e;
  --text: #e4e4ef;
  --text-dim: #8888a0;
  --accent: #6366f1;
  --accent-hover: #818cf8;

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --code-font: 'SF Mono', Monaco, 'Cascadia Code', monospace;

  /* HTTP method colours */
  --post: #22c55e;
  --get: #3b82f6;
  --delete: #ef4444;

  /* Layout constants */
  --nav-height: 56px;
  --sidebar-width: 220px;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

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

img {
  max-width: 100%;
  display: block;
}

ul, ol {
  list-style: none;
}

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
}

::selection {
  background: rgba(99, 102, 241, 0.3);
  color: #fff;
}

/* ------------------------------------------------------------
   2. Top Navigation (.top-nav)
   ------------------------------------------------------------ */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.top-nav .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  white-space: nowrap;
  transition: color 0.15s ease;
  flex-shrink: 0;
}

.top-nav .logo:hover {
  color: #fff;
}

.top-nav .logo img {
  width: 24px;
  height: 24px;
  border-radius: 6px;
}

.top-nav .logo span {
  color: var(--text-dim);
  font-weight: 400;
  margin-left: 2px;
  font-size: 14px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-links a {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  padding: 6px 12px;
  border-radius: 6px;
  transition: color 0.15s ease, background 0.15s ease;
}

.nav-links a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.nav-links a.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.search-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  min-width: 180px;
}

.search-trigger:hover {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
}

.search-trigger kbd {
  font-family: var(--font-sans);
  font-size: 10px;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text-dim);
  margin-left: auto;
  line-height: 1;
}

.nav-app-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}

.nav-app-link:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.04);
}

/* ------------------------------------------------------------
   3. Layout Wrapper (.docs-layout)
   ------------------------------------------------------------ */
.docs-layout {
  display: flex;
  padding-top: var(--nav-height);
  min-height: 100vh;
}

/* ------------------------------------------------------------
   4. Sidebar (.sidebar)
   ------------------------------------------------------------ */
.sidebar {
  width: var(--sidebar-width);
  position: fixed;
  top: var(--nav-height);
  left: 0;
  bottom: 0;
  overflow-y: auto;
  overflow-x: hidden;
  background: #08080d;
  border-right: 1px solid var(--border);
  padding: 16px 0;
  z-index: 50;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.06) transparent;
}

.sidebar::-webkit-scrollbar {
  width: 4px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
}

.sidebar-group {
  margin-bottom: 20px;
}

.sidebar-group-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 0 20px;
  margin-bottom: 4px;
  line-height: 2;
}

.sidebar-link {
  display: block;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-dim);
  padding: 6px 20px;
  margin: 0 8px;
  border-radius: 6px;
  transition: color 0.12s ease, background 0.12s ease;
  line-height: 1.5;
}

.sidebar-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-link.active {
  color: var(--accent);
  background: rgba(99, 102, 241, 0.1);
  font-weight: 500;
}

.sidebar-separator {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 20px 12px;
}

.sidebar-bottom {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  margin-left: 20px;
  margin-right: 20px;
}

.sidebar-bottom .sidebar-link {
  margin: 0;
  padding-left: 0;
  padding-right: 0;
}

/* Hamburger toggle (hidden on desktop) */
.sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: var(--text-dim);
  transition: color 0.15s ease, background 0.15s ease;
}

.sidebar-toggle:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.sidebar-overlay.active {
  display: block;
}

/* ------------------------------------------------------------
   5. Main Content (.main-content)
   ------------------------------------------------------------ */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  max-width: 720px;
  padding: 32px 40px 80px;
  min-height: calc(100vh - var(--nav-height));
}

.main-content h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.25;
  color: #fff;
  margin-bottom: 16px;
}

.main-content h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: #fff;
  margin-top: 40px;
  margin-bottom: 12px;
}

.main-content h3 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.4;
  color: var(--text);
  margin-top: 28px;
  margin-bottom: 8px;
}

.main-content p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 16px;
}

.main-content ul,
.main-content ol {
  margin-bottom: 16px;
  padding-left: 20px;
}

.main-content ul {
  list-style: disc;
}

.main-content ol {
  list-style: decimal;
}

.main-content li {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 4px;
}

.main-content code {
  font-family: var(--code-font);
  font-size: 12.5px;
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent-hover);
}

.main-content pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  overflow-x: auto;
  margin-bottom: 20px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.06) transparent;
}

.main-content pre code {
  background: none;
  padding: 0;
  font-size: 12px;
  line-height: 1.8;
  color: var(--text-dim);
}

.main-content a {
  color: var(--accent);
  font-weight: 500;
  transition: color 0.15s ease;
}

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

.main-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 32px 0;
}

.main-content strong {
  font-weight: 600;
  color: #fff;
}

/* ------------------------------------------------------------
   6. Breadcrumb (.breadcrumb)
   ------------------------------------------------------------ */
.breadcrumb {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.breadcrumb a {
  color: var(--text-dim);
  font-weight: 400;
  transition: color 0.15s ease;
}

.breadcrumb a:hover {
  color: var(--text);
}

.breadcrumb .separator {
  color: rgba(136, 136, 160, 0.4);
  font-size: 10px;
  user-select: none;
}

/* ------------------------------------------------------------
   7. Tabbed Code Blocks
   ------------------------------------------------------------ */
.code-tabs {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 20px;
  background: var(--surface);
}

.code-tab-bar {
  display: flex;
  flex-direction: row;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
  overflow-x: auto;
  scrollbar-width: none;
}

.code-tab-bar::-webkit-scrollbar {
  display: none;
}

.code-tab {
  padding: 8px 14px;
  font-size: 11px;
  font-family: var(--code-font);
  font-weight: 500;
  color: var(--text-dim);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease;
  position: relative;
}

.code-tab:hover {
  color: var(--text);
}

.code-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.code-panel {
  display: none;
  padding: 16px 20px;
  font-family: var(--code-font);
  font-size: 12px;
  line-height: 1.8;
  color: var(--text-dim);
  overflow-x: auto;
  white-space: pre;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.06) transparent;
}

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

/* Syntax highlighting */
.comment  { color: #5c5c7a; font-style: italic; }
.keyword  { color: #818cf8; }
.string   { color: #86efac; }
.number   { color: #f0abfc; }
.function { color: #67e8f9; }
.property { color: #e4e4ef; }
.operator { color: #8888a0; }
.punctuation { color: #5c5c7a; }

/* ------------------------------------------------------------
   8. Method Badges (.method-badge)
   ------------------------------------------------------------ */
.method-badge {
  display: inline-block;
  font-family: var(--code-font);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.03em;
  line-height: 1;
  vertical-align: middle;
  flex-shrink: 0;
}

.method-badge.post {
  background: rgba(34, 197, 94, 0.12);
  color: var(--post);
}

.method-badge.get {
  background: rgba(59, 130, 246, 0.12);
  color: var(--get);
}

.method-badge.delete {
  background: rgba(239, 68, 68, 0.12);
  color: var(--delete);
}

.method-badge.put {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
}

.method-badge.patch {
  background: rgba(168, 85, 247, 0.12);
  color: #a855f7;
}

/* ------------------------------------------------------------
   9. Endpoint Rows (.endpoint-row)
   ------------------------------------------------------------ */
.endpoint-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 8px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.endpoint-row:hover {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(18, 18, 26, 0.8);
}

.endpoint-row a {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  width: 100%;
}

.endpoint-path {
  font-family: var(--code-font);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  flex-shrink: 0;
}

.endpoint-desc {
  font-size: 13px;
  color: var(--text-dim);
  margin-left: auto;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ------------------------------------------------------------
   10. Info / Warning Callouts
   ------------------------------------------------------------ */
.callout {
  padding: 14px 16px;
  border-radius: 8px;
  border-left: 3px solid;
  margin-bottom: 20px;
  font-size: 13px;
  line-height: 1.7;
}

.callout p {
  margin-bottom: 0;
}

.callout p + p {
  margin-top: 8px;
}

.callout code {
  font-size: 12px;
}

.callout.info {
  border-left-color: var(--accent);
  background: rgba(99, 102, 241, 0.06);
  color: var(--text);
}

.callout.warning {
  border-left-color: #f59e0b;
  background: rgba(245, 158, 11, 0.06);
  color: var(--text);
}

.callout.danger {
  border-left-color: var(--delete);
  background: rgba(239, 68, 68, 0.06);
  color: var(--text);
}

.callout.success {
  border-left-color: var(--post);
  background: rgba(34, 197, 94, 0.06);
  color: var(--text);
}

.callout-title {
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.callout.info .callout-title   { color: var(--accent-hover); }
.callout.warning .callout-title { color: #fbbf24; }
.callout.danger .callout-title  { color: #f87171; }
.callout.success .callout-title { color: #4ade80; }

/* ------------------------------------------------------------
   11. Tables
   ------------------------------------------------------------ */
.main-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
  font-size: 13px;
}

.main-content thead th {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}

.main-content tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(30, 30, 46, 0.5);
  color: var(--text);
  vertical-align: top;
}

.main-content tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.015);
}

.main-content tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.main-content tbody td code {
  font-size: 12px;
}

/* Parameter tables (API docs) */
.param-required {
  font-size: 10px;
  font-weight: 600;
  color: var(--delete);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.param-optional {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.param-type {
  font-family: var(--code-font);
  font-size: 11px;
  color: var(--accent-hover);
}

/* ------------------------------------------------------------
   12. Landing Page (no sidebar)
   ------------------------------------------------------------ */
.landing {
  text-align: center;
  padding-top: var(--nav-height);
  min-height: 100vh;
}

/* Section label pill */
.section-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 16px;
}

/* --- Hero --- */
.landing-hero {
  position: relative;
  padding: 72px 24px 56px;
  max-width: 680px;
  margin: 0 auto;
  overflow: visible;
}

.hero-glow {
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 480px;
  height: 320px;
  background: radial-gradient(ellipse at center, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.hero-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
}

.landing-hero h1 {
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: #fff;
  margin-bottom: 18px;
  position: relative;
  z-index: 1;
}

.landing-hero p {
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-dim);
  max-width: 520px;
  margin: 0 auto 32px;
  position: relative;
  z-index: 1;
}

.landing-cta {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.landing-cta .btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  padding: 10px 24px;
  border-radius: 8px;
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.landing-cta .btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.25);
}

.landing-cta .btn-primary:active {
  transform: translateY(0);
}

.landing-cta .btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border);
  padding: 10px 24px;
  border-radius: 8px;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}

.landing-cta .btn-secondary:hover {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.04);
  transform: translateY(-1px);
}

.landing-cta .btn-secondary:active {
  transform: translateY(0);
}

/* --- Quick Start Code Section --- */
.landing-code {
  max-width: 640px;
  margin: 0 auto;
  padding: 48px 24px 64px;
  text-align: left;
  border-top: 1px solid var(--border);
}

.landing-code .section-label,
.landing-steps .section-label,
.landing-cards-section .section-label {
  margin-bottom: 12px;
}

.landing-code h2 {
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 28px;
  letter-spacing: -0.02em;
}

/* --- How It Works Steps --- */
.landing-steps {
  max-width: 860px;
  margin: 0 auto;
  padding: 48px 24px 64px;
  border-top: 1px solid var(--border);
}

.landing-steps h2 {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 36px;
  letter-spacing: -0.02em;
}

.steps-grid {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
}

.step {
  flex: 1;
  max-width: 220px;
  text-align: center;
  padding: 0 12px;
}

.step-number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}

.step h3 {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.step p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-dim);
}

.step-connector {
  width: 48px;
  flex-shrink: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--border), rgba(99, 102, 241, 0.3), var(--border));
  margin-top: 18px;
}

/* --- Explore Cards Section --- */
.landing-cards-section {
  max-width: 920px;
  margin: 0 auto;
  padding: 48px 24px 72px;
  border-top: 1px solid var(--border);
}

.landing-cards-section h2 {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 32px;
  letter-spacing: -0.02em;
}

.landing-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.landing-card {
  text-align: left;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.landing-card:hover {
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.landing-card h3 {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.landing-card p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-dim);
  margin-bottom: 12px;
  flex: 1;
}

.card-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  transition: color 0.15s ease;
}

.landing-card:hover .card-link {
  color: var(--accent-hover);
}

.landing-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  font-size: 18px;
  color: var(--accent);
}

/* ------------------------------------------------------------
   13. Responsive Breakpoints
   ------------------------------------------------------------ */

/* --- Tablet (768px - 1024px) --- */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .sidebar.sidebar-open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
    max-width: 100%;
    padding: 24px 32px 80px;
  }

  .sidebar-toggle {
    display: flex;
  }

  .landing-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .landing-hero h1 {
    font-size: 34px;
  }

  .steps-grid {
    flex-direction: column;
    align-items: center;
    gap: 24px;
  }

  .step {
    max-width: 320px;
  }

  .step-connector {
    width: 1px;
    height: 24px;
    margin: 0;
  }
}

/* --- Mobile (<768px) --- */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    bottom: 0;
    width: 260px;
    z-index: 60;
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
  }

  .sidebar.sidebar-open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
    max-width: 100%;
    padding: 20px 16px 60px;
  }

  .sidebar-toggle {
    display: flex;
  }

  .top-nav {
    padding: 0 12px;
  }

  .nav-links {
    display: none;
  }

  .search-trigger {
    min-width: auto;
    padding: 6px 10px;
  }

  .search-trigger span {
    display: none;
  }

  .search-trigger kbd {
    display: none;
  }

  .landing-hero {
    padding: 48px 16px 32px;
  }

  .landing-hero h1 {
    font-size: 28px;
  }

  .landing-hero p {
    font-size: 14px;
  }

  .landing-cards {
    grid-template-columns: 1fr;
  }

  .landing-cards-section {
    padding: 32px 16px 48px;
  }

  .landing-code {
    padding: 32px 16px 48px;
  }

  .landing-steps {
    padding: 32px 16px 48px;
  }

  .landing-cta {
    flex-direction: column;
    align-items: center;
  }

  .hero-glow {
    width: 300px;
    height: 200px;
  }

  .endpoint-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .endpoint-desc {
    margin-left: 0;
    text-align: left;
  }

  .main-content table {
    display: block;
    overflow-x: auto;
  }

  .code-tabs {
    border-radius: 0;
    margin-left: -16px;
    margin-right: -16px;
    border-left: none;
    border-right: none;
  }
}

/* Hide sidebar toggle on large screens */
@media (min-width: 1025px) {
  .sidebar-toggle {
    display: none;
  }

  .sidebar-overlay {
    display: none !important;
  }
}

/* ------------------------------------------------------------
   14. Search Modal (.search-modal)
   ------------------------------------------------------------ */
.search-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  align-items: flex-start;
  justify-content: center;
  padding-top: 120px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.search-modal.active {
  display: flex;
}

.search-modal-content {
  width: 100%;
  max-width: 560px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  animation: searchModalIn 0.15s ease-out;
}

@keyframes searchModalIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.search-modal-input {
  width: 100%;
  padding: 16px 20px;
  font-size: 16px;
  font-family: var(--font-sans);
  color: var(--text);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  outline: none;
}

.search-modal-input::placeholder {
  color: var(--text-dim);
}

.search-results {
  max-height: 360px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.06) transparent;
}

.search-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  transition: background 0.1s ease;
}

.search-result:hover,
.search-result.focused {
  background: rgba(255, 255, 255, 0.04);
}

.search-result-icon {
  flex-shrink: 0;
  width: 20px;
  text-align: center;
  color: var(--text-dim);
  font-size: 12px;
}

.search-result-title {
  font-weight: 500;
}

.search-result-section {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
}

.search-empty {
  padding: 32px 20px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
}

.search-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 20px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-dim);
}

.search-footer kbd {
  font-family: var(--font-sans);
  font-size: 10px;
  padding: 2px 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
}

/* ------------------------------------------------------------
   15. Footer
   ------------------------------------------------------------ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.8rem;
  line-height: 1.6;
}

.site-footer a {
  color: var(--text-dim);
  transition: color 0.15s ease;
}

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

/* ------------------------------------------------------------
   16. Utility Classes
   ------------------------------------------------------------ */
.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;
}

/* Fade-in animation for page transitions */
.fade-in {
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Text utilities */
.text-dim   { color: var(--text-dim); }
.text-accent { color: var(--accent); }
.mono       { font-family: var(--code-font); }
.uppercase  { text-transform: uppercase; letter-spacing: 0.05em; }

/* Spacing */
.mt-0  { margin-top: 0; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-32 { margin-top: 32px; }
.mb-0  { margin-bottom: 0; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-32 { margin-bottom: 32px; }
