@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  body, h1, h2, h3, h4, p, figure, blockquote, dl, dd, ul, ol { margin: 0; }
  ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
  img, picture, svg, video { display: block; max-width: 100%; height: auto; }
  input, button, textarea, select { font: inherit; color: inherit; }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
}

/* Font lokalny, licencja SIL OFL (docs/OFL-Archivo.txt) */
@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-var.6670d76716.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Square Peg";
  src: url("../fonts/squarepeg.b1dd890b95.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Give You Glory";
  src: url("../fonts/giveyouglory.a6ec158bf2.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
/* Fallback z przybliżonymi metrykami, ogranicza CLS */
@font-face {
  font-family: "Archivo Fallback";
  src: local("Arial"), local("Helvetica"), local("Liberation Sans");
  size-adjust: 101%;
  ascent-override: 87%;
  descent-override: 21%;
  line-gap-override: 0%;
}

@layer base {
  html {
    color-scheme: light;
    scroll-padding-top: calc(var(--size-header) + var(--space-4));
    scroll-behavior: smooth;
  }

  body {
    min-height: 100vh;
    background: var(--color-surface-page);
    color: var(--color-text-default);
    font-family: var(--font-family-body);
    font-size: var(--font-size-body);
    line-height: var(--font-line-height-body);
    font-stretch: calc(var(--font-stretch-normal) * 1%);
    text-rendering: optimizeLegibility;
  }

  h1, h2, h3, h4 {
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-heavy);
    font-stretch: calc(var(--font-stretch-heading) * 1%);
    line-height: var(--font-line-height-heading);
    letter-spacing: -0.01em;
    text-wrap: pretty;
  }
  h1 { font-size: var(--font-size-h1); }
  h2 { font-size: var(--font-size-h2); line-height: var(--font-line-height-section); }
  h3 { font-size: var(--font-size-h3); font-weight: var(--font-weight-bold); font-stretch: calc(var(--font-stretch-normal) * 1%); letter-spacing: 0; }

  p { max-width: calc(var(--size-measure) * 1ch); text-wrap: pretty; }

  a { color: inherit; text-decoration-color: var(--color-brand-orange); text-decoration-thickness: 2px; text-underline-offset: 0.2em; }

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

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

  @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;
    }
  }
}

@layer utilities {
  .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;
  }
  .stack > * + * { margin-block-start: var(--stack-space, var(--space-4)); }
  .cluster { display: flex; flex-wrap: wrap; gap: var(--cluster-space, var(--space-4)); align-items: center; }
  .nowrap { white-space: nowrap; }
}

@layer utilities {
  [hidden] { display: none !important; }
}
