/* ════════════════════════════════════════════════════════════════════════════
   Uazapio — design system padrão (sem marca de agência aplicada).
   Fonte da verdade: src/styles/globals.css do painel. Usado pela LP e pelo style guide.
   Tokens em HSL "cru" (h s% l%) para permitir opacidade: hsl(var(--primary) / 0.3).
   ════════════════════════════════════════════════════════════════════════════ */

@font-face {
  font-family: 'Inter';
  src: url('fonts/inter.woff2') format('woff2');
  font-weight: 300 500;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('fonts/jetbrains-mono.woff2') format('woff2');
  font-weight: 400 500;
  font-display: swap;
}

/* ───────── Cores: claro (base) ───────── */
:root {
  --background: 200 22% 97%;
  --background-glow: 142 60% 45%;
  --surface: 200 25% 99%;
  --surface-raised: 200 30% 99.5%;      /* painel usa branco; aqui quase-branco (regra: nunca branco puro) */
  --surface-sunken: 200 18% 94%;
  --border: 200 14% 88%;
  --border-strong: 200 12% 80%;
  --foreground: 205 22% 13%;
  --muted-foreground: 205 9% 40%;
  --subtle-foreground: 205 8% 42%;      /* 55% no painel; escurecido para AA (4,5:1) em texto pequeno */

  --primary: 142 70% 26%;
  --primary-hover: 142 70% 22%;
  --primary-foreground: 140 40% 97%;
  --primary-soft: 142 55% 92%;
  --primary-soft-foreground: 142 70% 22%;

  --cyan: 190 85% 30%;
  --cyan-soft: 190 70% 92%;
  --amber: 32 92% 34%;
  --amber-soft: 38 90% 92%;

  --danger: 0 72% 46%;
  --danger-soft: 0 80% 95%;
  --success: 142 70% 30%;
  --warning: 32 92% 33%;
  --info: 210 80% 45%;

  --ring: 142 70% 32%;
  --shadow-color: 205 30% 20%;
  --noise-opacity: 0.025;
  color-scheme: light;

  /* ───────── Forma, espaço e tipo (não mudam com o tema) ───────── */
  --radius: 0.625rem;                    /* 10px */
  --radius-sm: calc(var(--radius) - 4px);
  --radius-lg: calc(var(--radius) + 4px);
  --radius-pill: 999px;

  --space-1: 0.25rem;  /* 4  */
  --space-2: 0.5rem;   /* 8  */
  --space-3: 0.75rem;  /* 12 */
  --space-4: 1rem;     /* 16 */
  --space-6: 1.5rem;   /* 24 */
  --space-8: 2rem;     /* 32 */
  --space-12: 3rem;    /* 48 */
  --space-16: 4rem;    /* 64 */

  --font-sans: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --shadow-card: 0 1px 0 0 hsl(var(--foreground) / 0.03) inset, 0 1px 2px hsl(var(--shadow-color) / 0.06),
    0 8px 24px -12px hsl(var(--shadow-color) / 0.18);
  --shadow-pop: 0 12px 40px -8px hsl(var(--shadow-color) / 0.35), 0 2px 6px hsl(var(--shadow-color) / 0.12);
  --shadow-glow: 0 0 0 1px hsl(var(--primary) / 0.35), 0 8px 28px -10px hsl(var(--primary) / 0.55);

  /* ───────── Movimento ─────────
     Curvas: "out" para entrar (rápido no começo, assenta suave); "in-out" para trocar estado.
     Durações curtas: feedback de toque 120–160 ms, troca de estado 220 ms, entrada de bloco 520 ms. */
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1); /* leve passada, só em microinterações pequenas */
  --dur-instant: 120ms;
  --dur-fast: 160ms;
  --dur-base: 220ms;
  --dur-slow: 520ms;
  --stagger: 70ms;
  --rise: 10px;
}

/* ───────── Cores: escuro (padrão do produto) ───────── */
.dark {
  --background: 200 14% 6.5%;
  --background-glow: 142 76% 58%;
  --surface: 200 12% 9.5%;
  --surface-raised: 200 11% 12.5%;
  --surface-sunken: 200 13% 7.5%;
  --border: 200 10% 16%;
  --border-strong: 200 9% 22%;
  --foreground: 160 12% 91%;
  --muted-foreground: 190 6% 64%;
  --subtle-foreground: 190 5% 56%;

  --primary: 142 76% 58%;
  --primary-hover: 142 70% 64%;
  --primary-foreground: 150 40% 7%;
  --primary-soft: 142 40% 14%;
  --primary-soft-foreground: 142 65% 70%;

  --cyan: 188 70% 62%;
  --cyan-soft: 188 40% 14%;
  --amber: 38 85% 64%;
  --amber-soft: 38 40% 14%;

  --danger: 0 72% 66%;
  --danger-soft: 0 40% 15%;
  --success: 142 60% 58%;
  --warning: 38 85% 64%;
  --info: 210 80% 68%;

  --ring: 142 76% 58%;
  --shadow-color: 200 30% 2%;
  --noise-opacity: 0.035;
  color-scheme: dark;
}

/* ───────── Base ───────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  margin: 0;
  min-height: 100dvh;
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.6;
  font-feature-settings: 'cv11', 'ss01', 'ss03';
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(1100px 520px at 12% -8%, hsl(var(--background-glow) / 0.08), transparent 60%),
    radial-gradient(900px 480px at 100% 0%, hsl(var(--cyan) / 0.04), transparent 55%);
  background-attachment: fixed;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: var(--noise-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
main, header, footer, aside { position: relative; z-index: 1; }
::selection { background: hsl(var(--primary) / 0.28); }
:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: 3px; border-radius: 6px; }
a { color: inherit; }
h1, h2, h3, h4 { font-weight: 400; letter-spacing: -0.02em; line-height: 1.15; margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }
figure { margin: 0; }

.tabular { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum', 'cv11'; }
.mono { font-family: var(--font-mono); font-size: 0.8125rem; letter-spacing: 0.02em; }
.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; }
.eyebrow {
  display: inline-block;
  font-size: 0.75rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase;
  color: hsl(var(--primary-soft-foreground));
}
.lead { color: hsl(var(--muted-foreground)); font-size: 1.0625rem; }
.wrap { width: 100%; max-width: 72rem; margin: 0 auto; padding: 0 1.25rem; }
@media (min-width: 640px) { .wrap { padding: 0 2rem; } }

/* ═══════════════════════════ Movimento ═══════════════════════════ */

/* 1. Entrada ao rolar: [data-reveal] sobe 10px e aparece; irmãos com [data-reveal] entram em cascata
      (o JS define --i). Só ativa quando o JS liga .js-reveal e o movimento está liberado. */
.js-reveal [data-reveal] {
  opacity: 0;
  transform: translateY(var(--rise));
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
  transition-delay: calc(var(--i, 0) * var(--stagger));
}
.js-reveal [data-reveal].is-in { opacity: 1; transform: none; }

/* 3. Troca de tema: com a View Transitions API, o novo tema se abre num círculo a partir do botão.
      Sem ela, as cores cruzam em 220 ms (.theme-fading fica no <html> só durante a troca). */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { animation: theme-reveal 480ms var(--ease-in-out); }
@keyframes theme-reveal {
  from { clip-path: circle(0 at var(--theme-x, 100%) var(--theme-y, 0)); }
  to { clip-path: circle(var(--theme-r, 150vmax) at var(--theme-x, 100%) var(--theme-y, 0)); }
}
.theme-fading, .theme-fading *, .theme-fading *::before, .theme-fading *::after {
  transition: background-color var(--dur-base) var(--ease-in-out), border-color var(--dur-base) var(--ease-in-out),
    color var(--dur-base) var(--ease-in-out), fill var(--dur-base) var(--ease-in-out) !important;
}

@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(0.6); opacity: 0; } 70% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse-ring { 0% { box-shadow: 0 0 0 0 hsl(var(--primary) / 0.45); } 100% { box-shadow: 0 0 0 10px hsl(var(--primary) / 0); } }
@keyframes shimmer { from { background-position: -200% 0; } to { background-position: 200% 0; } }

/* Respeito a quem pede menos movimento: tudo vira instantâneo, nada se perde. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
  ::view-transition-new(root) { animation: none; }
}
