/* ==========================================================================
   G6Solver Landing Page - CSS Foundation and Design System
   Cross-Browser Compatibility Optimized
   ========================================================================== */

/* Browser-specific prefixes and fallbacks */
@supports not (display: grid) {
  .grid {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
    -ms-flex-direction: row;
    flex-direction: row;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
  }
  
  .grid-cols-2 > * {
    -webkit-box-flex: 0;
    -ms-flex: 0 0 calc(50% - 12px);
    flex: 0 0 calc(50% - 12px);
  }
  
  .grid-cols-3 > * {
    -webkit-box-flex: 0;
    -ms-flex: 0 0 calc(33.333% - 16px);
    flex: 0 0 calc(33.333% - 16px);
  }
  
  .grid-cols-4 > * {
    -webkit-box-flex: 0;
    -ms-flex: 0 0 calc(25% - 18px);
    flex: 0 0 calc(25% - 18px);
  }
}

/* Backdrop filter fallbacks */
@supports not (backdrop-filter: blur(10px)) {
  header {
    background: rgba(0, 0, 0, 0.95) !important;
  }
  
  .mobile-menu {
    background: rgba(0, 0, 0, 0.98) !important;
  }
  
  .backdrop-blur-sm {
    background: rgba(0, 0, 0, 0.8);
  }
  
  .backdrop-blur-md {
    background: rgba(0, 0, 0, 0.9);
  }
}

/* CSS Custom Properties fallbacks for older browsers */
.legacy-fallback {
  /* Fallback colors for browsers that don't support CSS custom properties */
  color: #ffffff;
  background-color: #000000;
}

.legacy-fallback .btn-primary {
  background: linear-gradient(135deg, #6366f1, #8b5cf6, #ec4899);
}

.legacy-fallback .gradient-text-primary {
  color: #6366f1;
}

/* ==========================================================================
   G6Solver Landing Page - CSS Foundation and Design System
   ========================================================================== */

/* ==========================================================================
   1. CSS Custom Properties (Design Tokens)
   ========================================================================== */

:root {
  /* Color Palette - Primary Gradients and Theme Colors */
  --color-primary-start: #6366f1;
  --color-primary-mid: #8b5cf6;
  --color-primary-end: #ec4899;
  --color-secondary-start: #ff6b6b;
  --color-secondary-end: #feca57;
  
  /* Background Colors */
  --color-bg-primary: #000000;
  --color-bg-secondary: #0a0a0a;
  --color-bg-tertiary: #1a0a2e;
  --color-bg-quaternary: #2d1b69;
  --color-bg-demo: #1a1a2e;
  --color-bg-demo-mid: #16213e;
  --color-bg-demo-end: #0f3460;
  
  /* Text Colors */
  --color-text-primary: #ffffff;
  --color-text-secondary: rgba(255, 255, 255, 0.8);
  --color-text-tertiary: rgba(255, 255, 255, 0.6);
  --color-text-accent: rgba(99, 102, 241, 0.9);
  --color-text-flash: #39ff14;
  
  /* Border and Surface Colors */
  --color-border-primary: rgba(255, 255, 255, 0.1);
  --color-border-secondary: rgba(255, 255, 255, 0.2);
  --color-surface-primary: rgba(255, 255, 255, 0.05);
  --color-surface-secondary: rgba(255, 255, 255, 0.1);
  --color-surface-tertiary: rgba(0, 0, 0, 0.8);
  --color-surface-blur: rgba(0, 0, 0, 0.95);
  
  /* Gradient Definitions with browser prefixes */
  --gradient-primary: linear-gradient(135deg, var(--color-primary-start), var(--color-primary-mid), var(--color-primary-end));
  --gradient-secondary: linear-gradient(135deg, var(--color-secondary-start), var(--color-secondary-end));
  --gradient-hero-text: linear-gradient(135deg, #fff 0%, var(--color-primary-start) 50%, var(--color-primary-mid) 100%);
  --gradient-bg-problem: linear-gradient(135deg, var(--color-bg-secondary) 0%, var(--color-bg-tertiary) 50%, var(--color-bg-quaternary) 100%);
  --gradient-bg-demo: linear-gradient(135deg, var(--color-bg-demo) 0%, var(--color-bg-demo-mid) 50%, var(--color-bg-demo-end) 100%);
  --gradient-button-hover: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  
  /* Webkit prefixed gradients for older Safari */
  --webkit-gradient-primary: -webkit-linear-gradient(135deg, var(--color-primary-start), var(--color-primary-mid), var(--color-primary-end));
  --webkit-gradient-secondary: -webkit-linear-gradient(135deg, var(--color-secondary-start), var(--color-secondary-end));
  --webkit-gradient-hero-text: -webkit-linear-gradient(135deg, #fff 0%, var(--color-primary-start) 50%, var(--color-primary-mid) 100%);
  
  /* Typography Scale */
  /* "IBM Plex Mono", monospace; */
  --font-family-primary: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-family-secondary: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* Font Sizes - Mobile First Approach */
  --font-size-xs: 0.75rem;      /* 12px */
  --font-size-sm: 0.875rem;     /* 14px */
  --font-size-base: 1rem;       /* 16px */
  --font-size-lg: 1.125rem;     /* 18px */
  --font-size-xl: 1.25rem;      /* 20px */
  --font-size-2xl: 1.5rem;      /* 24px */
  --font-size-3xl: 1.875rem;    /* 30px */
  --font-size-4xl: 2.25rem;     /* 36px */
  --font-size-5xl: 3rem;        /* 48px */
  --font-size-6xl: 3.75rem;     /* 60px */
  --font-size-7xl: 4.5rem;      /* 72px */
  --font-size-8xl: 6rem;        /* 96px */
  
  /* Responsive Font Sizes using clamp() */
  --font-size-hero-h1: clamp(2.5rem, 8vw, 6rem);
  --font-size-hero-subtitle: clamp(1rem, 3vw, 1.8rem);
  --font-size-hero-tagline: clamp(1rem, 2.5vw, 1.3rem);
  --font-size-section-h2: clamp(2.5rem, 5vw, 4rem);
  --font-size-hexagon-h3: clamp(0.75rem, 2.5vw, 1.1rem);
  --font-size-hexagon-p: clamp(0.6rem, 2vw, 0.83rem);
  
  /* Font Weights */
  --font-weight-light: 300;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-extrabold: 800;
  --font-weight-black: 900;
  
  /* Line Heights */
  --line-height-tight: 1.1;
  --line-height-snug: 1.2;
  --line-height-normal: 1.4;
  --line-height-relaxed: 1.5;
  --line-height-loose: 1.6;
  
  /* Letter Spacing */
  --letter-spacing-tight: -0.02em;
  --letter-spacing-normal: 0;
  --letter-spacing-wide: 0.025em;
  
  /* Spacing System - Based on 8px grid */
  --space-1: 0.25rem;    /* 4px */
  --space-2: 0.5rem;     /* 8px */
  --space-3: 0.75rem;    /* 12px */
  --space-4: 1rem;       /* 16px */
  --space-5: 1.25rem;    /* 20px */
  --space-6: 1.5rem;     /* 24px */
  --space-8: 2rem;       /* 32px */
  --space-10: 2.5rem;    /* 40px */
  --space-12: 3rem;      /* 48px */
  --space-16: 4rem;      /* 64px */
  --space-20: 5rem;      /* 80px */
  --space-24: 6rem;      /* 96px */
  --space-32: 8rem;      /* 128px */
  
  /* Component Spacing */
  --spacing-section-padding-mobile: 3.75rem;  /* 60px */
  --spacing-section-padding-desktop: 6.25rem; /* 100px */
  --spacing-component-gap: 2.5rem;            /* 40px */
  --spacing-card-padding: 1.875rem;           /* 30px */
  --spacing-button-padding-y: 1.125rem;       /* 18px */
  --spacing-button-padding-x: 2.5rem;         /* 40px */
  
  /* Border Radius */
  --radius-sm: 0.25rem;     /* 4px */
  --radius-base: 0.5rem;    /* 8px */
  --radius-md: 0.625rem;    /* 10px */
  --radius-lg: 0.9375rem;   /* 15px */
  --radius-xl: 1.25rem;     /* 20px */
  --radius-2xl: 3.125rem;   /* 50px - for buttons */
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-base: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-button-hover: 0 15px 40px rgba(99, 102, 241, 0.4);
  
  /* Z-Index Scale */
  --z-index-background: -1;
  --z-index-base: 0;
  --z-index-dropdown: 10;
  --z-index-sticky: 20;
  --z-index-fixed: 30;
  --z-index-modal-backdrop: 40;
  --z-index-modal: 50;
  --z-index-popover: 60;
  --z-index-tooltip: 70;
  --z-index-toast: 80;
  --z-index-header: 1000;
  --z-index-mobile-menu: 1000;
  --z-index-mobile-toggle: 1001;
  --z-index-cursor: 9998;
  --z-index-cursor-main: 9999;
  
  /* Transition Durations */
  --duration-fast: 0.1s;
  --duration-normal: 0.3s;
  --duration-slow: 0.5s;
  --duration-slower: 1s;
  --duration-hero-animation: 1.5s;
  --duration-header-scroll: 0.4s;
  --duration-mobile-menu: 0.4s;
  
  /* Transition Timing Functions */
  --ease-linear: linear;
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --ease-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  
  /* Breakpoints (for reference in media queries) */
  --breakpoint-sm: 640px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 1024px;
  --breakpoint-xl: 1280px;
  --breakpoint-2xl: 1536px;
  
  /* Container Max Widths */
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1200px;
  --container-2xl: 1400px;
  
  /* Animation Properties */
  --animation-float-duration: 6s;
  --animation-problem-float-duration: 4s;
  --animation-flash-duration: 5s;
  
  /* Backdrop Filters */
  --backdrop-blur-sm: blur(10px);
  --backdrop-blur-md: blur(20px);
  
  /* Opacity Levels */
  --opacity-disabled: 0.1;
  --opacity-inactive: 0.3;
  --opacity-muted: 0.6;
  --opacity-secondary: 0.8;
  --opacity-primary: 1;
}

/* ==========================================================================
   2. Font Imports
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Lato:wght@300;400;500;600;700;800;900&display=swap");
/*
 ==========================================================================
   3. CSS Reset and Base Styles
   ========================================================================== */

/* Modern CSS Reset */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Remove default list styles */
ul,
ol {
  list-style: none;
}

/* Remove default button styles */
button {
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
}

/* Remove default link styles */
a {
  text-decoration: none;
  color: inherit;
}

/* Improve media defaults */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Remove built-in form typography styles */
input,
button,
textarea,
select {
  font: inherit;
}

/* Avoid text overflows */
p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

/* ==========================================================================
   4. Base Typography Styles
   ========================================================================== */

html {
  scroll-behavior: smooth;
  font-size: 16px; /* Base font size for rem calculations */
  /* Prevent horizontal overflow at the root level */
  overflow-x: hidden;
  max-width: 100%;
}

body {
  font-family: var(--font-family-primary);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-loose);
  color: var(--color-text-primary);
  background: var(--color-bg-primary);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Ensure no horizontal scrolling on any device */
  max-width: 100vw;
  position: relative;
}

/* Heading Styles */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: var(--font-weight-extrabold);
  line-height: var(--line-height-tight);
  letter-spacing: var(--letter-spacing-tight);
  margin-bottom: var(--space-6);
}

h1 {
  font-size: var(--font-size-hero-h1);
  font-weight: var(--font-weight-black);
}

h2 {
  font-size: var(--font-size-section-h2);
  line-height: var(--line-height-snug);
  /* Prevent glyph descenders/gradient text from being clipped */
  padding-bottom: 0.15em;
}

h3 {
  font-size: var(--font-size-2xl);
}

h4 {
  font-size: var(--font-size-xl);
}

h5 {
  font-size: var(--font-size-lg);
}

h6 {
  font-size: var(--font-size-base);
}

/* Paragraph Styles */
p {
  margin-bottom: var(--space-4);
  line-height: var(--line-height-loose);
}

/* Link Styles */
a {
  transition: all var(--duration-normal) var(--ease-in-out);
}

/* ==========================================================================
   5. Responsive Grid System and Layout Utilities
   ========================================================================== */

/* Container Classes */
.container {
  width: 100%;
  margin: 0 auto;
  padding: 0 var(--space-5);
}

.container-sm {
  max-width: var(--container-sm);
}

.container-md {
  max-width: var(--container-md);
}

.container-lg {
  max-width: var(--container-lg);
}

.container-xl {
  max-width: var(--container-xl);
}

.container-2xl {
  max-width: var(--container-2xl);
}

/* Responsive Grid System */
.grid {
  display: grid;
  gap: var(--space-6);
}

.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

.grid-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid-cols-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.grid-cols-6 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

/* Flexbox Utilities */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.flex-row {
  flex-direction: row;
}

.flex-wrap {
  flex-wrap: wrap;
}

.flex-nowrap {
  flex-wrap: nowrap;
}

.items-start {
  align-items: flex-start;
}

.items-center {
  align-items: center;
}

.items-end {
  align-items: flex-end;
}

.items-stretch {
  align-items: stretch;
}

.justify-start {
  justify-content: flex-start;
}

.justify-center {
  justify-content: center;
}

.justify-end {
  justify-content: flex-end;
}

.justify-between {
  justify-content: space-between;
}

.justify-around {
  justify-content: space-around;
}

.justify-evenly {
  justify-content: space-evenly;
}

/* Gap Utilities */
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }
.gap-10 { gap: var(--space-10); }
.gap-12 { gap: var(--space-12); }
.gap-16 { gap: var(--space-16); }
.gap-20 { gap: var(--space-20); }

/* Spacing Utilities */
.p-0 { padding: 0; }
.p-1 { padding: var(--space-1); }
.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-5 { padding: var(--space-5); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }
.p-10 { padding: var(--space-10); }
.p-12 { padding: var(--space-12); }

.px-0 { padding-left: 0; padding-right: 0; }
.px-1 { padding-left: var(--space-1); padding-right: var(--space-1); }
.px-2 { padding-left: var(--space-2); padding-right: var(--space-2); }
.px-3 { padding-left: var(--space-3); padding-right: var(--space-3); }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.px-5 { padding-left: var(--space-5); padding-right: var(--space-5); }
.px-6 { padding-left: var(--space-6); padding-right: var(--space-6); }

.py-0 { padding-top: 0; padding-bottom: 0; }
.py-1 { padding-top: var(--space-1); padding-bottom: var(--space-1); }
.py-2 { padding-top: var(--space-2); padding-bottom: var(--space-2); }
.py-3 { padding-top: var(--space-3); padding-bottom: var(--space-3); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }
.py-5 { padding-top: var(--space-5); padding-bottom: var(--space-5); }
.py-6 { padding-top: var(--space-6); padding-bottom: var(--space-6); }

.m-0 { margin: 0; }
.m-1 { margin: var(--space-1); }
.m-2 { margin: var(--space-2); }
.m-3 { margin: var(--space-3); }
.m-4 { margin: var(--space-4); }
.m-5 { margin: var(--space-5); }
.m-6 { margin: var(--space-6); }
.m-8 { margin: var(--space-8); }
.m-10 { margin: var(--space-10); }
.m-12 { margin: var(--space-12); }

.mx-auto { margin-left: auto; margin-right: auto; }
.my-auto { margin-top: auto; margin-bottom: auto; }

/* Text Alignment */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-justify { text-align: justify; }

/* Display Utilities */
.block { display: block; }
.inline-block { display: inline-block; }
.inline { display: inline; }
.hidden { display: none; }

/* Position Utilities */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

/* Width and Height Utilities */
.w-full { width: 100%; }
.h-full { height: 100%; }
.min-h-screen { min-height: 100vh; }
.h-screen { height: 100vh; }

/* ==========================================================================
   6. Responsive Breakpoints (Mobile-First)
   ========================================================================== */

/* Mobile-specific optimizations (up to 640px) */
@media (max-width: 639px) {
  /* Ensure proper mobile spacing */
  .container {
    padding: 0 var(--space-4);
  }
  
  /* Prevent horizontal overflow on mobile */
  body {
    overflow-x: hidden;
  }
  
  /* Ensure all elements stay within viewport bounds */
  * {
    max-width: 100vw;
    box-sizing: border-box;
  }
  
  /* Specifically constrain fixed and absolute positioned elements */
  *[style*="position: fixed"],
  *[style*="position: absolute"] {
    max-width: 100vw;
  }
  
  /* Mobile-specific button sizing */
  .btn-primary,
  .btn-secondary {
    min-width: 280px;
    padding: var(--space-4) var(--space-6);
    font-size: var(--font-size-base);
  }
  
  .btn-text {
    font-size: var(--font-size-base);
  }
  
  .btn-subtitle {
    font-size: var(--font-size-xs);
  }
  
  /* Mobile hero adjustments */
  .hero-cta {
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
  }

  /* Make hero-cta buttons 50% smaller on mobile */
  .hero-cta .btn-primary,
  .hero-cta .btn-secondary {
    font-size: calc(var(--font-size-base) * 0.5);
    padding: calc(var(--spacing-button-padding-y) * 0.5)
             calc(var(--spacing-button-padding-x) * 0.5);
    min-width: 140px; /* half of 280px set above for mobile */
  }
  
  /* Mobile navigation visibility */
  .nav-links {
    display: none;
  }
  
  /* Temporarily disabled hamburger menu */
  .mobile-menu-toggle {
    display: none !important;
  }
  
  /* Mobile section padding */
  section {
    padding: var(--spacing-section-padding-mobile) 0;
  }
  
  /* Mobile typography adjustments */
  h2 {
    font-size: clamp(1.875rem, 6vw, 2.5rem);
    margin-bottom: var(--space-4);
  }
  
  h3 {
    font-size: var(--font-size-lg);
    margin-bottom: var(--space-3);
  }
  
  p {
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-3);
  }
}

/* Extra small mobile devices (320px to 430px) */
@media (max-width: 430px) {
  /* Tighter container padding for very small screens */
  .container {
    padding: 0 var(--space-3);
  }
  
  /* Ensure no content gets cut off */
  * {
    max-width: 100%;
    box-sizing: border-box;
  }
  
  /* Adjust section padding for small screens */
  section {
    padding: calc(var(--spacing-section-padding-mobile) * 0.8) 0;
  }
  
  /* Smaller typography for very small screens */
  h1 {
    font-size: clamp(1.75rem, 8vw, 3rem);
  }
  
  h2 {
    font-size: clamp(1.5rem, 6vw, 2.25rem);
  }
  
  h3 {
    font-size: clamp(1.125rem, 4vw, 1.5rem);
  }
  
  p {
    font-size: var(--font-size-sm);
    line-height: var(--line-height-normal);
  }
  
  /* Smaller buttons for very small screens */
  .btn-primary,
  .btn-secondary {
    min-width: 240px;
    padding: var(--space-3) var(--space-5);
    font-size: var(--font-size-sm);
  }
}

/* Small devices (landscape phones, 640px and up) */
@media (min-width: 640px) {
  .container {
    padding: 0 var(--space-6);
  }
  
  .sm\:grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sm\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sm\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  
  .sm\:flex-row { flex-direction: row; }
  .sm\:flex-col { flex-direction: column; }
  
  .sm\:text-left { text-align: left; }
  .sm\:text-center { text-align: center; }
  .sm\:text-right { text-align: right; }
  
  .sm\:block { display: block; }
  .sm\:hidden { display: none; }
  
  /* Keep mobile navigation on small screens (640px-767px) */
  .nav-links {
    display: none;
  }
  
  /* Temporarily disabled hamburger menu */
  .mobile-menu-toggle {
    display: none !important;
  }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
  .container {
    padding: 0 var(--space-8);
  }
  
  /* Show desktop navigation and hide mobile menu toggle on tablets and up */
  .nav-links {
    display: flex !important;
  }
  
  .mobile-menu-toggle {
    display: none !important;
  }
  
  .md\:grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .md\:grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  
  .md\:flex-row { flex-direction: row; }
  .md\:flex-col { flex-direction: column; }
  
  .md\:text-left { text-align: left; }
  .md\:text-center { text-align: center; }
  .md\:text-right { text-align: right; }
  
  .md\:block { display: block; }
  .md\:hidden { display: none; }
  
  .md\:gap-8 { gap: var(--space-8); }
  .md\:gap-10 { gap: var(--space-10); }
  .md\:gap-12 { gap: var(--space-12); }
  .md\:gap-16 { gap: var(--space-16); }
  .md\:gap-20 { gap: var(--space-20); }
  
  /* Tablet-specific optimizations */
  .btn-primary,
  .btn-secondary {
    min-width: 220px;
    padding: var(--space-5) var(--space-7);
  }
  
  /* Tablet section spacing */
  section {
    padding: calc(var(--spacing-section-padding-mobile) + 1rem) 0;
  }
  
  /* Tablet typography scaling */
  h1 {
    font-size: clamp(3rem, 7vw, 5rem);
  }
  
  h2 {
    font-size: clamp(2.25rem, 5vw, 3.5rem);
  }
  
  h3 {
    font-size: clamp(1.5rem, 3vw, 2rem);
  }
}

/* Large devices (desktops, 1024px and up) */
@media (min-width: 1024px) {
  .container {
    padding: 0 var(--space-10);
  }
  
  .lg\:grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
  .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .lg\:grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .lg\:grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  
  .lg\:flex-row { flex-direction: row; }
  .lg\:flex-col { flex-direction: column; }
  
  .lg\:text-left { text-align: left; }
  .lg\:text-center { text-align: center; }
  .lg\:text-right { text-align: right; }
  
  .lg\:block { display: block; }
  .lg\:hidden { display: none; }
  
  /* Desktop-specific optimizations */
  .btn-primary,
  .btn-secondary {
    min-width: 240px;
    padding: var(--spacing-button-padding-y) var(--spacing-button-padding-x);
  }
  
  /* Desktop section spacing */
  section {
    padding: var(--spacing-section-padding-desktop) 0;
  }
  
  /* Desktop typography - full scale */
  h1 {
    font-size: var(--font-size-hero-h1);
  }
  
  h2 {
    font-size: var(--font-size-section-h2);
  }
  
  h3 {
    font-size: var(--font-size-2xl);
  }
  
  /* Desktop hover effects */
  .hover\:scale-105:hover {
    transform: scale(1.05);
  }
  
  .hover\:-translate-y-2:hover {
    transform: translateY(-0.5rem);
  }
}

/* Extra large devices (large desktops, 1280px and up) */
@media (min-width: 1280px) {
  .xl\:grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
  .xl\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .xl\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .xl\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .xl\:grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .xl\:grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  
  .xl\:flex-row { flex-direction: row; }
  .xl\:flex-col { flex-direction: column; }
  
  .xl\:text-left { text-align: left; }
  .xl\:text-center { text-align: center; }
  .xl\:text-right { text-align: right; }
  
  .xl\:block { display: block; }
  .xl\:hidden { display: none; }
}

/* 2X Large devices (larger desktops, 1536px and up) */
@media (min-width: 1536px) {
  .container {
    padding: 0 var(--space-12);
  }
  
  /* Escape class names starting with digits using attribute selectors to satisfy CSS parsers */
  [class~="2xl:grid-cols-1"] { grid-template-columns: repeat(1, minmax(0, 1fr)); }
  [class~="2xl:grid-cols-2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  [class~="2xl:grid-cols-3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  [class~="2xl:grid-cols-4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  [class~="2xl:grid-cols-5"] { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  [class~="2xl:grid-cols-6"] { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

/* ==========================================================================
   7. Utility Classes for Common Patterns
   ========================================================================== */

/* Gradient Text Utilities with fallbacks */
.gradient-text-primary {
  background: var(--gradient-primary);
  background: var(--webkit-gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

/* Fallback for browsers without background-clip: text support */
@supports not (-webkit-background-clip: text) and not (background-clip: text) {
  .gradient-text-primary {
    color: #6366f1;
    background: none;
  }
}

.gradient-text-secondary {
  background: var(--gradient-secondary);
  background: var(--webkit-gradient-secondary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

@supports not (-webkit-background-clip: text) and not (background-clip: text) {
  .gradient-text-secondary {
    color: #ff6b6b;
    background: none;
  }
}

.gradient-text-hero {
  background: var(--gradient-hero-text);
  background: var(--webkit-gradient-hero-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

@supports not (-webkit-background-clip: text) and not (background-clip: text) {
  .gradient-text-hero {
    color: #ffffff;
    background: none;
  }
}

/* Background Utilities */
.bg-gradient-primary {
  background: var(--gradient-primary);
}

.bg-gradient-secondary {
  background: var(--gradient-secondary);
}

.bg-surface-primary {
  background: var(--color-surface-primary);
}

.bg-surface-secondary {
  background: var(--color-surface-secondary);
}

/* Border Utilities */
.border-primary {
  border: 1px solid var(--color-border-primary);
}

.border-secondary {
  border: 1px solid var(--color-border-secondary);
}

.rounded-sm { border-radius: var(--radius-sm); }
.rounded { border-radius: var(--radius-base); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-2xl); }

/* Backdrop Filter Utilities with browser prefixes and fallbacks */
.backdrop-blur-sm {
  -webkit-backdrop-filter: var(--backdrop-blur-sm);
  backdrop-filter: var(--backdrop-blur-sm);
}

.backdrop-blur-md {
  -webkit-backdrop-filter: var(--backdrop-blur-md);
  backdrop-filter: var(--backdrop-blur-md);
}

/* Fallback for browsers without backdrop-filter support */
@supports not (backdrop-filter: blur(10px)) and not (-webkit-backdrop-filter: blur(10px)) {
  .backdrop-blur-sm {
    background: rgba(0, 0, 0, 0.8);
  }
  
  .backdrop-blur-md {
    background: rgba(0, 0, 0, 0.9);
  }
}

/* Transition Utilities */
.transition-all {
  transition: all var(--duration-normal) var(--ease-in-out);
}

.transition-colors {
  transition: color var(--duration-normal) var(--ease-in-out),
              background-color var(--duration-normal) var(--ease-in-out),
              border-color var(--duration-normal) var(--ease-in-out);
}

.transition-transform {
  transition: transform var(--duration-normal) var(--ease-in-out);
}

/* Hover Utilities */
.hover\:scale-105:hover {
  transform: scale(1.05);
}

.hover\:scale-110:hover {
  transform: scale(1.1);
}

.hover\:-translate-y-1:hover {
  transform: translateY(-0.25rem);
}

.hover\:-translate-y-2:hover {
  transform: translateY(-0.5rem);
}

.hover\:-translate-y-3:hover {
  transform: translateY(-0.75rem);
}

/* Focus Utilities */
.focus\:outline-none:focus {
  outline: 2px solid transparent;
  outline-offset: 2px;
}

.focus\:ring-2:focus {
  box-shadow: 0 0 0 2px var(--color-primary-start);
}

/* Accessibility Utilities */
.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;
}

/* Print Utilities */
@media print {
  .print\:hidden {
    display: none !important;
  }
}/* Das
hboard responsive styles */
@media (max-width: 768px) {
  .usage-overview {
    grid-template-columns: 1fr;
  }
  
  .dashboard-header {
    flex-direction: column;
    gap: var(--space-3);
    text-align: center;
  }
  
  .chart-bars {
    height: 80px;
  }
  
  .usage-amount {
    font-size: var(--font-size-2xl);
  }
  
  .dashboard-mockup {
    padding: var(--space-5);
  }
}

/* Account Management responsive styles */
@media (max-width: 768px) {
  .management-grid {
    grid-template-columns: 1fr;
  }
  
  .subscription-actions {
    flex-direction: column;
  }
  
  .action-btn {
    width: 100%;
    text-align: center;
  }
  
  .device-info {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
  }
  
  .api-key-display {
    flex-wrap: wrap;
  }
  
  .api-actions {
    flex-direction: column;
  }
}

/* container behind hero content */
  .hero-background {
    position: absolute;
    inset: 0;
    z-index: -1;                 /* behind content */
    pointer-events: none;
    overflow: hidden;
  }

  .graph-bg {
    width: 100%;
    height: 100%;
    display: block;
  }

  /* grid lines style (thin & faint) */
  .graph-grid line {
    stroke: rgba(255,255,255,0.03);
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
  }

  /* graph lines */
  .graph { fill: none; stroke-linecap: round; stroke-linejoin: round; }
  .line-1 { stroke-width: 2.6; filter: url(#soft-blur); opacity: 0.98; mix-blend-mode: screen; }
  .line-2 { stroke-width: 1.2; opacity: 0.9; }

  /* moving dot */
  .graph-dot {
    fill: #fff;
    stroke: rgba(0,0,0,0.08);
    stroke-width: 1;
    filter: drop-shadow(0 10px 22px rgba(12,20,40,0.25));
    transition: transform 120ms linear;
  }

  /* reduced motion -> static rendering */
  @media (prefers-reduced-motion: reduce) {
    .line-1, .line-2 { transition: none !important; animation: none !important; }
    .graph-dot { opacity: 0; }
  }

/* ==========================================================================
   Footer adjustments
   ========================================================================== */

/* Reduce spacing between "Contact" and the mailto link in the footer brand column */
#footer .footer-brand .footer-section-title {
  margin-bottom: 10px;
}

/* ==========================================================================
   Modal (shared across pages)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  align-items: flex-start;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  z-index: var(--z-index-modal-backdrop);
  padding: var(--space-6);
  padding-top: 30vh;
  overflow-y: auto;
}

.modal-backdrop.open {
  display: flex;
}

.modal-card {
  width: 100%;
  max-width: 640px;
  background: var(--color-surface-tertiary);
  border: 1px solid var(--color-border-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  padding-top: calc(var(--space-6) + 10px);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-index-modal);
  margin-bottom: var(--space-6);
}

.modal-actions {
  margin-top: var(--space-6);
  margin-bottom: calc(var(--space-6) * 3);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-4);
}

/* Modal form styling */
.modal-card .contact-form {
  padding: 0 var(--space-4);
}

.modal-card .form-group {
  margin-bottom: var(--space-6);
}

.modal-card .form-group:last-child {
  margin-bottom: 0;
}

.modal-card input[type="text"],
.modal-card input[type="email"] {
  border: 2px solid rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text-primary);
  padding: 12px 16px;
  margin: 0;
  width: 100%;
  box-sizing: border-box;
}

.modal-card input[type="text"]:focus,
.modal-card input[type="email"]:focus {
  border-color: rgba(255, 255, 255, 0.8);
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

.modal-card input[type="radio"],
.modal-card input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-right: 12px;
  accent-color: var(--color-primary-start);
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.6);
}

.modal-card label {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  color: var(--color-text-primary);
  margin: 0 0 12px 0;
  padding: 12px 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  width: 100%;
  box-sizing: border-box;
}

.modal-card .form-group label.block {
  display: block;
  margin-bottom: 12px;
}

.modal-card .form-group label.flex {
  display: flex;
  align-items: center;
}

.modal-card .form-group label.flex input[type="checkbox"] {
  margin-left: 22px;
}

.modal-card .form-group span.block {
  color: var(--color-text-primary);
  font-weight: var(--font-weight-medium);
  margin: 0 0 12px 0;
  padding: 12px 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  width: 100%;
  box-sizing: border-box;
  display: block;
}

.modal-card .radio-group {
  margin-left: 0;
  margin-top: 8px;
}

.modal-card .radio-group label {
  margin-bottom: 8px;
}

.modal-card .form-group:last-child {
  text-align: center;
}

.modal-card button[type="submit"] {
  border: 2px solid rgba(255, 255, 255, 0.5);
  padding: 12px 24px;
  margin: 0 auto;
  display: inline-block;
}

.modal-card .modal-actions {
  text-align: center;
}

.modal-card button[type="button"] {
  border: 2px solid rgba(255, 255, 255, 0.5);
  padding: 12px 24px;
  margin: 0 auto;
  display: inline-block;
}

/* Responsive modal adjustments */
@media (max-width: 768px) {
  .modal-backdrop {
    padding: var(--space-4);
    padding-top: 15vh;
  }
  
  .modal-card {
    padding: var(--space-4);
  }
}

@media (max-height: 600px) {
  .modal-backdrop {
    padding-top: 10vh;
  }
}
