/* ===================================
   APP-LIKE MOBILE DENSITY SYSTEM
   Based on iOS HIG and Material Design
   =================================== */

/* -----------------------------------
   TYPOGRAPHY SYSTEM
   iOS-inspired: 17px base, 1.4-1.5 line height
   4 sizes max for hierarchy
   ----------------------------------- */
:root {
  /* Typography Scale - Major Third (1.25) for mobile */
  --font-size-base: clamp(
    1.0625rem,
    0.5vw + 0.9375rem,
    1.125rem
  ); /* 17px-18px */
  --font-size-secondary: clamp(
    0.875rem,
    0.5vw + 0.8125rem,
    0.9375rem
  ); /* 14px-15px */
  --font-size-caption: 0.8125rem; /* 13px */
  --font-size-h1: clamp(1.75rem, 1.287rem + 2.315vw, 3rem); /* 28px-48px */

  /* Line Heights - Tighter than typical web */
  --line-height-tight: 1.25; /* Headings */
  --line-height-base: 1.45; /* Body text */
  --line-height-loose: 1.6; /* Only for long-form content */

  /* Letter Spacing */
  --letter-spacing-tight: -0.01em;
  --letter-spacing-normal: 0;
  --letter-spacing-wide: 0.05em;

  /* 8pt Grid Spacing System */
  --space-1: 0.5rem; /* 8px */
  --space-2: 1rem; /* 16px */
  --space-3: 1.5rem; /* 24px */
  --space-4: 2rem; /* 32px */
  --space-5: 2.5rem; /* 40px */
  --space-6: 3rem; /* 48px */
  --space-8: 4rem; /* 64px */

  /* Touch Targets - iOS minimum */
  --touch-target-min: 44px;
  --touch-target-comfortable: 48px;
  --touch-separation-min: 8px;

  /* Layout Margins */
  --margin-mobile: 1rem; /* 16px per iOS */
  --margin-tablet: 1.5rem; /* 24px per iOS */
  --margin-desktop: 2rem; /* 32px */

  /* Header Heights */
  --header-mobile: 56px; /* Sticky header max */
  --header-tablet: 64px;

  /* Colors remain same */
  --primary-neon: #00ffff;
  --secondary-neon: #ff00ff;
  --dark-bg: #0a0a0a;
  --text-primary: #ffffff;
  --text-secondary: #b0b0b0;
}

/* -----------------------------------
   BASE TYPOGRAPHY
   ----------------------------------- */
body {
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  letter-spacing: var(--letter-spacing-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  line-height: var(--line-height-tight);
  letter-spacing: var(--letter-spacing-tight);
  margin: 0;
}

/* Desktop/Mobile Typography Hierarchy */
h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(2rem, 1.287rem + 2.315vw, 3rem); /* Mobile: 32px → Desktop: 48px */
  color: #ffffff; /* White - primary headlines */
  letter-spacing: 2px;
}

h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(1.5rem, 1.031rem + 1.875vw, 2.25rem); /* Mobile: 24px → Desktop: 36px */
  color: #ffffff; /* White - section headers */
  letter-spacing: 2px;
}

h3 {
  font-size: clamp(1.25rem, 0.938rem + 1.25vw, 1.75rem); /* Mobile: 20px → Desktop: 28px */
  color: #ffffff; /* White - sub-sections */
}

h4 {
  font-size: clamp(1.125rem, 1.031rem + 0.375vw, 1.5rem); /* Mobile: 18px → Desktop: 24px */
  color: #d1d5db; /* Light gray - card titles */
}

h5 {
  font-size: clamp(1rem, 0.938rem + 0.25vw, 1.25rem); /* Mobile: 16px → Desktop: 20px */
  color: #d1d5db; /* Light gray - small headings */
}

p {
  font-size: 1rem; /* 16px - consistent across devices */
  color: #9ca3af; /* Medium gray - body text */
  margin: 0 0 var(--space-2) 0;
}

small,
.text-small {
  font-size: 0.875rem; /* 14px - labels, captions */
  color: #9ca3af; /* Medium gray */
}

/* Secondary text */
.text-secondary {
  font-size: var(--font-size-secondary);
  color: var(--text-secondary);
}

/* Caption text */
.text-caption {
  font-size: var(--font-size-caption);
  color: var(--text-secondary);
}

/* -----------------------------------
   LAYOUT SYSTEM - 8pt Grid
   ----------------------------------- */
.container-dense {
  max-width: 1200px;
  margin: 0 auto;
  padding-left: var(--margin-mobile);
  padding-right: var(--margin-mobile);
}

@media (min-width: 768px) {
  .container-dense {
    padding-left: var(--margin-tablet);
    padding-right: var(--margin-tablet);
  }
}

@media (min-width: 1024px) {
  .container-dense {
    padding-left: var(--margin-desktop);
    padding-right: var(--margin-desktop);
  }
}

/* Spacing Utilities */
.mb-1 {
  margin-bottom: var(--space-1);
}
.mb-2 {
  margin-bottom: var(--space-2);
}
.mb-3 {
  margin-bottom: var(--space-3);
}
.mb-4 {
  margin-bottom: var(--space-4);
}
.mb-5 {
  margin-bottom: var(--space-5);
}
.mb-6 {
  margin-bottom: var(--space-6);
}

.mt-1 {
  margin-top: var(--space-1);
}
.mt-2 {
  margin-top: var(--space-2);
}
.mt-3 {
  margin-top: var(--space-3);
}
.mt-4 {
  margin-top: var(--space-4);
}

.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);
}

/* -----------------------------------
   TOUCH TARGETS
   ----------------------------------- */
button:not(.back-to-top):not(.hamburger-menu):not(.submenu-back):not(
    #close-popup
  ),
a.btn,
.touch-target {
  min-height: var(--touch-target-min);
  min-width: var(--touch-target-min);
  padding: var(--space-1) var(--space-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
}

/* Comfortable touch targets for primary actions */
.touch-target-lg {
  min-height: var(--touch-target-comfortable);
  min-width: var(--touch-target-comfortable);
}

/* Touch separation */
button:not(.back-to-top):not(.hamburger-menu):not(.submenu-back):not(
    #close-popup
  )
  + button:not(.back-to-top):not(.hamburger-menu):not(.submenu-back):not(
    #close-popup
  ),
a.btn + a.btn {
  margin-left: var(--touch-separation-min);
}

/* -----------------------------------
   FOOTER CONTACT SCROLL BUTTON
   Bottom-left fixed button to scroll to contact form
   ----------------------------------- */
.footer-contact-scroll-btn {
  position: fixed;
  bottom: 16px;
  left: 16px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    var(--primary-neon),
    var(--secondary-neon)
  );
  box-shadow: 0 6px 20px rgba(0, 255, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}

.footer-contact-scroll-btn:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 28px rgba(0, 255, 255, 0.5);
}

.footer-contact-scroll-btn:active {
  transform: translateY(0) scale(0.98);
}

.footer-contact-scroll-btn i {
  font-size: 24px;
  color: var(--dark-bg);
}

/* Move above bottom nav on mobile */
@media (max-width: 1023px) {
  .footer-contact-scroll-btn {
    bottom: calc(72px + env(safe-area-inset-bottom));
  }
}

/* -----------------------------------
   BOTTOM NAVIGATION
   iOS-inspired bottom tab bar
   ----------------------------------- */
/* Bottom nav styles moved to navbar.css for consolidation */

/* -----------------------------------
   DENSE CARD COMPONENTS
   ----------------------------------- */
.card-dense {
  background: rgba(20, 20, 30, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 255, 255, 0.2);
  border-radius: 12px;
  padding: var(--space-2);
  transition: all 0.3s ease;
}

.card-dense:hover {
  border-color: rgba(0, 255, 255, 0.4);
  transform: translateY(-2px);
}

.card-dense-title {
  font-size: clamp(1.125rem, 1rem + 0.625vw, 1.5rem);
  font-weight: 600;
  margin-bottom: var(--space-1);
  color: var(--primary-neon);
}

.card-dense-body {
  font-size: var(--font-size-secondary);
  line-height: var(--line-height-base);
  color: var(--text-secondary);
}

/* -----------------------------------
   SECTION SPACING
   Tighter than traditional web
   ----------------------------------- */
section {
  padding: var(--space-4) 0;
}

@media (min-width: 768px) {
  section {
    padding: var(--space-6) 0;
  }
}

@media (min-width: 1024px) {
  section {
    padding: var(--space-8) 0;
  }
}

/* -----------------------------------
   BUTTON SYSTEM
   Consistent touch targets
   ----------------------------------- */
/* Button styles moved to buttons.css to avoid conflicts */
/* Touch target enforcement handled by universal selector above */

/* -----------------------------------
   FORM INPUTS
   16px minimum to prevent iOS zoom
   ----------------------------------- */
input[type='text'],
input[type='email'],
input[type='tel'],
textarea {
  font-size: 16px !important; /* Critical for iOS */
  line-height: var(--line-height-base);
  padding: var(--space-1) var(--space-2);
  border: 1px solid rgba(0, 255, 255, 0.3);
  border-radius: 8px;
  background: rgba(20, 20, 30, 0.6);
  color: var(--text-primary);
  min-height: var(--touch-target-min);
}

input[type='text']:focus,
input[type='email']:focus,
input[type='tel']:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary-neon);
  box-shadow: 0 0 0 3px rgba(0, 255, 255, 0.2);
}

/* -----------------------------------
   PERFORMANCE OPTIMIZATIONS
   GPU-accelerated animations only
   ----------------------------------- */
.will-change-transform {
  will-change: transform;
}

.gpu-accelerated {
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* Only animate transform and opacity */
.animate {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* -----------------------------------
   SAFE AREA SUPPORT
   iOS notch and home indicator
   ----------------------------------- */
@supports (padding: max(0px)) {
  .safe-top {
    padding-top: max(var(--space-2), env(safe-area-inset-top));
  }

  .safe-bottom {
    padding-bottom: max(var(--space-2), env(safe-area-inset-bottom));
  }
}
