/* Element defaults, fonts and accessibility helpers. Tokens only. */

/* Self-hosted variable fonts (OFL, see vendor/licenses). Latin subset only.
   The URLs are root-relative so Propshaft rewrites them to digested paths. */
@font-face {
  font-family: "Inter";
  src: url("/assets/inter-latin-wght-5e6b0c47.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/assets/plus-jakarta-sans-latin-wght-ca247690.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

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

  html {
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: calc(var(--header-height) + var(--space-4));
  }

  @media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
  }

  /* Asked for less motion: no transitions or animations anywhere, so things
     (a focus ring, a hover state, the drawer) simply appear. */
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      transition-duration: 0.01ms !important;
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
    }
  }

  body {
    margin: 0;
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: var(--leading-body);
    color: var(--color-text);
    background: var(--color-bg);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
  }

  h1, h2, h3, h4 {
    font-family: var(--font-heading);
    color: var(--color-heading);
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-heading);
    font-weight: 700;
    margin: 0 0 var(--space-4);
    text-wrap: balance;
  }
  h1 { font-size: var(--text-3xl); font-weight: 750; }
  h2 { font-size: var(--text-2xl); }
  h3 { font-size: var(--text-lg); line-height: var(--leading-snug); }
  h4 { font-size: var(--text-base); }

  p { margin: 0 0 var(--space-4); text-wrap: pretty; }
  ul, ol { margin: 0 0 var(--space-4); padding-left: 1.25em; }

  a {
    color: var(--color-link);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: color var(--duration) var(--ease);
  }
  a:hover { color: var(--color-link-hover); }

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

  button, input, select, textarea { font: inherit; color: inherit; }

  /* A two-tone ring: gold outside, navy inside, so focus is visible on white,
     on mist AND on navy without per-surface rules. */
  :focus-visible {
    outline: 3px solid var(--color-focus);
    outline-offset: 2px;
    box-shadow: 0 0 0 2px var(--color-focus-ring);
    border-radius: var(--radius-sm);
  }

  ::selection { background: var(--gold-100); color: var(--navy-900); }

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

  /* A class that sets `display` outranks the browser's own [hidden] rule, so
     el.hidden = true silently does nothing on anything carrying .button. */
  [hidden] { display: none !important; }

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

  .skip-link {
    position: absolute;
    left: var(--space-4);
    top: -100px;
    z-index: 100;
    padding: var(--space-3) var(--space-4);
    background: var(--navy-900);
    color: var(--white);
    font-weight: 600;
    border-radius: var(--radius);
    text-decoration: none;
  }
  .skip-link:focus { top: var(--space-4); color: var(--white); }

  /* Anything inside a navy surface flips to the dark palette. */
  .surface-dark {
    --color-bg: var(--dark-bg);
    --color-text: var(--dark-text);
    --color-heading: var(--dark-text);
    --color-text-muted: var(--dark-text-muted);
    --color-border: var(--dark-border);
    --color-link: var(--gold-300);
    --color-link-hover: var(--white);
    --color-eyebrow: var(--dark-eyebrow);
    --color-focus-ring: var(--white);
    background: var(--color-bg);
    color: var(--color-text);
  }
}
