/* ==========================================================================
   Orbit — reset, typography, links, focus, utilities, motion
   Version: 1.3.2
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* W-06 P2-2 — every in-page anchor must clear the sticky header.
     SC 2.4.11 Focus Not Obscured (Minimum). */
  scroll-padding-top: 104px;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  color: var(--ink);
  background: var(--paper);
  text-wrap: pretty;
  -webkit-font-smoothing: antialiased;
}

/* The horizontal-overflow guard lives on the ROOT and uses `clip`, not
   `hidden`, and the difference is the whole point.
   
   `overflow-x: hidden` on <body> was breaking the sticky header. A box cannot
   have one axis hidden and the other visible, so the used value of overflow-y
   became `auto`; body then became a scroll container of its own, nested inside
   the viewport's. `position: sticky` resolved against that inner scrollport
   instead of the viewport and juddered up and down on every scroll — and
   `window.scrollY` stayed at 0, so the header's own scroll state (the shrink
   to 68px and the shadow) had never once fired since the guard was added.
   
   `clip` clips without creating a scroll container, which is exactly what a
   guard should do. Measured after removing it: no horizontal overflow on any
   page at 1536, 1440, 1100, 900, 600 or 375 — the section library clips its
   own decoration, and the ring fields are backgrounds, which clip for free.
   
   W-10 §6 · defect L-20. */
html { overflow-x: clip; }

/* Belt and braces alongside scroll-padding-top, for browsers that honour one
   and not the other. */
main, [id] { scroll-margin-top: 104px; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  line-height: var(--lh-display);
  margin: 0;
  /* pretty, not balance. Balance shortens the first line of a two-line
     heading, which set the heading as a narrow ragged column against a
     full-width paragraph beneath it. The artboards specify pretty. */
  text-wrap: pretty;
  color: var(--ink);
}
h1 { font-size: var(--t-h1); font-weight: 700; }
h2 { font-size: var(--t-h2); font-weight: 700; }
h3 { font-size: var(--t-h3); font-weight: 600; }
h4 { font-size: var(--t-h4); font-weight: 600; }

p, ul, ol, dl, table, figure, blockquote { margin: 0; }
img, svg, video { max-width: 100%; height: auto; }
img { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ---- Links -----------------------------------------------------------
   Always underlined. Never underline-on-hover-only (W-03 §5.5). */
a {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover { color: var(--primary-hover); text-decoration-thickness: 2px; }

.on-dark { color: var(--white); }
.on-dark h1, .on-dark h2, .on-dark h3, .on-dark h4 { color: var(--white); }
.on-dark a { color: var(--mint-light); }
.on-dark a:hover { color: var(--white); }

/* ---- Focus — dual ring, never removed (W-03 §5.7) ---------------------
   Present on every interactive element, on any background. */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--white) inset;
  border-radius: inherit;
}
.on-dark :focus-visible {
  outline-color: var(--focus-dark);
  box-shadow: 0 0 0 2px var(--ink) inset;
}
/* W-06 P2-1 — where the real control is visually hidden inside a label
   (the consent switches), the ring has to paint on the label instead. */
label:focus-within {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--r-input);
}
.on-dark label:focus-within { outline-color: var(--focus-dark); }

/* ---- Utilities -------------------------------------------------------- */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* W-06 P2-4 — fixed, not absolute. Absolute anchors it to the top of the
   document, so a visitor tabbing into a scrolled page focuses an off-screen
   control. */
.skip-link {
  position: fixed;
  left: var(--s-5); top: var(--s-3);
  z-index: var(--z-skip);
  transform: translateY(-200%);
  background: var(--primary); color: var(--white);
  padding: 12px 20px; border-radius: var(--r-input);
  font-weight: 600; text-decoration: none;
  transition: transform var(--d-micro) var(--ease);
}
.skip-link:focus { transform: translateY(0); }

/* W-06 P2-3 — <main> is focusable so the skip link moves focus, not just
   scroll position. Its own ring is suppressed; the destination is the point,
   not the box. */
main:focus { outline: none; }

.container { max-width: var(--container); margin-inline: auto; padding-inline: var(--page-pad); }
.measure   { max-width: var(--measure); }
.section   { padding-block: var(--section-y); }
.section--mist { background: var(--mist); }
.section--sand { background: var(--sand); }
.section--deep-2 { background: var(--deep-2); color: var(--white); }
.section--deep { background: var(--deep); color: var(--white); }

/* ---- Buttons ---------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--s-2);
  min-height: 48px; padding: 0 var(--s-5);
  border-radius: var(--r-input);
  font-family: var(--font-body); font-size: var(--t-small); font-weight: 600;
  text-decoration: none; cursor: pointer;
  border: 2px solid transparent;
  transition: background-color var(--d-micro) var(--ease),
              color var(--d-micro) var(--ease),
              transform var(--d-micro) var(--ease);
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }

.btn--primary { background: var(--primary); color: var(--white); }
.btn--primary:hover { background: var(--primary-hover); color: var(--white); }

.btn--secondary { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn--secondary:hover { background: var(--mist); color: var(--primary-hover); }

.btn--quiet { background: var(--white); color: var(--ink); border: 1px solid var(--line-strong); }
.btn--quiet:hover { background: var(--mist); color: var(--ink); }

.btn--on-dark { background: var(--white); color: var(--deep); }
.btn--on-dark:hover { background: var(--mint-light); color: var(--deep); }

/* A button inside an .on-dark band is still an <a>, so ".on-dark a" (0,1,1)
   outranked ".btn--on-dark" (0,1,0) and repainted the label mint-light. On the
   white button in the closing CTA that measured #8FE3C6 on #FFFFFF — 1.75:1,
   a hard AA failure on the one control the page is asking people to press.

   Matching at (0,2,1) rather than reaching for !important, so a later variant
   can still override in the normal way. W-08 defect L-09. */
.on-dark a.btn--on-dark,
.on-dark a.btn--on-dark:hover { color: var(--deep); }

.on-dark a.btn--primary,
.on-dark a.btn--primary:hover { color: var(--white); }

.on-dark a.btn--secondary { color: var(--white); border-color: var(--white); }
.on-dark a.btn--secondary:hover { background: rgba(255, 255, 255, 0.14); color: var(--white); }

.on-dark a.btn--quiet,
.on-dark a.btn--quiet:hover { color: var(--ink); }

/* Buttons are never disabled anywhere on this site (W-03 §5.5). */

/* ---- Data tables ------------------------------------------------------
   Legal documents. At ≤768px they reflow to stacked key–value pairs rather
   than scrolling sideways: every <td> carries a data-label. */
.data-table { width: 100%; border-collapse: collapse; font-size: var(--t-small); }
.data-table caption { text-align: left; font-weight: 600; padding-bottom: var(--s-3); }
.data-table th, .data-table td {
  text-align: left; padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--line); vertical-align: top;
}
.data-table thead th {
  background: var(--mist); border-bottom: 1px solid var(--line-strong); font-weight: 600;
}

@media (max-width: 768px) {
  .data-table thead {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%);
  }
  .data-table tr {
    display: block; border: 1px solid var(--line-strong);
    border-radius: var(--r-input); margin-bottom: var(--s-4); padding: var(--s-2) var(--s-3);
  }
  .data-table td {
    display: grid; grid-template-columns: 1fr; gap: 2px;
    border: 0; border-bottom: 1px solid var(--line); padding: var(--s-3) 0;
  }
  .data-table tr td:last-child { border-bottom: 0; }
  .data-table td::before { content: attr(data-label); font-weight: 600; color: var(--slate); }
}

/* ---- Motion preference ------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
