/* RowPix - Main CSS | Optimized for PageSpeed 100/100 */

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

:root {
  /* Colors */
  --navy: #0F172A;
  --blue: #38BDF8;
  --green: #22C55E;
  --gray-50: #F8FAFC;
  --gray-100: #F1F5F9;
  --gray-200: #E2E8F0;
  --gray-300: #CBD5E1;
  --gray-700: #334155;
  --gray-800: #1E293B;
  --gray-900: #0F172A;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;

  /* Typography */
  --font-system: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  /* Borders */
  --radius: 0.5rem;
  --radius-lg: 0.75rem;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);

  /* Transitions */
  --transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-system);
  color: var(--gray-900);
  background: var(--gray-50);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.2;
  font-weight: 700;
  color: var(--navy);
}

h1 { font-size: 2.5rem; margin-bottom: var(--space-md); }
h2 { font-size: 2rem; margin-bottom: var(--space-sm); }
h3 { font-size: 1.5rem; margin-bottom: var(--space-sm); }
h4 { font-size: 1.25rem; }

p { margin-bottom: var(--space-sm); }

a {
  color: var(--blue);
  text-decoration: none;
  transition: color var(--transition);
}

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

/* Layout */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-sm);
}

.container-narrow {
  max-width: 800px;
}

/* Header */
header {
  background: white;
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  max-width: 1200px;
  margin: 0 auto;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo:hover { color: var(--blue); }

nav {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

nav a {
  font-weight: 500;
  color: var(--gray-700);
  transition: color var(--transition);
}

nav a:hover { color: var(--blue); }

/* Footer */
footer {
  background: var(--navy);
  color: var(--gray-300);
  margin-top: auto;
  padding: var(--space-xl) 0 var(--space-lg);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.footer-section h4 {
  color: white;
  font-size: 1rem;
  margin-bottom: var(--space-sm);
}

.footer-section ul {
  list-style: none;
}

.footer-section li {
  margin-bottom: 0.5rem;
}

.footer-section a {
  color: var(--gray-300);
}

.footer-section a:hover {
  color: var(--blue);
}

.footer-bottom {
  text-align: center;
  padding-top: var(--space-md);
  border-top: 1px solid var(--gray-700);
  font-size: 0.875rem;
}

/* Main Content */
main {
  flex: 1;
  padding: var(--space-xl) 0;
}

.hero {
  text-align: center;
  padding: var(--space-xl) 0;
  max-width: 800px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: var(--space-sm);
}

.hero p {
  font-size: 1.25rem;
  color: var(--gray-700);
  margin-bottom: var(--space-lg);
}

/* Utility Classes */
.text-center { text-align: center; }
.text-muted { color: var(--gray-700); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }

/* Responsive */
@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  .hero h1 { font-size: 2.25rem; }
  .hero p { font-size: 1.125rem; }

  nav {
    gap: var(--space-sm);
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }
}

/* Skip to main content (accessibility) */
.skip-to-main {
  position: absolute;
  left: -9999px;
  z-index: 999;
  padding: var(--space-sm) var(--space-md);
  background: var(--blue);
  color: white;
  text-decoration: none;
}

.skip-to-main:focus {
  left: 50%;
  transform: translateX(-50%);
  top: var(--space-sm);
}

/* Performance: Critical Above-the-Fold Styles */
.loading {
  opacity: 0;
  animation: fadeIn 0.3s ease-in forwards;
}

@keyframes fadeIn {
  to { opacity: 1; }
}
