/* ============================================
   AUTOMATION CONTROLS SERVICES — DESIGN TOKENS
   Design concept: "Scan Cycle" — the visual language
   borrows directly from PLC control-loop diagrams:
   INPUT -> LOGIC -> OUTPUT, dashed signal traces,
   a live scan-time readout. Signature element =
   the animated control-loop trace used in the hero
   and as section dividers.
   ============================================ */

:root {
  /* --- Color: 6 named values, derived from the supplied logo (deep blue -> chrome) --- */
  --navy-950: #070b12;      /* deepest background */
  --navy-900: #0b121d;      /* primary background */
  --charcoal-800: #131b28;  /* panel / card background */
  --charcoal-700: #1b2634;  /* elevated panel / borders base */
  --steel-400: #8b95a5;     /* metallic grey — secondary text, hairlines */
  --steel-200: #c7cfd9;     /* light steel — body copy on dark */
  --paper-100: #eef1f4;     /* off-white — headings on dark, light-mode bg */
  --accent-blue: #2f5fe0;   /* primary accent, pulled from logo blue */
  --accent-blue-bright: #5b8bff; /* hover / glow state */
  --signal-cyan: #2fd3c4;   /* "live signal" accent — used ONLY for active/animated states */

  --line: rgba(139, 149, 165, 0.18); /* hairline borders on dark */
  --line-strong: rgba(139, 149, 165, 0.32);

  /* --- Type --- */
  --font-display: 'Space Grotesk', 'Arial Narrow', sans-serif;
  --font-body: 'IBM Plex Sans', -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;

  /* --- Scale --- */
  --step--1: clamp(0.83rem, 0.8rem + 0.15vw, 0.9rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.1rem);
  --step-1: clamp(1.2rem, 1.1rem + 0.4vw, 1.4rem);
  --step-2: clamp(1.5rem, 1.3rem + 0.8vw, 1.9rem);
  --step-3: clamp(1.9rem, 1.6rem + 1.4vw, 2.6rem);
  --step-4: clamp(2.4rem, 1.9rem + 2.2vw, 3.6rem);
  --step-5: clamp(3rem, 2.2rem + 3.6vw, 5rem);

  /* --- Layout --- */
  --container: 1240px;
  --radius-sm: 3px;
  --radius-md: 5px;
  --gutter: clamp(1.25rem, 4vw, 3rem);

  /* --- Motion --- */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 160ms;
  --dur-med: 420ms;
  --dur-slow: 900ms;
}

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

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--navy-900);
  color: var(--steel-200);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--paper-100);
  line-height: 1.08;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}
h1 { font-size: var(--step-5); font-weight: 600; }
h2 { font-size: var(--step-4); font-weight: 600; }
h3 { font-size: var(--step-2); font-weight: 600; }
h4 { font-size: var(--step-1); font-weight: 600; }
p { margin: 0 0 1em; color: var(--steel-200); }
.mono { font-family: var(--font-mono); letter-spacing: 0.02em; }

:focus-visible {
  outline: 2px solid var(--signal-cyan);
  outline-offset: 3px;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--signal-cyan);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  display: flex;
  align-items: center;
  gap: 0.6em;
  margin-bottom: 1em;
}
.eyebrow::before {
  content: '';
  width: 18px;
  height: 1px;
  background: var(--signal-cyan);
}

section { padding: clamp(3.5rem, 7vw, 7rem) 0; position: relative; }

/* Blueprint grid backdrop — subtle, used behind hero / dark sections */
.grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
  pointer-events: none;
  opacity: 0.5;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.95em 1.6em;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent-blue);
  color: var(--paper-100);
  border-color: var(--accent-blue);
}
.btn-primary:hover { background: var(--accent-blue-bright); border-color: var(--accent-blue-bright); transform: translateY(-1px); }
.btn-ghost {
  background: transparent;
  color: var(--paper-100);
  border-color: var(--line-strong);
}
.btn-ghost:hover { border-color: var(--signal-cyan); color: var(--signal-cyan); }
.btn-sm { padding: 0.7em 1.2em; font-size: 0.78rem; }

/* Cards */
.card {
  background: var(--charcoal-800);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.8rem;
  transition: border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.card:hover { border-color: var(--line-strong); transform: translateY(-2px); }

/* Reveal-on-scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* Signal line divider — the signature motif */
.signal-divider { position: relative; height: 2px; background: var(--line); overflow: hidden; margin: 0; }
.signal-divider::after {
  content: '';
  position: absolute; top: 0; left: -20%;
  width: 20%; height: 100%;
  background: linear-gradient(90deg, transparent, var(--signal-cyan), transparent);
  animation: travel 3.6s linear infinite;
}
@keyframes travel { to { left: 120%; } }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--accent-blue); color: #fff; padding: 0.8em 1.2em; z-index: 999;
}
.skip-link:focus { left: 1rem; top: 1rem; }
