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

:root {
  --main-bg: #09090b;
  --surface: #111113;
  --surface-2: #18181b;
  --surface-hover: #1f1f23;

  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --border-soft: rgba(255, 255, 255, 0.05);

  --text: #fafafa;
  --text-soft: #d4d4d8;
  --muted: #a1a1aa;
  --muted-soft: #71717a;

  --violet: #8b5cf6;
  --violet-hover: #7c3aed;
  --violet-soft: rgba(139, 92, 246, 0.15);
  --violet-glow: rgba(139, 92, 246, 0.35);
  --cyan: #22d3ee;

  --font: 'Geist', -apple-system, system-ui, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, monospace;

  --radius: 12px;
  --radius-sm: 8px;
  --max-w: 1180px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--main-bg);
  color: var(--text);
  letter-spacing: -0.011em;
  font-feature-settings: 'ss01', 'cv11';
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.55;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 70% 55% at 80% -10%, rgba(139, 92, 246, 0.12), transparent 60%),
    radial-gradient(ellipse 50% 40% at 0% 100%, rgba(34, 211, 238, 0.04), transparent 60%);
}

body > * { position: relative; z-index: 1; }

::selection { background: var(--violet-soft); color: var(--text); }

a { color: inherit; text-decoration: none; }

/* ───────── Nav (mirror of landing) ───────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  background: rgba(9, 9, 11, 0.65);
  border-bottom: 1px solid var(--border-soft);
}
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0.95rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.02em;
}
.logo-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--violet);
  box-shadow: 0 0 14px var(--violet-glow);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.nav-link {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.15s var(--ease);
}
.nav-link:hover { color: var(--text); }
.nav-link.is-active { color: var(--text); }

/* ───────── Shell ───────── */
.docs-shell {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 3.5rem;
  align-items: start;
}

@media (max-width: 900px) {
  .docs-shell {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 1.5rem 1.25rem 3rem;
  }
}

/* ───────── TOC ───────── */
.docs-toc {
  position: sticky;
  top: 5.25rem;
  align-self: start;
  max-height: calc(100vh - 6rem);
  overflow-y: auto;
}
@media (max-width: 900px) {
  .docs-toc {
    position: static;
    max-height: none;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
  }
}

.docs-toc-inner {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.docs-toc-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-soft);
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}

.docs-toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  counter-reset: toc;
}

.docs-toc-list li {
  counter-increment: toc;
}

.docs-toc-list a {
  display: flex;
  gap: 0.65rem;
  padding: 0.42rem 0;
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.35;
  transition: color 0.15s var(--ease), transform 0.15s var(--ease);
  position: relative;
}

.docs-toc-list a::before {
  content: counter(toc, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--muted-soft);
  letter-spacing: 0.05em;
  min-width: 1.6rem;
  padding-top: 0.08rem;
  transition: color 0.15s var(--ease);
}

.docs-toc-list a:hover {
  color: var(--text);
}
.docs-toc-list a:hover::before { color: var(--text-soft); }

.docs-toc-list a.is-active {
  color: var(--violet);
}
.docs-toc-list a.is-active::before { color: var(--violet); }

.docs-toc-cta {
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}
.docs-cta-link {
  font-size: 0.85rem;
  color: var(--text-soft);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: color 0.15s var(--ease);
}
.docs-cta-link:hover { color: var(--violet); }

/* ───────── Article ───────── */
.docs-article {
  max-width: 720px;
  min-width: 0;
}

.docs-hero {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.docs-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-soft);
  margin-bottom: 1rem;
}

.docs-hero h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.08;
  color: var(--text);
  margin-bottom: 1.1rem;
  background: linear-gradient(180deg, #fafafa 0%, #b7b7bd 120%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.docs-lede {
  font-size: 1.075rem;
  color: var(--muted);
  line-height: 1.6;
  max-width: 60ch;
}

/* ───────── Sections ───────── */
.docs-section {
  padding-top: 2.5rem;
  padding-bottom: 0.25rem;
  scroll-margin-top: 5.5rem;
}

.docs-section h2 {
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--text);
  margin-bottom: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.docs-section h2::before {
  content: '';
  width: 4px;
  height: 1.1rem;
  background: var(--violet);
  border-radius: 2px;
  display: inline-block;
  box-shadow: 0 0 10px var(--violet-glow);
}

.docs-section h3 {
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-soft);
  margin-top: 1.75rem;
  margin-bottom: 0.6rem;
}

.docs-section h4 {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--muted);
  margin-top: 1.1rem;
  margin-bottom: 0.4rem;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

.docs-section p {
  color: var(--text-soft);
  line-height: 1.65;
  margin-bottom: 0.85rem;
  font-size: 0.95rem;
}

.docs-section em {
  color: var(--text);
  font-style: normal;
  font-weight: 500;
}

/* ───────── Callout ───────── */
.docs-callout {
  margin-top: 1.1rem;
  padding: 0.95rem 1.1rem;
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.06), rgba(139, 92, 246, 0.02));
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text-soft);
  line-height: 1.55;
}
.docs-callout strong {
  color: var(--violet);
  font-weight: 600;
}

/* ───────── Steps ───────── */
.docs-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  margin-top: 0.5rem;
}
.docs-steps li {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.docs-step-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--violet);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.05rem;
}
.docs-steps strong {
  display: block;
  color: var(--text);
  font-weight: 500;
  margin-bottom: 0.15rem;
  font-size: 0.98rem;
}
.docs-steps p {
  margin-bottom: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

/* ───────── Definition list (options avancées) ───────── */
.docs-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.docs-list > div {
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s var(--ease);
}
.docs-list > div:hover { border-color: var(--border-strong); }
.docs-list dt {
  font-weight: 600;
  color: var(--text);
  font-size: 0.94rem;
  margin-bottom: 0.25rem;
  letter-spacing: -0.01em;
}
.docs-list dd {
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.55;
}

/* ───────── Bullets ───────── */
.docs-bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0.3rem 0 0.5rem;
}
.docs-bullets li {
  position: relative;
  padding-left: 1.1rem;
  color: var(--text-soft);
  font-size: 0.92rem;
  line-height: 1.55;
}
.docs-bullets li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.72rem;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--violet);
  opacity: 0.6;
}
.docs-bullets strong {
  color: var(--text);
  font-weight: 500;
}

/* ───────── Code ───────── */
code {
  font-family: var(--font-mono);
  font-size: 0.84em;
  background: #111113;
  border: 1px solid var(--border);
  padding: 0.1rem 0.38rem;
  border-radius: 5px;
  color: var(--cyan);
  letter-spacing: -0.005em;
}

pre {
  background: #0a0a0c;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.15rem;
  overflow-x: auto;
  margin: 0.6rem 0 1rem;
  position: relative;
}
pre::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px;
  height: 100%;
  background: linear-gradient(180deg, var(--violet), transparent 80%);
  border-top-left-radius: var(--radius-sm);
  border-bottom-left-radius: var(--radius-sm);
  opacity: 0.55;
}
pre code {
  background: transparent;
  border: none;
  padding: 0;
  color: var(--text-soft);
  font-size: 0.82rem;
  line-height: 1.65;
  letter-spacing: 0;
}

/* ───────── Plan table ───────── */
.docs-plan-table {
  margin: 0.5rem 0 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.docs-plan-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.docs-plan-table thead th {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.docs-plan-table thead th:first-child { text-align: left; background: transparent; }
.docs-plan-table tbody th[scope="row"] {
  text-align: left;
  font-weight: 500;
  color: var(--text-soft);
  padding: 0.75rem 1rem;
  font-size: 0.88rem;
}
.docs-plan-table tbody td {
  padding: 0.75rem 1rem;
  text-align: center;
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
  border-top: 1px solid var(--border-soft);
}
.docs-plan-table tbody tr:hover td,
.docs-plan-table tbody tr:hover th {
  background: rgba(139, 92, 246, 0.04);
}
.docs-plan-note {
  font-size: 0.82rem;
  color: var(--muted-soft);
  font-style: italic;
}

/* ───────── FAQ ───────── */
.docs-faq {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  transition: border-color 0.2s var(--ease);
}
.docs-faq[open] { border-color: var(--border-strong); }
.docs-faq summary {
  cursor: pointer;
  padding: 0.9rem 1.1rem;
  color: var(--text);
  font-weight: 500;
  font-size: 0.94rem;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  transition: color 0.15s var(--ease);
}
.docs-faq summary::-webkit-details-marker { display: none; }
.docs-faq summary::after {
  content: '＋';
  color: var(--muted-soft);
  font-size: 1rem;
  transition: transform 0.2s var(--ease), color 0.15s var(--ease);
}
.docs-faq[open] summary::after {
  content: '−';
  color: var(--violet);
}
.docs-faq summary:hover { color: var(--violet); }
.docs-faq p {
  padding: 0 1.1rem 1rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
  margin: 0;
}

/* ───────── Footer ───────── */
.docs-footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--muted);
}
.docs-footer p { margin-bottom: 0.5rem; }
.docs-footer a { color: var(--text-soft); transition: color 0.15s var(--ease); }
.docs-footer a:hover { color: var(--violet); }
.docs-footer-meta {
  color: var(--muted-soft);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}
