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

* {
  margin: 0;
  padding: 0;
}

html {
  background-color: var(--canvas);
  scroll-padding-top: calc(var(--nav-height) + var(--space-sm));
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

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

body {
  font-family: var(--font-sans);
  font-size: var(--text-body);
  font-weight: var(--weight-regular);
  line-height: var(--leading-body);
  letter-spacing: var(--tracking-body);
  font-synthesis: none;
  color: var(--ink);
  background-color: var(--canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

h1,
h2,
h3 {
  font-weight: var(--weight-semibold);
  text-wrap: balance;
}

h1 {
  font-size: var(--text-display);
  line-height: var(--leading-display);
  letter-spacing: var(--tracking-display);
}

h2 {
  font-size: var(--text-headline);
  line-height: var(--leading-headline);
  letter-spacing: var(--tracking-headline);
}

h3 {
  font-size: var(--text-title);
  line-height: var(--leading-title);
  letter-spacing: var(--tracking-headline);
}

p {
  text-wrap: pretty;
}

ul,
ol {
  list-style-position: outside;
}

a {
  color: var(--link);
  text-underline-offset: 0.2em;
}

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

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

button {
  cursor: pointer;
}

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

::selection {
  background-color: color-mix(in srgb, var(--accent) 28%, transparent);
  color: inherit;
}

:root {
  caret-color: var(--accent);
  accent-color: var(--accent);
  scrollbar-color: var(--hairline) transparent;
}

time,
.numeric {
  font-variant-numeric: tabular-nums;
}

.nowrap {
  white-space: nowrap;
}

/* Polish runs long: browser hyphenation splits words wrongly ("Twoje-go"), so wrap whole words and only break a word that would push the page wide. */
:lang(pl) :is(p, li, summary, figcaption) {
  hyphens: manual;
  overflow-wrap: break-word;
}

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

.skip-link {
  position: absolute;
  left: var(--space-sm);
  top: -4rem;
  z-index: 10000;
  padding: var(--space-xs) var(--space-sm);
  background-color: var(--canvas);
  border-radius: var(--radius-sm);
}

.skip-link:focus {
  top: var(--space-xs);
}
