/* ============================================================================
   PODSTAWY — reset, typografia dokumentu, dostępność.
   ============================================================================ */

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

* {
  margin: 0;
  padding: 0;
}

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

body {
  min-height: 100svh;
  background: var(--c-bg);
  color: var(--c-ink);
  font-family: var(--f-sans);
  font-size: var(--t-base);
  line-height: var(--lh-normal);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

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

/* Atrybut `hidden` musi wygrywać z regułami układu — bez tego `display: flex`
   z klasy komponentu przykrywa domyślne `display: none`. */
[hidden] {
  display: none !important;
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

::selection {
  background: var(--c-accent);
  color: #fff;
}

/* ----------------------------------------------------------------------------
   Typografia dokumentu
   ---------------------------------------------------------------------------- */

h1,
h2,
h3,
h4 {
  font-family: var(--f-display);
  font-weight: 600;
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  color: var(--c-ink);
  text-wrap: balance;
}

h1 {
  font-size: var(--t-3xl);
  font-weight: 600;
}
h2 {
  font-size: var(--t-2xl);
}
h3 {
  font-size: var(--t-lg);
  line-height: var(--lh-snug);
}
h4 {
  font-size: var(--t-md);
  line-height: var(--lh-snug);
}

p {
  text-wrap: pretty;
}

/* `b` razem z `strong`: bez tego `b` bierze domyślne 700, którego żaden krój
   na stronie nie pobiera — przeglądarka pogrubiała je wtedy sztucznie.
   Po tej regule waga 700 nie jest już nigdzie potrzebna i nie musi się
   ładować. */
strong,
b {
  font-weight: 600;
}

/* ----------------------------------------------------------------------------
   Dostępność
   ---------------------------------------------------------------------------- */

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

.skip-link {
  position: absolute;
  top: var(--sp-4);
  left: var(--sp-4);
  z-index: var(--z-toast);
  padding: var(--sp-3) var(--sp-5);
  background: var(--c-accent);
  color: #fff;
  font-family: var(--f-mono);
  font-size: var(--t-sm);
  border-radius: var(--r-md);
  transform: translateY(-200%);
  transition: transform var(--d-base) var(--e-out);
}
.skip-link:focus {
  transform: translateY(0);
}

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

/* ----------------------------------------------------------------------------
   Ograniczony ruch
   ---------------------------------------------------------------------------- */
@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;
  }

  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}
