/* Landing do Synapse. Só consome tokens de assets/css/tokens.css (skill knowledge-studio-ds).
 * Regra de ouro: superfície neutra, índigo só na ação, status sempre com a palavra.
 * Mobile-first: cresce por min-width, com os breakpoints --bp-* do tokens.css (40rem, 48rem, 64rem). */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--sp-16); }
body { margin: 0; font-size: var(--fs-base); }
h1, h2, h3, p, ul, dl, dd, pre { margin: 0; }
ul { padding: 0; list-style: none; }
code, pre { font-family: var(--font-mono); }
code { font-size: 0.9em; background: var(--surface-3); border-radius: var(--radius-default); padding: 0 var(--sp-1); }
[hidden] { display: none !important; }

.pular {
  position: absolute; left: var(--sp-4); top: calc(-1 * var(--sp-16));
  background: var(--surface-1); color: var(--foreground); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: var(--sp-2) var(--sp-4); z-index: var(--z-50);
}
.pular:focus { top: var(--sp-4); }

.wrap { width: 100%; max-width: var(--container-6xl); margin-inline: auto; padding-inline: var(--sp-4); }

/* Tipografia (§4): H1 Geist peso regular, eyebrow índigo em caixa alta */
.eyebrow {
  font-size: var(--fs-xs); font-weight: var(--fw-semibold); text-transform: uppercase;
  letter-spacing: var(--tracking-widest); color: var(--primary);
}
.titulo-pagina {
  font-family: var(--font-display); font-weight: var(--fw-normal); letter-spacing: var(--tracking-display);
  font-size: var(--fs-4xl); line-height: var(--lh-tight); margin-top: var(--sp-3); max-width: 22ch;
}
.titulo-secao {
  font-family: var(--font-display); font-weight: var(--fw-normal); letter-spacing: var(--tracking-display);
  font-size: var(--fs-3xl); line-height: var(--lh-tight); margin-top: var(--sp-2); max-width: 28ch;
}
.subtitulo {
  font-size: var(--fs-base); line-height: var(--lh-relaxed); color: var(--muted-foreground);
  margin-top: var(--sp-3); max-width: var(--container-3xl);
}
.nota { font-size: var(--fs-sm); color: var(--muted-foreground); margin-top: var(--sp-4); }

/* Topo */
.topo {
  position: sticky; top: 0; z-index: var(--z-40);
  background: var(--background); border-bottom: 1px solid var(--border);
}
.topo__interno { display: flex; align-items: center; gap: var(--sp-4); min-height: var(--sp-16); }
.marca { display: inline-flex; align-items: center; gap: var(--sp-3); color: var(--foreground); text-decoration: none; margin-right: auto; }
.marca__simbolo {
  display: inline-grid; place-items: center; width: var(--sp-10); height: var(--sp-10);
  border-radius: var(--radius-full); background: var(--gradient-brand); color: var(--white);
}
.marca__nome { font-family: var(--font-display); font-weight: var(--fw-semibold); font-size: var(--fs-lg); letter-spacing: var(--tracking-display); }
.topo__nav { display: none; gap: var(--sp-1); }
.topo__nav a {
  display: inline-flex; align-items: center; min-height: var(--size-control-md); padding-inline: var(--sp-3);
  border-radius: var(--radius-sm); color: var(--muted-foreground); text-decoration: none; font-size: var(--fs-sm); font-weight: var(--fw-medium);
  transition: background var(--dur-default) var(--ease-default), color var(--dur-default) var(--ease-default);
}
.topo__nav a:hover { background: var(--surface-3); color: var(--foreground); }

/* Botões (§8): um CTA em gradiente por tela, o resto em contorno ou fantasma */
.botao {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: var(--size-control-lg); padding-inline: var(--sp-4);
  border-radius: var(--radius-sm); border: 1px solid transparent; cursor: pointer;
  font: inherit; font-size: var(--fs-sm); font-weight: var(--fw-medium); text-decoration: none;
  transition: background var(--dur-default) var(--ease-default), box-shadow var(--dur-default) var(--ease-default);
}
.botao--primario { background: var(--gradient-brand); color: var(--primary-foreground); box-shadow: var(--shadow-primary-sm); }
.botao--primario:hover { box-shadow: var(--shadow-md); }
.dark .botao--primario { background: var(--primary); }
.botao--contorno { background: var(--surface-1); color: var(--foreground); border-color: var(--border); }
.botao--contorno:hover { background: var(--surface-3); }
.botao--pequeno { min-height: var(--size-control-sm); padding-inline: var(--sp-3); font-size: var(--fs-xs); }
.botao--icone { width: var(--size-control-md); min-height: var(--size-control-md); padding: 0; background: transparent; color: var(--foreground); border-color: var(--border); }
.botao--icone:hover { background: var(--surface-3); }
.icone-sol { display: none; }
.dark .icone-sol { display: block; }
.dark .icone-lua { display: none; }

/* Hero */
.hero { position: relative; overflow: hidden; padding-block: var(--sp-12) var(--sp-8); text-align: center; min-height: min(92svh, 800px); display: flex; flex-direction: column; justify-content: center; }
.hero__campo { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero__texto { position: relative; display: flex; flex-direction: column; align-items: center; }
.hero .titulo-pagina { max-width: 20ch; }
.hero .subtitulo { margin-inline: auto; max-width: 34rem; }
.hero .acoes { justify-content: center; }
.acoes { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-6); }
.numeros { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); margin-top: var(--sp-10); width: 100%; text-align: left; }
.numero {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm); padding: var(--sp-4);
}
.numero dt { font-size: var(--fs-sm); color: var(--muted-foreground); }
.numero dd { font-size: var(--fs-3xl); font-weight: var(--fw-medium); line-height: var(--lh-tight); margin-top: var(--sp-1); }
.numero small { display: block; font-size: var(--fs-xs); color: var(--muted-foreground); margin-top: var(--sp-1); }

/* Seções */
.secao { padding-block: var(--sp-10); border-top: 1px solid var(--border); }
.secao__cabeca { margin-bottom: var(--sp-6); }
.grade { display: grid; gap: var(--sp-4); }
.cartao {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm); padding: var(--sp-5);
}
.cartao__titulo { font-size: var(--fs-base); font-weight: var(--fw-semibold); margin-bottom: var(--sp-2); }
.cartao p { font-size: var(--fs-sm); line-height: var(--lh-relaxed); color: var(--muted-foreground); }
.codigo {
  margin-top: var(--sp-4); padding: var(--sp-3) var(--sp-4); overflow-x: auto;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md); font-size: var(--fs-xs);
}
.codigo code { background: none; padding: 0; }

/* Segmentos (filtro segmentado, §7) */
.segmentos {
  display: flex; gap: var(--sp-1); padding: var(--sp-1); overflow-x: auto;
  background: var(--surface-3); border-radius: var(--radius-md); width: fit-content; max-width: 100%;
}
.segmento {
  min-height: var(--size-control-md); padding-inline: var(--sp-4); border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--muted-foreground); font: inherit; font-size: var(--fs-sm); font-weight: var(--fw-medium);
  cursor: pointer; white-space: nowrap;
  transition: background var(--dur-default) var(--ease-default), color var(--dur-default) var(--ease-default);
}
.segmento:hover { color: var(--foreground); }
.segmento[aria-selected="true"], .segmento[aria-pressed="true"] { background: var(--surface-1); color: var(--foreground); box-shadow: var(--shadow-sm); }

/* Painel do plugin */
.painel-plugin {
  margin-top: var(--sp-4); background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius-xl); box-shadow: var(--shadow-sm); padding: var(--sp-5);
  display: grid; gap: var(--sp-5);
}
.plugin__cabeca { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-3); }
.plugin__nome { font-family: var(--font-mono); font-size: var(--fs-3xl); font-weight: var(--fw-semibold); line-height: var(--lh-tight); }
.plugin__versao { font-size: var(--fs-sm); color: var(--muted-foreground); }
.plugin__resumo { font-size: var(--fs-base); line-height: var(--lh-relaxed); margin-top: var(--sp-2); max-width: var(--container-3xl); }
.plugin__fatos { display: grid; gap: var(--sp-3); }
.fato { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--sp-4); }
.fato dt { font-size: var(--fs-xs); font-weight: var(--fw-semibold); text-transform: uppercase; letter-spacing: var(--tracking-wider); color: var(--muted-foreground); }
.fato dd { font-size: var(--fs-sm); line-height: var(--lh-relaxed); margin-top: var(--sp-1); }
.fluxo { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface-2); padding: var(--sp-4); }
.fluxo__titulo { font-size: var(--fs-sm); font-weight: var(--fw-semibold); margin-bottom: var(--sp-3); }
.fluxo__quadro svg { display: block; width: 100%; height: auto; }
.legenda { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); margin-top: var(--sp-3); font-size: var(--fs-xs); color: var(--muted-foreground); }
.legenda span { display: inline-flex; align-items: center; gap: var(--sp-2); }
.legenda svg { width: var(--sp-6); height: var(--sp-4); }
.chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); }

/* Diagrama SVG: tudo por token; estado é forma e palavra, nunca só cor (§10) */
.no { fill: var(--card); stroke: var(--border); stroke-width: 1.5; }
.no--skill { stroke: var(--foreground); }
.no--subagente { stroke: var(--muted-foreground); stroke-dasharray: 5 4; }
.no--hook { stroke: var(--foreground); stroke-width: 2.5; }
.no--servidor { stroke: var(--foreground); stroke-dasharray: 2 3; }
.no--pessoa, .no--saida { fill: var(--accent); stroke: var(--border); rx: var(--radius-full); }
.no--opcional { stroke-dasharray: 5 4; }
/* Padrões da literatura: HITL = pílula com selo de pessoa e a palavra HITL; decisão = gateway exclusivo do BPMN (losango com ×) */
.no--hitl { stroke: var(--foreground); stroke-width: 2; }
.no--gateway { fill: var(--card); stroke: var(--foreground); stroke-width: 1.5; }
.gateway-x { fill: none; stroke: var(--foreground); stroke-width: 2; stroke-linecap: round; }
.selo-hitl__fundo { fill: var(--card); stroke: var(--foreground); stroke-width: 1.5; }
.selo-hitl__icone { fill: var(--foreground); stroke: none; }
.no-titulo { font-family: var(--font-mono); font-size: 13px; font-weight: var(--fw-semibold); fill: var(--foreground); }
.no-sub { font-family: var(--font-sans); font-size: 11px; fill: var(--muted-foreground); }
.no-tag { font-family: var(--font-sans); font-size: 10px; font-weight: var(--fw-semibold); letter-spacing: var(--tracking-wider); text-transform: uppercase; fill: var(--muted-foreground); }
.aresta { fill: none; stroke: var(--muted-foreground); stroke-width: 1.5; }
.aresta--filho { stroke-dasharray: 4 4; }
.seta { fill: var(--muted-foreground); }
.aresta-rotulo { font-family: var(--font-sans); font-size: 10px; fill: var(--muted-foreground); }

/* Rótulos de estado: pílula 21px com palavra (§10) */
.selo {
  display: inline-flex; align-items: center; height: var(--sp-5); padding-inline: var(--sp-2);
  border: 1px solid var(--border); border-radius: var(--radius-full); background: var(--surface-2);
  font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--foreground); white-space: nowrap;
}
.selo--leitura { background: var(--info-soft); border-color: var(--info-border); }
.selo--escrita { background: var(--warning-soft); border-color: var(--warning-border); color: var(--foreground); }
.selo--neutro { background: var(--surface-2); border-color: var(--border); }
.selo--mono { font-family: var(--font-mono); }

/* Barra de busca e filtros */
.barra { display: grid; gap: var(--sp-3); align-items: end; }
.barra--secundaria { margin-top: var(--sp-3); }
.campo { display: grid; gap: var(--sp-1); }
.campo__rotulo { font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--muted-foreground); }
.campo__entrada {
  min-height: var(--size-control-lg); padding-inline: var(--sp-3); width: 100%; max-width: var(--container-lg);
  background: var(--surface-1); color: var(--foreground); border: 1px solid var(--input); border-radius: var(--radius-sm); font: inherit; font-size: var(--fs-sm);
}
.campo__entrada::placeholder { color: var(--muted-foreground); }
.filtros { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.filtro {
  min-height: var(--size-control-sm); padding-inline: var(--sp-3); border: 1px solid var(--border); border-radius: var(--radius-full);
  background: var(--surface-1); color: var(--foreground); font: inherit; font-size: var(--fs-xs); font-weight: var(--fw-medium); cursor: pointer;
  transition: background var(--dur-default) var(--ease-default);
}
.filtro:hover { background: var(--surface-3); }
.filtro[aria-pressed="true"] { background: var(--accent); border-color: var(--primary); color: var(--accent-foreground); }
.contagem { font-size: var(--fs-sm); color: var(--muted-foreground); }

/* Cartões de skill */
.grade--skills { margin-top: var(--sp-5); }
.skill {
  display: flex; flex-direction: column; gap: var(--sp-3); width: 100%; height: 100%; text-align: left;
  background: var(--surface-1); color: var(--foreground); border: 1px solid var(--border); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm); padding: var(--sp-4); font: inherit; cursor: pointer;
  transition: box-shadow var(--dur-default) var(--ease-default), background var(--dur-default) var(--ease-default);
}
.skill:hover { box-shadow: var(--shadow-md); }
.skill__topo { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-2); }
.skill__nome { font-family: var(--font-mono); font-size: var(--fs-sm); font-weight: var(--fw-semibold); overflow-wrap: anywhere; }
.skill__versao { font-size: var(--fs-xs); color: var(--muted-foreground); }
.skill__resumo { font-size: var(--fs-sm); line-height: var(--lh-normal); color: var(--muted-foreground); flex: 1; }
.skill__mais { font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--foreground); }
.vazio {
  margin-top: var(--sp-5); padding: var(--sp-8); text-align: center; display: grid; gap: var(--sp-3); justify-items: center;
  background: var(--surface-2); border: 1px dashed var(--border); border-radius: var(--radius-xl);
}
.vazio p { color: var(--muted-foreground); font-size: var(--fs-sm); }

/* Modal (§9.6, derivado: o DS não mediu overlay) */
.modal {
  padding: 0; border: 1px solid var(--border); border-radius: var(--radius-2xl);
  background: var(--popover); color: var(--popover-foreground); box-shadow: var(--shadow-lg);
  width: min(var(--container-3xl), calc(100% - var(--sp-8))); max-height: calc(100dvh - var(--sp-8));
  overflow: hidden;
}
.modal[open] { display: flex; flex-direction: column; }
.modal::backdrop { background: color-mix(in srgb, var(--foreground) 50%, transparent); backdrop-filter: blur(var(--blur-sm)); }
.modal__corpo { display: flex; flex-direction: column; min-height: 0; }
.modal__cabeca { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-4); padding: var(--sp-5) var(--sp-5) var(--sp-4); border-bottom: 1px solid var(--border); }
.modal__nome { font-family: var(--font-mono); font-size: var(--fs-xl); font-weight: var(--fw-semibold); overflow-wrap: anywhere; }
.modal__resumo { font-size: var(--fs-sm); color: var(--muted-foreground); margin-top: var(--sp-1); line-height: var(--lh-normal); }
.modal__rolagem { overflow-y: auto; padding: var(--sp-5); display: grid; gap: var(--sp-5); align-content: start; overscroll-behavior: contain; }
.modal__bloco h3 { font-size: var(--fs-xs); font-weight: var(--fw-semibold); text-transform: uppercase; letter-spacing: var(--tracking-wider); color: var(--muted-foreground); margin-bottom: var(--sp-2); }
.modal__bloco p, .modal__bloco li { font-size: var(--fs-sm); line-height: var(--lh-relaxed); }
.modal__bloco ul { display: grid; gap: var(--sp-1); padding-left: var(--sp-5); list-style: disc; }
.modal__aviso { background: var(--warning-soft); border: 1px solid var(--warning-border); border-radius: var(--radius-md); padding: var(--sp-3) var(--sp-4); font-size: var(--fs-sm); line-height: var(--lh-normal); }
.modal__rodape { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--sp-3); padding: var(--sp-4) var(--sp-5); border-top: 1px solid var(--border); }
.modal__comando { display: flex; gap: var(--sp-2); align-items: stretch; }
.modal__comando pre { flex: 1; min-width: 0; margin: 0; }

.rodape { border-top: 1px solid var(--border); padding-block: var(--sp-8); font-size: var(--fs-sm); color: var(--muted-foreground); }
.rodape__interno { display: grid; gap: var(--sp-2); }
.rodape__nota { font-size: var(--fs-xs); }

@media (min-width: 40rem) {
  .wrap { padding-inline: var(--sp-6); }
  .titulo-pagina { font-size: var(--fs-5xl); }
  .numeros { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grade--2, .grade--skills { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plugin__fatos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .barra { grid-template-columns: 1fr; }
  .barra--secundaria { grid-template-columns: 1fr auto; align-items: center; }
}
@media (min-width: 48rem) {
  .topo__nav { display: flex; }
  .grade--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .painel-plugin { padding: var(--sp-6); }
}
@media (min-width: 64rem) {
  .hero { padding-block: var(--sp-16) var(--sp-10); }
  .titulo-secao { font-size: var(--fs-4xl); }
  .grade--skills { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .secao { padding-block: var(--sp-16); }
}

/* Diagrama rola na horizontal em tela estreita, em vez de encolher o texto */
.fluxo { overflow-x: auto; }
.fluxo__quadro svg { min-width: 36rem; max-width: 40rem; margin-inline: auto; }

.fluxo__dica { display: none; font-size: var(--fs-xs); color: var(--muted-foreground); margin-top: var(--sp-2); }
@media (max-width: 47.99rem) { .fluxo__dica { display: block; } }

/* Plugin no diagrama macro: preenchimento cinza, traço cheio */
.no--plugin { fill: var(--surface-3); stroke: var(--foreground); stroke-width: 2; }
.pacote { fill: var(--foreground); }
.fluxo--macro { margin-top: var(--sp-8); }

/* ---------- Movimento ----------
 * Extensão do DS para landing: o §17 mede só o app e proíbe animar entrada de card (§17.3).
 * Aqui a entrada é permitida por ser página de apresentação, mas só com opacity e transform (§17.4)
 * e sempre desligável por prefers-reduced-motion. Easing e duração tomados da referência (antigravity.google). */
:root {
  --mov-ease: cubic-bezier(0.165, 0.84, 0.44, 1);
  --mov-dur: 700ms;
  --mov-passo: 80ms;
  --i: 0; /* índice do elemento na sequência, definido por elemento em motion.js e flows.js */
}

.progresso {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: var(--z-50);
  background: var(--foreground); transform: scaleX(0); transform-origin: left; pointer-events: none;
}

/* Título: sobe palavra por palavra por trás de uma máscara */
.palavra { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.12em; margin-bottom: -0.12em; }
.palavra > span { display: inline-block; }
.movimento .palavra > span { animation: palavra-sobe var(--mov-dur) var(--mov-ease) both; animation-delay: calc(120ms + var(--i) * 70ms); }
@keyframes palavra-sobe { from { transform: translateY(105%); opacity: 0; } to { transform: none; opacity: 1; } }

/* Revelação ao rolar */
.rev { opacity: 0; transform: translateY(var(--sp-5)); }
.rev.visivel { animation: assenta var(--mov-dur) var(--mov-ease) both; animation-delay: calc(var(--i, 0) * var(--mov-passo)); }
@keyframes assenta { from { opacity: 0; transform: translateY(var(--sp-5)); } to { opacity: 1; transform: none; } }
#skills-lista.rev { opacity: 1; transform: none; }
#skills-lista.rev.visivel { animation: none; }
#skills-lista.visivel > li { animation: assenta var(--mov-dur) var(--mov-ease) both; }
#skills-lista.visivel > li:nth-child(3n+2) { animation-delay: var(--mov-passo); }
#skills-lista.visivel > li:nth-child(3n) { animation-delay: calc(var(--mov-passo) * 2); }
#skills-lista.visivel.estavel > li { animation: none; }

/* Diagramas: nós sobem, setas surgem na sequência */
svg .anim { opacity: 0; }
svg.tocar .anim-no { animation: no-entra 600ms var(--mov-ease) both; animation-delay: calc(var(--i) * 90ms); transform-box: fill-box; transform-origin: center; }
svg.tocar .anim-aresta { animation: aresta-entra 500ms var(--mov-ease) both; animation-delay: calc(var(--i) * 90ms + 120ms); }
@keyframes no-entra { from { opacity: 0; transform: translateY(8px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes aresta-entra { from { opacity: 0; } to { opacity: 1; } }
svg.pronto .anim { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .rev { opacity: 1; transform: none; }
}

.titulo-pagina, .titulo-secao, .subtitulo { text-wrap: balance; }

/* Como adicionar o plugin */
.adicionar { display: grid; gap: var(--sp-3); padding: var(--sp-5); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.adicionar__titulo { font-size: var(--fs-xl); font-weight: var(--fw-semibold); line-height: var(--lh-tight); }
#via-alvo { display: grid; gap: var(--sp-3); }
.comando { display: flex; gap: var(--sp-2); align-items: stretch; flex-wrap: wrap; }
.comando .codigo { flex: 1; min-width: 0; margin: 0; white-space: pre; font-size: var(--fs-sm); }
.adicionar__notas { display: grid; gap: var(--sp-1); padding-left: var(--sp-5); list-style: disc; font-size: var(--fs-sm); line-height: var(--lh-relaxed); }
.adicionar__aviso { font-size: var(--fs-sm); color: var(--muted-foreground); }
.modal__nota { font-size: var(--fs-xs); color: var(--muted-foreground); margin-top: var(--sp-2); }
