@font-face {
  font-family: 'Bricolage Grotesque';
  src: url('/assets/fonts/bricolage-grotesque-latin.woff2') format('woff2');
  font-weight: 400 800;
  font-stretch: 75% 100%;
  font-display: swap;
}

/* Mesmos tons do client (client/src/index.css), para a home e o app
   parecerem a mesma coisa. */
:root {
  --bg: #f4f3ec;
  --bg-alt: #ebeaf0;
  --surface: #ffffff;
  --border: #dddbe2;
  --text: #4b4553;
  --text-h: #08060d;
  --muted: #6b6375;
  --accent: #8a22e0;
  --accent-fill: #aa3bff;
  --on-accent: #ffffff;
  --code-bg: #16171d;
  --code-text: #e7e5ee;
  --mock-bg: #16171d;
  --shadow: 0 24px 60px -24px rgb(30 10 60 / 0.35);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101014;
    --bg-alt: #16171d;
    --surface: #1c1d24;
    --border: #2e303a;
    --text: #b4b8c2;
    --text-h: #f3f4f6;
    --muted: #8b909c;
    --accent: #c084fc;
    --accent-fill: #aa3bff;
    --code-bg: #0b0b0e;
    --mock-bg: #1c1d24;
    --shadow: 0 24px 60px -24px rgb(0 0 0 / 0.7);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .marca span {
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  color: var(--text-h);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

h1 { font-size: clamp(2.5rem, 6vw, 4.25rem); font-weight: 800; margin: 0 0 20px; }
h2 { font-size: clamp(1.9rem, 4vw, 2.6rem); font-weight: 700; margin: 0 0 12px; }
h3 { font-size: 1.2rem; font-weight: 700; margin: 0 0 8px; }
p { margin: 0 0 16px; }
a { color: var(--accent); }
a:hover { color: var(--text-h); }
code {
  overflow-wrap: anywhere;
  font: 0.88em ui-monospace, 'Cascadia Code', Consolas, monospace;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 6px;
}
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; z-index: 10; background: var(--surface); padding: 8px 12px; }

/* Topo */
.topo {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topo-inner { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.topo nav { display: flex; gap: 22px; margin-left: auto; }
.topo nav a { color: var(--text); text-decoration: none; font-size: 0.95rem; }
.topo nav a:hover { color: var(--text-h); }

.marca { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.marca span { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.03em; }

/* Botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 22px;
  border-radius: 12px; border: 2px solid var(--accent-fill);
  background: var(--accent-fill); color: var(--on-accent);
  font-weight: 600; text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn:hover { color: var(--on-accent); transform: translateY(-1px); background: #9526f0; }
.btn-ghost { background: transparent; color: var(--text-h); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface); color: var(--text-h); }
.btn-sm { min-height: 44px; padding: 0 16px; }
.acoes { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* Hero */
.hero { position: relative; overflow: hidden; padding: 72px 0 88px; isolation: isolate; }

/* Rede de servidores trocando pacotes, atrás do hero. Esmaece no centro
   para não brigar com o texto. */
.rede {
  position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1;
  color: var(--accent-fill);
  -webkit-mask-image: radial-gradient(ellipse 60% 70% at 38% 45%, transparent 20%, #000 75%);
  mask-image: radial-gradient(ellipse 60% 70% at 38% 45%, transparent 20%, #000 75%);
}
.rede-linhas path { stroke: currentColor; stroke-width: 1; opacity: 0.22; fill: none; }
.rede-nos circle { fill: var(--bg); stroke: currentColor; stroke-width: 1.5; opacity: 0.7; }
.rede-pacotes circle { fill: currentColor; filter: drop-shadow(0 0 4px currentColor); }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.selo {
  display: inline-block; margin-bottom: 20px; padding: 4px 12px;
  border: 1px solid var(--border); border-radius: 999px;
  font-size: 0.85rem; color: var(--muted); background: var(--surface);
}
.lead { font-size: 1.2rem; color: var(--text); }

/* Mock do app: só ilustração, sem interação (aria-hidden). */
.app-mock {
  display: grid; grid-template-columns: 56px 170px 1fr;
  height: 380px; border-radius: 16px; overflow: hidden;
  background: var(--mock-bg); border: 1px solid #2e303a;
  box-shadow: var(--shadow);
  font-size: 0.82rem; color: #b4b8c2;
}
.app-mock p { margin: 0; }
.mock-rail { background: #101014; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 12px 0; }
.mock-srv {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  background: #26272f; color: #f3f4f6; font-weight: 700; font-size: 0.8rem;
}
.mock-srv.ativo { background: #aa3bff; border-radius: 12px; font-family: 'Bricolage Grotesque', sans-serif; font-size: 1rem; }
.mock-srv.add { color: #3ba55c; }
.mock-canais { background: #16171d; padding: 12px 10px; display: flex; flex-direction: column; gap: 4px; }
.mock-nome-srv { color: #f3f4f6; font-weight: 700; padding: 0 6px 10px; border-bottom: 1px solid #2e303a; margin-bottom: 6px !important; }
.mock-cat { text-transform: uppercase; font-size: 0.68rem; letter-spacing: 0.06em; color: #80848e; padding: 8px 6px 2px; }
.mock-canal { padding: 4px 8px; border-radius: 6px; display: flex; align-items: center; gap: 6px; }
.mock-canal.ativo { background: #26272f; color: #f3f4f6; }
.ico { width: 14px; height: 14px; flex: none; }
.mock-chat { background: #1c1d24; display: flex; flex-direction: column; gap: 14px; padding: 12px 16px; min-width: 0; }
.mock-topo { color: #f3f4f6; font-weight: 700; padding-bottom: 10px; border-bottom: 1px solid #2e303a; }
.mock-msg { display: flex; gap: 10px; }
.mock-msg b { color: #f3f4f6; font-weight: 600; }
.av {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 700; color: #fff; background: var(--c);
}
.mock-canal.voz { margin-bottom: 0; }
.mock-falantes { display: flex; gap: 6px; padding: 2px 8px 4px 28px; }
.av.mini { width: 20px; height: 20px; font-size: 0.6rem; }
.av.falando { box-shadow: 0 0 0 2px #1c1d24, 0 0 0 4px #3ba55c; animation: falando 1.4s ease-in-out infinite; }
@keyframes falando {
  0%, 100% { box-shadow: 0 0 0 2px #16171d, 0 0 0 3px #3ba55c; }
  50% { box-shadow: 0 0 0 2px #16171d, 0 0 0 5px rgb(59 165 92 / 0.55); }
}
.mock-msg.entrando { animation: entra 0.35s ease-out; }
.mock-msg.saindo { animation: sai 0.28s ease-in forwards; }
@keyframes entra { from { opacity: 0; transform: translateY(8px); } }
@keyframes sai { to { opacity: 0; transform: translateY(-8px); } }
.mock-digitando {
  margin-top: auto !important; height: 18px; font-size: 0.75rem; color: #80848e;
  display: flex; align-items: center; gap: 4px;
  opacity: 0; transition: opacity 0.2s;
}
.mock-digitando.ativo { opacity: 1; }
.mock-digitando b { color: #b4b8c2; font-weight: 600; }
.pontos { display: inline-flex; gap: 3px; margin-right: 2px; }
.pontos i { width: 5px; height: 5px; border-radius: 50%; background: #b4b8c2; animation: pula 1.1s infinite; }
.pontos i:nth-child(2) { animation-delay: 0.15s; }
.pontos i:nth-child(3) { animation-delay: 0.3s; }
@keyframes pula { 0%, 60%, 100% { transform: translateY(0); opacity: 0.5; } 30% { transform: translateY(-3px); opacity: 1; } }
.mock-input { background: #26272f; border-radius: 8px; padding: 9px 12px; color: #80848e; }

/* Seções */
.secao { padding: 88px 0; }
.secao-alt { background: var(--bg-alt); border-block: 1px solid var(--border); }
.sub { color: var(--muted); font-size: 1.1rem; margin-bottom: 36px; }

.grade { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 24px;
}
.card p { margin: 0; }

/* Arquitetura */
.arq { display: grid; grid-template-columns: 1fr 72px 1fr 72px 1fr; align-items: center; gap: 8px; }
.arq-no { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 20px; }
.arq-no p:last-child { margin-bottom: 0; }
.arq-no.central { border-color: var(--accent-fill); }
.arq-no.mini { padding: 14px 18px; }
.arq-no.mini h3 { margin: 0; font-size: 1.05rem; }
.arq-nos { display: flex; flex-direction: column; gap: 10px; }
.arq-tag { font: 0.78rem ui-monospace, Consolas, monospace; color: var(--accent); margin-bottom: 6px !important; }
.arq-seta { height: 2px; background: var(--border); position: relative; }
.arq-seta::after {
  content: ''; position: absolute; right: -2px; top: -5px;
  border: 6px solid transparent; border-left-color: var(--border); border-right: 0;
}
.pacote {
  position: absolute; top: -3px; left: 0; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-fill); box-shadow: 0 0 10px var(--accent-fill);
  animation: corre 1.8s linear infinite;
}
.pacote.p2 { animation-delay: 0.9s; animation-direction: reverse; background: var(--accent); }
@keyframes corre { from { left: -4px; opacity: 0; } 15%, 85% { opacity: 1; } to { left: calc(100% - 4px); opacity: 0; } }
@keyframes corre-v { from { top: -4px; opacity: 0; } 15%, 85% { opacity: 1; } to { top: calc(100% - 4px); opacity: 0; } }
.arq-no.central { animation: brilho 3.6s ease-in-out infinite; }
@keyframes brilho {
  0%, 100% { box-shadow: 0 0 0 0 transparent; }
  50% { box-shadow: 0 0 28px -6px var(--accent-fill); }
}

/* Revelar ao rolar: só com JS (classe .js no <html>), senão fica visível. */
.js .revelar { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease var(--atraso, 0ms), transform 0.6s ease var(--atraso, 0ms); }
.js .revelar.visivel { opacity: 1; transform: none; }
.nota { margin-top: 32px; max-width: 760px; }

/* Hospedar */
.duas-col { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.terminal { background: var(--code-bg); border: 1px solid #2e303a; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.terminal-barra { display: flex; gap: 6px; padding: 12px 14px; border-bottom: 1px solid #2e303a; }
.terminal-barra span { width: 11px; height: 11px; border-radius: 50%; background: #3a3c48; }
.terminal pre { margin: 0; padding: 20px 22px; overflow-x: auto; }
.terminal code { background: none; border: 0; padding: 0; color: var(--code-text); font-size: 0.92rem; line-height: 1.7; }
.terminal .c { color: #8b909c; }
.terminal .p { color: #c084fc; user-select: none; }
.terminal .ok { color: #3ba55c; }
.cursor { display: inline-block; width: 0.55em; height: 1.1em; vertical-align: text-bottom; background: #c084fc; animation: pisca 1s steps(1) infinite; }
@keyframes pisca { 50% { opacity: 0; } }
.link-seta { font-weight: 600; text-decoration: none; }
.link-seta::after { content: ' →'; }

/* Nome */
.nome { grid-template-columns: 300px 1fr; }
.nome-marca { display: grid; place-items: center; }
.nome-marca img { width: 100%; max-width: 240px; height: auto; }

.status p { max-width: 760px; }

/* Histórico de versões */
.versoes-atuais { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; }
.versao-atual {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 6px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 0.9rem;
}
.versao-atual b { font: 600 0.85rem ui-monospace, Consolas, monospace; color: var(--text-h); }
.comp {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 0.75rem; font-weight: 600; color: #fff; background: var(--c, #6b6375);
  white-space: nowrap;
}
.comp-client { --c: #8a22e0; }
.comp-central { --c: #1864ab; }
.comp-channel { --c: #2b8a3e; }
.comp-channel-image { --c: #0b7285; }
.comp-site { --c: #c2410c; }

.filtros { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.filtro {
  min-height: 44px; padding: 0 16px; border-radius: 10px;
  border: 1px solid var(--border); background: transparent; color: var(--text);
  font: inherit; font-size: 0.92rem; cursor: pointer;
}
.filtro:hover { color: var(--text-h); background: var(--surface); }
.filtro[aria-pressed="true"] { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--on-accent); }

.linha-tempo { list-style: none; margin: 0; padding: 0 0 0 28px; position: relative; max-width: 820px; }
.linha-tempo::before { content: ''; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--border); }
.versao { position: relative; padding-bottom: 28px; }
.versao::before {
  content: ''; position: absolute; left: -27px; top: 6px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg-alt); border: 2px solid var(--accent-fill);
}
.versao:first-child::before { background: var(--accent-fill); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-fill) 25%, transparent); }
.versao-topo { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 8px; }
.versao-num { font: 700 1.05rem ui-monospace, Consolas, monospace; color: var(--text-h); }
.versao time { color: var(--muted); font-size: 0.9rem; }
.versao ul { margin: 0; padding-left: 20px; }
.versao ul li { margin-bottom: 4px; }
.versoes-aviso { color: var(--muted); }
.versoes-mais { margin: 4px 0 0 28px; }

/* Rodapé */
.rodape { border-top: 1px solid var(--border); padding: 40px 0; }
.rodape-inner { display: grid; grid-template-columns: auto 1fr auto; gap: 32px; align-items: center; }
.rodape .marca span { font-size: 1.3rem; }
.ovo { margin: 0; font-size: 0.85rem; color: var(--muted); max-width: 520px; }
.rodape-links { display: flex; gap: 20px; margin: 0; }
.rodape-links a { color: var(--text); text-decoration: none; }
.rodape-links a:hover { color: var(--text-h); }

@media (max-width: 960px) {
  .hero-grid, .duas-col, .nome { grid-template-columns: 1fr; }
  .grade { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .arq { grid-template-columns: 1fr; }
  .arq-seta { width: 2px; height: 48px; margin-inline: auto; }
  .arq-seta::after { right: -5px; top: auto; bottom: -2px; border: 6px solid transparent; border-top-color: var(--border); border-bottom: 0; }
  .pacote { left: -3px; top: 0; animation-name: corre-v; }
  .rodape-inner { grid-template-columns: 1fr; gap: 16px; }
  .topo nav { gap: 16px; }
}

@media (max-width: 640px) {
  .topo nav { display: none; }
  .topo .btn-sm { margin-left: auto; }
  .hero { padding: 48px 0 64px; }
  .grade { grid-template-columns: 1fr; }
  .app-mock { grid-template-columns: 48px 1fr; height: 340px; }
  .mock-canais { display: none; }
  .secao { padding: 64px 0; }
  .nome-marca img { max-width: 160px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
  *, *::before, *::after { animation: none !important; }
  .pacote, .rede-pacotes { display: none; }
  .js .revelar { opacity: 1; transform: none; transition: none; }
}
