/* ---------------------------------------------------------------- fonts --
   Newsreader, self-hosted. The unicode-range split means an English page
   never downloads the latin-ext subset that carries Polish diacritics.     */

@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/newsreader-latin-400-normal.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: 'Newsreader';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/newsreader-latin-ext-400-normal.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;
}
@font-face {
  font-family: 'Newsreader';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/newsreader-latin-400-italic.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: 'Newsreader';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/newsreader-latin-ext-400-italic.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;
}
@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/newsreader-latin-600-normal.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: 'Newsreader';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/newsreader-latin-ext-600-normal.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;
}

/* --------------------------------------------------------------- tokens -- */

:root {
  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;

  --bg: #fcfbf9;
  --fg: #16181a;
  --fg-muted: #5d6367;
  --rule: rgba(22, 24, 26, 0.13);
  --accent: #1f5f52;
  --accent-hover: #14413a;
  --selection: rgba(31, 95, 82, 0.16);

  --step-body: clamp(1.0625rem, 1.02rem + 0.22vw, 1.1875rem);
  --step-h1: clamp(2.25rem, 1.55rem + 3vw, 3.5rem);
  --step-h2: clamp(1.4rem, 1.28rem + 0.55vw, 1.7rem);

  --measure: 34rem;
  --gutter: clamp(1.25rem, 5vw, 2.5rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101213;
    --fg: #e8e7e3;
    --fg-muted: #9aa1a4;
    --rule: rgba(232, 231, 227, 0.16);
    --accent: #7cc3ae;
    --accent-hover: #a3dbc9;
    --selection: rgba(124, 195, 174, 0.2);
  }
}

/* ------------------------------------------------------------ structure -- */

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--serif);
  font-size: var(--step-body);
  line-height: 1.65;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

::selection {
  background: var(--selection);
}

.wrap {
  width: min(100%, 64rem);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -4rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--fg);
  color: var(--bg);
  border-radius: 0.4rem;
  text-decoration: none;
  transition: top 0.15s ease;
}
.skip-link:focus {
  top: 0.5rem;
}

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

/* --------------------------------------------------------------- header -- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
}

.header-inner {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  padding-block: 1.15rem;
}

.wordmark {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--fg);
  text-decoration: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.6rem;
  margin-left: auto;
}

.site-nav a {
  color: var(--fg-muted);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.site-nav a:hover {
  color: var(--fg);
}

.site-nav a[aria-current='page'] {
  color: var(--fg);
  border-bottom-color: var(--accent);
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  align-self: center;
}

.lang {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem;
  border-radius: 0.35rem;
  line-height: 0;
  color: var(--fg);
  opacity: 0.4;
  transition: opacity 0.15s ease, background-color 0.15s ease;
}

.lang:hover {
  opacity: 0.85;
}

.lang.is-current {
  opacity: 1;
  background: var(--rule);
}

.flag {
  display: block;
  border-radius: 2px;
}

/* ----------------------------------------------------------------- main -- */

main {
  flex: 1;
  padding-block: clamp(3rem, 8vw, 6rem) clamp(4rem, 10vw, 7rem);
}

.prose {
  max-width: var(--measure);
}

.prose h1 {
  font-size: var(--step-h1);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.025em;
  margin: 0 0 1.1rem;
  text-wrap: balance;
}

.prose h2 {
  font-size: var(--step-h2);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.012em;
  margin: 2.6rem 0 0.7rem;
  text-wrap: balance;
}

.prose h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 2rem 0 0.5rem;
}

.prose p {
  margin: 0 0 1.15rem;
  text-wrap: pretty;
}

.prose .lead {
  font-size: 1.22em;
  line-height: 1.5;
  letter-spacing: -0.005em;
  margin-bottom: 1.5rem;
}

.prose a {
  color: var(--accent);
  text-decoration-line: underline;
  text-decoration-thickness: 0.055em;
  text-underline-offset: 0.18em;
  text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.prose a:hover {
  color: var(--accent-hover);
  text-decoration-color: currentColor;
}

.prose strong {
  font-weight: 600;
}

.prose ul,
.prose ol {
  margin: 0 0 1.15rem;
  padding-left: 1.2rem;
}

.prose li {
  margin-bottom: 0.45rem;
}

.prose li::marker {
  color: var(--fg-muted);
}

.prose blockquote {
  margin: 1.6rem 0;
  padding-left: 1.2rem;
  border-left: 2px solid var(--rule);
  color: var(--fg-muted);
  font-style: italic;
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 3rem 0;
}

.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.875em;
  background: var(--rule);
  padding: 0.12em 0.35em;
  border-radius: 0.25rem;
}

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 0.4rem;
}

/* --------------------------------------------------------------- footer -- */

.site-footer {
  border-top: 1px solid var(--rule);
  color: var(--fg-muted);
  font-size: 0.94rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.4rem 2rem;
  padding-block: 2rem 2.5rem;
}

.site-footer p {
  margin: 0;
  max-width: var(--measure);
}

.site-footer a {
  color: inherit;
  text-underline-offset: 0.18em;
}

.colophon {
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------- mobile -- */

@media (max-width: 40em) {
  .header-inner {
    gap: 0.5rem 1rem;
  }
  .wordmark {
    order: 1;
  }
  .lang-switch {
    order: 2;
    margin-left: auto;
  }
  .site-nav {
    order: 3;
    flex-basis: 100%;
    margin-left: 0;
    gap: 0.3rem 1.35rem;
    font-size: 0.98rem;
    padding-bottom: 0.15rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.01ms !important;
  }
}
