/**
 * Global Styles & Resets
 * Base styles, typography, and utility classes
 *
 * CRITICAL CSS: Lines 1-150 contain above-the-fold styles
 * These should be inlined for optimal performance
 */

/* ==================== MODERN RESET ==================== */

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--color-charcoal);
  background-color: var(--color-white);
  min-height: 100vh;
  overflow-x: hidden;
  max-width: 100vw;
}

/* ==================== TYPOGRAPHY ==================== */

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--color-primary);
  margin-bottom: var(--space-4);
}

h1 {
  font-size: var(--font-size-5xl);
  margin-bottom: var(--space-6);
}

h2 {
  font-size: var(--font-size-4xl);
  margin-bottom: var(--space-5);
}

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

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

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

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

p {
  margin-bottom: var(--space-4);
  line-height: var(--line-height-relaxed);
  color: var(--color-charcoal);
}

a {
  color: var(--color-accent-1);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary);
}

strong {
  font-weight: var(--font-weight-semibold);
  color: var(--color-primary);
}

/* ==================== LISTS ==================== */

ul, ol {
  list-style: none;
}

/* ==================== IMAGES ==================== */

img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ==================== BUTTONS ==================== */

button {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* ==================== FORMS ==================== */

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

input:focus, textarea:focus, select:focus {
  outline: none;
}

/* ==================== UTILITY CLASSES ==================== */

.container {
  max-width: var(--container-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

.section {
  padding-top: var(--section-padding-mobile);
  padding-bottom: var(--section-padding-mobile);
}

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

.section-subtitle {
  text-align: center;
  font-size: var(--font-size-xl);
  color: var(--color-secondary);
  max-width: 700px;
  margin: 0 auto var(--space-12);
}

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

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

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

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Spacing Utilities */
.mt-auto { margin-top: auto; }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

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

/* Center align all content by default */
.section {
  text-align: center;
}

.solution-item,
.implementation-card,
.about-container {
  text-align: center;
}

.text-primary { color: var(--color-primary); }
.text-secondary { color: var(--color-secondary); }
.text-accent { color: var(--color-accent-1); }
.text-muted { color: var(--color-secondary); opacity: 0.8; }

.font-mono { font-family: var(--font-mono); }

/* Visibility */
.hidden { display: none; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ==================== ACCESSIBILITY ==================== */

/* Skip Navigation Links */
.skip-nav-link {
  position: absolute;
  top: -40px;
  left: 6px;
  z-index: 1000;
  padding: 8px 16px;
  background-color: var(--color-primary);
  color: var(--color-white);
  text-decoration: none;
  border-radius: 4px;
  font-weight: var(--font-weight-semibold);
  transition: top 0.3s ease;
}

.skip-nav-link:focus {
  top: 6px;
}

/* Focus Indicators */
*:focus {
  outline: 2px solid var(--color-accent-1);
  outline-offset: 2px;
}

/* Remove default button outline and add custom */
button:focus,
.btn:focus {
  outline: 2px solid var(--color-accent-1);
  outline-offset: 2px;
}

/* Form focus indicators */
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--color-accent-1);
  outline-offset: 2px;
  border-color: var(--color-accent-1);
}

/* Link focus indicators */
a:focus {
  outline: 2px solid var(--color-accent-1);
  outline-offset: 2px;
  text-decoration: underline;
}

/* ==================== RESPONSIVE TYPOGRAPHY ==================== */

@media (max-width: 767px) {
  h1 { font-size: var(--font-size-4xl); }
  h2 { font-size: var(--font-size-3xl); }
  h3 { font-size: var(--font-size-2xl); }
  h4 { font-size: var(--font-size-xl); }
}

@media (min-width: 768px) {
  .section {
    padding-top: var(--section-padding);
    padding-bottom: var(--section-padding);
  }
}

@media (min-width: 1024px) {
  .container {
    padding-left: var(--space-8);
    padding-right: var(--space-8);
  }
}