/* ============================================================================
   Informed Software Solutions — Base
   Modern reset, global element defaults, core utilities, accessibility,
   and the GLOBAL reduced-motion gate. Consumes tokens.css only.
   Load order: tokens.css → base.css → components.css → product.css → page.css
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Anchor jumps clear the fixed header. JS may bypass when ScrollSmoother
     is active (it routes anchors through ScrollSmoother.scrollTo). */
  scroll-padding-top: calc(var(--header-h) + var(--space-4));
  -moz-tab-size: 4;
  tab-size: 4;
}

body {
  min-height: 100vh;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: var(--fw-body);
  line-height: var(--lh-body);
  letter-spacing: var(--ls-body);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Media defaults */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

svg {
  fill: currentColor;
}

/* Form elements inherit type */
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

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

/* Better text wrapping */
p,
li,
figcaption {
  text-wrap: pretty;
}

ul,
ol {
  list-style: none;
}

/* ---------------------------------------------------------------------------
   LINKS
--------------------------------------------------------------------------- */
a {
  color: inherit;
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-standard);
}

a:hover {
  color: var(--accent-text);
}

/* ---------------------------------------------------------------------------
   SELECTION — beacon on navy (forensic glint)
--------------------------------------------------------------------------- */
::selection {
  background-color: var(--selection-bg);
  color: var(--selection-fg);
}

/* ---------------------------------------------------------------------------
   HEADINGS — Fraunces display, navy on light
--------------------------------------------------------------------------- */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: var(--fw-display);
  font-variation-settings: 'opsz' var(--opsz-display), 'wght' var(--fw-display);
  color: var(--heading);
  line-height: var(--lh-heading);
  letter-spacing: var(--ls-heading);
  text-wrap: balance;
}

h1 { font-size: var(--fs-h1); line-height: var(--lh-tight); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-lead); font-weight: var(--fw-display-bold); }

/* Hero display utility — larger than h1, tightest leading */
.display {
  font-family: var(--font-display);
  font-size: var(--fs-display);
  font-weight: var(--fw-display);
  font-variation-settings: 'opsz' 144, 'wght' var(--fw-display);
  line-height: var(--lh-display);
  letter-spacing: var(--ls-display);
  color: var(--heading);
  text-wrap: balance;
}

/* ---------------------------------------------------------------------------
   TEXT UTILITIES
--------------------------------------------------------------------------- */
.lead {
  font-size: var(--fs-lead);
  line-height: var(--lh-snug);
  color: var(--text-soft);
  font-weight: var(--fw-body);
}

.text-small { font-size: var(--fs-small); }

.measure { max-width: var(--measure); }
.measure-narrow { max-width: 52ch; }

.mono {
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: var(--ls-tag);
}

.text-accent { color: var(--accent-text); }
.text-soft   { color: var(--text-soft); }

/* ---------------------------------------------------------------------------
   KICKER — monospaced "evidence tag" eyebrow.
   Usage: <p class="kicker">// 01 — INTELLIGENCE</p>
--------------------------------------------------------------------------- */
.kicker {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: var(--fs-kicker);
  line-height: 1;
  letter-spacing: var(--ls-kicker);
  text-transform: uppercase;
  color: var(--accent); /* amber on navy — AA on every band (see tokens.css) */
}

/* Accent-dot variant for kickers that lead a section */
.kicker::before {
  content: '';
  display: none; /* opt-in: add .kicker--dot to show */
}

.kicker--dot::before {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: var(--radius-pill);
  background-color: var(--accent);
  /* faint amber halo so the dot glints against the deep navy ground */
  box-shadow: 0 0 8px 1px color-mix(in srgb, var(--accent) 55%, transparent);
}

/* ---------------------------------------------------------------------------
   LAYOUT — container + section
--------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.container-wide {
  width: 100%;
  max-width: var(--container-wide);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.section {
  padding-block: var(--section-py);
  position: relative;
}

.section--sm {
  padding-block: var(--section-py-sm);
}

/* Themed section wrapper paints its own background */
.section.theme-daylight,
.section.theme-operations {
  background-color: var(--bg);
  color: var(--text);
}

/* ---------------------------------------------------------------------------
   SECTION HEADER PATTERN — kicker + h2 + lead
   (component styling for spacing lives in components.css; these are base
    rhythm tokens so the pattern is consistent before components load)
--------------------------------------------------------------------------- */
.section-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-width: var(--measure);
}

.section-header > h2 {
  margin: 0;
}

/* ---------------------------------------------------------------------------
   HAIRLINE RULE — forensic detail
--------------------------------------------------------------------------- */
.rule {
  border: 0;
  border-top: var(--border-hairline) solid var(--rule);
  width: 100%;
}

/* ---------------------------------------------------------------------------
   ACCESSIBILITY
--------------------------------------------------------------------------- */

/* Visually hidden but available to assistive tech */
.visually-hidden,
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip link — first focusable element, visible on focus */
.skip-link {
  position: fixed;
  top: var(--space-3);
  left: var(--space-3);
  z-index: var(--z-toast);
  transform: translateY(-150%);
  padding: var(--space-3) var(--space-5);
  background-color: var(--navy-700);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  font-weight: 500;
  letter-spacing: var(--ls-tag);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  transition: transform var(--dur-fast) var(--ease-out);
}

.skip-link:focus {
  transform: translateY(0);
  color: var(--paper);
}

/* Focus-visible — 2px beacon outline + offset, everywhere (bright amber on the
   dark ground for an unmistakable, AA-strong focus ring) */
:focus-visible {
  outline: var(--border-thick) solid var(--beacon-400);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Remove default outline only where focus-visible takes over */
:focus:not(:focus-visible) {
  outline: none;
}

/* ---------------------------------------------------------------------------
   ANIMATION SAFETY — content is NEVER hidden by CSS alone.
   [data-anim] elements stay fully visible by default; JS sets the initial
   pre-animation state (opacity:0 etc.) only AFTER confirming motion is
   allowed. So no-JS and reduced-motion users always see content.
--------------------------------------------------------------------------- */
[data-anim] {
  opacity: 1;
}

/* JS adds .js-anim-ready to <html> once it has taken control of initial
   states. Only then may animated elements start hidden (set inline by JS,
   never here). This class is a hook for any CSS that must wait for JS. */

/* ---------------------------------------------------------------------------
   GLOBAL REDUCED-MOTION GATE
   Short-circuits all animation/transition to a near-instant final state.
   Mirrored by the .no-motion class (JS adds it on <html> for the same effect
   when JS-side reduced-motion / low-power is detected).
--------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

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

/* Belt-and-braces: if motion is reduced, force any element JS might have
   hidden back to visible, so nothing is ever stranded at opacity:0. */
@media (prefers-reduced-motion: reduce) {
  [data-anim] {
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
  }
}

.no-motion [data-anim] {
  opacity: 1 !important;
  transform: none !important;
  clip-path: none !important;
}

/* ===========================================================================
   ATMOSPHERE LAYER  ("Operations-grade dark" richness)
   Reusable, token-driven patterns. The product-pages agent should REPLICATE
   these onto converted pages for a consistent cinematic feel:
     • .grain-overlay   — fixed film-grain veil (place once per page in <body>)
     • .has-glow        — section opts into a cool navy-glow atmosphere pool
     • .section-numeral — oversized translucent editorial numeral behind a head
     • .ridge-bg        — faint fingerprint-ridge texture field on a surface
   All are decorative + pointer-events:none and never trap interaction.
   =========================================================================== */

/* Film-grain veil — a single fixed element near the top of <body>. ~3.5%
   opacity tile of SVG fractal noise; soft-light keeps it as texture, not haze.
   Reduced motion / no-JS unaffected (purely static). */
.grain-overlay {
  position: fixed;
  inset: 0;
  z-index: 1; /* above section bg paint, below all content (content is z-raised+) */
  pointer-events: none;
  background-image: var(--grain-tile);
  background-size: 140px 140px;
  opacity: 0.035;
  mix-blend-mode: soft-light;
}

/* A section that opts into the cool glow pool. The pool is painted on a
   ::before behind content; sections set their own size/position by overriding
   --glow-pos / --glow-size if needed. */
.has-glow { position: relative; isolation: isolate; }
.has-glow > * { position: relative; z-index: var(--z-raised); }
.has-glow::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: var(--glow, var(--glow-navy));
  background-repeat: no-repeat;
  background-position: var(--glow-pos, 50% -10%);
  background-size: var(--glow-size, 120% 70%);
}

/* Oversized translucent section numeral. Markup:
     <span class="section-numeral" aria-hidden="true" data-numeral="01"></span>
   The glyph is rendered via ::before from the attr so it never enters the
   accessibility tree or text flow. Outline + faint fill = editorial punch. */
.section-numeral {
  position: absolute;
  top: var(--numeral-top, -0.18em);
  right: var(--numeral-right, 0);
  z-index: 0;
  pointer-events: none;
  user-select: none;
  font-family: var(--font-display);
  font-weight: var(--fw-display-bold);
  font-variation-settings: 'opsz' 144, 'wght' var(--fw-display-bold);
  font-size: var(--numeral-size, clamp(7rem, 4rem + 18vw, 18rem));
  line-height: 0.8;
  letter-spacing: -0.04em;
  color: var(--numeral-fill);
  -webkit-text-stroke: 1px var(--numeral-line);
}
.section-numeral::before { content: attr(data-numeral); }

/* Faint fingerprint-ridge texture field on a surface (cards / bands). */
.ridge-bg { position: relative; }
.ridge-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: var(--ridge-field);
  opacity: var(--ridge-opacity, 0.6);
  -webkit-mask-image: radial-gradient(70% 70% at 50% 50%, #000 0%, transparent 78%);
          mask-image: radial-gradient(70% 70% at 50% 50%, #000 0%, transparent 78%);
}

/* Reduced motion: the atmosphere is static CSS, so nothing to gate — but keep
   the grain a touch lighter to avoid any shimmer perception on scaled DPI. */
@media (prefers-reduced-motion: reduce) {
  .grain-overlay { opacity: 0.03; }
}
