/* ============================================
   Aceternity UI-inspired effects
   ============================================ */

/* --- Dot Grid Background --- */
.dot-pattern {
  background-image: radial-gradient(circle, rgba(148, 163, 184, 0.25) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none; /* allow clicks and selection to pass through decorative overlay */
}
.dot-pattern > * {
  pointer-events: auto;
}

/* --- Spotlight Card Effect --- */
.spotlight-card {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.spotlight-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(37, 99, 235, 0.08),
    transparent 40%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: 0;
}
.spotlight-card:hover::before {
  opacity: 1;
}
.spotlight-card > * {
  position: relative;
  z-index: 1;
}

/* --- Moving Border / Gradient Border --- */
@property --border-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}
.moving-border {
  position: relative;
  border-radius: 1.5rem;
  background: white;
}
.moving-border::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: conic-gradient(
    from var(--border-angle, 0deg),
    transparent 70%,
    #2563EB 78%,
    #0891B2 88%,
    #22D3EE 94%,
    transparent 100%
  );
  z-index: -1;
  animation: border-spin 4s linear infinite;
}
/* Fallback for browsers without @property support */
@supports not (background: conic-gradient(from 0deg, red, blue)) {
  .moving-border::before {
    background: linear-gradient(135deg, #2563EB, #0891B2);
  }
}
@keyframes border-spin {
  to { --border-angle: 360deg; }
}

/* --- Text Shimmer / Gradient Sweep --- */
.text-shimmer {
  background: linear-gradient(
    110deg,
    #1E3A5F 30%,
    #2563EB 42%,
    #0891B2 50%,
    #6366F1 58%,
    #1E3A5F 70%
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 3s ease-in-out infinite;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* --- Glow Effect (buttons, cards) --- */
.glow {
  box-shadow:
    0 0 20px rgba(37, 99, 235, 0.2),
    0 0 60px rgba(37, 99, 235, 0.1);
}
.glow-sm {
  box-shadow: 0 0 15px rgba(37, 99, 235, 0.15);
}

/* --- Meteors / Shooting Stars --- */
.meteors-container {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.meteor {
  position: absolute;
  width: 2px;
  height: 80px;
  background: linear-gradient(to bottom, rgba(37, 99, 235, 0.6), transparent);
  border-radius: 9999px;
  animation: meteor-fall linear infinite;
  opacity: 0;
}
.meteor:nth-child(1) { left: 15%; animation-duration: 3s; animation-delay: 0s; }
.meteor:nth-child(2) { left: 35%; animation-duration: 4s; animation-delay: 1.2s; }
.meteor:nth-child(3) { left: 55%; animation-duration: 3.5s; animation-delay: 2.4s; }
.meteor:nth-child(4) { left: 75%; animation-duration: 4.5s; animation-delay: 0.8s; }
.meteor:nth-child(5) { left: 90%; animation-duration: 3.2s; animation-delay: 3s; }
@keyframes meteor-fall {
  0%   { transform: translateY(-100px) rotate(215deg); opacity: 0; }
  10%  { opacity: 1; }
  70%  { opacity: 1; }
  100% { transform: translateY(calc(100vh + 100px)) rotate(215deg); opacity: 0; }
}

/* --- Scroll Reveal --- */
.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.revealed {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }
.reveal-delay-6 { transition-delay: 0.6s; }

/* --- 3D Tilt Card --- */
.tilt-card {
  transform-style: preserve-3d;
  perspective: 1000px;
  transition: transform 0.15s ease-out;
}
.tilt-card-inner {
  transform: inherit;
  will-change: transform;
}

/* --- Bento Grid Layout --- */
.bento-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: auto;
}
.bento-item-wide {
  grid-column: span 2;
}
.bento-item-tall {
  grid-row: span 2;
}
@media (max-width: 1023px) {
  .bento-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .bento-item-wide {
    grid-column: span 2;
  }
}
@media (max-width: 767px) {
  .bento-grid {
    grid-template-columns: 1fr;
  }
  .bento-item-wide {
    grid-column: span 1;
  }
}

/* --- Subtle Background Beams --- */
.bg-beams {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.bg-beams::before,
.bg-beams::after {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.12;
  animation: beam-drift 12s ease-in-out infinite alternate;
}
.bg-beams::before {
  background: #2563EB;
  top: -10%;
  left: 10%;
}
.bg-beams::after {
  background: #818CF8;
  bottom: -10%;
  right: 10%;
  animation-delay: -6s;
}
@keyframes beam-drift {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(80px, 40px) scale(1.3); }
}

/* --- Animated Grid Background --- */
.animated-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.animated-grid::before {
  content: '';
  position: absolute;
  inset: -50%;
  background-image:
    linear-gradient(rgba(37, 99, 235, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.05) 1px, transparent 1px);
  background-size: 60px 60px;
  animation: grid-scroll 20s linear infinite;
}
@keyframes grid-scroll {
  0%   { transform: translate(0, 0); }
  100% { transform: translate(60px, 60px); }
}

/* --- Typing Cursor --- */
.typing-cursor::after {
  content: '|';
  animation: blink-cursor 1s step-end infinite;
  color: #2563EB;
  font-weight: 300;
}
@keyframes blink-cursor {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0; }
}

/* --- Hover Lift (enhanced card-hover) --- */
.hover-lift {
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.hover-lift:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow:
    0 25px 50px -12px rgba(0, 0, 0, 0.12),
    0 0 30px rgba(37, 99, 235, 0.08);
}

/* --- Gradient Mesh Background (hero) --- */
.gradient-mesh {
  background:
    radial-gradient(at 15% 25%, rgba(37, 99, 235, 0.1) 0%, transparent 50%),
    radial-gradient(at 85% 75%, rgba(124, 58, 237, 0.07) 0%, transparent 50%),
    radial-gradient(at 50% 50%, rgba(8, 145, 178, 0.05) 0%, transparent 70%);
}

/* --- Noise Texture Overlay --- */
.noise-overlay {
  position: relative;
}
.noise-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  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.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1;
  opacity: 0.4;
}

/* --- Stagger Animation for lists --- */
.stagger-in > * {
  opacity: 0;
  transform: translateY(20px);
  animation: stagger-fade-in 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.stagger-in > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-in > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-in > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-in > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-in > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-in > *:nth-child(6) { animation-delay: 0.3s; }
@keyframes stagger-fade-in {
  to { opacity: 1; transform: translateY(0); }
}

/* --- Frosted Glass (enhanced) --- */
.frosted-glass {
  backdrop-filter: blur(20px) saturate(180%);
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* --- Number Counter Animation --- */
@keyframes count-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.count-animate {
  animation: count-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* --- Badge Pulse --- */
.badge-pulse {
  animation: badge-glow 2s ease-in-out infinite;
}
@keyframes badge-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.3); }
  50%      { box-shadow: 0 0 0 8px rgba(37, 99, 235, 0); }
}

/* --- Underline Animation --- */
.animated-underline {
  position: relative;
  display: inline-block;
}
.animated-underline::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #2563EB, #6366F1);
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.animated-underline:hover::after {
  width: 100%;
}

/* --- Step Circle Glow Ring --- */
.step-circle {
  position: relative;
}
.step-circle::before,
.step-circle::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  border: 2px solid rgba(37, 99, 235, 0.25);
  transition: all 0.4s ease;
}
.step-circle::after {
  inset: -10px;
  border-color: rgba(37, 99, 235, 0.08);
}
.step-circle:hover::before {
  inset: -6px;
  border-color: rgba(37, 99, 235, 0.5);
  box-shadow: 0 0 20px rgba(37, 99, 235, 0.15);
}
.step-circle:hover::after {
  inset: -14px;
  border-color: rgba(37, 99, 235, 0.2);
}
