/* Reset: cor base dos links em áreas claras */
a {
  color: inherit;
  text-decoration: none;
}
html:not(.dark) section.bg-white a:not([class*="text-"]):not(.gradient-bg):not(.btn-glow),
html:not(.dark) section.bg-gray-50 a:not([class*="text-"]):not(.gradient-bg):not(.btn-glow) {
  color: #2563eb;
}
html.dark section a:not([class*="text-"]):not(.gradient-bg):not(.btn-glow) {
  color: #60a5fa;
}

/* gradient-text NÃO vaza para filhos */
.gradient-text {
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.gradient-text * {
  -webkit-text-fill-color: initial;
}

.gradient-bg {
  background: linear-gradient(135deg, #2563eb, #7c3aed);
}
.gradient-bg-soft {
  background: linear-gradient(135deg, #eff6ff, #f3e8ff);
}

/* Header glass escuro - nunca branco */
.header-scrolled {
  background: rgba(15, 23, 42, 0.95) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-gradient {
  background-color: #0f172a;
  background-image: linear-gradient(
    135deg,
    #0f172a 0%,
    #1e3a8a 50%,
    #312e81 100%
  );
}

/* Animações */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.7s ease-out,
    transform 0.7s ease-out;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}
.fade-in-left {
  opacity: 0;
  transform: translateX(-40px);
  transition:
    opacity 0.7s ease-out,
    transform 0.7s ease-out;
}
.fade-in-left.visible {
  opacity: 1;
  transform: translateX(0);
}
.fade-in-right {
  opacity: 0;
  transform: translateX(40px);
  transition:
    opacity 0.7s ease-out,
    transform 0.7s ease-out;
}
.fade-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}
.scale-in {
  opacity: 0;
  transform: scale(0.9);
  transition:
    opacity 0.6s ease-out,
    transform 0.6s ease-out;
}
.scale-in.visible {
  opacity: 1;
  transform: scale(1);
}

.card-hover {
  transition: all 0.3s ease;
}
.card-hover:hover {
  transform: translateY(-8px);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}
.btn-glow {
  position: relative;
  overflow: hidden;
}
.btn-glow::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent,
    rgba(255, 255, 255, 0.15),
    transparent
  );
  transform: rotate(45deg);
  transition: all 0.6s ease;
}
.btn-glow:hover::after {
  left: 100%;
}
.portfolio-item {
  position: relative;
  overflow: hidden;
}
.portfolio-item .overlay {
  opacity: 0;
  transition: opacity 0.4s ease;
}
.portfolio-item:hover .overlay {
  opacity: 1;
}
.portfolio-item:hover img {
  transform: scale(1.1);
}
.portfolio-item img {
  transition: transform 0.5s ease;
}
@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-15px);
  }
}
.float-animation {
  animation: float 4s ease-in-out infinite;
}
@keyframes pulse-glow {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4);
  }
  50% {
    box-shadow: 0 0 0 15px rgba(37, 99, 235, 0);
  }
}
.pulse-glow {
  animation: pulse-glow 2s ease-in-out infinite;
}
.testimonial-card {
  transition: all 0.3s ease;
}
.testimonial-card:hover {
  transform: scale(1.03);
}
.grid-pattern {
  background-image: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.08) 1px,
    transparent 1px
  );
  background-size: 40px 40px;
}
.stagger-1 {
  transition-delay: 0.1s;
}
.stagger-2 {
  transition-delay: 0.2s;
}
.stagger-3 {
  transition-delay: 0.3s;
}
.stagger-4 {
  transition-delay: 0.4s;
}

@keyframes gradient-shift {
  0% { background-position: 0% center; }
  50% { background-position: 100% center; }
  100% { background-position: 0% center; }
}

/* ==================== DARK MODE ==================== */
html.dark { color-scheme: dark; }

html.dark .gradient-bg-soft {
  background: linear-gradient(135deg, #1e1b4b, #172554);
}

html.dark .header-scrolled {
  background: rgba(3, 7, 18, 0.95) !important;
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

/* Theme toggle animation */
.theme-toggle {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}
.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}
.theme-toggle svg {
  transition: transform 0.4s ease, opacity 0.3s ease;
}
.theme-toggle .icon-sun { position: absolute; opacity: 0; transform: rotate(-90deg) scale(0); }
.theme-toggle .icon-moon { position: absolute; opacity: 1; transform: rotate(0) scale(1); }
html.dark .theme-toggle .icon-sun { opacity: 1; transform: rotate(0) scale(1); }
html.dark .theme-toggle .icon-moon { opacity: 0; transform: rotate(90deg) scale(0); }
