/* ============================================
   The Racket - Industrial Noir Design System
   ============================================ */

/* === CSS Reset === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* === CSS Variables === */
:root {
  /* Industrial Safety Palette */
  --color-matte-black: #131618;
  --color-safety-orange: #FF5F15;
  --color-machined-steel: #B0C4DE;
  --color-lockout-red: #CF6679;
  --color-signal-green: #00E676;

  /* Asphalt & Brick Palette */
  --color-wet-asphalt: #0D0C0C;
  --color-rusted-ibeam: #784F1C;
  --color-dried-blood: #7A0B0B;
  --color-newsprint-grey: #D0C8C8;
  --color-bruised-plum: #531C72;
  --color-gunmetal: #3D403C;

  /* Typography */
  --font-primary: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-headers: 'Oswald', 'Arial Narrow', sans-serif;
  --font-data: 'Barlow', 'Courier New', monospace;

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

  /* Border radius */
  --radius-sm: 2px;
  --radius-md: 4px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.5);
  --shadow-inset: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* === Base Styles === */
html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  background-color: var(--color-matte-black);
  color: var(--color-machined-steel);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* === Typography === */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-headers);
  font-weight: 600;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-newsprint-grey);
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin-bottom: var(--spacing-lg);
}

h2 {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  margin-bottom: var(--spacing-md);
}

h3 {
  font-size: clamp(1.25rem, 3vw, 2rem);
  margin-bottom: var(--spacing-md);
}

h4 {
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  margin-bottom: var(--spacing-sm);
}

p {
  margin-bottom: var(--spacing-md);
  font-size: clamp(0.95rem, 2vw, 1.1rem);
}

a {
  color: var(--color-safety-orange);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-rusted-ibeam);
}

/* === Utility Classes === */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
}

.container-wide {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
}

.section {
  padding: var(--spacing-3xl) 0;
}

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

.text-muted {
  color: var(--color-gunmetal);
}

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

/* === Texture Backgrounds === */
.bg-concrete {
  background-color: var(--color-wet-asphalt);
  background-image:
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 2px,
      rgba(255, 255, 255, 0.02) 2px,
      rgba(255, 255, 255, 0.02) 4px
    ),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(255, 255, 255, 0.02) 2px,
      rgba(255, 255, 255, 0.02) 4px
    );
}

.bg-noise::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  pointer-events: none;
}

/* === Grid System === */
.grid {
  display: grid;
  gap: var(--spacing-lg);
}

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

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

/* === Responsive === */
@media (max-width: 768px) {
  :root {
    --spacing-3xl: 2rem;
    --spacing-2xl: 1.5rem;
  }

  .container {
    padding: 0 var(--spacing-md);
  }

  .section {
    padding: var(--spacing-2xl) 0;
  }
}

/* === Accessibility === */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --color-machined-steel: #E0E0E0;
    --color-newsprint-grey: #F0F0F0;
  }
}
