:root {
    color-scheme: dark;
    --mono: "OpenTUI Mono", ui-monospace, SFMono-Regular, "JetBrains Mono",
      "IBM Plex Mono", Menlo, Consolas, "Liberation Mono", monospace;
    --bg: #090909;
    --fg: #efefef;
    --muted: #929292;
    --border: #303030;
    --surface: #101010;
    --surface-2: #161616;
    --link: #4d8eff;
    --code-bg: rgba(239, 239, 239, 0.1);
    --header-bg: rgba(9, 9, 9, 0.82);
    --header-border: rgba(48, 48, 48, 0.7);
    --header-height: 62px;
    --frame-width: 96rem;
    --content-width: 60rem;
  }
  :root[data-tema="claro"] {
    color-scheme: light;
    --bg: #ffffff;
      --fg: #1a1a1a;
      --muted: #6b6b6b;
      --border: #e2e2e2;
      --surface: #f6f6f6;
      --surface-2: #ffffff;
      --link: #1d63d8;
      --code-bg: rgba(26, 26, 26, 0.07);
      --header-bg: rgba(255, 255, 255, 0.82);
      --header-border: rgba(226, 226, 226, 0.8);
  }
  * { box-sizing: border-box; }
  html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + 24px); }
  body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font: 14px/1.8 var(--mono);
    -webkit-font-smoothing: antialiased;
  }
  ::selection { background: var(--link); color: #fff; }

  header {
    position: sticky;
    top: 0;
    z-index: 10;
    height: var(--header-height);
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 0 24px;
    background: var(--header-bg);
    border-bottom: 1px solid var(--header-border);
    backdrop-filter: blur(16px);
  }
  header .marca {
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--fg);
    text-decoration: none;
  }
  header .marca span { color: var(--muted); font-weight: 400; }
  header .tema {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: 0;
    font: inherit;
    font-size: 12px;
    cursor: pointer;
  }
  header .tema:hover { color: var(--fg); border-color: var(--muted); }
  header .tema:focus-visible { outline: 1px solid var(--link); outline-offset: 2px; }
  header .tema .icone { font-size: 13px; line-height: 1; }

  .layout {
    display: flex;
    align-items: flex-start;
    max-width: var(--frame-width);
    margin: 0 auto;
  }

  aside {
    position: sticky;
    top: var(--header-height);
    flex: 0 0 272px;
    width: 272px;
    max-height: calc(100vh - var(--header-height));
    overflow-y: auto;
    padding: 24px 20px 64px;
    border-right: 1px solid var(--border);
    font-size: 13px;
  }
  aside .grupo {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--fg);
    margin: 28px 0 10px;
  }
  aside .grupo:first-child { margin-top: 0; }
  aside a {
    display: block;
    padding: 2px 0;
    color: var(--muted);
    text-decoration: none;
    line-height: 1.55;
  }
  aside a.n2 { color: var(--fg); font-weight: 600; margin-top: 12px; }
  aside a.n3 { padding-left: 12px; }
  aside a:hover { color: var(--fg); }
  aside a.ativo { color: var(--fg); font-weight: 700; }

  main {
    flex: 1 1 auto;
    min-width: 0;
    max-width: var(--content-width);
    padding: 48px 51px 96px;
  }

  h1 {
    font-size: 30px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 0 0 24px;
  }
  h2 {
    position: relative;
    font-size: 20px;
    line-height: 1.5;
    font-weight: 700;
    margin: 48px 0 12px;
  }
  h2::after {
    content: "#";
    color: var(--muted);
    margin-left: 6px;
    opacity: 0;
    transition: opacity 0.12s;
    font-weight: 400;
  }
  h2:hover::after { opacity: 1; }
  h3 { font-size: 16px; line-height: 1.5; font-weight: 700; margin: 32px 0 8px; }
  h4 { font-size: 14px; font-weight: 700; margin: 24px 0 6px; }

  p { margin: 0 0 20px; color: var(--muted); }
  h1, h2, h3, h4 { color: var(--fg); }
  strong { color: var(--fg); font-weight: 700; }
  em { font-style: italic; }

  a { color: var(--link); text-decoration: none; }
  a:hover { text-decoration: underline; }

  code {
    background: var(--code-bg);
    color: var(--fg);
    padding: 1px 3px;
    border-radius: 0;
    font-family: var(--mono);
    font-size: 0.93em;
  }
  pre {
    margin: 0 0 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0;
    padding: 14px 16px;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.8;
  }
  pre code { background: none; padding: 0; font-size: 13px; }
  .bloco-terminal { position: relative; margin: 0 0 24px; }
  .bloco-terminal > pre[data-linguagem] { margin: 0; padding-top: 42px; }
  .botao-copiar {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 1;
    padding: 3px 9px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--muted);
    font: inherit;
    font-size: 11px;
    line-height: 1.5;
    cursor: pointer;
  }
  .botao-copiar:hover:not(:disabled) { border-color: var(--muted); color: var(--fg); }
  .botao-copiar:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
  .botao-copiar.copiado { border-color: var(--link); color: var(--link); }
  .botao-copiar:disabled { cursor: wait; }

  ul, ol { margin: 0 0 24px; padding-left: 24px; }
  li { margin: 0; color: var(--fg); }
  li::marker { color: var(--muted); }

  blockquote {
    margin: 0 0 24px;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-left: 2px solid var(--link);
    background: var(--surface);
  }
  blockquote p { margin: 0; color: var(--muted); }

  .tabela { overflow-x: auto; margin: 0 0 24px; border: 1px solid var(--border); }
  table { border-collapse: collapse; width: 100%; font-size: 13px; }
  th {
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-align: left;
    white-space: nowrap;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
    background: var(--surface);
  }
  td {
    padding: 8px 12px;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
    vertical-align: top;
  }
  td strong { color: var(--fg); }
  tbody tr:last-child td { border-bottom: none; }
  tbody tr:hover td { background: var(--surface-2); }
  tbody tr:hover td { color: var(--fg); }

  hr { border: none; border-top: 1px solid var(--border); margin: 48px 0 24px; }

  @media (max-width: 1000px) {
    .layout { display: block; }
    aside {
      position: static;
      width: auto;
      flex: none;
      max-height: none;
      border-right: none;
      border-bottom: 1px solid var(--border);
      padding: 16px 20px 24px;
    }
    main { max-width: none; padding: 32px 20px 72px; }
    h1 { font-size: 24px; }
    h2 { font-size: 18px; }
  }
  @media print {
    header, aside { display: none; }
    .botao-copiar { display: none; }
    .layout { display: block; }
    body { background: #fff; color: #000; }
    main { max-width: none; padding: 0; }
    h2 { page-break-after: avoid; }
    .tabela, pre, blockquote { page-break-inside: avoid; }
    a { color: inherit; text-decoration: none; }
    p, td, th { color: #000; }
  }

/* Navegação multipágina e apresentação inicial */
header { gap: 16px; }
header .marca {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}
header .marca img { display: block; width: 32px; height: 32px; }
header .marca .marca-texto { color: var(--fg); font-weight: 700; }
header .marca .marca-texto span { color: var(--muted); font-weight: 400; }
header .menu-paginas { position: relative; flex: 0 0 auto; margin-left: auto; }
header .menu-paginas > summary {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  color: var(--fg);
  cursor: pointer;
  list-style: none;
  user-select: none;
}
header .menu-paginas > summary::-webkit-details-marker { display: none; }
header .menu-paginas > summary::marker { content: ""; }
header .menu-paginas > summary:hover,
header .menu-paginas[open] > summary { border-color: var(--muted); background: var(--surface); }
header .menu-paginas > summary:focus-visible { outline: 1px solid var(--link); outline-offset: 2px; }
header .menu-paginas .indicador-menu { color: var(--muted); transition: transform 0.15s; }
header .menu-paginas[open] .indicador-menu { transform: rotate(180deg); }
header .menu-paginas .lista-paginas {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  display: grid;
  gap: 4px;
  width: min(320px, calc(100vw - 32px));
  max-height: min(70vh, 520px);
  margin: 0;
  padding: 8px;
  overflow-y: auto;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.32);
}
header .menu-paginas .lista-paginas a {
  display: block;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  text-decoration: none;
}
header .menu-paginas .lista-paginas a:hover,
header .menu-paginas .lista-paginas a:focus-visible { background: var(--surface-2); color: var(--fg); }
header .menu-paginas .lista-paginas a[aria-current="page"] {
  border-left: 2px solid var(--link);
  background: var(--surface-2);
  color: var(--fg);
  font-weight: 700;
}
header .link-markdown { flex: 0 0 auto; color: var(--muted); white-space: nowrap; }
header .link-markdown:hover { color: var(--fg); }
header .tema { flex: 0 0 auto; }

.pagina-inicial { max-width: 70rem; }
.hero { padding: 8px 0 32px; }
.hero h1 { max-width: 48rem; font-size: clamp(30px, 5vw, 52px); }
.hero p { max-width: 52rem; font-size: 15px; }
.hero hr { margin-top: 32px; }
.acoes-iniciais { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 24px; }
a.botao-download {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border: 1px solid var(--link);
  background: var(--surface);
  color: var(--fg);
  font-weight: 700;
  text-decoration: none;
}
a.botao-download:hover { background: var(--surface-2); }
a.botao-download:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; }
.apresentacao { margin-top: 36px; }
.apresentacao h2 { margin-top: 0; }
.cartoes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 20px 0 40px;
}
a.cartao {
  display: block;
  min-height: 150px;
  padding: 18px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--fg);
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
a.cartao:hover {
  border-color: var(--link);
  background: var(--surface-2);
  text-decoration: none;
  transform: translateY(-2px);
}
a.cartao:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; }
.cartao .numero { display: block; color: var(--link); font-size: 12px; margin-bottom: 10px; }
.cartao h3 { margin: 0 0 8px; font-size: 15px; }
.cartao p { margin: 0; font-size: 12px; line-height: 1.65; }
.cartao .acao { display: inline-block; margin-top: 14px; color: var(--link); font-size: 12px; }
.percurso { margin-top: 36px; }
.percurso ol { color: var(--muted); }
.demonstracoes { margin-top: 40px; }
.carrossel-videos {
  max-width: 62rem;
  margin: 20px 0 40px;
}
.videos {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.videos::-webkit-scrollbar { display: none; }
.videos:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; }
.video-card {
  min-width: 0;
  flex: 0 0 100%;
  scroll-snap-align: start;
  border: 1px solid var(--border);
  background: var(--surface);
}
.video-card video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 72vh;
  background: #000;
}
.video-info { padding: 14px 16px 16px; }
.video-info h3 { margin: 0 0 6px; font-size: 16px; }
.video-info p { margin: 0; font-size: 12px; line-height: 1.6; }
.controles-carrossel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
}
.controles-carrossel button {
  padding: 7px 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--fg);
  font: inherit;
  cursor: pointer;
}
.controles-carrossel button:hover:not(:disabled) { border-color: var(--muted); background: var(--surface-2); }
.controles-carrossel button:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.controles-carrossel button:disabled { color: var(--muted); cursor: not-allowed; opacity: 0.55; }
.controles-carrossel span { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.rodape {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: var(--frame-width);
  margin: 0 auto;
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}
.rodape p { margin: 0; color: inherit; }
.rodape a { color: inherit; }
.rodape a:hover { color: var(--fg); }
.link-repositorio { display: inline-flex; align-items: center; gap: 9px; white-space: nowrap; font-size: 13px; font-weight: 600; }
.link-repositorio .icone-github { display: block; flex: 0 0 auto; width: 24px; height: 24px; }
.link-repositorio .icone-github-escuro { display: none; }
:root[data-tema="escuro"] .link-repositorio .icone-github-claro { display: none; }
:root[data-tema="escuro"] .link-repositorio .icone-github-escuro { display: block; }

@media (max-width: 760px) {
  header {
    height: auto;
    min-height: var(--header-height);
    flex-wrap: wrap;
    gap: 8px 12px;
    padding: 10px 16px;
  }
  header .marca { order: 1; }
  header .tema { order: 2; margin-left: auto; }
  header .menu-paginas { order: 3; margin-left: 0; }
  header .link-markdown { order: 4; margin-left: auto; }
  header .menu-paginas .lista-paginas { right: auto; left: 0; }
  .hero { padding-top: 0; }
  .cartoes { grid-template-columns: 1fr; }
  .rodape { align-items: flex-start; flex-direction: column; padding: 18px 16px; }
}
