/* ==========================================================================
   Farner Intelligent Systems — shared reset
   Foundation Agent, Wave 2 (2026-08-30)

   HARD RULE — no color values, no font-family values in this file.
   (currentColor and `inherit` are relationships, not colors/faces.)
   Loaded FIRST in every direction, before tokens.css and local styles.
   ========================================================================== */

/* --- box model & margins ------------------------------------------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

/* --- document ----------------------------------------------------------- */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Anchor jumps land BELOW the sticky header. Every direction overrides
     --header-height on :root to its real rendered header height
     (tokens.css). A stale value here is how sections get clipped behind
     the header — and clipped = defect (binding-specs.md §8). */
  scroll-padding-top: calc(var(--header-height, 4rem) + 0.5rem);
}

body {
  min-height: 100svh;
  line-height: var(--leading-normal, 1.55);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

img {
  height: auto; /* scale by width only — never distort supplied artwork.
                   Natural pixel dimensions belong in the width/height
                   attributes (binding-specs.md §2). */
}

/* --- forms — the classic gotcha ----------------------------------------- */
/* Form controls do NOT inherit typography by default; without this, inputs
   render in the UA face and break the direction's type system. */
input,
button,
textarea,
select {
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
}

textarea {
  resize: vertical;
}

/* --- text --------------------------------------------------------------- */
p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

/* --- links & buttons ---------------------------------------------------- */
a {
  color: inherit; /* directions style links locally */
}

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

/* --- focus-visible baseline --------------------------------------------- */
/* The floor every direction inherits. A direction MAY restyle focus with
   its accent locally, but may NEVER remove the visible indicator or ship
   one below 3:1 contrast against its ground (component-contract.md §5). */
:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* --- hidden ------------------------------------------------------------- */
[hidden] {
  display: none !important;
}

/* --- shared utilities --------------------------------------------------- */
/* Visually hidden, available to assistive tech (skip links, sr-only text). */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Skip link becomes visible on focus; direction styles its surface locally. */
.sr-only.skip-link:focus-visible {
  position: fixed;
  top: var(--space-2, 0.5rem);
  left: var(--space-2, 0.5rem);
  width: auto;
  height: auto;
  margin: 0;
  padding: var(--space-2, 0.5rem) var(--space-4, 1rem);
  clip: auto;
  clip-path: none;
  white-space: normal;
  z-index: var(--z-skiplink, 300);
}

/* Honeypot wrapper — the contact-form spam trap (binding-specs.md §3).
   Off-layout hiding, NOT display:none, so unsophisticated bots still see
   and fill the field; aria-hidden + tabindex="-1" on the markup keep it
   out of the accessibility tree and tab order. */
.hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  pointer-events: none;
}

/* --- prefers-reduced-motion global guard --------------------------------- */
/* The FLOOR builders can rely on: under reduced motion nothing loops,
   nothing transitions perceptibly, and smooth scrolling is off. It is NOT
   the whole implementation — every moving element must also ship its
   semantic static state (marquee: wrapped static list with the duplicate
   track hidden and the toggle removed; typing/decode effects: final text
   rendered; reveals: content visible without entrance). See
   component-contract.md §6 and binding-specs.md §5. */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
    scroll-behavior: auto !important;
  }
}
