/* ==========================================================================
   base.css — resets, self-hosted fonts, base element styles, a11y primitives
   (POOL-SITE-BUILD-PLAN §4.3, §9). Depends on tokens.css.
   ========================================================================== */

/* --- Self-hosted fonts (§4.3) — woff2, font-display:swap, no Google CDN ---
   latin-subset variable files. opsz handled via font-optical-sizing:auto so
   large display sizes get the sharp, high-contrast cut automatically. */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/fraunces-latin-var.woff2') format('woff2-variations');
}
@font-face {
  font-family: 'Inter Tight';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/inter-tight-latin-var.woff2') format('woff2-variations');
}

/* --- Reset ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

/* [hidden] must always win — else a class like .btn{display:...} keeps a
   JS-hidden element visible (bit the quote-wizard nav/submit). */
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-body);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  color: var(--ink);
  background: var(--sand);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
}

img, picture, svg, video { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }

/* --- Headings — display face, tight leading (§4.3) --------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  font-optical-sizing: auto;
  line-height: var(--lh-tight);
  color: var(--deep);
  text-wrap: balance;
}
h1 { font-size: var(--t-h1); }
h2 { font-size: var(--t-h2); }
h3 { font-size: var(--t-h3); }

p, li { max-width: var(--measure); }
p { line-height: var(--lh-body); }

/* --- Links ------------------------------------------------------------- */
a { color: var(--water); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

ul, ol { padding-left: var(--s6); }
li + li { margin-top: var(--s2); }

strong, b { font-weight: 600; }
small { font-size: var(--t-small); }

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

/* --- Accessibility primitives (§9) ------------------------------------- */

/* Visible keyboard focus — never outline:none without a replacement. */
:focus-visible {
  outline: 3px solid var(--water);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Skip-to-content link */
.skip-link {
  position: absolute;
  left: var(--s4);
  top: -100%;
  z-index: 1000;
  padding: var(--s3) var(--s4);
  background: var(--deep);
  color: var(--on-deep);
  border-radius: var(--radius-md);
  transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: var(--s4); text-decoration: none; }

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

/* --- Reduced motion (§4.5) — water-line goes static, transitions to 0 --- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
