/* Smooll v2 — Documentação de referência.
   Sistema de design derivado da identidade já aprovada do curso:
   verde-ácido + preto quente, tipografia Inter em peso 900 com tracking
   negativo agressivo, rótulos mono maiúsculos. Dia e noite, mesma alma. */

:root {
  --bg: #f3efe0;
  --surface: #ffffff;
  --surface-2: #eae4cd;
  --ink: #15170d;
  --muted: #66674f;
  --line: #15170d1e;
  --line-strong: #15170d3d;
  --acid: #6d8f00;
  --acid-fill: #baff32;
  --acid-ink: #0c1400;
  --blue: #2b46c9;
  --code-bg: #15170d;
  --code-ink: #d7f3ab;
  --code-dim: #ffffff6b;
  --ghost: #15170d0d;
  --shadow: 0 1.4rem 3.6rem #15170d17, 0 .3rem .6rem #15170d10;
  --radius: 1.6rem;
  --topbar-bg: #6d8f00;
  --topbar-ink: #f7f8ec;
  --topbar-muted: #f7f8ecb0;
  --topbar-line: #f7f8ec33;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0b07;
    --surface: #14160d;
    --surface-2: #1b1e12;
    --ink: #f5f1e3;
    --muted: #9a9a80;
    --line: #ffffff1a;
    --line-strong: #ffffff30;
    --acid: #baff32;
    --acid-fill: #baff32;
    --acid-ink: #0c1400;
    --blue: #7d97ff;
    --code-bg: #060704;
    --code-ink: #baff32;
    --code-dim: #ffffff59;
    --ghost: #ffffff0a;
    --shadow: 0 1.4rem 3.6rem #00000066, 0 .3rem .6rem #00000045;
    --topbar-bg: color-mix(in oklab, var(--surface) 88%, transparent);
    --topbar-ink: var(--ink);
    --topbar-muted: var(--muted);
    --topbar-line: var(--line-strong);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0b07;
  --surface: #14160d;
  --surface-2: #1b1e12;
  --ink: #f5f1e3;
  --muted: #9a9a80;
  --line: #ffffff1a;
  --line-strong: #ffffff30;
  --acid: #baff32;
  --acid-fill: #baff32;
  --acid-ink: #0c1400;
  --blue: #7d97ff;
  --code-bg: #060704;
  --code-ink: #baff32;
  --code-dim: #ffffff59;
  --ghost: #ffffff0a;
  --shadow: 0 1.4rem 3.6rem #00000066, 0 .3rem .6rem #00000045;
  --topbar-bg: color-mix(in oklab, var(--surface) 88%, transparent);
  --topbar-ink: var(--ink);
  --topbar-muted: var(--muted);
  --topbar-line: var(--line-strong);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { font-size: 62.5%; scroll-behavior: smooth; }
html, body { max-width: 100%; overflow-x: clip; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 1.6rem/1.6 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  transition: background .25s ease, color .25s ease;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
h1, h2, h3, h4 { margin: 0; letter-spacing: -.03em; line-height: .96; text-wrap: balance; font-weight: 900; }
p { margin: 0; }
a { color: inherit; }
code, pre, kbd { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; }
button { font: inherit; cursor: pointer; }
em { color: var(--acid); font-style: normal; }
::selection { background: var(--acid-fill); color: var(--acid-ink); }

/* ---------- Barra superior flutuante (mesma família da nav do curso) ---------- */
.doc-topbar-wrap { position: sticky; top: 1.2rem; z-index: 200; padding: 0 1.6rem; }
.doc-topbar {
  display: flex; align-items: center; gap: 1rem;
  max-width: 130rem; margin: 0 auto; padding: .8rem 1rem .8rem 1.4rem;
  border: 1px solid var(--topbar-line); border-radius: 1.8rem;
  background: var(--topbar-bg); color: var(--topbar-ink);
  box-shadow: var(--shadow); backdrop-filter: blur(1.6rem) saturate(1.3);
}
.doc-brand { display: flex; align-items: center; gap: .8rem; text-decoration: none; color: var(--topbar-ink); flex: 0 0 auto; }
.doc-brand img { display: block; height: 4rem; width: auto; padding: .0rem .9rem; border-radius: .8rem; }
.doc-brand span { padding: .15rem .5rem; border: 1px solid var(--topbar-line); border-radius: .5rem; color: var(--topbar-ink); font: 800 1.05rem/1.3 ui-monospace, monospace; letter-spacing: .06em; }
.doc-brand small { display: none; color: var(--topbar-muted); font: 800 1rem/1 ui-monospace, monospace; text-transform: uppercase; letter-spacing: .1em; padding-left: .6rem; border-left: 1px solid var(--topbar-line); }
@media (min-width: 560px) { .doc-brand small { display: inline; } }
.doc-topbar-spacer { flex: 1; }
.doc-course-link {
  display: none; align-items: center; gap: .6rem; padding: .8rem 1.3rem;
  border: 1px solid var(--topbar-line); border-radius: 99rem; text-decoration: none; color: var(--topbar-muted);
  font: 700 1.3rem/1 Inter, sans-serif;
}
.doc-course-link:hover { color: var(--topbar-ink); border-color: var(--topbar-line); }
.doc-menu-toggle {
  display: flex; align-items: center; gap: .6rem; padding: .8rem 1.3rem;
  border: 1px solid var(--topbar-line); border-radius: 99rem; background: color-mix(in oklab, var(--topbar-ink) 12%, transparent); color: var(--topbar-ink);
  font: 800 1.3rem/1 Inter, sans-serif;
}
.doc-theme-toggle {
  position: relative; flex: 0 0 auto; width: 5.8rem; height: 3.4rem; padding: .3rem;
  border: 1px solid var(--topbar-line); border-radius: 99rem; background: color-mix(in oklab, var(--topbar-ink) 12%, transparent);
}
.doc-theme-toggle i {
  display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%;
  background: var(--acid-fill); color: var(--acid-ink); font-style: normal; font-size: 1.3rem;
  transform: translateX(0); transition: transform .25s cubic-bezier(.4,0,.2,1);
}
:root[data-theme="dark"] .doc-theme-toggle i { transform: translateX(2.2rem); }
.doc-theme-toggle .sun, .doc-theme-toggle .moon { position: absolute; top: 50%; translate: 0 -50%; opacity: 1; transition: opacity .2s; font-size: 1.3rem; }
.doc-theme-toggle .sun { left: 1rem; }
.doc-theme-toggle .moon { right: .9rem; opacity: .35; }
:root[data-theme="dark"] .doc-theme-toggle .sun { opacity: .35; }
:root[data-theme="dark"] .doc-theme-toggle .moon { opacity: 1; }

/* ---------- Layout com barra lateral ---------- */
.doc-shell { display: flex; flex-direction: column; min-height: 100dvh; }
.doc-body { display: grid; grid-template-columns: 1fr; gap: 0; flex: 1; padding-top: 1.6rem; }
.doc-sidebar { display: none; padding: 0 1.6rem 4rem; }
.doc-sidebar h2 { font: 800 1.1rem/1 ui-monospace, monospace; color: var(--muted); letter-spacing: .12em; text-transform: uppercase; margin-bottom: 1.4rem; padding-left: 1.1rem; }
.doc-sidebar nav { display: grid; gap: .2rem; }
.doc-sidebar a {
  position: relative; display: flex; align-items: baseline; gap: 1rem; padding: 1rem 1.1rem; border-radius: 1rem;
  text-decoration: none; color: var(--muted); border: 1px solid transparent;
}
.doc-sidebar a i { flex: 0 0 auto; color: var(--line-strong); font: 800 1.2rem/1 ui-monospace, monospace; font-style: normal; }
.doc-sidebar a b { color: var(--ink); font-size: 1.6rem; font-weight: 500; letter-spacing: .0em; }
.doc-sidebar a span { display: none; }
.doc-sidebar a:hover { background: var(--ghost); color: var(--ink); }
.doc-sidebar a[aria-current="page"] { background: var(--surface); border-color: var(--line); box-shadow: var(--shadow); }
.doc-sidebar a[aria-current="page"] i { color: var(--acid); }
.doc-sidebar a[aria-current="page"] b { color: var(--acid); }
.doc-main { min-width: 0; padding: 0 0 8rem; }

@media (min-width: 992px) {
  .doc-course-link { display: inline-flex; }
  .doc-menu-toggle { display: none; }
  .doc-body { grid-template-columns: 25rem 1fr; }
  .doc-sidebar { display: block; position: sticky; top: 7.6rem; height: calc(100dvh - 8.4rem); overflow-y: auto; }
}
.doc-sidebar[data-open="true"] { display: block; position: fixed; z-index: 300; inset: 0; overflow-y: auto; padding: 9rem 1.6rem 4rem; background: var(--bg); }
@media (min-width: 992px) { .doc-sidebar[data-open] { position: sticky; inset: auto; padding: 0 1.6rem 4rem; } }

/* ---------- Conteúdo ---------- */
.doc-page-head { position: relative; overflow: hidden; padding: 6rem max(2rem, calc((100% - 108rem) / 2)) 4rem; border-bottom: 1px solid var(--line); }
.doc-page-head::before {
  content: attr(data-ghost); position: absolute; z-index: 0; right: max(-2rem, calc((100% - 108rem) / 2 - 4rem)); top: 40%; translate: 0 -50%;
  font: 950 clamp(14rem, 26vw, 34rem)/1 Inter, sans-serif; letter-spacing: -.06em; color: var(--ghost); pointer-events: none;
}
.doc-kicker { position: relative; z-index: 1; display: flex; align-items: center; gap: 1rem; margin-bottom: 1.6rem; color: var(--acid); font: 800 1.2rem/1 ui-monospace, monospace; letter-spacing: .14em; text-transform: uppercase; }
.doc-kicker::before { content: ""; width: .8rem; height: .8rem; border-radius: 50%; background: var(--acid-fill); }
.doc-page-head h1 { position: relative; z-index: 1; font-size: clamp(4.4rem, 7vw, 8rem); max-width: 16ch; }
.doc-page-head .lead { position: relative; z-index: 1; max-width: 68rem; margin-top: 2rem; color: var(--muted); font: 500 clamp(1.7rem, 1.6vw, 2rem)/1.55 Inter, sans-serif; }
.doc-badges { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2.4rem; }
.doc-badge { padding: .7rem 1.3rem; border: 1px solid var(--line-strong); border-radius: 99rem; font: 700 1.24rem/1 Inter, sans-serif; color: var(--muted); background: var(--surface); }
.doc-experimental { display: inline-flex; align-items: center; gap: .5rem; padding: .5rem 1.1rem; border: 1px solid #ffb06655; border-radius: 99rem; background: #ffb06618; color: var(--warn); font: 800 1.05rem/1 ui-monospace, monospace; letter-spacing: .06em; text-transform: uppercase; }

.doc-section { position: relative; padding: 6rem max(2rem, calc((100% - 108rem) / 2)); border-bottom: 1px solid var(--line); }
.doc-section:last-of-type { border-bottom: none; }
.doc-section > .doc-kicker { margin-bottom: 1rem; }
.doc-section > h2 { font-size: clamp(2.8rem, 3.4vw, 4rem); max-width: 22ch; letter-spacing: -.025em; }
.doc-section > .doc-section-note { max-width: 68rem; margin-top: 1.4rem; color: var(--muted); font-size: 1.75rem; line-height: 1.6; }

.doc-plain {
  display: grid; gap: 1rem; margin-top: 2.4rem; padding: 2.2rem 2.4rem;
  border-radius: 1.2rem; background: var(--surface-2);
  border-left: .4rem solid var(--acid-fill);
}
.doc-plain b { color: var(--acid); font: 800 1.1rem/1 ui-monospace, monospace; letter-spacing: .1em; text-transform: uppercase; }
.doc-plain p { color: var(--ink); font-size: 1.65rem; line-height: 1.55; }

/* Vitrine de demonstração ao vivo */
.doc-demo {
  margin-top: 2.8rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow); overflow: hidden;
}
.doc-demo-stage {
  position: relative; min-height: 28rem; display: grid; place-items: center;
  padding: 3rem; background: var(--surface-2); overflow: hidden;
}
.doc-demo-stage::before {
  content: ""; position: absolute; z-index: 0; inset: -20%;
  background: radial-gradient(circle at 22% 18%, color-mix(in oklab, var(--acid-fill) 30%, transparent), transparent 46%);
  pointer-events: none;
}
.doc-demo-stage.is-tall { min-height: 60svh; align-items: start; padding-top: 6rem; }
.doc-demo-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; padding: 1.3rem 1.8rem;
  border-top: 1px solid var(--line); background: var(--surface);
}
.doc-demo-toolbar span { color: var(--muted); font: 800 1.1rem/1 ui-monospace, monospace; letter-spacing: .08em; text-transform: uppercase; margin-right: .4rem; }
.doc-chip {
  padding: .7rem 1.3rem; border: 1px solid var(--line-strong); border-radius: 99rem; background: var(--surface);
  color: var(--muted); font: 800 1.24rem/1 Inter, sans-serif;
}
.doc-chip[aria-pressed="true"] { background: var(--acid-fill); border-color: var(--acid-fill); color: var(--acid-ink); }
.doc-chip.is-play { color: var(--acid); border-color: color-mix(in oklab, var(--acid) 55%, transparent); }
.doc-progress-readout { margin-left: auto; color: var(--muted); font: 800 1.2rem/1 ui-monospace, monospace; }

/* Grade de variações */
.doc-variants { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1.2rem; margin-top: 2.6rem; }
.doc-variant-card {
  border: 1px solid var(--line); border-radius: 1.2rem; background: var(--surface); overflow: hidden;
  box-shadow: var(--shadow);
}
.doc-variant-stage { min-height: 11rem; display: grid; place-items: center; background: var(--surface-2); }
.doc-variant-target {
  width: 7rem; height: 7rem; display: grid; place-items: center; border-radius: 1.4rem;
  background: var(--acid-fill); color: var(--acid-ink); font: 900 1.6rem/1 ui-monospace, monospace;
}
.doc-variant-info { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: 1.1rem 1.2rem; }
.doc-variant-info code { font-size: 1.24rem; color: var(--acid); }
.doc-variant-info button { display: grid; place-items: center; width: 3.3rem; height: 3.3rem; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--surface); color: var(--ink); }
.doc-variant-info button:hover { background: var(--acid-fill); color: var(--acid-ink); border-color: var(--acid-fill); }

/* Bloco de código — mesmo tratamento acid-on-black do curso */
.doc-code { position: relative; margin-top: 2.2rem; border-radius: 1.2rem; overflow: hidden; background: var(--code-bg); border: 1px solid var(--line); }
.doc-code header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.7rem; border-bottom: 1px solid #ffffff14; }
.doc-code header span { color: var(--code-dim); font: 800 1.1rem/1 ui-monospace, monospace; letter-spacing: .08em; text-transform: uppercase; }
.doc-code button.copy { padding: .5rem 1.1rem; border: 1px solid #ffffff26; border-radius: .7rem; background: transparent; color: #ffffffcc; font: 700 1.15rem/1 Inter, sans-serif; }
.doc-code button.copy:hover { background: #ffffff14; }
.doc-code pre { margin: 0; padding: 2.2rem; overflow-x: auto; color: var(--code-ink); font-size: 1.36rem; line-height: 1.75; }
.doc-code .tag { color: #7fb3ff; }
.doc-code .attr { color: var(--code-ink); }
.doc-code .val { color: #ffd479; }

/* Tabela de atributos */
.doc-attrs { display: grid; margin-top: 2.6rem; border: 1px solid var(--line); border-radius: 1.2rem; overflow: hidden; background: var(--surface); }
.doc-attrs > div { display: grid; grid-template-columns: 1fr; gap: .4rem; padding: 1.8rem 2rem; border-bottom: 1px solid var(--line); }
.doc-attrs > div:last-child { border-bottom: none; }
.doc-attrs code { color: var(--acid); font-size: 1.42rem; font-weight: 700; }
.doc-attrs .doc-attr-desc { color: var(--ink); font-size: 1.5rem; }
.doc-attrs .doc-attr-values { color: var(--muted); font-size: 1.3rem; }
@media (min-width: 768px) { .doc-attrs > div { grid-template-columns: 19rem 1fr 20rem; align-items: center; gap: 1.6rem; } }

/* Aviso / dica */
.doc-tip { display: flex; gap: 1.4rem; margin-top: 2.6rem; padding: 2rem 2.2rem; border: 1px dashed var(--line-strong); border-radius: 1.2rem; background: var(--surface); }
.doc-tip i { flex: 0 0 auto; width: 3.4rem; height: 3.4rem; display: grid; place-items: center; border-radius: 50%; background: var(--ghost); color: var(--acid); font-style: normal; font-weight: 900; }
.doc-tip p { color: var(--muted); font-size: 1.52rem; line-height: 1.55; }
.doc-tip strong { color: var(--ink); }

/* Índice de componentes — lista de campo, não grade de ícones */
.doc-index { display: grid; gap: 1px; margin-top: 3.2rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--line); overflow: hidden; }
.doc-index-row {
  position: relative; display: grid; grid-template-columns: 5.5rem 1fr auto; align-items: center; gap: 1.6rem;
  padding: 2.2rem 2.4rem; background: var(--surface); text-decoration: none; color: inherit;
  transition: padding-left .18s ease, background .18s ease;
}
.doc-index-row:hover { background: var(--surface-2); padding-left: 3rem; }
.doc-index-num { color: var(--line-strong); font: 900 2rem/1 ui-monospace, monospace; }
.doc-index-row:hover .doc-index-num { color: var(--acid); }
.doc-index-body b { display: block; font-size: 2.2rem; letter-spacing: -.02em; }
.doc-index-body p { margin-top: .4rem; color: var(--muted); font-size: 1.5rem; max-width: 60ch; }
.doc-index-tag { justify-self: end; padding: .5rem 1.1rem; border-radius: 99rem; background: var(--ghost); color: var(--muted); font: 800 1.05rem/1 ui-monospace, monospace; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
@media (max-width: 560px) { .doc-index-row { grid-template-columns: 3.6rem 1fr; } .doc-index-tag { display: none; } }

/* Navegação entre páginas de componente */
.doc-pager { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.6rem; padding: 4rem max(2rem, calc((100% - 108rem) / 2)) 6rem; }
.doc-pager a { display: grid; gap: .4rem; max-width: 30rem; text-decoration: none; color: inherit; }
.doc-pager a:last-child { text-align: right; margin-left: auto; }
.doc-pager span { color: var(--acid); font: 800 1.1rem/1 ui-monospace, monospace; letter-spacing: .08em; text-transform: uppercase; }
.doc-pager strong { font-size: 2.1rem; font-weight: 900; letter-spacing: -.02em; }

.doc-footer { padding: 3rem max(2rem, calc((100% - 108rem) / 2)) 5rem; color: var(--muted); font-size: 1.4rem; border-top: 1px solid var(--line); }
.doc-footer a { color: var(--acid); text-decoration: none; }
