/* ═══════════════════════════════════════════════════════════
   KLYVO v2 — TOKENS GLOBAIS + RESET + PRIMITIVOS
   Paleta oficial Klyvo (light): azul #0ea5e9 + âmbar #f59e0b
   ═══════════════════════════════════════════════════════════ */

:root {
  /* Acento — sobrescrito em runtime pelo painel Tweaks */
  --primary: #0ea5e9;
  --primary-dark: #0284c7;
  --primary-deep: #0c4a6e;
  --accent: #f59e0b;
  --accent-light: #fef3c7;

  --green: #10b981;
  --red: #ef4444;
  --indigo: #6366f1;
  --teal: #14b8a6;

  --bg: #ffffff;
  --bg-2: #f8fafc;
  --bg-3: #f1f5f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e2e8f0;
  --border-2: #cbd5e1;

  --text-1: #0f172a;
  --text-2: #334155;
  --text-3: #64748b;
  --text-4: #94a3b8;

  --shadow-sm: 0 1px 3px rgba(15, 23, 42, .07), 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-md: 0 6px 20px rgba(15, 23, 42, .08), 0 2px 8px rgba(15, 23, 42, .05);
  --shadow-lg: 0 18px 48px rgba(15, 23, 42, .12), 0 6px 16px rgba(15, 23, 42, .06);
  --shadow-xl: 0 32px 80px rgba(15, 23, 42, .16), 0 12px 28px rgba(15, 23, 42, .07);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --font-display: 'Sora', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;

  --nav-h: 68px;
  --container: 1180px;

  /* Controlado pelo painel Tweaks (efeito glow on/off) */
  --glow-opacity: 1;
}

/* Textura de fundo sutilíssima (grain) — evita a chapada lisa de
   gradiente radial genérico; some no reduced-motion/print. */
.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: .025;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@media print {
  .grain { display: none; }
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-1);
  line-height: 1.6;
  font-size: 16px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

ul {
  list-style: none;
}

/* ── Tipografia ─────────────────────────────────────────── */
h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
  color: var(--text-1);
}

h1 {
  font-size: clamp(2.3rem, 5.4vw, 3.9rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

h2 {
  font-size: clamp(1.85rem, 3.8vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.025em;
}

h3 {
  font-size: clamp(1.05rem, 1.6vw, 1.22rem);
  font-weight: 700;
}

h4 {
  font-size: 0.95rem;
  font-weight: 700;
}

p {
  text-wrap: pretty;
}

/* ── Layout ─────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

.section {
  padding: clamp(48px, 6vw, 80px) 0;
}

/* A navbar é fixa: sem isso o topo da seção fica escondido atrás dela
   ao navegar pelas âncoras do menu. */
[id] {
  scroll-margin-top: calc(var(--nav-h) + 18px);
}

.section-alt {
  background: var(--bg-2);
}

.section-header {
  max-width: 720px;
  margin: 0 auto clamp(40px, 5vw, 60px);
  text-align: center;
}

.section-header p {
  margin-top: 16px;
  font-size: 1.06rem;
  color: var(--text-3);
}

/* ── Tag / eyebrow ──────────────────────────────────────── */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 10px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  color: var(--primary-dark);
  border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent);
  margin-bottom: 16px;
}

.tag::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.tag-accent {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: #b45309;
  border-color: color-mix(in srgb, var(--accent) 32%, transparent);
}

.tag-danger {
  background: color-mix(in srgb, var(--red) 10%, transparent);
  color: #dc2626;
  border-color: color-mix(in srgb, var(--red) 25%, transparent);
}

/* ── Botões ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 6px 20px color-mix(in srgb, var(--primary) calc(32% * var(--glow-opacity)), transparent);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px color-mix(in srgb, var(--primary) calc(42% * var(--glow-opacity)), transparent);
}

.btn-outline {
  background: var(--surface);
  color: var(--text-1);
  border-color: var(--border-2);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-2);
}

.btn-ghost:hover {
  color: var(--primary-dark);
}

.btn-sm {
  padding: 9px 16px;
  font-size: 0.875rem;
}

.btn-lg {
  padding: 15px 30px;
  font-size: 1.02rem;
}

.btn-block {
  width: 100%;
}

/* ── Card base ──────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

/* ── Reveal (IntersectionObserver + fallback) ───────────── */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .6s cubic-bezier(.16, 1, .3, 1), transform .6s cubic-bezier(.16, 1, .3, 1);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

.reveal-delay-1 { transition-delay: .08s; }
.reveal-delay-2 { transition-delay: .16s; }
.reveal-delay-3 { transition-delay: .24s; }
.reveal-delay-4 { transition-delay: .32s; }

/* Fallback: sem JS, nada fica invisível */
.no-js .reveal {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* ── Acessibilidade ─────────────────────────────────────── */
.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;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  top: -60px;
  left: 16px;
  z-index: 200;
  padding: 10px 18px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  transition: top .2s ease;
}

.skip-link:focus {
  top: 0;
}

/* ── Loader inicial (antes do React montar) ─────────────── */
#root:empty::after {
  content: '';
  display: block;
  width: 34px;
  height: 34px;
  margin: 30vh auto;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
