@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;600&family=Space+Grotesk:wght@600;700;800&display=swap');

/* CACHE BUST: REMOVE GLOBAL VIDEO HIDING V9 - 2025-09-03 */

/* ===========================================
   MOBILE-FIRST RESPONSIVE DESIGN SYSTEM
   Built for performance and scalability
   =========================================== */

/* CSS CUSTOM PROPERTIES - MOBILE-FIRST FLUID DESIGN */
:root {
  /* Fluid Typography Scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.375vw, 1rem);
  --text-base: clamp(1rem, 0.9rem + 0.5vw, 1.25rem);
  --text-lg: clamp(1.125rem, 1rem + 0.625vw, 1.5rem);
  --text-xl: clamp(1.25rem, 1.1rem + 0.75vw, 1.75rem);
  --text-2xl: clamp(1.5rem, 1.3rem + 1vw, 2.25rem);
  --text-3xl: clamp(1.875rem, 1.6rem + 1.375vw, 2.875rem);
  --text-hero: clamp(1.6rem, 8vw, 6.5rem);
  --text-subtitle: clamp(1rem, 3vw, 1.5rem);

  /* Fluid Spacing System */
  --space-xs: clamp(0.5rem, 1vw, 0.75rem);
  --space-sm: clamp(0.75rem, 1.5vw, 1rem);
  --space-base: clamp(1rem, 2vw, 1.5rem);
  --space-lg: clamp(1.5rem, 3vw, 2rem);
  --space-xl: clamp(2rem, 4vw, 3rem);
  --space-2xl: clamp(3rem, 6vw, 4rem);
  --space-3xl: clamp(4rem, 8vw, 6rem);
  --space-section: clamp(2rem, 8vh, 6rem);

  /* Fluid Container Widths */
  --container-sm: clamp(320px, 90%, 640px);
  --container-md: clamp(320px, 90%, 768px);
  --container-lg: clamp(320px, 90%, 1024px);
  --container-xl: clamp(320px, 90%, 1200px);
  --container-full: clamp(320px, 95%, 1400px);

  /* Color System - Mobile Optimized */
  --color-primary: #ffffff;
  --color-secondary: #cccccc;
  --color-accent: #EF13F2;
  --color-text: #ffffff;
  --color-text-secondary: #999999;
  --color-bg-primary: #000000;
  --color-bg-secondary: #1F1326;
  --color-border: rgba(255, 255, 255, 0.1);
  
  /* Shadows - Subtle for mobile */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;

  /* Z-Index Scale */
  --z-background: -10;
  --z-base: 0;
  --z-content: 10;
  --z-header: 100;
  --z-modal: 1000;
}

/* ===========================================
   RESET & BASE STYLES - MOBILE FIRST
   =========================================== */

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

html {
  font-size: 16px; /* Base for rem calculations */
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg-primary);
  overflow-x: hidden;
  min-height: 100vh;
}

/* ===========================================
   TYPOGRAPHY - MOBILE FIRST FLUID SYSTEM
   =========================================== */

h1, h2, h3, h4, h5, h6 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--space-sm);
  color: var(--color-text);
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }
h5 { font-size: var(--text-base); }
h6 { font-size: var(--text-sm); }

p, ul, ol {
  margin-bottom: var(--space-base);
  max-width: 65ch; /* Optimal reading width */
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover, a:focus {
  color: var(--color-primary);
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* ===========================================
   LAYOUT SYSTEM - MOBILE FIRST
   =========================================== */

.container {
  width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--space-base);
}

.container-sm { width: var(--container-sm); }
.container-md { width: var(--container-md); }
.container-lg { width: var(--container-lg); }
.container-full { width: var(--container-full); }

/* Grid System - Mobile First */
.grid {
  display: grid;
  gap: var(--space-base);
  grid-template-columns: 1fr; /* Mobile: single column */
}

/* Sections */
.section {
  padding: var(--space-section) 0;
}

/* ===========================================
   NAVIGATION - MOBILE FIRST PROGRESSIVE
   =========================================== */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-header);
  background: rgba(0, 0, 0, 0.95);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-base);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: var(--container-xl);
  margin: 0 auto;
}

/* Mobile-first logo - minimal */
.nav-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 800;
  font-size: var(--text-lg);
  color: var(--color-text);
  text-decoration: none;
}

.nav-logo img {
  display: none; /* Hide on mobile for simplicity */
}

/* Mobile menu toggle */
.mobile-menu-toggle {
  display: block;
  background: none;
  border: none;
  color: var(--color-text);
  font-size: var(--text-xl);
  cursor: pointer;
  padding: var(--space-sm);
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--radius-sm);
  transition: background-color 0.2s ease;
}

.mobile-menu-toggle:hover,
.mobile-menu-toggle:focus {
  background: rgba(255, 255, 255, 0.1);
}

/* Mobile navigation menu - hidden by default */
.nav-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.98);
  border-bottom: 1px solid var(--color-border);
  transform: translateY(-100%);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  list-style: none;
  padding: var(--space-lg);
  margin: 0;
}

.nav-menu.active {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.nav-menu li {
  margin-bottom: var(--space-base);
}

.nav-menu a {
  display: block;
  color: var(--color-text);
  font-size: var(--text-lg);
  padding: var(--space-base);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.nav-menu a:hover,
.nav-menu a:focus {
  background: rgba(239, 19, 242, 0.1);
  color: var(--color-accent);
}

/* ===========================================
   HERO SECTION - MOBILE FIRST
   =========================================== */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(80px + var(--space-xl)) var(--space-base) var(--space-xl);
  overflow: hidden;
}

/* Mobile background - lightweight image */
.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('/assets/images/mobile-screenshots/site-bg.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: var(--z-background);
  opacity: 0.7;
}

.hero-content {
  position: relative;
  z-index: var(--z-content);
  max-width: var(--container-md);
  margin: 0 auto;
}

/* Mobile-first hero typography */
.hero-title {
  font-size: var(--text-hero);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: var(--space-lg);
  color: var(--color-text);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-subtitle {
  font-size: var(--text-subtitle);
  color: var(--color-secondary);
  margin-bottom: var(--space-xl);
  line-height: 1.4;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* ===========================================
   SECTIONS - MOBILE FIRST RESPONSIVE
   =========================================== */

/* Split Hero Section - Mobile First */
.split-hero-section {
  position: relative;
  min-height: 100vh; /* Mobile: full height for impact */
  display: flex;
  flex-direction: column; /* Mobile: stack vertically */
  background: #0a0a0a;
  overflow: hidden;
  padding: var(--space-xl) 0;
}

.split-video-container {
  position: relative;
  width: 100%;
  height: 50vh; /* Mobile: half screen for video */
  overflow: hidden;
  order: 1; /* Video first on mobile */
}

.split-content-container {
  width: 100%;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl) var(--space-base);
  background: linear-gradient(135deg, #1a1a2e 0%, #0a0a0a 100%);
  order: 2; /* Content second on mobile */
}

.split-content {
  width: 100%;
  max-width: 500px;
  text-align: center; /* Mobile: center text */
}

/* Featured Modules Section - Mobile First */
.featured-modules {
  position: relative;
  padding: var(--space-3xl) 0;
  background: var(--color-bg-primary);
}

.section-header {
  margin-bottom: var(--space-2xl);
  text-align: center;
}

.section-title {
  font-size: var(--text-3xl); /* Mobile: reasonable size */
  font-weight: 900;
  margin: var(--space-lg) 0;
  color: var(--color-text);
  line-height: 1.1;
  white-space: normal; /* Mobile: allow wrapping */
}

.section-subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  line-height: 1.6;
  max-width: 65ch;
  margin: 0 auto;
}

/* Grid System - Mobile First */
.grid-4 {
  display: grid;
  gap: var(--space-lg);
  grid-template-columns: 1fr; /* Mobile: single column */
}

/* Module Cards - Enhanced */
.module-card {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  transition: all 0.3s ease;
  min-height: 400px; /* Consistent height */
}

.module-card-top {
  position: relative;
  height: 250px; /* Fixed height for consistency */
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
}

.module-card-title {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  text-align: center;
  width: 100%;
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
  padding: 0 var(--space-base);
  word-wrap: break-word;
}

.module-card-bottom {
  padding: var(--space-lg);
  position: relative;
  z-index: var(--z-content);
}

.module-category {
  font-size: var(--text-xs);
  color: var(--color-accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-sm);
}

.module-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: var(--space-base);
}

.module-tags span {
  background: rgba(239, 19, 242, 0.1);
  color: var(--color-accent);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 500;
}

/* Category Showcase Section */
.category-showcase {
  padding: var(--space-3xl) 0;
  background: var(--color-bg-secondary);
}

/* Lab Tour Section - Mobile First */
.lab-tour-section {
  position: relative;
  padding: var(--space-3xl) 0;
  min-height: 100vh; /* Ensure full coverage */
  background: var(--color-bg-primary);
}

.lab-tour-section h2 {
  font-size: var(--text-3xl); /* Mobile: manageable size */
  margin-bottom: var(--space-xl);
  text-align: center;
}

/* How Lab Works Section - Mobile First */
.how-lab-works-section {
  position: relative;
  padding: var(--space-3xl) 0;
  background: var(--color-bg-secondary);
}

.how-lab-works-grid {
  display: grid;
  gap: var(--space-xl);
  grid-template-columns: 1fr; /* Mobile: single column */
  align-items: center;
}

.how-lab-works-video {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9; /* Maintain aspect ratio */
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
}

/* We Break Things Section - Mobile First */
.we-break-things-section {
  position: relative;
  padding: var(--space-3xl) 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: var(--color-bg-primary);
}

/* Make Sense Grid - Mobile First */
.make-sense-grid {
  display: grid;
  gap: var(--space-xl);
  grid-template-columns: 1fr; /* Mobile: single column */
  align-items: center;
  padding: var(--space-3xl) 0;
}

/* Scroll Indicators and Effects */
.scroll-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease;
}

.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Hero Badge */
.hero-badge {
  display: inline-block;
  background: rgba(239, 19, 242, 0.1);
  border: 1px solid rgba(239, 19, 242, 0.3);
  color: var(--color-accent);
  padding: var(--space-sm) var(--space-base);
  border-radius: var(--radius-md);
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-sm);
  font-weight: 500;
  margin-bottom: var(--space-lg);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Scroll Indicator */
.scroll-indicator {
  position: absolute;
  bottom: var(--space-xl);
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  animation: bounce 2s infinite;
}

.scroll-text {
  margin-bottom: var(--space-sm);
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.scroll-arrow {
  opacity: 0.7;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  40% {
    transform: translateX(-50%) translateY(-10px);
  }
  60% {
    transform: translateX(-50%) translateY(-5px);
  }
}

/* Highlight text styling */
.highlight-text {
  color: #ff69b4;
  display: inline;
}

/* Long headline desktop enhancement */
.long-headline {
  font-size: clamp(1.5rem, 4vw, 3rem);
  text-transform: uppercase;
  letter-spacing: -0.02em;
  line-height: 1.1;
  max-width: 900px;
  margin: 0 auto 2rem auto;
  text-align: center;
}

/* ===========================================
   COMPONENTS - MOBILE FIRST
   =========================================== */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-base) var(--space-lg);
  font-size: var(--text-base);
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  min-height: 44px; /* Touch-friendly */
  min-width: 44px;
}

.btn-primary {
  background: var(--color-accent);
  color: white;
}

.btn-primary:hover,
.btn-primary:focus {
  background: #d10fd6;
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border: 2px solid var(--color-border);
}

.btn-secondary:hover,
.btn-secondary:focus {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* Cards */
.card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-accent);
}

/* Module Cards */
.module-card {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  transition: all 0.3s ease;
}

.module-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('/assets/images/mobile-screenshots/texture-bb94bd1e.jpg');
  background-size: cover;
  background-position: center;
  opacity: 0.1;
  z-index: var(--z-background);
}

.module-card:nth-child(even)::before {
  background-image: url('/assets/images/mobile-screenshots/texture-434f5d5d.jpg');
}

.module-card:nth-child(3n)::before {
  background-image: url('/assets/images/mobile-screenshots/coding-terminals.jpg');
}

/* ===========================================
   MEDIA QUERIES - PROGRESSIVE ENHANCEMENT
   =========================================== */

/* iPhone-specific optimizations */
@media (max-width: 414px) {
  /* iPhone Pro Max and smaller */
  .section-title {
    font-size: clamp(1.5rem, 7vw, 2.2rem) !important;
    line-height: 1.15 !important;
    word-wrap: break-word;
    hyphens: auto;
    white-space: normal !important; /* Override any nowrap */
  }
  
  /* Force responsive breaking for long headlines */
  .section-title:contains("Don't even think about it") {
    font-size: clamp(1.4rem, 6vw, 2rem) !important;
  }
  
  /* Better subtitle breaking */
  .section-subtitle,
  .hero-subtitle {
    font-size: clamp(0.95rem, 4vw, 1.15rem) !important;
    line-height: 1.5 !important;
    word-wrap: break-word;
    hyphens: auto;
  }
  
  /* Module card titles - better positioning */
  .module-card-title {
    font-size: clamp(1rem, 4vw, 1.2rem) !important;
    line-height: 1.3 !important;
    padding: 0 0.5rem !important;
    word-wrap: break-word;
  }
  
  /* Hero title specific */
  .hero-title {
    font-size: clamp(1.4rem, 8vw, 2.5rem) !important;
    line-height: 1.1 !important;
  }
  
  /* Long headlines - extra small on iPhone */
  .long-headline {
    font-size: clamp(1.2rem, 5vw, 1.8rem) !important;
    text-transform: uppercase;
    letter-spacing: -0.01em;
    max-width: 100% !important;
    word-spacing: 0.1em;
  }
}

/* Small screens (large phones) */
@media (min-width: 480px) {
  .hero {
    padding: calc(80px + var(--space-2xl)) var(--space-lg) var(--space-2xl);
  }
  
  .grid-sm-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Medium screens (tablets) */
@media (min-width: 768px) {
  /* Navigation enhancement */
  .nav {
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
  }
  
  .nav-logo img {
    display: inline-block;
    height: 32px;
    margin-right: var(--space-sm);
  }
  
  .mobile-menu-toggle {
    display: none;
  }
  
  .nav-menu {
    position: static;
    display: flex;
    background: none;
    border: none;
    transform: none;
    opacity: 1;
    visibility: visible;
    padding: 0;
    gap: var(--space-lg);
  }
  
  .nav-menu li {
    margin: 0;
  }
  
  .nav-menu a {
    padding: var(--space-sm) var(--space-base);
    font-size: var(--text-base);
  }
  
  /* Hero enhancements */
  .hero::before {
    display: none; /* Switch to video background */
  }
  
  /* Grid enhancements */
  .grid-md-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-md-3 { grid-template-columns: repeat(3, 1fr); }
  
  /* Section enhancements for tablet+ */
  .split-hero-section {
    flex-direction: row; /* Desktop: side by side */
    height: 75vh;
    padding: 0;
  }
  
  .split-video-container {
    width: 50%;
    height: 100%;
    order: initial;
    background-image: none; /* Remove mobile image on desktop */
    -webkit-mask-image: none; /* Remove mobile mask on desktop */
    mask-image: none;
  }
  
  .split-content-container {
    width: 50%;
    height: 100%;
    padding: 4rem;
    order: initial;
  }
  
  .split-content {
    text-align: left; /* Desktop: left align */
  }
  
  .section-title {
    font-size: clamp(2.5rem, 5vw, 4.5rem); /* Desktop: larger titles */
    white-space: nowrap; /* Desktop: can handle single line */
  }
  
  .grid-4 {
    grid-template-columns: repeat(2, 1fr); /* Tablet: 2 columns */
  }
  
  .how-lab-works-grid {
    grid-template-columns: 1fr 1fr; /* Tablet: side by side */
  }
  
  .make-sense-grid {
    grid-template-columns: 1fr 1fr; /* Tablet: side by side */
  }
}

/* Large screens (desktop) */
@media (min-width: 1024px) {
  .grid-lg-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-lg-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-lg-4 { grid-template-columns: repeat(4, 1fr); }
  
  /* Desktop grid - 4 columns for modules */
  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .hero {
    padding: calc(80px + var(--space-3xl)) var(--space-xl) var(--space-3xl);
  }
  
  /* Desktop section title sizes */
  .section-title {
    font-size: clamp(3rem, 6vw, 4.5rem);
  }
  
  .lab-tour-section h2 {
    font-size: clamp(2.5rem, 5vw, 4rem);
  }
}

/* Extra large screens */
@media (min-width: 1200px) {
  .grid-xl-4 { grid-template-columns: repeat(4, 1fr); }
  .grid-xl-5 { grid-template-columns: repeat(5, 1fr); }
}

/* ===========================================
   UNIVERSAL MOBILE FIXES - ALL PAGES
   =========================================== */

/* Fix any page-specific inline styles on mobile */
@media (max-width: 767px) {
  /* Force responsive for ANY element with problematic sizing */
  [style*="font-size: 4rem"],
  [style*="font-size: 5rem"],
  [style*="font-size: 6rem"] {
    font-size: clamp(1.5rem, 6vw, 2.5rem) !important;
  }
  
  [style*="font-size: 3rem"],
  [style*="font-size: 3.5rem"] {
    font-size: clamp(1.3rem, 5vw, 2rem) !important;
  }
  
  [style*="font-size: 2rem"],
  [style*="font-size: 2.5rem"] {
    font-size: clamp(1.2rem, 4vw, 1.8rem) !important;
  }
  
  /* Force proper spacing for inline styles */
  [style*="padding: 4rem"],
  [style*="padding: 5rem"],
  [style*="padding: 6rem"] {
    padding: var(--space-xl) var(--space-base) !important;
  }
  
  [style*="margin: 3rem"],
  [style*="margin: 4rem"],
  [style*="margin: 5rem"] {
    margin: var(--space-lg) 0 !important;
  }
  
  /* Fix width issues */
  [style*="width: 50%"] {
    width: 100% !important;
  }
  
  [style*="max-width: 800px"],
  [style*="max-width: 900px"],
  [style*="max-width: 1000px"] {
    max-width: 100% !important;
    padding: 0 var(--space-base) !important;
  }
  
  /* Fix height issues */
  [style*="height: 100vh"],
  [style*="height: 75vh"],
  [style*="height: 80vh"] {
    min-height: 70vh !important;
    height: auto !important;
  }
  
  /* Fix any grid that's not mobile-friendly */
  [style*="grid-template-columns: repeat(2"],
  [style*="grid-template-columns: repeat(3"],
  [style*="grid-template-columns: repeat(4"],
  [style*="display: grid"][style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: var(--space-base) !important;
  }
  
  /* Fix flex layouts */
  [style*="display: flex"][style*="flex-direction: row"] {
    flex-direction: column !important;
  }
  
  /* Universal text fixes */
  * {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
  }
  
  /* Fix images */
  img {
    max-width: 100% !important;
    height: auto !important;
  }
  
  /* Fix tables */
  table {
    width: 100% !important;
    display: block !important;
    overflow-x: auto !important;
    white-space: nowrap;
  }
}

/* ===========================================
   UTILITIES
   =========================================== */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.hidden { display: none !important; }
.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;
}

/* ===========================================
   VIDEO STRATEGY - MOBILE FIRST
   =========================================== */

/* This rule moved to mobile media query - see mobile section for video hiding */

/* Mobile background image for video container with mask */
.split-video-container {
  background-image: url('/assets/images/mobile-screenshots/vaporwave-guy-screenshot.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  -webkit-mask-image: url('/assets/images/mask2.png');
  mask-image: url('/assets/images/mask2.png');
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}

/* Desktop video background */
@media (min-width: 768px) {
  .hero-video {
    display: block !important;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: var(--z-background);
  }
  
  /* Scroll-controlled video styles */
  .scroll-controlled-video {
    display: block !important;
    width: 118%;
    height: 118%;
    object-fit: cover;
    transform: rotate(-5deg) scale(1.08);
    -webkit-mask-image: url('/assets/images/mask2.png');
    mask-image: url('/assets/images/mask2.png');
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
  }
  
  /* Allow background videos only */
  video.hero-video,
  video[class*="background"],
  .scroll-controlled-video {
    display: block !important;
  }
  
  /* REMOVED - was hiding positioned videos */
  
  /* REMOVED - was hiding videos with opacity 0.3 */
  
  /* Override: Show module card videos on desktop - higher specificity */
  .module-card video[style*="opacity: 0.3"] {
    display: block !important;
  }
}

/* Performance optimization */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  /* REMOVED - was hiding all videos */
}