/* FIXMAN base: reset, type, layout primitives, a11y, motion (v2) */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.62;
  color: var(--fg);
  background: var(--bg);
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { color: var(--fg); line-height: 1.14; margin: 0 0 var(--sp-3); font-weight: 750; letter-spacing: -0.02em; }
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }
h1, h2, h3 { text-wrap: balance; }
p { margin: 0 0 var(--sp-4); text-wrap: pretty; }
a { color: var(--teal-700); text-underline-offset: 3px; }
a:hover { color: var(--navy); }
img, svg, video { max-width: 100%; height: auto; display: block; }
ul, ol { padding-left: 1.25rem; }

strong { font-weight: 650; }
small, .small { font-size: var(--step--1); color: var(--fg-muted); }
.lead { font-size: var(--step-1); color: var(--fg-muted); line-height: 1.55; }

:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: 6px;
}

/* Skip link */
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--navy); color: #fff; padding: var(--sp-2) var(--sp-4);
  border-radius: 0 0 var(--r-sm) 0;
}
.skip-link:focus { left: 0; box-shadow: none; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 1.75rem); }
.container-wide { max-width: var(--maxw-wide); }
.container-narrow { max-width: var(--maxw-narrow); }
.section { padding-block: clamp(2.75rem, 6vw, 5.5rem); }
.section-tight { padding-block: clamp(2rem, 4vw, 3.25rem); }
.section-alt { background: var(--bg-alt); }
.section-ink { background: var(--grad-hero); color: #eaf2ff; }
.section-ink h1, .section-ink h2, .section-ink h3, .section-ink h4 { color: #fff; }
.section-ink .lead, .section-ink p { color: #c7d6ec; }
.section-head { max-width: 760px; margin-bottom: clamp(1.5rem, 3vw, 2.5rem); }
.section-head.center { margin-inline: auto; }
.section-head p { color: var(--fg-muted); font-size: var(--step-1); margin-bottom: 0; }
.section-head .eyebrow { margin-bottom: var(--sp-2); }
.stack > * + * { margin-top: var(--sp-4); }
.center { text-align: center; }
.mx-auto { margin-inline: auto; }
.hidden { display: none !important; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Grids ---------- */
.grid { display: grid; gap: clamp(1rem, 2.4vw, 1.75rem); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.split { display: grid; gap: clamp(1.5rem, 4vw, 3rem); grid-template-columns: 1fr 1fr; align-items: center; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

/* ---------- Utility ---------- */
.flow > * + * { margin-top: 1em; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.text-muted { color: var(--fg-muted); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  text-transform: uppercase; letter-spacing: 0.1em; font-size: var(--step--1);
  font-weight: 700; color: var(--teal-700); margin-bottom: var(--sp-2);
}
.eyebrow::before { content: ""; width: 22px; height: 2px; border-radius: 2px; background: var(--grad-brand); }
.eyebrow.center-line { justify-content: center; }
.section-ink .eyebrow { color: #7fe8e2; }
.kicker { font-family: var(--font-mono); font-size: var(--step--2); letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-faint); }

.grad-text { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Decorative background helpers */
.mesh-navy { background: var(--grad-hero); color: #eaf2ff; }
.dot-grid {
  background-image: radial-gradient(rgba(91, 107, 127, 0.22) 1px, transparent 1px);
  background-size: 22px 22px;
}

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out); will-change: opacity, transform; }
.reveal.is-in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: 80ms; }
.reveal[data-delay="2"] { transition-delay: 160ms; }
.reveal[data-delay="3"] { transition-delay: 240ms; }
.reveal[data-delay="4"] { transition-delay: 320ms; }
.reveal[data-delay="5"] { transition-delay: 400ms; }
.reveal[data-delay="6"] { transition-delay: 480ms; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* Circuit-trace signature divider */
.circuit-divider { display: block; width: 100%; height: 40px; margin: var(--sp-6) 0; }
.circuit-divider path, .circuit-divider circle, .circuit-divider polyline {
  fill: none; stroke: var(--teal); stroke-width: 1.6;
  stroke-dasharray: 6 5; stroke-linecap: round; stroke-linejoin: round;
  animation: trace 18s linear infinite;
}
.circuit-divider .spark { fill: var(--orange); stroke: none; animation: spark 8s var(--ease) infinite; }
@keyframes trace { to { stroke-dashoffset: -400; } }
@keyframes spark { 0% { transform: translateX(0); } 50% { transform: translateX(260px); } 100% { transform: translateX(0); } }
@media (prefers-reduced-motion: reduce) {
  .circuit-divider path, .circuit-divider circle, .circuit-divider polyline,
  .circuit-divider .spark { animation: none; }
}

@media (max-width: 640px) {
  .section { padding-block: 2.4rem; }
}
