/* ===== SCROLL REVEAL ANIMATIONS ===== */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.reveal-left {
  opacity: 0;
  transform: translateX(-60px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(60px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* Staggered delays for grid items */
[data-delay="50"] { transition-delay: 0.05s; }
[data-delay="100"] { transition-delay: 0.1s; }
[data-delay="150"] { transition-delay: 0.15s; }
[data-delay="200"] { transition-delay: 0.2s; }
[data-delay="250"] { transition-delay: 0.25s; }

/* ===== CUSTOM CURSOR ===== */
.custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 10000;
  mix-blend-mode: difference;
}

.cursor-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  background: #a855f7;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.2s, height 0.2s, background 0.2s;
}

.cursor-ring {
  position: absolute;
  width: 40px;
  height: 40px;
  border: 2px solid rgba(168, 85, 247, 0.5);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s, border-color 0.3s;
}

.custom-cursor.hovering .cursor-dot {
  width: 12px;
  height: 12px;
  background: #06b6d4;
}

.custom-cursor.hovering .cursor-ring {
  width: 60px;
  height: 60px;
  border-color: rgba(6, 182, 212, 0.5);
}

@media (max-width: 768px) {
  .custom-cursor {
    display: none;
  }
}

/* ===== MORPHING GRADIENT BACKGROUND ===== */
.gradient-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.gradient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.15;
  transition: all 2s cubic-bezier(0.16, 1, 0.3, 1);
}

.orb-1 {
  width: 600px;
  height: 600px;
  background: #a855f7;
  top: -200px;
  right: -200px;
  animation: orb-float-1 20s ease-in-out infinite;
}

.orb-2 {
  width: 500px;
  height: 500px;
  background: #06b6d4;
  bottom: -150px;
  left: -150px;
  animation: orb-float-2 25s ease-in-out infinite;
}

.orb-3 {
  width: 400px;
  height: 400px;
  background: #ec4899;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: orb-float-3 18s ease-in-out infinite;
}

@keyframes orb-float-1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(-100px, 100px) scale(1.1); }
  50% { transform: translate(50px, 50px) scale(0.9); }
  75% { transform: translate(-50px, -50px) scale(1.05); }
}

@keyframes orb-float-2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(80px, -80px) scale(1.15); }
  50% { transform: translate(-40px, 60px) scale(0.85); }
  75% { transform: translate(60px, 40px) scale(1.1); }
}

@keyframes orb-float-3 {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  33% { transform: translate(-30%, -70%) scale(1.2); }
  66% { transform: translate(-70%, -30%) scale(0.8); }
}

/* ===== LOADING SCREEN ===== */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #0a0a0f;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-content {
  text-align: center;
}

.loader-text {
  margin-top: 24px;
  color: #6b6b80;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
}

/* ===== PARALLAX ===== */
.parallax-layer {
  will-change: transform;
  transition: transform 0.1s linear;
}

/* ===== MAGNETIC BUTTON EFFECT ===== */
.magnetic {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ===== TEXT SHIMMER ===== */
@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

.shimmer-text {
  background: linear-gradient(
    90deg,
    var(--text-primary) 0%,
    var(--accent-purple) 25%,
    var(--accent-cyan) 50%,
    var(--accent-purple) 75%,
    var(--text-primary) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 4s linear infinite;
}

/* ===== RIPPLE EFFECT ===== */
.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(168, 85, 247, 0.15) 10%, transparent 10.01%);
  background-repeat: no-repeat;
  background-position: 50%;
  transform: scale(10, 10);
  opacity: 0;
  transition: transform 0.5s, opacity 0.8s;
}

.ripple:active::after {
  transform: scale(0, 0);
  opacity: 0.3;
  transition: 0s;
}

/* ===== GLOWING BORDER ANIMATION ===== */
@keyframes border-glow {
  0%, 100% {
    border-color: rgba(168, 85, 247, 0.2);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.1);
  }
  50% {
    border-color: rgba(6, 182, 212, 0.3);
    box-shadow: 0 0 30px rgba(6, 182, 212, 0.15);
  }
}

.glow-pulse {
  animation: border-glow 3s ease-in-out infinite;
}

/* ===== TILT EFFECT ===== */
.tilt-card {
  transform-style: preserve-3d;
  perspective: 1000px;
}

.tilt-card-inner {
  transform: translateZ(20px);
}

/* ===== FLOATING PARTICLES ===== */
.particle {
  position: fixed;
  pointer-events: none;
  border-radius: 50%;
  z-index: 1;
}

/* ===== SECTION DIVIDER ===== */
.section-divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-purple), var(--accent-cyan), transparent);
  opacity: 0.3;
}

/* ===== FORM SUCCESS ANIMATION ===== */
@keyframes success-check {
  0% { transform: scale(0) rotate(-45deg); opacity: 0; }
  50% { transform: scale(1.2) rotate(-45deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.form-success {
  animation: success-check 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ===== SMOOTH SECTION TRANSITIONS ===== */
section {
  position: relative;
}

section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(180deg, var(--bg-primary), transparent);
  pointer-events: none;
  opacity: 0.5;
  z-index: 1;
}

section:nth-child(even)::before {
  background: linear-gradient(180deg, var(--bg-secondary), transparent);
}

/* ===== NOISE TEXTURE OVERLAY ===== */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9998;
  opacity: 0.015;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* ===== HIGHLIGHT HIGHLIGHT ===== */
::selection {
  background: rgba(168, 85, 247, 0.3);
  color: white;
}

/* ===== SMOOTH ANCHOR OFFSET ===== */
section[id] {
  scroll-margin-top: 80px;
}

/* ===== FORM ANIMATIONS ===== */
.contact-form.success {
  border-color: rgba(16, 185, 129, 0.5) !important;
}

.contact-form.success::before {
  content: 'Message Sent!';
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #10b981, #06b6d4);
  color: white;
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  animation: success-check 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
