/* Loading Screen Styles */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

.loading-screen.fade-out {
  opacity: 0;
  visibility: hidden;
}

.loading-container {
  text-align: center;
  position: relative;
  z-index: 2;
}

.loading-logo {
  margin-bottom: 3rem;
  animation: logoFadeIn 1.5s ease-out;
}

.loading-logo .logo-text-tri {
  background: linear-gradient(45deg, #ffffff, #f8fafc, #e2e8f0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s ease-in-out infinite;
}

.loading-logo .logo-text-stack {
  background: linear-gradient(45deg, #10b981, #34d399, #6ee7b7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s ease-in-out infinite 0.5s;
}

.loading-logo .logo-text-labs {
  background: linear-gradient(45deg, #3b82f6, #60a5fa, #93c5fd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s ease-in-out infinite 1s;
}

.loading-logo .logo-accent-dot {
  animation: enhanced-pulse 2s ease-in-out infinite;
  filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.8));
  will-change: transform, opacity;
}

.loading-underline {
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #10b981, #3b82f6, #10b981, transparent);
  background-size: 200% 100%;
  animation: loading-gradient 2s ease-in-out infinite;
  margin-top: 1rem;
  border-radius: 1px;
  will-change: background-position;
}

.loading-spinner {
  margin: 2rem 0;
  animation: spinnerFadeIn 2s ease-out 0.5s both;
}

.spinner-ring {
  width: 80px;
  height: 80px;
  margin: 0 auto;
  position: relative;
}

.spinner-ring::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 3px solid rgba(16, 185, 129, 0.2);
  border-radius: 50%;
}

.spinner-inner {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 3px solid transparent;
  border-top: 3px solid #10b981;
  border-right: 3px solid #3b82f6;
  border-radius: 50%;
  animation: spin 1.5s linear infinite;
}

.loading-text {
  margin: 2rem 0;
  animation: textFadeIn 2s ease-out 1s both;
}

.loading-dots {
  display: inline-flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  animation: dotPulse 1.5s ease-in-out infinite;
}

.dot:nth-child(2) {
  animation-delay: 0.2s;
}

.dot:nth-child(3) {
  animation-delay: 0.4s;
}

.loading-progress {
  margin-top: 3rem;
  animation: progressFadeIn 2s ease-out 1.5s both;
}

.progress-bar {
  width: 300px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  margin: 0 auto 1rem;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #3b82f6, #10b981);
  background-size: 200% 100%;
  border-radius: 2px;
  width: 0%;
  animation: progressFill 3s ease-out forwards, loading-gradient 2s ease-in-out infinite;
}

.progress-text {
  color: #10b981;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
}

.loading-pattern {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 25% 25%, rgba(16, 185, 129, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 75% 25%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 25% 75%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 75% 75%, rgba(16, 185, 129, 0.1) 0%, transparent 50%);
  animation: patternMove 20s ease-in-out infinite;
  z-index: 1;
}

/* Loading Screen Animations */
@keyframes logoFadeIn {
  0% {
    opacity: 0;
    transform: translateY(-30px) scale(0.8);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes spinnerFadeIn {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes textFadeIn {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes progressFadeIn {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes dotPulse {
  0%, 100% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

@keyframes loading-gradient {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

@keyframes progressFill {
  0% {
    width: 0%;
  }
  25% {
    width: 25%;
  }
  50% {
    width: 60%;
  }
  75% {
    width: 85%;
  }
  100% {
    width: 100%;
  }
}

@keyframes patternMove {
  0%, 100% {
    transform: translateX(0) translateY(0);
  }
  25% {
    transform: translateX(10px) translateY(-10px);
  }
  50% {
    transform: translateX(-5px) translateY(10px);
  }
  75% {
    transform: translateX(5px) translateY(-5px);
  }
}

/* Hide main content during loading */
body.loading {
  overflow: hidden;
}

body.loading main {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

body.loaded main {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive Loading Screen */
@media (max-width: 768px) {
  .loading-logo h1 {
    font-size: 2.5rem;
  }
  
  .loading-logo .logo-text-labs {
    font-size: 2rem;
  }
  
  .progress-bar {
    width: 250px;
  }
  
  .spinner-ring {
    width: 60px;
    height: 60px;
  }
}

/* CSS Custom Properties for Brand Colors */
:root {
  --primary-blue: #0f172a;
  --secondary-blue: #1e293b;
  --accent-blue: #3b82f6;
  --light-blue: #dbeafe;
  --primary-green: #10b981;
  --light-green: #d1fae5;
  --dark-green: #047857;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --background-light: #f8fafc;
  --background-white: #ffffff;
  --gradient-primary: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  --gradient-accent: linear-gradient(135deg, #10b981 0%, #047857 100%);
  --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-medium: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-large: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --border-radius: 1rem;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Smooth Scrolling and Enhanced Animations */
* {
  scroll-behavior: smooth;
}

html {
  scroll-padding-top: 80px; /* Account for fixed header if needed */
}

body {
  font-family: "Inter", sans-serif;
  background-color: var(--background-light);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden; /* Prevent horizontal scroll */
}

/* Smooth scroll for webkit browsers */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #10b981, #3b82f6);
  border-radius: 4px;
  transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #047857, #1d4ed8);
}

/* Enhanced Page Load Animations */
.page-enter {
  animation: pageEnter 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes pageEnter {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Enhanced Scroll Reveal Animations */
.scroll-reveal {
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.scroll-reveal-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.scroll-reveal-left.revealed {
  opacity: 1;
  transform: translateX(0);
}

.scroll-reveal-right {
  opacity: 0;
  transform: translateX(50px);
  transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.scroll-reveal-right.revealed {
  opacity: 1;
  transform: translateX(0);
}

.scroll-reveal-scale {
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.scroll-reveal-scale.revealed {
  opacity: 1;
  transform: scale(1);
}

/* Stagger animation delays */
.scroll-reveal:nth-child(1) { transition-delay: 0.1s; }
.scroll-reveal:nth-child(2) { transition-delay: 0.2s; }
.scroll-reveal:nth-child(3) { transition-delay: 0.3s; }
.scroll-reveal:nth-child(4) { transition-delay: 0.4s; }
.scroll-reveal:nth-child(5) { transition-delay: 0.5s; }
.scroll-reveal:nth-child(6) { transition-delay: 0.6s; }

.font-display {
  font-family: "Space Grotesk", sans-serif;
}

/* Enhanced Logo Styles with Better Animations */
.logo-container {
  position: relative;
  display: inline-block;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo-container::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 140%;
  height: 140%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.15) 0%, rgba(59, 130, 246, 0.1) 50%, transparent 70%);
  transform: translate(-50%, -50%) scale(0.8);
  border-radius: 50%;
  z-index: -1;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo-container:hover {
  transform: translateY(-2px) scale(1.02);
}

.logo-container:hover::before {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.logo-accent-dot {
  animation: enhanced-pulse 3s ease-in-out infinite;
  filter: drop-shadow(0 0 4px rgba(16, 185, 129, 0.6));
}

@keyframes enhanced-pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
    filter: drop-shadow(0 0 4px rgba(16, 185, 129, 0.6));
  }
  25% {
    opacity: 0.8;
    transform: scale(1.1);
    filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.8));
  }
  50% {
    opacity: 0.9;
    transform: scale(1.3);
    filter: drop-shadow(0 0 12px rgba(16, 185, 129, 1));
  }
  75% {
    opacity: 0.85;
    transform: scale(1.15);
    filter: drop-shadow(0 0 6px rgba(16, 185, 129, 0.7));
  }
}

/* Logo text gradient animation */
.logo-text-tri {
  background: linear-gradient(45deg, #ffffff, #f8fafc, #e2e8f0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 4s ease-in-out infinite;
}

.logo-text-stack {
  background: linear-gradient(45deg, #10b981, #34d399, #6ee7b7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 4s ease-in-out infinite 0.5s;
}

.logo-text-labs {
  background: linear-gradient(45deg, #3b82f6, #60a5fa, #93c5fd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 4s ease-in-out infinite 1s;
}

@keyframes shimmer {
  0%, 100% {
    filter: brightness(1) saturate(1);
  }
  50% {
    filter: brightness(1.2) saturate(1.3);
  }
}

/* Enhanced Button Styles */
.btn-primary {
  background: var(--gradient-accent);
  color: white;
  padding: 0.875rem 2rem;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 1.1rem;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-medium);
  position: relative;
  overflow: hidden;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-large);
}

.btn-primary::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;
}

.btn-primary:hover::before {
  left: 100%;
}

/* Card Enhancements */
.card {
  background: var(--background-white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-soft);
  transition: var(--transition);
  border: 1px solid #f1f5f9;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-medium);
}

/* Section Headers */
.section-header {
  background: var(--gradient-primary);
  color: white;
  padding: 1rem 2.5rem;
  border-radius: 0 3rem 3rem 3rem;
  display: inline-block;
  font-weight: 600;
  font-size: 1.25rem;
  box-shadow: var(--shadow-medium);
  position: relative;
}

.section-header::after {
  content: '';
  position: absolute;
  bottom: -8px;
  right: -8px;
  width: 16px;
  height: 16px;
  background: var(--primary-green);
  border-radius: 50%;
}

/* Service Cards */
.service-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--border-radius);
  transition: var(--transition);
  box-shadow: var(--shadow-soft);
}

.service-card:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-large);
}

.service-overlay {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.85) 0%, rgba(30, 41, 59, 0.85) 100%);
  transition: var(--transition);
}

.service-card:hover .service-overlay {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.95) 100%);
}

/* Typography Improvements */
.hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  background: linear-gradient(135deg, #ffffff 0%, #d1fae5 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  color: #e2e8f0;
  font-weight: 400;
  max-width: 48rem;
  margin: 0 auto;
}

/* Form Enhancements */
.form-input {
  padding: 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 0.75rem;
  background: var(--background-white);
  color: var(--text-primary);
  font-size: 1rem;
  transition: var(--transition);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-green);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Enhanced Navigation Animations */
.nav-link {
  position: relative;
  padding: 0.75rem 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.nav-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0.1), transparent);
  transition: left 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover::before {
  left: 100%;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #10b981, #3b82f6);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateX(-50%);
}

.nav-link:hover::after {
  width: 100%;
}

.nav-link:hover {
  color: #10b981;
  transform: translateY(-2px);
}

/* Enhanced Hero Animations */
.hero-content {
  animation: heroSlideUp 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes heroSlideUp {
  0% {
    opacity: 0;
    transform: translateY(80px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-button {
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-button:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 20px 40px rgba(16, 185, 129, 0.3);
}

.hero-button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translate(-50%, -50%);
  border-radius: 50%;
}

.hero-button:hover::before {
  width: 300px;
  height: 300px;
}

/* Parallax Effect */
.parallax-element {
  transition: transform 0.1s ease-out;
}

/* Accessibility Improvements */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Animation Classes */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Shake Animation */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* Logo Click Animation */
@keyframes logoClick {
  0% { transform: scale(1) rotate(0deg); }
  25% { transform: scale(1.1) rotate(5deg); }
  50% { transform: scale(1.05) rotate(-3deg); }
  75% { transform: scale(1.02) rotate(1deg); }
  100% { transform: scale(1) rotate(0deg); }
}

/* Responsive Typography */
@media (max-width: 768px) {
  .section-header {
    font-size: 1.125rem;
    padding: 0.875rem 2rem;
  }
}

/* Gradient Animation Utilities */
.bg-size-200 {
  background-size: 200% 200%;
}

.animate-gradient-x {
  animation: gradient-x 3s ease infinite;
}

@keyframes gradient-x {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

/* Loading Animation for Images */
.image-loading {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
