/* Custom CSS for Home Page */

/* Gradient text effect */
.gradient-text {
  background: linear-gradient(135deg, #3b82f6, #8b5cf6, #06b6d4);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradient-shift 3s ease-in-out infinite;
}

@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Hero background */
.hero-bg {
  background: linear-gradient(to bottom right, #3b82f6, #2563eb, #8b5cf6);
  position: relative;
}

.hero-bg::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 80%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(6, 182, 212, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

/* Floating animation */
@keyframes floating-animation {
  0%, 100% {
    transform: translateY(0px) translateX(0px) rotate(0deg);
    opacity: 0.7;
  }
  25% {
    transform: translateY(-20px) translateX(10px) rotate(90deg);
    opacity: 0.9;
  }
  50% {
    transform: translateY(-40px) translateX(-10px) rotate(180deg);
    opacity: 0.6;
  }
  75% {
    transform: translateY(-20px) translateX(-15px) rotate(270deg);
    opacity: 0.8;
  }
}

.floating-animation {
  animation: floating-animation 8s ease-in-out infinite;
}

/* Fade in up animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.8s ease-out forwards;
  opacity: 0;
}

.fade-in-up.stagger-1 {
  animation-delay: 0.2s;
}

.fade-in-up.stagger-2 {
  animation-delay: 0.4s;
}

.fade-in-up.stagger-3 {
  animation-delay: 0.6s;
}

.fade-in-up.stagger-4 {
  animation-delay: 0.8s;
}

.fade-in-up.stagger-5 {
  animation-delay: 1.0s;
}

.fade-in-up.stagger-6 {
  animation-delay: 1.2s;
}

/* Backdrop filter support */
.backdrop-filter {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Hover lift effect */
.hover-lift {
  transition: all 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Pillar card hover effect */
.pillar-card {
  transition: all 0.4s ease;
  position: relative;
  overflow: hidden;
}

.pillar-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.pillar-card:hover::before {
  left: 100%;
}

.pillar-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

/* Section divider */
.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(156, 163, 175, 0.3), transparent);
  margin: 0;
}

/* Subtle shift animation */
@keyframes subtle-shift {
  0%, 100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(5px);
  }
}

.subtle-shift {
  animation: subtle-shift 3s ease-in-out infinite;
}

/* Float animation */
@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

.float {
  animation: float 3s ease-in-out infinite;
}

/* Button hover effects */
button, .btn {
  position: relative;
  overflow: hidden;
}

/* Delayed content animation */
@keyframes delayedFadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#delayed-text {
  opacity: 0;
  transform: translateY(20px);
  animation: delayedFadeInUp 0.8s ease-out 1s forwards;
}

#delayed-button {
  opacity: 0;
  transform: translateY(20px);
  animation: delayedFadeInUp 0.8s ease-out 1.1s forwards;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .hero-bg {
    min-height: 100vh;
    padding-left: 20px;
    padding-right: 20px;
  }
  
  .fade-in-up {
    animation-delay: 0s !important;
  }
  
  .fade-in-up.stagger-1,
  .fade-in-up.stagger-2,
  .fade-in-up.stagger-3,
  .fade-in-up.stagger-4,
  .fade-in-up.stagger-5,
  .fade-in-up.stagger-6 {
    animation-delay: 0.1s;
  }

  /* Mobile hero heading at 32px to prevent overflow */
  .hero-bg h1 {
    font-size: 32px;
    line-height: 1.25;
  }

  /* Enable automatic wrapping for the delayed intro paragraph on mobile */
  #delayed-text p {
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}

/* Smooth transitions for all interactive elements */
* {
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}



/* Focus states for accessibility */
button:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* General links focus, but exclude navigation links */
a:focus:not(.nav-link) {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Navigation links should not show outline on focus to avoid visual confusion */
nav a:focus,
.nav-link:focus {
  outline: none;
}

/* Typewriter effect */
.typewriter {
  overflow: hidden;
  white-space: nowrap;
  animation: typing 2.5s steps(40, end);
  position: relative;
}

.typewriter-line2 {
  overflow: hidden;
  white-space: nowrap;
  animation: typing-line2 2s steps(30, end) 3s both;
  position: relative;
}

@keyframes typing {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes typing-line2 {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes blink-caret {
  from, to { border-color: transparent; }
  50% { border-color: rgba(255, 255, 255, 0.75); }
}

@keyframes blink-caret-gradient {
  from, to { border-color: transparent; }
  50% { border-color: rgba(139, 92, 246, 0.75); }
}

/* Caret styles controlled by JS */
.typewriter.has-caret::after,
.typewriter-line2.has-caret::after {
  content: '';
  display: inline-block;
  width: 3px;
  height: 1em;
  margin-left: 2px;
  background-color: rgba(255, 255, 255, 0.85);
  animation: blink-caret 0.75s step-end infinite;
}

.typewriter-line2.has-caret::after {
  background-color: rgba(139, 92, 246, 0.85);
}

/* Removed conflicting delayed-content rules */

/* Print styles */
@media print {
  .floating-animation,
  .fade-in-up {
    animation: none !important;
  }
  
  .hero-bg::before {
    display: none;
  }
  
  .typewriter,
  .typewriter-line2 {
    animation: none !important;
    border-right: none !important;
    white-space: normal !important;
  }
}

@media (max-width: 768px) {
  /* Constrain hero heading to viewport width on mobile */
  .hero-bg h1 {
    overflow: hidden;
  }

  /* Keep typewriter animation, but cap width to container */
  .typewriter,
  .typewriter-line2 {
    width: 100%;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
  }
}

@media (max-width: 768px) {
  /* Ensure equal left/right padding on hero inner container */
  #home .w-full.max-w-7xl {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }
}