/* ============================================
   BASE STYLES & RESET
   ============================================ */
html {
  background-color: #0f1617;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

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

body {
  font-family: "JetBrains Mono", "Courier New", monospace;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  /* CRITICAL: Do NOT set overflow-y hidden */
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-overflow-scrolling: touch; /* Smooth momentum scroll on iOS */
}

main {
  flex: 1;
}

footer {
  margin-top: auto;
}

/* ============================================
   GRID PATTERN
   ============================================ */
.bg-grid-pattern {
  background-image:
    linear-gradient(to right, #e5e7eb 1px, transparent 1px),
    linear-gradient(to bottom, #e5e7eb 1px, transparent 1px);
  background-size: 40px 40px;
}

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

.animate-float {
  animation: float 6s ease-in-out infinite;
  will-change: transform;
}

.animate-float-delayed {
  animation: float 7s ease-in-out infinite 2s;
}

@keyframes scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.marquee-container {
  overflow: hidden;
  white-space: nowrap;
}

.marquee-content {
  display: inline-flex;
  animation: scroll 30s linear infinite;
}

/* ============================================
   FLUID TYPOGRAPHY UTILITIES
   ============================================ */
.fluid-hero-title {
  font-size: clamp(1.875rem, 5vw + 1rem, 4.5rem);
  line-height: 1.1;
}

.fluid-section-title {
  font-size: clamp(1.5rem, 3vw + 0.75rem, 3rem);
  line-height: 1.2;
}

.fluid-card-title {
  font-size: clamp(1.125rem, 1.5vw + 0.5rem, 1.5rem);
  line-height: 1.3;
}

.fluid-body-large {
  font-size: clamp(0.9375rem, 1vw + 0.5rem, 1.25rem);
  line-height: 1.6;
}

.fluid-body {
  font-size: clamp(0.875rem, 0.5vw + 0.75rem, 1rem);
  line-height: 1.7;
}

/* ============================================
   TOUCH-FRIENDLY IMPROVEMENTS
   ============================================ */
.touch-target {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ============================================
   MOBILE-FIRST RESPONSIVE STYLES
   ============================================ */

/* Critical mobile fixes for hero section */
@media screen and (max-width: 768px) {
  .hero-section {
    overflow: visible !important;
    min-height: auto !important;
    height: auto !important;
  }

  .fluid-hero-title {
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .hero-content {
    position: relative;
    z-index: 10;
    overflow: visible !important;
  }

  /* Hide floating avatars on tablet and below */
  .animate-float,
  .animate-float-delayed {
    display: none !important;
  }

  /* Fix any overflow containers that block scrolling */
  section,
  .section-padding,
  main {
    overflow: visible !important;
    max-height: none !important;
    height: auto !important;
  }

  /* Ensure nav doesn't block content */
  nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
  }
}

/* Extra small devices (320px - 480px) */
@media screen and (max-width: 480px) {
  .hero-badge {
    font-size: 0.625rem;
    padding: 0.375rem 0.75rem;
  }

  .stat-number {
    font-size: 2.25rem !important;
  }

  .logo-strip {
    gap: 1rem !important;
  }

  .logo-strip > div {
    font-size: 0.875rem !important;
  }

  .mobile-card-padding {
    padding: 1rem !important;
  }

  .cta-heading {
    font-size: 1.5rem !important;
    line-height: 1.3 !important;
  }

  .footer-grid {
    gap: 1.5rem !important;
  }

  .bg-grid-pattern {
    background-size: 30px 30px;
  }
}

/* Small devices (481px - 640px) */
@media screen and (max-width: 640px) {
  .nav-container {
    padding-left: 1rem;
    padding-right: 1rem;
    height: 4rem;
  }

  .hero-section {
    padding-top: 6rem;
    padding-bottom: 3rem;
  }

  .hero-content {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .section-padding {
    padding-top: 3rem;
    padding-bottom: 3rem;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .btn-primary,
  .btn-secondary {
    min-height: 48px;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .testimonial-text {
    font-size: 1.125rem !important;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  .bento-card {
    padding: 1.25rem !important;
  }

  .chart-container {
    padding: 1rem !important;
  }

  .chart-bars {
    gap: 0.25rem !important;
  }
}

/* Medium devices / Tablets (641px - 768px) */
@media screen and (max-width: 768px) {
  .section-md-padding {
    padding-top: 4rem;
    padding-bottom: 4rem;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr !important;
  }

  .logo-strip {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
  }

  .stats-container {
    flex-direction: column;
    gap: 2rem;
  }
}

/* Large devices / Small laptops (769px - 1024px) */
@media screen and (min-width: 769px) and (max-width: 1024px) {
  .bento-wide-card {
    flex-direction: column !important;
    gap: 2rem !important;
  }

  .cta-container {
    flex-direction: column;
    text-align: center;
    gap: 2rem;
  }
}

/* ============================================
   DESKTOP ENHANCEMENTS (1025px+)
   ============================================ */
@media screen and (min-width: 1025px) {
  .animate-float,
  .animate-float-delayed {
    animation-play-state: running;
  }

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

/* ============================================
   ULTRA-WIDE SCREENS (1440px+)
   ============================================ */
@media screen and (min-width: 1440px) {
  .max-content-width {
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* ============================================
   REDUCED MOTION ACCESSIBILITY
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  .animate-float,
  .animate-float-delayed,
  .marquee-content {
    animation: none;
  }

  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ============================================
   SAFE AREA INSETS (Notch devices)
   ============================================ */
@supports (padding: max(0px)) {
  .safe-area-padding {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }

  .safe-area-bottom {
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  .no-print {
    display: none !important;
  }

  body {
    background: white;
  }

  .bg-grid-pattern {
    background-image: none;
  }
}
