/*
  Automation Ace — Base Design System
  Fonts: Space Grotesk (headings) · DM Sans (body) · Space Mono (accents)
*/

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&family=Space+Mono:wght@400;700&display=swap');

/* ── Design Tokens ─────────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg:           #080808;
  --bg-surface:   #0d0d0d;
  --bg-card:      #111111;
  --bg-hover:     #181818;

  /* Borders */
  --border:       #1c1c1c;
  --border-mid:   #252525;
  --border-light: #2e2e2e;

  /* Brand Red */
  --red:          #8e1210;
  --red-mid:      #b01614;
  --red-bright:   #d01614;
  --red-glow:     rgba(142, 18, 16, 0.14);
  --red-glow-sm:  rgba(142, 18, 16, 0.08);

  /* Brand Gold */
  --gold:         #f0c038;
  --gold-dim:     rgba(240, 192, 56, 0.12);
  --gold-glow:    rgba(240, 192, 56, 0.2);

  /* Text */
  --text:         #f0f0f0;
  --text-muted:   #6a6a6a;
  --text-dim:     #3a3a3a;
  --text-sub:     #999999;

  /* Fonts */
  --font-display: 'Space Grotesk', sans-serif;
  --font-body:    'DM Sans', sans-serif;
  --font-mono:    'Space Mono', monospace;

  /* Spacing */
  --sp-2:   2px;
  --sp-4:   4px;
  --sp-8:   8px;
  --sp-12:  12px;
  --sp-16:  16px;
  --sp-20:  20px;
  --sp-24:  24px;
  --sp-32:  32px;
  --sp-40:  40px;
  --sp-48:  48px;
  --sp-64:  64px;
  --sp-80:  80px;
  --sp-96:  96px;
  --sp-128: 128px;

  /* Radius */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 16px;
  --r-xl: 24px;

  /* Layout */
  --container: 1240px;
  --nav-h:     72px;

  /* Motion */
  --ease:        cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --t:           180ms;
  --t-lg:        320ms;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
}

img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
input, textarea, select { font: inherit; }
table { border-collapse: collapse; }

/* ── Typography ─────────────────────────────────────────── */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.025em;
  color: var(--text);
}

h1 { font-size: clamp(2.75rem, 5.5vw, 4.75rem); }
h2 { font-size: clamp(2rem,    4vw,   3.25rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.75rem); }
h4 { font-size: 1.125rem; font-weight: 600; letter-spacing: -0.01em; }
h5 { font-size: 0.9375rem; font-weight: 600; letter-spacing: 0; }

p { color: var(--text-muted); line-height: 1.75; }
p + p { margin-top: var(--sp-16); }

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

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

.section     { padding: var(--sp-96) 0; }
.section-sm  { padding: var(--sp-64) 0; }
.section-lg  { padding: var(--sp-128) 0; }

.grid-2    { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-20); }
.grid-3    { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-20); }
.grid-4    { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-20); }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--sp-20); }

/* ── Text Utilities ─────────────────────────────────────── */
.text-center  { text-align: center; }
.text-muted   { color: var(--text-muted); }
.text-red     { color: var(--red-bright); }
.text-gold    { color: var(--gold); }
.text-mono    { font-family: var(--font-mono); }
.text-label   {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.gradient-text {
  background: linear-gradient(135deg, var(--red-bright) 0%, var(--gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Visual Utilities ───────────────────────────────────── */
.divider   { height: 1px; background: var(--border); }
.dot-grid  {
  background-image: radial-gradient(var(--border-mid) 1px, transparent 1px);
  background-size: 28px 28px;
}
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

/* ── Section Label ──────────────────────────────────────── */
.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-8);
  margin-bottom: var(--sp-20);
}
.section-eyebrow::before {
  content: '';
  display: block;
  width: 20px;
  height: 2px;
  background: var(--red);
  border-radius: 1px;
  flex-shrink: 0;
}
.section-eyebrow span {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--red-bright);
}

/* ── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar       { width: 3px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--red); border-radius: 2px; }

/* ── Selection ──────────────────────────────────────────── */
::selection { background: var(--red); color: white; }

/* ── Focus ──────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--red-bright);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

/* ── Responsive Breakpoints ─────────────────────────────── */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .section { padding: var(--sp-80) 0; }
}

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .section { padding: var(--sp-64) 0; }
  .section-lg { padding: var(--sp-80) 0; }
  .container { padding: 0 var(--sp-16); }
}

@media (max-width: 480px) {
  .section { padding: var(--sp-48) 0; }
}
