/*
 * Sentinel Agent — página pública (agent.sentinel.gowo.com.br)
 * Paleta fixa (ADR 0016, marca 3A): #08111F #0F1E35 #2563EB #17D4F2 — os quatro tokens
 * abaixo. Qualquer OUTRO literal de cor nesta folha vem com comentário explicando o
 * porquê (o Jenkinsfile desta branch falha o build num literal sem justificativa).
 */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/inter-400.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/inter-500.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/inter-600.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/inter-700.woff2") format("woff2");
}

:root {
  /* ADR 0016 — marca 3A, os quatro valores oficiais */
  --bg: #08111F;
  --surface: #0F1E35;
  --primary: #2563EB;
  --accent: #17D4F2;

  /* Derivados por opacidade dos quatro tokens acima — não são cores novas. */
  --surface-2: color-mix(in srgb, var(--surface) 70%, var(--bg));
  --border: color-mix(in srgb, var(--accent) 18%, transparent);
  --border-strong: color-mix(in srgb, var(--accent) 32%, transparent);
  --text: #F4F7FC; /* branco levemente frio, para casar com o fundo azul-marinho */
  --text-dim: color-mix(in srgb, var(--text) 62%, var(--bg));
  /* 50%, não 40% — medido: 40% cai a ~3.6:1 sobre --bg/--surface, abaixo do AA (4.5:1)
     para texto normal; 50% mede ~4.8-5:1 nos dois fundos onde este token é usado. */
  --text-dimmer: color-mix(in srgb, var(--text) 50%, var(--bg));
  --shadow: 0 20px 60px -20px color-mix(in srgb, var(--bg) 80%, black);

  --font-sans: "Inter", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;

  --wrap: 1180px;
  --space-section: clamp(56px, 9vw, 120px);

  color-scheme: dark;
}

* { box-sizing: border-box; }

/* AGT-29 (#72): guarda global — sem isto, qualquer regra de autor com `display` (classe ou
   atributo, especificidade >= a do [hidden] da folha do navegador) vence o `[hidden]` e o
   elemento aparece renderizado mesmo com o atributo certo. Era o caso de
   `.version__state[data-state="loading"]` e `.version__signed`: o JS estava correto
   (hidden=true), o CSS que ignorava. `!important` aqui é a exceção deliberada — é a MESMA
   garantia que o próprio atributo `hidden` promete, e vale para todo elemento alternado por
   `hidden` a partir de agora, não só os dois que este defeito expôs. */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, p, dl, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
svg { width: 22px; height: 22px; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -60px; left: 12px;
  z-index: 1000;
  background: var(--primary);
  color: var(--text);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  transition: top .2s ease;
}
.skip-link:focus { top: 12px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 20px;
}

/* ---------- Botões ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease, opacity .15s ease;
  white-space: nowrap;
}
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } }
.btn--primary { background: var(--primary); color: var(--text); }
.btn--primary:hover { background: color-mix(in srgb, var(--primary) 88%, white); transform: translateY(-1px); }
.btn--secondary { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn--secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn--ghost { background: color-mix(in srgb, var(--accent) 10%, transparent); border-color: var(--border-strong); font-size: 14px; padding: 9px 16px; }
.btn--ghost:hover { border-color: var(--accent); }
.btn--tiny { padding: 7px 12px; font-size: 13px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); }
.btn--tiny:hover { border-color: var(--accent); }
.btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.section-title {
  font-size: clamp(26px, 3.4vw, 36px);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: clamp(28px, 4vw, 44px);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 72px;
}
.site-header__brand img { height: 28px; width: auto; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 14.5px;
  font-weight: 500;
}
.site-nav a:not(.btn) {
  text-decoration: none;
  color: var(--text-dim);
  transition: color .15s ease;
}
.site-nav a:not(.btn):hover { color: var(--text); }

.menu-toggle {
  display: none;
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
}
.menu-toggle__bar,
.menu-toggle__bar::before,
.menu-toggle__bar::after {
  content: "";
  display: block;
  width: 20px; height: 2px;
  background: var(--text);
  position: relative;
  transition: transform .2s ease;
}
.menu-toggle__bar::before { position: absolute; top: -6px; }
.menu-toggle__bar::after { position: absolute; top: 6px; }

@media (max-width: 860px) {
  .menu-toggle { display: inline-flex; }
  .site-nav {
    position: absolute;
    top: 72px; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    max-height: 0;
    overflow: hidden;
    transition: max-height .25s ease;
  }
  @media (prefers-reduced-motion: reduce) { .site-nav { transition: none; } }
  .site-nav.is-open { max-height: 420px; }
  .site-nav a { padding: 14px 20px; border-top: 1px solid var(--border); }
  .site-nav .btn { margin: 14px 20px; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-block: clamp(64px, 10vw, 128px) clamp(56px, 8vw, 96px);
  overflow: hidden;
}
.hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero__media img { width: 100%; height: 100%; object-fit: cover; }
.hero__scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, var(--bg) 5%, color-mix(in srgb, var(--bg) 35%, transparent) 55%, color-mix(in srgb, var(--bg) 78%, transparent) 100%),
    linear-gradient(180deg, color-mix(in srgb, var(--bg) 55%, transparent) 0%, var(--bg) 100%);
}
.hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.75fr);
  gap: clamp(32px, 6vw, 72px);
  align-items: center;
}
.eyebrow {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--accent);
  margin-bottom: 16px;
}
.hero__copy h1 {
  font-size: clamp(32px, 4.6vw, 52px);
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-bottom: 20px;
}
.hero__lead {
  font-size: 17px;
  color: var(--text-dim);
  max-width: 52ch;
  margin-bottom: 30px;
}
.hero__ctas { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 20px; }
.hero__compat { font-size: 13.5px; color: var(--text-dimmer); }

.hero__diagram { display: flex; align-items: center; justify-content: center; }

/* ---------- Diagrama de fluxo (hero compacto + seção "Como funciona") ---------- */
.flow {
  display: flex;
  align-items: center;
  gap: 6px;
}
.flow--compact { flex-direction: column; gap: 18px; }
.flow--full { flex-direction: row; justify-content: space-between; }

.flow__node {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 18px;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  border: 1px solid var(--border);
  min-width: 150px;
}
.flow--compact .flow__node { flex-direction: row; min-width: 0; padding: 12px 16px; }
.flow__node--accent { border-color: var(--border-strong); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent) inset; }
.flow__dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}
.flow__label { font-size: 14px; font-weight: 600; }
.flow__desc { font-size: 13.5px; color: var(--text-dim); max-width: 22ch; }

.flow__line {
  flex: 1;
  height: 2px;
  min-width: 24px;
  background: linear-gradient(90deg, var(--border-strong), var(--accent), var(--border-strong));
  position: relative;
}
.flow--compact .flow__line { width: 2px; height: 26px; min-width: 0; flex: none; margin-inline: 21px; background: linear-gradient(180deg, var(--border-strong), var(--accent), var(--border-strong)); }
.flow__pulse {
  position: absolute;
  top: -3px; left: -4px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px 2px color-mix(in srgb, var(--accent) 70%, transparent);
  animation: flow-pulse 2.6s ease-in-out infinite;
}
.flow--compact .flow__pulse { top: -3px; left: -3px; animation-name: flow-pulse-v; }
@keyframes flow-pulse { 0% { left: -4px; opacity: 0; } 12% { opacity: 1; } 88% { opacity: 1; } 100% { left: calc(100% - 4px); opacity: 0; } }
@keyframes flow-pulse-v { 0% { top: -3px; opacity: 0; } 12% { opacity: 1; } 88% { opacity: 1; } 100% { top: calc(100% - 5px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .flow__pulse { animation: none; opacity: .9; left: 50%; }
  .flow--compact .flow__pulse { top: 50%; }
}

@media (max-width: 980px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__diagram { justify-content: flex-start; }
}
@media (max-width: 720px) {
  .flow--full { flex-direction: column; }
  .flow--full .flow__line { width: 2px; height: 26px; min-width: 0; flex: none; background: linear-gradient(180deg, var(--border-strong), var(--accent), var(--border-strong)); }
  .flow--full .flow__line .flow__pulse { animation-name: flow-pulse-v; top: -3px; left: -3px; }
}

/* ---------- Cards / features ---------- */
.features { padding-block: var(--space-section); }
.features__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
@media (max-width: 980px) { .features__grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .features__grid { grid-template-columns: 1fr; } }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
}
.card__icon {
  display: inline-flex;
  width: 42px; height: 42px;
  align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--primary) 22%, transparent);
  color: var(--accent);
  margin-bottom: 16px;
}
.card h3 { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.card p { font-size: 14.5px; color: var(--text-dim); }

/* ---------- Versão ---------- */
.version { padding-block: var(--space-section); background: var(--surface); }

/* Produção primeiro, em toda a largura (issue #69, §9) — uma coluna por padrão, e a
   coluna de Produção ganha mais peso visual (--version-card--primary), não mais espaço
   de grid: as duas colunas continuam de largura igual quando lado a lado no desktop. */
.version__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; align-items: start; }
@media (max-width: 780px) { .version__grid { grid-template-columns: 1fr; } }

.version__card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow);
  transition: box-shadow .4s ease, border-color .4s ease;
}
@media (prefers-reduced-motion: reduce) { .version__card { transition: none; } }

.version__card--primary { border-color: var(--border-strong); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 20%, transparent), var(--shadow); }

/* Destaque breve ao chegar pelo CTA do hero (issue #69, §22) — instantâneo sob
   prefers-reduced-motion, sem transição. */
.version__card--flash { box-shadow: 0 0 0 2px var(--accent), var(--shadow); }

.version__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.version__channel { font-size: 15px; font-weight: 700; }
.version__card--primary .version__channel { font-size: 17px; }

.version__badge {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.version__badge--primary { background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--accent); }
.version__badge--secondary { background: color-mix(in srgb, var(--text) 12%, transparent); color: var(--text-dim); }

.version__caption { font-size: 13.5px; color: var(--text-dim); margin-bottom: 18px; max-width: 46ch; }

.version__body { min-height: 64px; }
.version__state:not([hidden]) { display: block; }

.version__state[data-state="loading"] { display: flex; align-items: center; gap: 12px; padding-block: 8px; color: var(--text-dim); font-size: 14px; }
.spinner {
  width: 18px; height: 18px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--accent) 25%, transparent);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; border-top-color: color-mix(in srgb, var(--accent) 25%, transparent); border-right-color: var(--accent); }
}

.version__state-heading { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.version__state[data-state="absent"] .version__state-heading { font-weight: 600; font-size: 15px; color: var(--text-dim); }
.version__state-text { font-size: 13.5px; color: var(--text-dim); margin-bottom: 14px; max-width: 42ch; }

.version__number { font-size: 30px; font-weight: 700; margin-bottom: 6px; }
.version__card--primary .version__number { font-size: 34px; color: var(--accent); }

.version__signed {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 12px;
}
.version__signed svg { width: 16px; height: 16px; }
.version__meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 16px 0;
  padding-block: 16px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.version__meta dt { font-size: 12px; color: var(--text-dimmer); margin-bottom: 4px; }
.version__meta dd { margin: 0; font-size: 13.5px; }
.version__sha {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}
.version__sha code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.version__release-notes { margin-top: 14px; font-size: 13px; }
.version__release-notes a { color: var(--accent); text-decoration: none; }
.version__release-notes a:hover { text-decoration: underline; }
.version__note { margin-top: 22px; font-size: 13px; color: var(--text-dimmer); }

/* ---------- Como funciona ---------- */
.flow-section { padding-block: var(--space-section); }

/* ---------- Instalação ---------- */
.install { padding-block: var(--space-section); background: var(--surface); }
.tabs__list {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 26px;
  overflow-x: auto;
}
.tabs__list button {
  padding: 12px 18px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-dim);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.tabs__list button[aria-selected="true"] { color: var(--text); border-color: var(--accent); }
.tabs__panel.is-hidden { display: none; }
.steps { display: grid; gap: 12px; counter-reset: step; max-width: 60ch; }
.steps li {
  counter-increment: step;
  padding-left: 34px;
  position: relative;
  font-size: 15px;
  color: var(--text-dim);
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: 0;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--primary) 30%, transparent);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.terminal {
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 20px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13.5px;
  color: var(--text-dim);
}
.terminal__placeholder a { color: var(--accent); }

/* ---------- Segurança ---------- */
.security { padding-block: var(--space-section); }
.security__list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 860px) { .security__list { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .security__list { grid-template-columns: 1fr; } }
.security__list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14.5px;
  font-weight: 500;
}
.security__icon { color: var(--accent); flex-shrink: 0; display: inline-flex; }
.security__icon svg { width: 20px; height: 20px; }

/* ---------- Documentação ---------- */
.docs { padding-block: var(--space-section); background: var(--surface); }
.docs__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}
@media (max-width: 780px) { .docs__grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .docs__grid { grid-template-columns: 1fr; } }
.docs__grid a {
  display: block;
  padding: 16px 18px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color .15s ease, color .15s ease;
}
.docs__grid a:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Footer ---------- */
.site-footer { padding-block: 56px; border-top: 1px solid var(--border); }
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
}
.site-footer__brand img { height: 40px; width: auto; margin-bottom: 12px; }
.site-footer__brand p { font-size: 13.5px; color: var(--text-dimmer); }
.site-footer__links { display: flex; flex-wrap: wrap; gap: 22px; font-size: 14px; }
.site-footer__links a { text-decoration: none; color: var(--text-dim); }
.site-footer__links a:hover { color: var(--text); }
.site-footer__copy { width: 100%; margin-top: 36px; font-size: 12.5px; color: var(--text-dimmer); }

/* ---------- Reveal-on-scroll (discreto, respeita prefers-reduced-motion) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .5s ease, transform .5s ease;
}
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}
