/* ===================================
   CSS RESET & BOX SIZING
   =================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ===================================
   DESIGN TOKENS & CSS VARIABLES
   =================================== */
:root {
  /* Colors */
  --primary-color: #2563eb;
  --secondary-color: #1e40af;
  --accent-color: #3b82f6;
  --text-dark: #e5e7eb;
  --text-light: #9ca3af;
  --bg-light: #1f2937;
  --white: #111827;
  --card-bg: #1f2937;
  --section-bg: #0f172a;

  /* Spacing Scale (base: 4px) */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;
  --space-2xl: 32px;

  /* Container padding by breakpoint */
  --container-padding-mobile: 16px;
  --container-padding-tablet: 24px;
  --container-padding-desktop: 32px;

  /* Grid system */
  --grid-columns: 12;
  --grid-gutter: 16px;
  --container-max-width: 1200px;
}

/* ===================================
   BASE STYLES (Mobile-first)
   =================================== */
html {
  /* Offset scroll position to account for sticky header on anchor clicks only */
  scroll-behavior: smooth;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  color: var(--text-dark);
  background: var(--white);
  font-size: 1rem;
}

/* Typography - Responsive scaling with clamp() */
h1 {
  font-size: clamp(2rem, 2.3vw, 2.5rem);
  line-height: 1.2;
  font-weight: 800;
}

h2 {
  font-size: clamp(1.6rem, 1.9vw, 2rem);
  line-height: 1.3;
  font-weight: 700;
}

h3 {
  font-size: clamp(1.3rem, 1.5vw, 1.6rem);
  line-height: 1.4;
  font-weight: 600;
}

p {
  line-height: 1.6;
}

/* Focus states for accessibility */
a:focus,
button:focus {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

/* ===================================
   LAYOUT CONTAINER
   12-column grid system
   =================================== */
.container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding-left: var(--container-padding-mobile);
  padding-right: var(--container-padding-mobile);
}

/* ===================================
   HEADER & NAVIGATION
   Mobile: Hamburger menu
   Desktop: Horizontal nav
   =================================== */
header {
  background: linear-gradient(135deg, #1e3a8a 0%, #0f172a 100%);
  color: #ffffff;
  padding: var(--space-lg) 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.logo {
  font-size: clamp(1.25rem, 1.5vw, 1.5rem);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  z-index: 101;
}

.logo-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: contain;
}

/* Mobile navigation toggle button */
.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: var(--space-sm);
  z-index: 101;
}

.hamburger {
  display: block;
  width: 24px;
  height: 2px;
  background: #ffffff;
  position: relative;
  transition: background 0.3s;
}

.hamburger::before,
.hamburger::after {
  content: "";
  display: block;
  width: 24px;
  height: 2px;
  background: #ffffff;
  position: absolute;
  transition: transform 0.3s;
}

.hamburger::before {
  top: -8px;
}

.hamburger::after {
  bottom: -8px;
}

.nav-toggle[aria-expanded="true"] .hamburger {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] .hamburger::before {
  transform: rotate(45deg);
  top: 0;
}

.nav-toggle[aria-expanded="true"] .hamburger::after {
  transform: rotate(-45deg);
  bottom: 0;
}

/* Mobile menu - collapsed by default */
.nav-menu {
  position: fixed;
  top: 72px;
  left: 0;
  right: 0;
  background: #0f172a;
  list-style: none;
  display: flex;
  flex-direction: column;
  padding: var(--space-xl) var(--container-padding-mobile);
  gap: var(--space-lg);
  transform: translateX(-100%);
  transition: transform 0.3s ease-in-out;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.nav-menu.active {
  transform: translateX(0);
}

.nav-menu a {
  color: #ffffff;
  text-decoration: none;
  font-weight: 500;
  font-size: 1.125rem;
  padding: var(--space-md) 0;
  transition: opacity 0.3s;
  /* Minimum tappable area: 44x44px */
  min-height: 44px;
  display: flex;
  align-items: center;
}

.nav-menu a:hover {
  opacity: 0.8;
}

/* ===================================
   HERO SECTION
   =================================== */
.hero {
  position: relative;
  color: #ffffff;
  padding: var(--space-2xl) 0;
  text-align: center;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

/* Video background */
.hero-video-bg {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  transform: translate(-50%, -50%);
  z-index: 0;
  object-fit: cover;
  opacity: 0.3;
}

/* Overlay to ensure text readability */
.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.6) 0%, rgba(15, 23, 42, 0.65) 100%);
  z-index: 1;
}

.hero .container {
  position: relative;
  z-index: 2;
  padding-top: var(--space-2xl);
  padding-bottom: var(--space-2xl);
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
}

.hero h1 {
  margin-bottom: var(--space-lg);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hero p {
  font-size: 1.125rem;
  margin-bottom: var(--space-xl);
  opacity: 0.95;
  line-height: 1.6;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* CTA Button */
.cta-button {
  display: inline-block;
  background: var(--accent-color);
  color: var(--white);
  padding: var(--space-lg) var(--space-2xl);
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.3s, box-shadow 0.3s;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  /* Minimum tappable area */
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
  background: #60a5fa;
}

/* ===================================
   SECTIONS
   =================================== */
.section {
  padding: var(--space-2xl) 0;
}

.section-alt {
  background: var(--section-bg);
}

.section-title {
  margin-bottom: var(--space-lg);
  color: var(--text-dark);
  text-align: center;
}

.section-subtitle {
  text-align: center;
  color: var(--text-light);
  font-size: 1.125rem;
  margin-bottom: var(--space-2xl);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

/* ===================================
   GRID SYSTEM
   Mobile: 1 column
   Tablet (md): 2 columns
   Desktop (lg): 3-4 columns
   =================================== */
.grid {
  display: grid;
  gap: var(--grid-gutter);
  /* Mobile-first: single column */
  grid-template-columns: 1fr;
}

/* Feature grid specific styling */
.grid-features {
  margin-top: var(--space-2xl);
}

/* Demo grid specific styling */
.grid-demos {
  margin-top: var(--space-2xl);
}

/* ===================================
   CARDS
   Full-width on mobile with generous padding
   =================================== */
.card {
  background: var(--card-bg);
  padding: var(--space-xl);
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s, box-shadow 0.3s;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.feature-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: var(--space-lg);
}

.card h3 {
  margin-bottom: var(--space-sm);
  color: var(--text-dark);
}

.card p {
  color: var(--text-light);
  margin-bottom: var(--space-lg);
  flex-grow: 1;
}

/* Demo link styling */
.demo-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-color);
  color: var(--white);
  padding: var(--space-md) var(--space-xl);
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.3s;
  /* Minimum tappable area */
  min-height: 44px;
  margin-top: auto;
}

.demo-link:hover {
  background: var(--secondary-color);
}

/* ===================================
   ABOUT SECTION
   =================================== */
.about-content {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.about-content p {
  font-size: 1.125rem;
  color: var(--text-light);
  margin-bottom: var(--space-xl);
  line-height: 1.6;
}

/* ===================================
   FOOTER
   =================================== */
footer {
  background: #0f172a;
  color: #ffffff;
  padding: var(--space-2xl) 0;
  text-align: center;
}

.footer-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
  list-style: none;
}

.footer-links a {
  color: #ffffff;
  text-decoration: none;
  opacity: 0.8;
  transition: opacity 0.3s;
  padding: var(--space-sm) var(--space-md);
  /* Minimum tappable area */
  min-height: 44px;
  display: flex;
  align-items: center;
}

.footer-links a:hover {
  opacity: 1;
}

.copyright {
  padding-top: var(--space-xl);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  opacity: 0.7;
}

/* ===================================
   RESPONSIVE BREAKPOINTS
   Mobile-first approach with min-width media queries
   =================================== */

/* sm: 480px - Large phones */
@media (min-width: 480px) {
  .hero p {
    font-size: 1.25rem;
  }

  .footer-links {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* md: 768px - Tablets */
@media (min-width: 768px) {
  /* Container padding increases on tablet */
  .container {
    padding-left: var(--container-padding-tablet);
    padding-right: var(--container-padding-tablet);
  }

  .nav-container {
    padding: 0 var(--container-padding-tablet);
  }

  /* Desktop navigation: horizontal layout */
  .nav-toggle {
    display: none;
  }

  .nav-menu {
    position: static;
    flex-direction: row;
    transform: none;
    padding: 0;
    background: transparent;
    box-shadow: none;
    gap: var(--space-xl);
  }

  .nav-menu a {
    font-size: 1rem;
    padding: 0;
  }

  /* Grid: demos can use 2 columns on tablet, features stay single column */
  .grid-demos {
    grid-template-columns: repeat(2, 1fr);
  }

  .section {
    padding: 3rem 0;
  }

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

/* lg: 1024px - Small desktops */
@media (min-width: 1024px) {
  /* Container padding increases on desktop */
  .container {
    padding-left: var(--container-padding-desktop);
    padding-right: var(--container-padding-desktop);
  }

  .nav-container {
    padding: 0 var(--container-padding-desktop);
  }
  /* Grid: 3 columns for feature cards (creates 3x2 layout with 6 items) */
  .grid-features {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Grid: 3 columns for demo cards */
  .grid-demos {
    grid-template-columns: repeat(3, 1fr);
  }

  .section {
    padding: 4rem 0;
  }

  .hero .container {
    padding-top: 4rem;
    padding-bottom: 4rem;
  }
}

/* xl: 1280px - Large desktops */
@media (min-width: 1280px) {
  /* Spacing increases slightly on very large screens */
  .section {
    padding: 5rem 0;
  }

  .hero .container {
    padding-top: 5rem;
    padding-bottom: 5rem;
  }

  /* Cards can breathe more with larger gaps */
  .grid {
    gap: var(--space-xl);
  }
}
