/* ==========================================================================
   The Measurement Lab — Base / Reset
   Ported from the Claude Design output's inline reset, extended for a real
   multi-page site (focus rings, motion preference, media defaults).
   ========================================================================== */

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

html, body { margin: 0; padding: 0; }

html {
  /* Anchor jumps (services.html#interpretation) must clear the sticky nav. */
  scroll-padding-top: calc(var(--nav-h) + var(--progress-h) + var(--space-4));
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--surface-page);
  color: var(--text-body);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  font-weight: var(--weight-regular);
  /* `normal` (~1.2), not 1.5, deliberately. The design output set no
     line-height on its root, so every element without an explicit one used
     normal leading — and every prose block DOES carry an explicit
     line-height, transcribed from the design. Defaulting to 1.5 here
     silently inflated the height of every single-line element that inherits
     it: nav links, buttons, card labels, the footer. The nav CTA measured
     41px against the approved 38px. Prose readability is unaffected because
     prose never inherits this value. */
  line-height: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { text-decoration: none; color: inherit; }

input, select, textarea, button { font-family: inherit; font-size: inherit; }

::placeholder { color: var(--tml-muted); opacity: 1; }

img, svg, video { max-width: 100%; height: auto; display: block; }

/* Headings inherit the brand stack; size is set per component, not here. */
h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: var(--weight-bold); line-height: var(--leading-tight); }
p, ul, ol { margin: 0; }

/* --- Focus: visible for keyboard users, suppressed for mouse ------------
   Every interactive control on this site must be keyboard-reachable
   (build-spec addendum §5). :focus-visible keeps the ring off mouse clicks
   without removing it from tab navigation. */
:focus-visible {
  outline: 2px solid var(--tml-terracotta);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* --- Skip link ---------------------------------------------------------
   First tab stop on every page; hidden until focused. */
.tml-skip {
  position: absolute;
  left: var(--space-4);
  top: calc(-1 * var(--space-16));
  z-index: 200;
  padding: var(--space-3) var(--space-5);
  background: var(--tml-purple);
  color: var(--tml-white);
  font-size: var(--fs-sm);
  border-radius: var(--radius-md);
  transition: top 120ms ease-out;
}
.tml-skip:focus { top: var(--space-4); }

/* --- Motion preference -------------------------------------------------
   The design uses a fade-in keyframe and transitions throughout. Honor a
   reduced-motion request rather than animating regardless. */
@keyframes tmlFade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

@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;
  }
}

/* --- Screen-reader-only ---- */
.tml-sr {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
