@tailwind base;
@tailwind components;
@tailwind utilities;

/* Custom CSS for the Artic Pulizie website */

:root {
  color-scheme: light;
  --accent-color: #0ea5e9;
  --accent-color-strong: #0369a1;
  --accent-contrast: #f8fafc;
  --accent-gradient: linear-gradient(120deg, #0ea5e9 0%, #06b6d4 50%, #10b981 100%);
  --accent-surface: rgba(14, 165, 233, 0.08);
}

:root[data-accent='sky'] {
  --accent-color: #0ea5e9;
  --accent-color-strong: #0369a1;
  --accent-gradient: linear-gradient(120deg, #0ea5e9 0%, #06b6d4 50%, #38bdf8 100%);
  --accent-surface: rgba(14, 165, 233, 0.08);
}

:root[data-accent='cyan'] {
  --accent-color: #06b6d4;
  --accent-color-strong: #0891b2;
  --accent-gradient: linear-gradient(120deg, #06b6d4 0%, #0ea5e9 50%, #22d3ee 100%);
  --accent-surface: rgba(6, 182, 212, 0.1);
}

:root[data-accent='emerald'] {
  --accent-color: #10b981;
  --accent-color-strong: #047857;
  --accent-gradient: linear-gradient(120deg, #0ea5e9 0%, #10b981 55%, #34d399 100%);
  --accent-surface: rgba(16, 185, 129, 0.1);
}

:root[data-accent='blue'] {
  --accent-color: #2563eb;
  --accent-color-strong: #1d4ed8;
  --accent-gradient: linear-gradient(120deg, #2563eb 0%, #0ea5e9 55%, #38bdf8 100%);
  --accent-surface: rgba(37, 99, 235, 0.1);
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  min-height: 100%;
  width: 100%;
  overflow-x: hidden;
  background-color: #f8fafc;
}

.accent-text {
  color: var(--accent-color);
}

.accent-strong {
  color: var(--accent-color-strong);
}

.accent-border {
  border-color: var(--accent-color);
}

.accent-surface {
  background-color: var(--accent-surface);
}

.accent-gradient {
  background-image: var(--accent-gradient);
}

.accent-focus:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 3px;
}

.accent-hover {
  transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.accent-hover:hover,
.accent-hover:focus-visible {
  color: var(--accent-color-strong) !important;
  background-color: var(--accent-surface);
}

@media (prefers-reduced-motion: reduce) {
  :root {
    transition: none;
  }
  html {
    scroll-behavior: auto;
  }
  body::before {
    transition: none;
  }
  .wave,
  .particle {
    animation: none !important;
  }
  .wave-container,
  .particles-container {
    display: none !important;
  }
}

/* Hero section animations - Optimized */
.wave-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  z-index: 1;
  will-change: transform;
}

.wave {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 200%;
  height: 200px;
  background: linear-gradient(45deg, rgba(14, 165, 233, 0.05), rgba(6, 182, 212, 0.05));
  border-radius: 50%;
  animation: wave 20s infinite linear;
  will-change: transform;
}

.wave-1 {
  animation-delay: -5s;
}

.wave-2 {
  animation-delay: -10s;
  background: linear-gradient(45deg, rgba(6, 182, 212, 0.03), rgba(20, 184, 166, 0.03));
}

.wave-3 {
  animation-delay: -15s;
  background: linear-gradient(45deg, rgba(20, 184, 166, 0.02), rgba(14, 165, 233, 0.02));
}

@keyframes wave {
  0% { transform: translateX(-50%) translateY(0) rotate(0deg); }
  100% { transform: translateX(-50%) translateY(0) rotate(360deg); }
}

/* Particles - Optimized */
.particles-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: linear-gradient(45deg, #0ea5e9, #06b6d4);
  border-radius: 50%;
  animation: float 15s infinite ease-in-out;
  will-change: transform, opacity;
}

.particle-1 {
  top: 20%;
  left: 10%;
  animation-delay: 0s;
}

.particle-2 {
  top: 60%;
  left: 80%;
  animation-delay: -5s;
}

@keyframes float {
  0%, 100% { transform: translate3d(0, 0, 0); opacity: 0.3; }
  50% { transform: translate3d(0, -40px, 0); opacity: 0.5; }
}

/* Button styles */
.primary-cta-button {
  border-radius: 0.75rem;
  font-weight: 700;
  transition: all 0.3s ease;
  box-shadow: 0 10px 25px -5px rgba(14, 165, 233, 0.3);
}

.white-bg-button {
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Typography */
.hero-title-montserrat {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  letter-spacing: -0.02em;
}

.text-balance {
  text-wrap: balance;
}

/* Responsive design */
@media (max-width: 768px) {
  .wave-container,
  .particles-container {
    display: none;
  }

  .wave {
    height: 100px;
  }

  .particle {
    width: 2px;
    height: 2px;
  }
}

/* Sticky CTA animations */
.cta-card {
  animation: ctaSlideIn 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.cta-card--pulse {
  animation: ctaSlideIn 0.55s cubic-bezier(0.16, 1, 0.3, 1) both, ctaPulse 1.8s ease-in-out 0.6s 1;
}

@keyframes ctaSlideIn {
  0% {
    transform: translateX(24px);
    opacity: 0;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes ctaPulse {
  0%,
  100% {
    transform: translateX(0) scale(1);
  }
  35% {
    transform: translateX(0) scale(1.04);
  }
  70% {
    transform: translateX(0) scale(0.97);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cta-card,
  .cta-card--pulse {
    animation: none !important;
  }
}

/* Scroll to top control */
.scroll-top-button {
  pointer-events: auto;
  width: 3rem;
  height: 3rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-image: var(--accent-gradient);
  color: #f8fafc;
  border: none;
  box-shadow: 0 18px 34px -18px rgba(15, 23, 42, 0.55);
  transform: translateY(20px);
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.scroll-top-button.accent-focus {
  outline: none;
}

.scroll-top-button:hover,
.scroll-top-button:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 22px 36px -18px rgba(15, 23, 42, 0.65);
  opacity: 1;
}

.scroll-top-button:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 3px;
}

.scroll-top-button.show {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .scroll-top-button,
  .scroll-top-button:hover,
  .scroll-top-button:focus-visible {
    transform: none;
  }
}

/* Mouse glow effect */
.mouse-glow-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 25;
  opacity: 0;
  transition: opacity 200ms ease;
  mix-blend-mode: screen;
}

.mouse-glow-layer--active {
  opacity: 0.6;
}

.mouse-glow-pointer {
  position: absolute;
  top: 0;
  left: 0;
  width: 300px;
  height: 300px;
  pointer-events: none;
  border-radius: 9999px;
  mask-image: radial-gradient(circle, rgba(0, 0, 0, 1) 55%, rgba(0, 0, 0, 0.1) 75%, transparent 100%);
  background: radial-gradient(
    circle at center,
    rgba(255, 255, 255, 0.38) 0%,
    rgba(255, 255, 255, 0.22) 35%,
    rgba(14, 165, 233, 0.16) 60%,
    rgba(14, 165, 233, 0.05) 75%,
    transparent 85%
  );
  background: radial-gradient(
    circle at center,
    color-mix(in srgb, var(--accent-color) 25%, white 60%) 0%,
    color-mix(in srgb, var(--accent-color) 40%, transparent) 45%,
    color-mix(in srgb, var(--accent-color) 20%, transparent) 65%,
    transparent 82%
  );
  filter: blur(24px) saturate(130%);
  box-shadow: 0 0 140px 0 rgba(14, 165, 233, 0.24), 0 0 80px 0 rgba(255, 255, 255, 0.2);
  transform: translate3d(-9999px, -9999px, 0);
  transition: opacity 240ms ease;
  opacity: 0;
}

.mouse-glow-layer--active .mouse-glow-pointer {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .mouse-glow-layer,
  .mouse-glow-pointer {
    display: none !important;
  }
}

/* Scroll reveal */
.scroll-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 600ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 600ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.scroll-reveal--visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .scroll-reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
