/*
 * OnAir Gestão: site institucional, identidade "Tally".
 * Valores dos tokens = frontend/src/index.css (fonte da verdade). Contrastes WCAG 2.2 calculados.
 * Regras da linguagem: papel e grafite; fios em vez de cartões; Sinal só em ação primária, link e foco;
 * Tally só para "agora" (no máximo uma marca por tela); Mono só em dado contado (horário, número);
 * raio <= 8 px; sem sombra decorativa; sem gradiente.
 */

/* ---------- Fontes (auto-hospedadas, OFL 1.1: ver assets/fonts/LICENSE-*.txt) ---------- */
@font-face { font-family: 'Atkinson Hyperlegible Next'; font-style: normal; font-weight: 400; font-display: swap; src: url('/assets/fonts/atkinson-hyperlegible-next-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Atkinson Hyperlegible Next'; font-style: normal; font-weight: 500; font-display: swap; src: url('/assets/fonts/atkinson-hyperlegible-next-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Atkinson Hyperlegible Next'; font-style: normal; font-weight: 600; font-display: swap; src: url('/assets/fonts/atkinson-hyperlegible-next-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Atkinson Hyperlegible Next'; font-style: normal; font-weight: 700; font-display: swap; src: url('/assets/fonts/atkinson-hyperlegible-next-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Atkinson Hyperlegible Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('/assets/fonts/atkinson-hyperlegible-mono-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Atkinson Hyperlegible Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url('/assets/fonts/atkinson-hyperlegible-mono-latin-500-normal.woff2') format('woff2'); }

/* ---------- Tokens: claro (padrão) ---------- */
:root {
  --canvas: #f6f6f3;      /* fg 16,40:1 */
  --surface: #ffffff;     /* fg 17,76:1 */
  --sunken: #eeeeea;      /* fg 15,27:1; fg-2 5,66:1 */
  --line: #e2e2dc;        /* fio decorativo */
  --control: #808078;     /* borda de botão secundário: 3,98:1 surface; 3,68:1 canvas */
  --fg: #16181d;
  --fg-2: #5a5d66;        /* 6,58:1 surface; 6,08:1 canvas */
  --fg-3: #6b6e76;        /* 5,10:1 surface; 4,71:1 canvas (nunca sobre sunken) */
  --sinal: #1a66b8;       /* 5,77:1 surface; 5,33:1 canvas; on-sinal 5,77:1 */
  --sinal-hover: #15579e; /* on-sinal 7,27:1 */
  --on-sinal: #ffffff;
  --tally: #c2410c;       /* 5,18:1 surface */
  --warn: #8a5a00;        /* 5,93:1 surface */

  --sans: 'Atkinson Hyperlegible Next', 'Segoe UI', system-ui, sans-serif;
  --mono: 'Atkinson Hyperlegible Mono', 'Cascadia Mono', Consolas, monospace;
  --r-ctl: 6px;
  --r-pop: 8px;
  --r-tag: 3px;
  --ease-out: cubic-bezier(.2, 0, 0, 1);
  --d-1: 120ms;
  --header-h: 64px;
  color-scheme: light;
}

/* ---------- Tokens: escuro (pelo sistema) ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #0f1012;      /* fg 16,07:1 */
    --surface: #16171a;     /* fg 15,13:1 */
    --sunken: #1d1f23;
    --line: #2a2c31;
    --control: #6b6e76;     /* 3,51:1 surface; 3,73:1 canvas */
    --fg: #ecece8;
    --fg-2: #a3a5ac;        /* 7,29:1 surface; 7,74:1 canvas */
    --fg-3: #8a8d95;        /* 5,40:1 surface; 5,73:1 canvas */
    --sinal: #5aa9f0;       /* 7,14:1 surface; on-sinal 7,38:1 */
    --sinal-hover: #7dbcf5; /* on-sinal 9,16:1 */
    --on-sinal: #0a1420;
    --tally: #ff7a45;       /* 6,93:1 surface */
    --warn: #e5b340;        /* 9,4:1 surface */
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--fg);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
h1, h2, h3, p, ol, ul, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--sinal); text-underline-offset: 3px; }
a:hover { color: var(--sinal-hover); }
:focus-visible { outline: 2px solid var(--sinal); outline-offset: 2px; border-radius: 2px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.tnum { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

.skip {
  position: absolute; left: 16px; top: -100px; z-index: 20;
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px;
  background: var(--surface); color: var(--fg); border: 1px solid var(--control); border-radius: var(--r-ctl);
  font-weight: 600; text-decoration: none;
}
.skip:focus { top: 8px; }

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

/* ---------- Botões (kit Tally; alvo mínimo 44 px) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px;
  border: 1px solid transparent; border-radius: var(--r-ctl);
  font: 500 15px/1.2 var(--sans); text-align: center; text-decoration: none; white-space: nowrap;
  cursor: pointer;
}
@media (prefers-reduced-motion: no-preference) {
  .btn { transition: background-color var(--d-1) var(--ease-out), color var(--d-1) var(--ease-out); }
}
.btn-primary { background: var(--sinal); color: var(--on-sinal); }
.btn-primary:hover { background: var(--sinal-hover); color: var(--on-sinal); }
.btn-secondary { background: var(--surface); color: var(--fg); border-color: var(--control); }
.btn-secondary:hover { background: var(--sunken); color: var(--fg); }
.btn-ghost { background: transparent; color: var(--fg); }
.btn-ghost:hover { background: var(--sunken); color: var(--fg); }
.btn-lg { min-height: 48px; padding: 0 20px; font-size: 16px; }

/* ---------- Topo ---------- */
.top {
  position: sticky; top: 0; z-index: 10;
  background: var(--canvas); border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; gap: 12px; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; min-height: 44px; flex: none; }
.brand img { width: auto; height: 44px; margin-left: -6px; }
.top nav { display: none; }
.top .sp { flex: 1; }
.top .act-primary { display: none; }
@media (min-width: 640px) { .top .act-primary { display: inline-flex; } }
@media (min-width: 1040px) {
  .top nav { display: flex; gap: 4px; margin-left: 16px; }
  .top nav a {
    display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px;
    color: var(--fg-2); font-size: 15px; font-weight: 500; text-decoration: none; border-radius: var(--r-ctl);
  }
  .top nav a:hover { color: var(--fg); background: var(--sunken); }
}

main section, main [id] { scroll-margin-top: calc(var(--header-h) + 16px); }

/* ---------- Hero ---------- */
.hero { padding: 40px 0 48px; }
.hero .wrap { display: grid; gap: 32px; align-items: center; }
@media (min-width: 960px) {
  .hero { padding: 72px 0 72px; }
  .hero .wrap { grid-template-columns: 1.1fr 1fr; gap: 48px; }
}
.hero h1 {
  font-size: clamp(36px, 7.2vw, 60px); line-height: 1.04; font-weight: 700; letter-spacing: -.035em;
}
.hero h1 em { display: block; font-style: normal; color: var(--fg-2); }
.lede { margin-top: 20px; font-size: 18px; line-height: 1.5; color: var(--fg-2); max-width: 44ch; }
.lede strong { color: var(--fg); font-weight: 600; }
.cta { display: flex; flex-wrap: wrap; gap: 8px 12px; margin-top: 28px; }
.cta-note { margin-top: 12px; font-size: 14px; color: var(--fg-2); }
@media (max-width: 479px) { .hero .cta .btn { flex: 1 1 100%; } }

/* Folha de log (o produto como ele é, com dados de exemplo) */
.log { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pop); font-size: 14px; overflow: hidden; }
.log-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.log-head b { font-weight: 600; }
.log-head span { font-size: 13px; color: var(--fg-2); white-space: nowrap; }
.log ol li {
  display: grid; grid-template-columns: 52px 1fr; gap: 4px 12px; align-items: baseline;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.log ol li:last-child { border-bottom: 0; }
.log .h { font: 500 13px/20px var(--mono); font-variant-numeric: tabular-nums; color: var(--fg-2); }
.log .ev { line-height: 20px; }
.log .st { grid-column: 2; }
@media (min-width: 480px) {
  .log ol li { grid-template-columns: 52px 1fr auto; }
  .log .st { grid-column: auto; }
}
.log li.now { box-shadow: inset 2px 0 0 var(--tally); }
.log li.now .h { color: var(--tally); font-weight: 500; }
.log li.now .h small { display: block; font: 500 12px/16px var(--sans); }
.log .muted { color: var(--fg-2); }
.log figcaption { padding: 10px 16px; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.4; color: var(--fg-2); }

/* Estado: forma + texto, nunca só cor */
.st { display: inline-flex; align-items: center; gap: 6px; font: 500 13px/20px var(--sans); color: var(--fg); white-space: nowrap; }
.st i { width: 8px; height: 8px; flex: none; border-radius: 1.5px; }
.st-sent i { border: 1.5px solid var(--sinal); box-shadow: inset 2.5px 0 0 var(--sinal); }
.st-acc i { background: var(--sinal); }
.st-wait i { border: 1.5px solid var(--warn); box-shadow: inset 2.5px 0 0 var(--warn); }

/* ---------- Seções ---------- */
.sec { padding: 48px 0; border-top: 1px solid var(--line); }
@media (min-width: 960px) { .sec { padding: 72px 0; } }
.sec-surface { background: var(--surface); }
.sec-head { display: grid; gap: 12px; max-width: 720px; margin-bottom: 32px; }
.sec h2 { font-size: clamp(26px, 3.6vw, 36px); line-height: 1.15; font-weight: 700; letter-spacing: -.025em; max-width: 24ch; }
.sec-head p { font-size: 17px; line-height: 1.55; color: var(--fg-2); max-width: 62ch; }

/* Régua numerada do fluxo */
.steps { display: grid; border-top: 1px solid var(--fg); }
@media (min-width: 560px) { .steps { grid-template-columns: 1fr 1fr; column-gap: 24px; } }
@media (min-width: 960px) { .steps { grid-template-columns: repeat(4, 1fr); } }
.steps li { padding: 16px 0 20px; border-bottom: 1px solid var(--line); }
@media (min-width: 960px) { .steps li { border-bottom: 0; padding-right: 8px; } }
.steps .k { font: 500 13px/1 var(--mono); color: var(--fg-3); }
.steps h3 { margin: 10px 0 6px; font-size: 18px; line-height: 1.3; font-weight: 600; }
.steps p { font-size: 15px; line-height: 1.55; color: var(--fg-2); max-width: 36ch; }

/* Lista diagramada (fios, não cartões) */
.groups { display: grid; gap: 40px; }
.group { display: grid; gap: 12px; }
@media (min-width: 900px) { .group { grid-template-columns: 240px 1fr; gap: 32px; } }
.group > h3 { font-size: 18px; line-height: 1.3; font-weight: 600; padding-top: 14px; border-top: 1px solid var(--fg); }
@media (max-width: 899px) { .group > h3 { border-top: 0; padding-top: 0; } }
.items { border-top: 1px solid var(--fg); }
@media (min-width: 900px) { .items { border-top-color: var(--line); } }
.items li { display: grid; gap: 4px; padding: 14px 0; border-bottom: 1px solid var(--line); }
@media (min-width: 720px) { .items li { grid-template-columns: minmax(200px, 1fr) 2fr; gap: 24px; } }
.items b { font-weight: 600; }
.items span { color: var(--fg-2); font-size: 15px; line-height: 1.55; max-width: 62ch; }

/* Em breve: mesma lista, com etiqueta de estado (texto + borda tracejada = "ainda não") */
.soon li { grid-template-columns: 1fr; }
@media (min-width: 720px) { .soon li { grid-template-columns: minmax(200px, 1fr) 2fr; } }
.soon .name { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tag-soon {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px;
  border: 1px dashed var(--control); border-radius: var(--r-tag);
  font: 500 12px/1 var(--sans); color: var(--fg-2); white-space: nowrap;
}

/* Duas colunas de texto */
.cols { display: grid; gap: 0 48px; }
@media (min-width: 900px) { .cols { grid-template-columns: 1fr 1fr; } }
.facts { border-top: 1px solid var(--fg); }
.facts li { padding: 16px 0; border-bottom: 1px solid var(--line); }
.facts h3 { font-size: 17px; line-height: 1.35; font-weight: 600; }
.facts p { margin-top: 4px; font-size: 15px; line-height: 1.6; color: var(--fg-2); max-width: 62ch; }
@media (min-width: 900px) { .cols .facts + .facts { border-top-color: var(--fg); } }
@media (max-width: 899px) { .cols .facts + .facts { border-top: 0; } }

/* Para quem */
.kinds { display: grid; border-top: 1px solid var(--fg); }
@media (min-width: 720px) { .kinds { grid-template-columns: repeat(3, 1fr); column-gap: 24px; } }
.kinds li { padding: 16px 0; border-bottom: 1px solid var(--line); }
.kinds b { display: block; font-size: 18px; line-height: 1.3; font-weight: 600; }
.kinds span { display: block; margin-top: 4px; font-size: 15px; color: var(--fg-2); }
.after { margin-top: 24px; max-width: 62ch; color: var(--fg-2); font-size: 16px; line-height: 1.6; }

/* Chamada final */
.final h2 { max-width: 20ch; }
.final p { margin-top: 12px; font-size: 18px; line-height: 1.5; color: var(--fg-2); max-width: 48ch; }
@media (max-width: 479px) { .final .cta .btn { flex: 1 1 100%; } }

/* ---------- Rodapé ---------- */
.foot { border-top: 1px solid var(--line); padding: 32px 0 40px; font-size: 15px; }
.foot .wrap { display: grid; gap: 20px; }
@media (min-width: 720px) { .foot .wrap { grid-template-columns: auto 1fr auto; align-items: center; gap: 24px; } }
.foot img { height: 40px; width: auto; margin-left: -5px; }
.foot ul { display: flex; flex-wrap: wrap; gap: 0 20px; }
.foot ul a { display: inline-flex; gap: 6px; align-items: center; min-height: 44px; color: var(--fg); text-decoration: underline; text-decoration-color: var(--control); }
.foot ul a:hover { color: var(--sinal); text-decoration-color: currentColor; }
.foot small { font-size: 14px; color: var(--fg-2); }

/* ---------- 404 ---------- */
.nf { padding: 72px 0 96px; }
.nf .code { font: 500 14px/1 var(--mono); color: var(--fg-3); }
.nf h1 { margin-top: 16px; font-size: clamp(34px, 6vw, 52px); line-height: 1.06; font-weight: 700; letter-spacing: -.03em; max-width: 18ch; }
.nf p { margin-top: 16px; font-size: 18px; line-height: 1.5; color: var(--fg-2); max-width: 46ch; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
