/* =========================================================
   CVL Info · Custom Styles
   Estende o Tailwind via CDN (utility-first + layers).
   ========================================================= */

@layer base {
  :root {
    --navy-900: #0A1F3F;
    --navy-800: #132D54;
    --navy-700: #1B3A6B;
    --brand-500: #E63946;
    --brand-400: #FF5A5F;
  }

  html {
    scroll-behavior: smooth;
    scroll-padding-top: 5rem;
  }

  body {
    font-family: 'Poppins', system-ui, sans-serif;
    background-color: var(--navy-900);
    color: #E5E7EB;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }

  h1, h2, h3, h4 {
    font-family: 'Inter', system-ui, sans-serif;
    letter-spacing: -0.02em;
  }

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

  ::-webkit-scrollbar { width: 10px; }
  ::-webkit-scrollbar-track { background: var(--navy-900); }
  ::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--brand-500), var(--brand-400));
    border-radius: 8px;
  }

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

@layer components {
  .glass {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.08);
  }

  .glass-card {
    background: linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.06) 0%,
      rgba(255, 255, 255, 0.02) 100%
    );
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
                box-shadow 0.4s ease,
                border-color 0.3s ease;
  }

  .glass-card:hover {
    transform: translateY(-6px) scale(1.02);
    border-color: rgba(230, 57, 70, 0.4);
    box-shadow:
      0 20px 40px -10px rgba(230, 57, 70, 0.25),
      0 0 0 1px rgba(230, 57, 70, 0.2);
  }

  .service-card {
    position: relative;
    overflow: hidden;
  }

  .service-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
      600px circle at var(--mx, 50%) var(--my, 50%),
      rgba(230, 57, 70, 0.12),
      transparent 40%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
  }

  .service-card:hover::before { opacity: 1; }

  .hero-bg {
    background:
      radial-gradient(ellipse 80% 60% at 80% 10%, rgba(230, 57, 70, 0.22), transparent 60%),
      radial-gradient(ellipse 60% 50% at 10% 90%, rgba(27, 58, 107, 0.6), transparent 60%),
      linear-gradient(180deg, var(--navy-900) 0%, var(--navy-800) 100%);
  }

  .hero-particles {
    background-image:
      radial-gradient(circle at 20% 30%, rgba(255, 90, 95, 0.15) 0, transparent 2px),
      radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.08) 0, transparent 2px),
      radial-gradient(circle at 50% 50%, rgba(230, 57, 70, 0.1) 0, transparent 2px),
      radial-gradient(circle at 35% 80%, rgba(255, 255, 255, 0.06) 0, transparent 2px),
      radial-gradient(circle at 70% 20%, rgba(255, 90, 95, 0.12) 0, transparent 2px);
    background-size: 600px 600px;
    animation: drift 30s linear infinite;
    opacity: 0.7;
  }

  @keyframes drift {
    from { background-position: 0 0; }
    to { background-position: 600px 600px; }
  }

  #header.scrolled {
    background: rgba(10, 31, 63, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  }

  .reveal { opacity: 0; transform: translateY(40px); }

  .portfolio-item {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  }

  .portfolio-item:hover { box-shadow: 0 20px 50px rgba(230, 57, 70, 0.3); }

  .btn-primary {
    @apply inline-flex items-center justify-center gap-2 px-7 py-4 rounded-full text-white font-semibold transition;
    background: linear-gradient(135deg, var(--brand-500), var(--brand-400));
    box-shadow: 0 12px 28px -8px rgba(230, 57, 70, 0.5);
  }

  .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 36px -8px rgba(230, 57, 70, 0.7);
  }
}

@layer utilities {
  .text-fluid-xl { font-size: clamp(2.5rem, 5vw + 1rem, 4.5rem); }
  .text-fluid-lg { font-size: clamp(2rem, 3vw + 1rem, 3rem); }
  .text-fluid-md { font-size: clamp(1.125rem, 0.5vw + 1rem, 1.25rem); }

  .text-gradient {
    background: linear-gradient(135deg, var(--brand-500), var(--brand-400));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }

  .no-scroll { overflow: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}

@media (max-width: 640px) {
  .hero-particles { opacity: 0.4; }
  #wa-float { bottom: 1rem; right: 1rem; }
}
