/* ============================================================================
   Accessible Stays — Base layer
   ----------------------------------------------------------------------------
   Reset + element defaults + accessibility utilities + print rules.
   Depends on tokens.css (load it first). No component classes here — this is
   the floor everything else builds on.
   ========================================================================== */

/* --------------------------------------------------------------- @font-face */
/* Self-hosted (Atkinson Hyperlegible is SIL OFL). The board ships one latin and
   one latin-ext file reused across weights — a variable font — so a single
   face covers 400–800. Paths are relative to this CSS file. */
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/atkinson-hyperlegible-next-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/atkinson-hyperlegible-next-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  color-scheme: light dark;
}

body {
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-body-lg);
  font-weight: var(--weight-regular);
  line-height: var(--leading-body);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

/* ------------------------------------------------------------- typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--color-heading);
  line-height: var(--leading-heading);
  font-weight: var(--weight-bold);
  text-wrap: balance;
}

h1 { font-size: var(--text-h1); }
h2 { font-size: var(--text-h2); }
h3 { font-size: var(--text-h3); }
h4 { font-size: var(--text-body-lg); }

.display {
  font-size: var(--text-display);
  font-weight: var(--weight-extrabold);
  line-height: var(--leading-display);
  letter-spacing: var(--tracking-display);
}

/* Uppercase label ("CHECKED BY OUR TEAM"). Short labels only, never prose. */
.label {
  font-size: var(--text-meta);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--color-accent-strong);
}

.eyebrow {
  font-size: var(--text-meta);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--color-link);
}

p,
ul,
ol,
dl,
blockquote {
  max-width: var(--prose-max);
}

small,
.meta {
  font-size: var(--text-meta);
  line-height: var(--leading-meta);
  color: var(--color-text-muted);
}

/* ------------------------------------------------------------------- links */
a {
  color: var(--color-link);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

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

/* Accessible inline links: only underline on hover would hide the affordance
   for some users, so links stay underlined by default (WCAG 1.4.1). */

/* ------------------------------------------------------------------- focus */
/* Two-tone ring: visible on sand, teal and dark backgrounds alike. */
:focus-visible {
  outline: var(--focus-width) solid var(--color-focus-inner);
  outline-offset: var(--focus-offset);
  box-shadow: 0 0 0 calc(var(--focus-width) * 2) var(--color-focus-outer);
  border-radius: var(--radius-xs);
}

/* Never remove focus outlines. Pointer users don't see :focus-visible. */
:focus:not(:focus-visible) {
  outline: none;
}

::selection {
  background: var(--color-selection-bg);
  color: var(--color-selection-text);
}

/* ------------------------------------------------------------------- forms */
input,
select,
textarea,
button {
  font: inherit;
  color: inherit;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  width: 100%;
  min-height: var(--tap-target);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  color: var(--color-text);
  border: 2px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
}

/* Checkboxes and radios keep their native sizing. */
input[type="checkbox"],
input[type="radio"] {
  width: auto;
  min-height: 0;
  padding: 0;
  border: 0;
}

textarea {
  min-height: 8rem;
  resize: vertical;
}

/* Placeholder text must still clear contrast; keep it at muted, not lighter. */
::placeholder {
  color: var(--color-text-muted);
  opacity: 1;
}

label {
  display: block;
  font-weight: var(--weight-semibold);
}

/* Honest error state (coral-deep is the text-safe coral). */
input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: var(--color-accent-strong);
}

/* ----------------------------------------------------------------- buttons */
button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--tap-target);
  padding: var(--space-3) var(--space-6);
  font-weight: var(--weight-semibold);
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  transition: background-color var(--dur-fast) var(--ease-standard),
    color var(--dur-fast) var(--ease-standard);
}

.button--primary {
  background: var(--color-action);
  color: var(--color-action-text); /* white on teal, 7.78:1 */
}

.button--primary:hover {
  background: var(--color-action-hover);
  color: var(--color-action-text);
}

.button--secondary {
  background: transparent;
  color: var(--color-link);
  border-color: var(--color-border-strong);
}

.button--secondary:hover {
  background: var(--color-surface-2);
  color: var(--color-link);
}

.button[disabled],
.button[aria-disabled="true"] {
  opacity: 0.6;
  cursor: not-allowed;
}

/* -------------------------------------------------------------------- misc */
table {
  border-collapse: collapse;
  width: 100%;
}

th,
td {
  padding: var(--space-3) var(--space-4);
  text-align: start;
  border-bottom: 1px solid var(--color-border);
}

hr {
  border: 0;
  border-top: 1px solid var(--color-border);
}

/* --------------------------------------------------------------- utilities */
.visually-hidden {
  position: absolute !important;
  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 to main content" — visible only when focused. */
.skip-link {
  position: absolute;
  inset-block-start: -100%;
  inset-inline-start: var(--space-4);
  z-index: var(--z-skip-link);
  padding: var(--space-3) var(--space-5);
  background: var(--color-action);
  color: var(--color-action-text);
  border-radius: var(--radius-sm);
  text-decoration: none;
}

.skip-link:focus {
  inset-block-start: var(--space-4);
}

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

/* ------------------------------------------------------------------ motion */
@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;
    scroll-behavior: auto !important;
  }
}

/* ------------------------------------------------------------------- print */
/* Access guides are printed/downloaded, so print deserves real rules. */
@media print {
  :root {
    --color-bg: #ffffff;
    --color-surface: #ffffff;
    --color-text: #000000;
    --color-text-muted: #333333;
    --color-link: #000000;
    --color-border: #999999;
    --shadow-sm: none;
    --shadow-md: none;
    --shadow-lg: none;
  }

  body {
    background: #ffffff;
    color: #000000;
    font-size: 12pt;
    line-height: 1.5;
  }

  /* Show where links lead. */
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    font-weight: var(--weight-regular);
  }

  /* Drop interactive chrome. */
  .skip-link,
  nav,
  [hidden] {
    display: none !important;
  }

  h1,
  h2,
  h3,
  h4 {
    break-after: avoid;
    color: #000000;
  }

  img,
  table,
  figure {
    break-inside: avoid;
  }
}
