/* ==========================================================================
   Fonts (self-hosted, SIL Open Font License 1.1, see assets/fonts/OFL-*.txt)
   Archivo: text, UI, condensed "studio" capitals (weight 100–900, width 62–125%)
   ========================================================================== */
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url("../fonts/archivo-latin-wdth-normal.de2f1fe81758.woff2") format("woff2-variations"),
       url("../fonts/archivo-latin-wdth-normal.de2f1fe81758.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: "Archivo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url("../fonts/archivo-latin-ext-wdth-normal.589f7bc0fac4.woff2") format("woff2-variations"),
       url("../fonts/archivo-latin-ext-wdth-normal.589f7bc0fac4.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;
}

/* ==========================================================================
   base.css
   Modern reset plus element defaults. No classes live here except the
   accessibility helpers that every page depends on.
   ========================================================================== */

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

  * { margin: 0; }

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

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

  body { min-height: 100dvh; }

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

  img, video { height: auto; }

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

  button { cursor: pointer; background: none; border: 0; padding: 0; }

  :where(button, [role="button"]):disabled { cursor: not-allowed; }

  p, h1, h2, h3, h4, h5, h6, li, dt, dd, figcaption { overflow-wrap: break-word; }

  h1, h2, h3, h4 { text-wrap: balance; }

  p { text-wrap: pretty; }

  ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }

  table { border-collapse: collapse; }

  [hidden] { display: none !important; }
}

@layer base {
  body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-sans);
    font-size: var(--step-0);
    font-weight: var(--weight-regular);
    line-height: var(--leading-body);
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
  }

  main { flex: 1 0 auto; }

  /* Headings: Archivo medium, slightly tight; size carries the hierarchy */
  h1, h2, h3, h4 {
    font-family: var(--font-sans);
    font-weight: var(--weight-medium);
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-tight);
    color: var(--color-text);
  }

  h4 { font-family: var(--font-sans); font-weight: var(--weight-medium); letter-spacing: 0; }

  h1 { font-size: var(--step-4); }
  h2 { font-size: var(--step-3); }
  h3 { font-size: var(--step-2); }
  h4 { font-size: var(--step-1); }

  small { font-size: var(--step--1); }

  strong, b { font-weight: var(--weight-medium); }

  a {
    color: var(--color-accent-text);
    text-decoration-thickness: 1px;
    text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
    text-underline-offset: 0.2em;
    transition: color var(--duration-fast) var(--ease-out);
  }

  a:hover { color: var(--color-on-accent); }

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

  ::selection {
    background: var(--color-accent);
    color: var(--color-on-accent);
  }

  html { background-color: var(--color-bg); }

  /* ---- Focus: visible, consistent, keyboard only ---- */
  :focus { outline: none; }

  :focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
  }

  /* ---- Accessibility helpers ---- */
  .visually-hidden:not(:focus):not(:active) {
    clip-path: inset(50%);
    height: 1px;
    width: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
  }

  /* File inputs opened through a <label>: always hidden. (.visually-hidden
     un-hides on :active, and clicking a label makes its input :active, which
     shifts the layout mid-click and cancels the file picker.) */
  .file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .skip-link {
    position: absolute;
    top: var(--space-2xs);
    left: var(--space-2xs);
    z-index: calc(var(--z-nav) + 1);
    padding: var(--space-2xs) var(--space-s);
    background: var(--color-text);
    color: var(--color-bg);
    border-radius: var(--radius-sm);
    font-weight: var(--weight-medium);
    text-decoration: none;
    transform: translateY(-200%);
    transition: transform var(--duration-base) var(--ease-out);
  }

  .skip-link:focus-visible { transform: translateY(0); }
}
