/* ===== BASE ===== */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
}

::selection {
  background: #d8b4fe;
  color: #3b0764;
}

/* ===== HEADER ===== */
#header {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(168, 85, 247, 0.08);
  transition: box-shadow 0.4s ease, background 0.4s ease;
}

#header.scrolled {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 30px rgba(124, 58, 237, 0.07);
}

/* ===== HERO ANIMATIONS ===== */
.hero-elem {
  opacity: 0;
  transform: translateY(30px);
  animation: heroSlideUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.hero-elem:nth-child(1) { animation-delay: 0.1s; }
.hero-elem:nth-child(2) { animation-delay: 0.25s; }
.hero-elem:nth-child(3) { animation-delay: 0.4s; }
.hero-elem:nth-child(4) { animation-delay: 0.55s; }

@keyframes heroSlideUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-card {
  opacity: 0;
  transform: translateY(40px) scale(0.97);
  animation: heroCardIn 1s cubic-bezier(0.22, 1, 0.36, 1) 0.3s forwards;
}

@keyframes heroCardIn {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Floating cards */
.floating-card {
  opacity: 0;
  animation: floatIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.card-1 { animation-delay: 0.8s; }
.card-2 { animation-delay: 1.0s; }
.card-3 { animation-delay: 1.2s; }

@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Continuous floating */
.card-1 {
  animation: floatIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.8s forwards,
             floatY 4s ease-in-out 1.5s infinite;
}
.card-2 {
  animation: floatIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) 1.0s forwards,
             floatY 4.5s ease-in-out 1.7s infinite;
}
.card-3 {
  animation: floatIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) 1.2s forwards,
             floatY 3.8s ease-in-out 1.9s infinite;
}

@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ===== REVEAL ON SCROLL ===== */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== SERVICE CARDS ===== */
.service-card {
  position: relative;
  overflow: hidden;
}
.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #7e22ce, #f59e0b);
  opacity: 0;
  transition: opacity 0.4s ease;
}
.service-card:hover::before {
  opacity: 1;
}

/* ===== MOBILE MENU ===== */
.mobile-link {
  position: relative;
}
.mobile-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #7e22ce, #f59e0b);
  transition: width 0.3s ease;
  border-radius: 1px;
}
.mobile-link:hover::after {
  width: 60%;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #faf5ff;
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #d8b4fe, #fcd34d);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #c084fc, #fbbf24);
}

/* ===== FOCUS ===== */
:focus-visible {
  outline: 2px solid #a855f7;
  outline-offset: 2px;
  border-radius: 4px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .floating-card {
    display: none;
  }

  .hero-card {
    max-width: 100% !important;
  }
}
