/* ==========================================================================
   ZapMidia — Sistema visual "Sinal Noturno"
   Tokens → base → layout → componentes → seções → responsivo
   ========================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  /* Cor */
  --ink:        #0C0616;
  --ink-2:      #150B26;
  --surface:    #1C1033;
  --surface-2:  #241542;
  --line:       #37225A;      /* divisórias decorativas */
  --line-ui:    #7458A8;      /* bordas de controles — 3.5:1 vs fundo (WCAG 1.4.11) */
  --paper:      #F3EEFA;
  --muted:      #C3B2DC;
  --pulse:      #FF2E88;
  --pulse-soft: #FF6DAC;
  --ember:      #FFB84D;
  --mint:       #4DE8B0;

  /* Tipografia */
  --font-display: "Bricolage Grotesque", "Poppins", system-ui, sans-serif;
  --font-body:    "Instrument Sans", system-ui, -apple-system, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;

  --step--1: clamp(0.82rem, 0.79rem + 0.15vw, 0.9rem);
  --step-0:  clamp(1rem, 0.96rem + 0.2vw, 1.12rem);
  --step-1:  clamp(1.2rem, 1.1rem + 0.5vw, 1.5rem);
  --step-2:  clamp(1.5rem, 1.3rem + 1vw, 2.1rem);
  --step-3:  clamp(2rem, 1.6rem + 2vw, 3.2rem);
  --step-4:  clamp(2.4rem, 1.6rem + 3.2vw, 4.4rem);

  /* Espaço e forma */
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --max: 1220px;
  --radius: 18px;
  --radius-sm: 10px;
  --ring: 0 0 0 3px rgba(255, 184, 77, 0.85);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg, canvas { max-width: 100%; display: block; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 0 0 0.4em;
  text-wrap: balance;
}
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); letter-spacing: -0.02em; }

p { margin: 0 0 1em; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

a { color: var(--paper); text-decoration-color: rgba(255, 46, 136, 0.6); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--pulse); }

:where(a, button, input, textarea, select, summary, [tabindex]):focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: 6px;
}

::selection { background: var(--pulse); color: #fff; }

.skip-link {
  position: absolute; left: 0.5rem; top: -100px; z-index: 999;
  background: var(--ember); color: #1a1005; font-weight: 700;
  padding: 0.75rem 1.25rem; border-radius: 8px; text-decoration: none;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 0.5rem; }

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

/* ---------- 3. Layout ---------- */
.wrap {
  width: 100%; max-width: var(--max);
  margin-inline: auto; padding-inline: var(--gutter);
}

.band { padding-block: clamp(4rem, 9vw, 7.5rem); position: relative; scroll-margin-top: 84px; }
.band--tint { background: var(--ink-2); }
.band--edge { border-top: 1px solid var(--line); }

/* Rótulo de seção */
.eyebrow {
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ember);
  margin: 0 0 1rem;
  display: flex; align-items: center; gap: 0.65rem;
}
.eyebrow::before {
  content: ""; width: 26px; height: 2px;
  background: var(--pulse); flex: none;
}

.lede { font-size: var(--step-1); color: var(--muted); max-width: 60ch; }

/* ---------- 4. Componentes ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.6rem;
  min-height: 52px; padding: 0.85rem 1.6rem;
  border-radius: 999px; border: 1px solid transparent;
  font-family: var(--font-body); font-size: 1rem; font-weight: 600;
  text-decoration: none; cursor: pointer;
  transition: transform 0.18s var(--ease), background-color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--primary { background: var(--pulse); color: #14040C; }
.btn--primary:hover { background: var(--pulse-soft); color: #14040C; }

.btn--ghost { border-color: var(--line-ui); background: rgba(255,255,255,0.02); color: var(--paper); }
.btn--ghost:hover { border-color: var(--ember); }

.btn--wide { width: 100%; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.4rem, 3vw, 2rem);
  position: relative;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.card:hover { border-color: rgba(255, 46, 136, 0.55); transform: translateY(-3px); }
.card h3 { margin-bottom: 0.5rem; }
.card p { color: var(--muted); font-size: 0.98rem; }

.grid { display: grid; gap: clamp(1rem, 2.4vw, 1.6rem); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.tag {
  display: inline-block;
  font-family: var(--font-mono); font-size: 0.72rem;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 0.3rem 0.6rem; border-radius: 6px;
  border: 1px solid var(--line); color: var(--muted);
}

/* ---------- 5. Cabeçalho ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(12, 6, 22, 0.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.site-header[data-stuck="true"] { border-bottom-color: var(--line); background: rgba(12, 6, 22, 0.94); }

.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 74px;
}

.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; letter-spacing: -0.02em; }
.brand svg { width: 30px; height: 30px; flex: none; }
.brand span b { color: var(--pulse); font-weight: 800; }

.nav { display: flex; align-items: center; gap: 0.35rem; }
.nav a:not(.btn) {
  display: inline-flex; align-items: center; min-height: 44px;
  text-decoration: none; color: var(--muted);
  padding: 0.6rem 0.85rem; border-radius: 8px; font-size: 0.95rem;
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.nav a:not(.btn):hover { color: var(--paper); background: rgba(255,255,255,0.05); }

.nav-toggle {
  display: none; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 10px;
  background: transparent; border: 1px solid var(--line-ui); color: var(--paper);
  cursor: pointer;
}

/* ---------- 6. Hero ---------- */
.hero { position: relative; min-height: min(94svh, 940px); display: flex; align-items: center; padding-block: clamp(2.5rem, 5vw, 4rem); }

#scene {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
}
.hero::after {
  /* véu de contraste sobre a cena 3D — garante AA no texto */
  content: ""; position: absolute; inset: 0; z-index: 1;
  background:
    radial-gradient(120% 90% at 15% 45%, rgba(12,6,22,0.94) 0%, rgba(12,6,22,0.7) 42%, rgba(12,6,22,0.15) 75%),
    linear-gradient(to top, var(--ink) 2%, transparent 40%);
  pointer-events: none;
}
.hero .wrap { position: relative; z-index: 2; }

.hero-copy { max-width: 47ch; }
.hero h1 { max-width: 15ch; }
.hero h1 { margin-bottom: 1.1rem; }
.hero .eyebrow { margin-bottom: 1.4rem; }
.hero h1 em { font-style: normal; color: var(--pulse); }
.hero .lede { max-width: 44ch; font-size: var(--step-0); margin-bottom: 1.8rem; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-bottom: 2rem; }

.kpis {
  display: grid; gap: 1px;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 760px;
  margin-top: 0.5rem;
}
.kpis div { background: rgba(21, 11, 38, 0.88); padding: 0.9rem 1.1rem; }
.kpis dt { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.35rem; }
.kpis dd { margin: 0; font-family: var(--font-display); font-size: var(--step-1); font-weight: 700; letter-spacing: -0.03em; }
.kpis dd b { color: var(--mint); font-weight: 700; }

/* ---------- 7. Canais ---------- */
.channels { border-collapse: collapse; width: 100%; margin-top: 2.5rem; }
.channels caption { text-align: left; color: var(--muted); font-size: var(--step--1); padding-bottom: 1rem; }
.channels th, .channels td { text-align: left; padding: 1rem 1.1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.channels thead th { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ember); border-bottom-color: var(--pulse); }
.channels tbody th { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; }
.channels td { color: var(--muted); font-size: 0.96rem; }
.channels tbody tr:hover td, .channels tbody tr:hover th { background: rgba(255, 46, 136, 0.06); }

/* ---------- 8. Processo ---------- */
.steps { counter-reset: step; margin: 2.5rem 0 0; padding: 0; display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-top: 2.5rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.steps li { background: var(--ink-2); padding: clamp(1.4rem, 3vw, 2rem); list-style: none; }
.steps li::before {
  counter-increment: step; content: counter(step, decimal-leading-zero);
  display: block; font-family: var(--font-mono); font-size: 0.85rem;
  color: var(--pulse); margin-bottom: 0.9rem; letter-spacing: 0.1em;
}
.steps h3 { font-size: 1.15rem; }
.steps p { color: var(--muted); font-size: 0.95rem; }

/* ---------- 9. LGPD ---------- */
.split { display: grid; gap: clamp(2rem, 5vw, 4rem); grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }
.checklist { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: 0.9rem; }
.checklist li { display: flex; gap: 0.8rem; align-items: flex-start; color: var(--muted); }
.checklist svg { flex: none; width: 22px; height: 22px; margin-top: 3px; color: var(--mint); }
.checklist b { color: var(--paper); font-weight: 600; }

/* ---------- 10. Setores ---------- */
.sectors { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 2rem; padding: 0; list-style: none; }
/* Chips informativos, não interativos */
.sectors li {
  font-family: var(--font-mono); font-size: 0.82rem; letter-spacing: 0.04em;
  padding: 0.6rem 1rem; border: 1px solid var(--line); border-radius: 999px;
  color: var(--muted); background: var(--surface);
}

/* ---------- 11. FAQ ---------- */
.faq { margin-top: 2.5rem; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer; list-style: none; padding: 1.4rem 3rem 1.4rem 0;
  font-family: var(--font-display); font-size: var(--step-1); font-weight: 600;
  letter-spacing: -0.02em; position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 0.5rem; top: 50%; transform: translateY(-50%);
  font-family: var(--font-mono); font-size: 1.6rem; color: var(--pulse); line-height: 1;
}
.faq details[open] summary::after { content: "\2212"; }
.faq details p { color: var(--muted); padding-bottom: 1.5rem; max-width: 72ch; }

/* ---------- 12. Contato ---------- */
.contact-card {
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(1.5rem, 4vw, 2.6rem);
}
.field { display: grid; gap: 0.45rem; margin-bottom: 1.1rem; }
.field label { font-size: 0.92rem; font-weight: 600; }
.field .hint { font-size: 0.82rem; color: var(--muted); }
.field input, .field select, .field textarea {
  font-family: inherit; font-size: 1rem; color: var(--paper);
  background: var(--ink); border: 1px solid var(--line-ui);
  border-radius: var(--radius-sm); padding: 0.85rem 1rem; min-height: 52px;
  width: 100%; transition: border-color 0.2s var(--ease);
}
.field textarea { min-height: 130px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: #9C8CB8; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--pulse-soft); }
.field [aria-invalid="true"] { border-color: #FF6B6B; }
.field .error { font-size: 0.85rem; color: #FF9B9B; min-height: 1.2em; }
.hp { position: absolute; left: -9999px; }

.form-note { font-size: 0.85rem; color: var(--muted); margin-top: 1rem; }

/* ---------- 13. Rodapé ---------- */
.site-footer { background: var(--ink-2); border-top: 1px solid var(--line); padding-block: clamp(3rem, 6vw, 4.5rem) 2rem; }
.footer-grid { display: grid; gap: 2.5rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.site-footer h4 { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ember); margin-bottom: 1rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--paper); text-decoration: underline; }
.legal { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; font-size: 0.85rem; color: var(--muted); }

/* ---------- 14. Botão WhatsApp ---------- */
.wa-float {
  position: fixed; right: 1.1rem; bottom: 1.1rem; z-index: 60;
  display: inline-flex; align-items: center; gap: 0.6rem;
  min-height: 56px; padding: 0.9rem 1.3rem;
  background: #1FB855; color: #05210f; font-weight: 700;
  border-radius: 999px; text-decoration: none;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.5);
  transition: transform 0.2s var(--ease);
}
.wa-float:hover { transform: translateY(-3px); color: #05210f; }
.wa-float svg { width: 24px; height: 24px; flex: none; }

/* ---------- 15. Revelação no scroll ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- 16. Responsivo ---------- */
@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    position: absolute; inset: 74px 0 auto; flex-direction: column; align-items: stretch;
    background: var(--ink-2); border-bottom: 1px solid var(--line);
    padding: 1rem var(--gutter) 1.5rem; gap: 0.25rem;
    display: none;
  }
  .nav[data-open="true"] { display: flex; }
  .nav a:not(.btn) { padding: 0.9rem 0.5rem; font-size: 1.05rem; }
  .nav .btn { margin-top: 0.5rem; }

  /* Tabela vira lista de cartões */
  .channels, .channels caption, .channels tbody, .channels tr, .channels th, .channels td { display: block; width: 100%; }
  .channels thead { display: none; }
  .channels tr { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 1rem; padding: 0.4rem 0; background: var(--surface); }
  .channels th, .channels td { border-bottom: none; padding: 0.55rem 1.1rem; }
  .channels td::before {
    content: attr(data-label);
    display: block; font-family: var(--font-mono); font-size: 0.68rem;
    letter-spacing: 0.12em; text-transform: uppercase; color: var(--ember); margin-bottom: 0.2rem;
  }
  .wa-float span { display: none; }
  .wa-float { padding: 1rem; }
}

@media (max-width: 480px) {
  .hero-actions .btn { width: 100%; }
}

/* ---------- 17. Movimento reduzido ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- 18. Impressão ---------- */
@media print {
  #scene, .wa-float, .site-header { display: none !important; }
  body { background: #fff; color: #000; }
}
