/* ==========================================================================
   FLEXIONEX — BASE
   Reset, typography, accessibility baseline.
   Depends on tokens.css.
   ========================================================================== */

/* ── RESET ───────────────────────────────────────────────────────────── */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--fx-header-h-compact) + var(--fx-s5));
}

body {
  margin: 0;
  background-color: var(--fx-bg);
  color: var(--fx-text);
  font-family: var(--fx-font-sans);
  font-size: var(--fx-text-base);
  line-height: var(--fx-leading-normal);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd { margin: 0; }

ul[class], ol[class] { list-style: none; margin: 0; padding: 0; }

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

img { height: auto; }

input, button, textarea, select { font: inherit; color: inherit; }

button { background: none; border: none; padding: 0; cursor: pointer; }

table { border-collapse: collapse; border-spacing: 0; width: 100%; }

address { font-style: normal; }

[hidden] { display: none !important; }

/* ── TYPOGRAPHY ──────────────────────────────────────────────────────── */

.fx-display,
.fx-h1, .fx-h2, .fx-h3, .fx-h4 {
  color: var(--fx-text-strong);
  text-wrap: balance;
}

.fx-display {
  font-size: var(--fx-text-6xl);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: var(--fx-tracking-tighter);
  max-width: 16ch;
}

.fx-h1 {
  font-size: var(--fx-text-5xl);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
  max-width: 18ch;
}

.fx-h2 {
  font-size: var(--fx-text-3xl);
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: var(--fx-tracking-tight);
  max-width: 24ch;
}

.fx-h3 {
  font-size: var(--fx-text-xl);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  max-width: 32ch;
}

.fx-h4 {
  font-size: var(--fx-text-lg);
  font-weight: 600;
  line-height: 1.4;
  color: var(--fx-text);
  max-width: 40ch;
}

.fx-lead {
  font-size: var(--fx-text-lg);
  line-height: var(--fx-leading-relaxed);
  color: var(--fx-text-muted);
  max-width: 62ch;
  text-wrap: pretty;
}

.fx-body { max-width: 70ch; text-wrap: pretty; }

.fx-body-sm {
  font-size: var(--fx-text-sm);
  line-height: var(--fx-leading-normal);
  color: var(--fx-text-muted);
  max-width: 70ch;
}

.fx-eyebrow {
  font-size: var(--fx-text-xs);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: var(--fx-tracking-wider);
  text-transform: uppercase;
  color: var(--fx-orange-400);
}

.fx-label {
  font-size: var(--fx-text-xs);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: var(--fx-tracking-wide);
  text-transform: uppercase;
  color: var(--fx-text-subtle);
}

.fx-caption {
  font-size: var(--fx-text-xs);
  line-height: var(--fx-leading-normal);
  color: var(--fx-text-subtle);
  max-width: 60ch;
}

/* ── SPEC VALUES ─────────────────────────────────────────────────────────
   Mono numerals are the engineering-credibility signal. Every technical
   value, model number, material grade and standard reference uses this.
   ------------------------------------------------------------------------ */

.fx-spec {
  display: inline-flex;
  align-items: baseline;
  gap: 0.15em;
  font-variant-numeric: tabular-nums;
}

.fx-spec__value {
  font-family: var(--fx-font-mono);
  font-size: var(--fx-text-base);
  font-weight: 500;
  line-height: 1.4;
  color: var(--fx-text-spec);
}

.fx-spec__unit {
  font-family: var(--fx-font-mono);
  font-size: var(--fx-text-sm);
  font-weight: 400;
  line-height: 1.4;
  color: var(--fx-text-unit);
}

.fx-mono {
  font-family: var(--fx-font-mono);
  font-variant-numeric: tabular-nums;
}

/* ── LINKS ───────────────────────────────────────────────────────────── */

a {
  color: var(--fx-link);
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  text-underline-offset: 0.2em;
  transition: color var(--fx-dur-fast) var(--fx-ease-in-out);
}

a:hover { color: var(--fx-link-hover); }

/* ── FOCUS ───────────────────────────────────────────────────────────── */

:focus { outline: none; }

:focus-visible {
  outline: 2px solid var(--fx-focus-ring);
  outline-offset: 2px;
  border-radius: var(--fx-radius-xs);
}

/* ── SKIP LINK ───────────────────────────────────────────────────────── */

.fx-skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: var(--fx-skiplink-z);
  padding: var(--fx-s3) var(--fx-s5);
  background: var(--fx-navy-800);
  color: var(--fx-white);
  font-size: var(--fx-text-sm);
  font-weight: 600;
  border-radius: var(--fx-radius);
}

.fx-skip-link:focus {
  left: var(--fx-s4);
  top: var(--fx-s4);
  color: var(--fx-white);
}

/* ── SCREEN READER ONLY ──────────────────────────────────────────────── */

.fx-sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── SELECTION ───────────────────────────────────────────────────────── */

::selection {
  background: var(--fx-orange-400);
  color: var(--fx-ink-900);
}

/* ── MOTION SAFETY ───────────────────────────────────────────────────────
   Three layers of protection: no-JS, no-IntersectionObserver, reduced-motion.
   Content must never depend on animation to become visible.
   ------------------------------------------------------------------------ */

[data-animate] {
  opacity: 0;
  will-change: opacity, transform;
}

[data-animate].is-visible {
  opacity: 1;
  transform: none;
  will-change: auto;
  transition:
    opacity   var(--fx-dur-reveal) var(--fx-ease),
    transform var(--fx-dur-reveal) var(--fx-ease);
}

html:not(.js) [data-animate],
html.no-io   [data-animate] {
  opacity: 1 !important;
  transform: none !important;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }

  [data-animate] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
