/* =====================================================================
   Reset / podstawy dokumentu
   ===================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 140px;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: calc(var(--fs-body) * var(--a11y-font-scale));
  font-weight: var(--fw-regular);
  line-height: var(--a11y-line-height);
  color: var(--color-text);
  background-color: var(--color-background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-weight: var(--fw-bold);
  line-height: var(--lh-heading);
  color: var(--color-text-strong);
  letter-spacing: -0.015em;
  text-wrap: balance;
}

h1 {
  font-size: calc(var(--fs-h1) * var(--a11y-font-scale));
  line-height: var(--lh-tight);
  letter-spacing: -0.025em;
}
h2 {
  font-size: calc(var(--fs-h2) * var(--a11y-font-scale));
  letter-spacing: -0.02em;
}
h3 {
  font-size: calc(var(--fs-h3) * var(--a11y-font-scale));
}
h4 {
  font-size: calc(var(--fs-h4) * var(--a11y-font-scale));
  font-weight: var(--fw-semibold);
}

p {
  margin: 0 0 var(--space-4);
  text-wrap: pretty;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}

a:hover {
  color: var(--color-primary-light);
}

ul,
ol {
  margin: 0;
  padding: 0;
}

li {
  list-style: none;
}

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

img {
  height: auto;
  border-style: none;
}

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

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

table {
  border-collapse: collapse;
  width: 100%;
}

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

address {
  font-style: normal;
}

figure {
  margin: 0;
}

/* --- Fokus: widoczny, ale tylko dla klawiatury ---------------------- */
:focus {
  outline: none;
}

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

/* --- Zaznaczenie tekstu -------------------------------------------- */
::selection {
  background: var(--color-primary);
  color: #fff;
}

/* --- Treść tylko dla czytników ekranu ------------------------------ */
.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 link ------------------------------------------------------ */
.skip-link {
  position: absolute;
  top: 0;
  left: var(--space-4);
  transform: translateY(-120%);
  z-index: var(--z-toast);
  padding: var(--space-3) var(--space-5);
  background: var(--color-primary);
  color: #fff;
  font-weight: var(--fw-semibold);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  transition: transform var(--dur-fast) var(--ease-out);
}

.skip-link:focus {
  transform: translateY(0);
  color: #fff;
}

/* --- Szanuj prefers-reduced-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;
  }
}
