/* ================================================================
   DIVISION ONE FIRE SYSTEMS — VANGUARD RMS
   main.css: Design Tokens, Reset, Base Typography, Layout
   ================================================================ */

/* ── Design Tokens ─────────────────────────────────────────────── */
:root {
  /* Core Colors */
  --color-bg:           #0A0E17;
  --color-surface:      #111827;
  --color-surface-2:    #0D1220;
  --color-card:         rgba(20, 27, 46, 0.7);
  --color-card-solid:   #141B2E;
  --color-border:       rgba(255, 255, 255, 0.07);
  --color-border-hover: rgba(230, 57, 70, 0.5);

  /* Brand Colors */
  --color-red:          #E63946;
  --color-red-dark:     #B22D38;
  --color-red-glow:     rgba(230, 57, 70, 0.15);
  --color-red-dim:      rgba(230, 57, 70, 0.08);
  --color-ember:        #F4882A;
  --color-ember-dim:    rgba(244, 136, 42, 0.5);

  /* Text Colors */
  --color-text:         #F0F4F8;
  --color-text-muted:   #CBD5E1;
  --color-text-dim:     #94A3B8;
  --color-text-faint:   #64748B;
  --color-silver:       #94A3B8;

  /* Typography */
  --font-display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Type Scale */
  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;
  --text-4xl:  2.25rem;
  --text-5xl:  3rem;
  --text-6xl:  3.75rem;
  --text-7xl:  4.5rem;

  /* Spacing (8px base grid) */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Layout */
  --container-max:  1200px;
  --container-pad:  clamp(1rem, 4vw, 2rem);
  --section-pad-y:  clamp(3.5rem, 8vw, 5.5rem);

  /* Border Radius */
  --radius-sm:  4px;
  --radius:     8px;
  --radius-lg:  12px;
  --radius-xl:  16px;
  --radius-2xl: 24px;

  /* Shadows */
  --shadow-sm:          0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-card:        0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-card-hover:  0 12px 48px rgba(0, 0, 0, 0.5);
  --shadow-red:         0 4px 20px rgba(230, 57, 70, 0.4);
  --shadow-red-lg:      0 8px 32px rgba(230, 57, 70, 0.5);

  /* Transitions */
  --transition-fast:   150ms ease;
  --transition-base:   250ms ease;
  --transition-slow:   400ms ease;
  --transition-spring: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Z-indices */
  --z-base:    1;
  --z-raised:  10;
  --z-overlay: 100;
  --z-nav:     1000;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, video, svg, canvas {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

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

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

/* ── Base Typography ────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.05;
  color: var(--color-text);
}

h1 { font-size: clamp(var(--text-4xl), 8vw, var(--text-7xl)); }
h2 { font-size: clamp(var(--text-3xl), 5vw, var(--text-5xl)); }
h3 { font-size: clamp(var(--text-xl), 2.5vw, var(--text-3xl)); font-weight: 600; }
h4 { font-size: var(--text-xl); font-weight: 600; }

p {
  color: var(--color-text-muted);
}

strong {
  color: var(--color-text);
  font-weight: 600;
}

/* ── Layout Utilities ───────────────────────────────────────────── */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

.section {
  padding: var(--section-pad-y) 0;
  position: relative;
}

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

.section--dark {
  background-color: var(--color-surface-2);
}

/* ── Section Header ─────────────────────────────────────────────── */
.section-header {
  margin-bottom: var(--space-12);
  max-width: 680px;
}

.section-header.centered {
  text-align: center;
  margin: 0 auto var(--space-12);
}

.section-header h2 {
  margin-top: var(--space-3);
}

.section-header p {
  margin-top: var(--space-5);
  font-size: var(--text-lg);
  color: var(--color-text-dim);
  max-width: 60ch;
}

.section-header.centered p {
  margin: var(--space-5) auto 0;
}

/* ── Overline (eyebrow label) ───────────────────────────────────── */
.overline {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-red);
}

.overline::before {
  content: '';
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-red);
  flex-shrink: 0;
}

/* ── Grid Utilities ─────────────────────────────────────────────── */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-6);
}

.grid-2-3 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
}

@media (min-width: 768px) {
  .grid-2-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .grid-2,
  .grid-3,
  .grid-4,
  .grid-2-3 { grid-template-columns: 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; }
.flex-col        { display: flex; flex-direction: column; }
.flex-wrap       { flex-wrap: wrap; }
.items-center    { align-items: center; }
.gap-2           { gap: var(--space-2); }
.gap-3           { gap: var(--space-3); }
.gap-4           { gap: var(--space-4); }
.gap-6           { gap: var(--space-6); }
.gap-8           { gap: var(--space-8); }

/* ── Utility Classes ────────────────────────────────────────────── */
.text-center  { text-align: center; }
.text-left    { text-align: left; }
.text-red     { color: var(--color-red); }
.text-ember   { color: var(--color-ember); }
.text-muted   { color: var(--color-text-muted); }
.text-dim     { color: var(--color-text-dim); }
.text-sm-body { font-size: var(--text-sm); }
.mt-2         { margin-top: var(--space-2); }
.mt-4         { margin-top: var(--space-4); }
.mt-6         { margin-top: var(--space-6); }
.mt-8         { margin-top: var(--space-8); }
.mt-10        { margin-top: var(--space-10); }
.mt-12        { margin-top: var(--space-12); }
.mb-4         { margin-bottom: var(--space-4); }
.mb-6         { margin-bottom: var(--space-6); }
.mb-8         { margin-bottom: var(--space-8); }

/* ── Divider ─────────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--color-border);
  border: none;
  margin: var(--space-8) 0;
}

/* ── Mesh Background Texture ────────────────────────────────────── */
.bg-mesh {
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 48px 48px;
}

/* ── Red Accent Line (decorative) ───────────────────────────────── */
.accent-line {
  display: block;
  width: 48px;
  height: 3px;
  background: linear-gradient(90deg, var(--color-red), var(--color-ember));
  border-radius: 2px;
  margin-bottom: var(--space-4);
}

/* ── Screen reader only ─────────────────────────────────────────── */
.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;
}
