@charset "UTF-8";
/* ==========================================================================
   aktywnykompensator.pl — arkusz stylów
   Kolejność: reset → tokeny → podstawa → typografia → elementy → nagłówek →
              hero → sekcje → komponenty → grafika SVG → układ dokumentu →
              proza → stopka → animacje → responsywność → druk
   Bez zależności zewnętrznych poza Google Fonts.
   ========================================================================== */

/* --- Reset ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 104px; }
body { margin: 0; }
img, svg, video, canvas { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, h5, p, ul, ol, figure, dl, dd, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
table { border-collapse: collapse; width: 100%; }
summary { cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
[hidden] { display: none !important; }

/* --- Tokeny --------------------------------------------------------------- */
:root {
  color-scheme: light;

  /* Tła i neutralne */
  --bg:          #fbfbfc;
  --bg-soft:     #f3f5f8;
  --bg-tint:     #eef2f6;
  --card:        #ffffff;
  --card-soft:   #f8fafb;
  --ink:         #0b1220;
  --text:        #47525f;
  --muted:       #77828f;
  --line:        #e5e9ee;
  --line-soft:   #eef1f5;
  --line-strong: #d2d9e1;

  /* Panel ciemny (w obu motywach ten sam) */
  --deep:        #070c14;
  --deep-2:      #0c1422;
  --deep-line:   rgba(255,255,255,.10);
  --deep-line-2: rgba(255,255,255,.18);
  --deep-ink:    #f2f6fa;
  --deep-text:   #a9b6c6;
  --deep-muted:  #7d8b9c;
  --deep-accent: #93e6f3;

  /* Marka — prąd kompensacyjny */
  --brand:       #0e9fb8;
  --brand-ink:   #0a7e94;
  --brand-deep:  #065c6d;
  --brand-soft:  #e6f6f9;
  --brand-glow:  rgba(14,159,184,.30);

  /* Drugi akcent — indygo */
  --indigo:      #3d5af1;
  --indigo-ink:  #2c46cf;
  --indigo-soft: #ecefff;

  /* Sygnały: moc bierna / koszt (bursztyn) i stan właściwy (zieleń) */
  --amber:       #c07708;
  --amber-ink:   #9c6106;
  --amber-soft:  #fdf2e0;
  --ok:          #12855f;
  --ok-ink:      #0d6b4d;
  --ok-soft:     #e6f4ef;

  /* Nagłówek */
  --header-bg:   rgba(251,251,252,.82);
  --header-h:    72px;

  /* Cienie i obrysy */
  --shadow-xs: 0 1px 2px rgba(11,18,32,.04);
  --shadow-sm: 0 1px 2px rgba(11,18,32,.05), 0 6px 16px -12px rgba(11,18,32,.22);
  --shadow-md: 0 1px 2px rgba(11,18,32,.05), 0 20px 44px -26px rgba(11,18,32,.30);
  --shadow-lg: 0 2px 4px rgba(11,18,32,.06), 0 52px 96px -40px rgba(11,18,32,.40);
  --ring:      0 0 0 3px rgba(14,159,184,.34);

  /* Promienie */
  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 30px;
  --r-full: 999px;

  /* Siatka */
  --maxw: 1200px;
  --maxw-wide: 1340px;
  --gap: 26px;

  /* Typografia */
  --font:   "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif:  "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Georgia, "Times New Roman", serif;
  --mono:   "JetBrains Mono", ui-monospace, "SF Mono", "Cascadia Mono", Consolas, "Roboto Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    --bg:          #080d15;
    --bg-soft:     #0c131d;
    --bg-tint:     #101927;
    --card:        #101823;
    --card-soft:   #0c141f;
    --ink:         #eaf0f6;
    --text:        #a4b1c0;
    --muted:       #7d8a9a;
    --line:        #1c2734;
    --line-soft:   #161f2b;
    --line-strong: #2a3849;

    --deep:        #050a11;
    --deep-2:      #0a121e;
    --deep-accent: #93e6f3;

    --brand:       #2cc6de;
    --brand-ink:   #5ad6ea;
    --brand-deep:  #93e6f3;
    --brand-soft:  #07242c;
    --brand-glow:  rgba(44,198,222,.28);

    --indigo:      #7f8cff;
    --indigo-ink:  #9aa5ff;
    --indigo-soft: #141a33;

    --amber:       #e0a54c;
    --amber-ink:   #efbb6d;
    --amber-soft:  #241a09;
    --ok:          #3bc08c;
    --ok-ink:      #63d3a7;
    --ok-soft:     #07261c;

    --header-bg:   rgba(8,13,21,.78);

    --shadow-xs: 0 1px 2px rgba(0,0,0,.5);
    --shadow-sm: 0 1px 2px rgba(0,0,0,.5), 0 6px 16px -12px rgba(0,0,0,.8);
    --shadow-md: 0 1px 2px rgba(0,0,0,.5), 0 20px 44px -26px rgba(0,0,0,.85);
    --shadow-lg: 0 2px 4px rgba(0,0,0,.55), 0 52px 96px -40px rgba(0,0,0,.95);
    --ring:      0 0 0 3px rgba(44,198,222,.38);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --bg:          #080d15;
  --bg-soft:     #0c131d;
  --bg-tint:     #101927;
  --card:        #101823;
  --card-soft:   #0c141f;
  --ink:         #eaf0f6;
  --text:        #a4b1c0;
  --muted:       #7d8a9a;
  --line:        #1c2734;
  --line-soft:   #161f2b;
  --line-strong: #2a3849;

  --deep:        #050a11;
  --deep-2:      #0a121e;
  --deep-accent: #93e6f3;

  --brand:       #2cc6de;
  --brand-ink:   #5ad6ea;
  --brand-deep:  #93e6f3;
  --brand-soft:  #07242c;
  --brand-glow:  rgba(44,198,222,.28);

  --indigo:      #7f8cff;
  --indigo-ink:  #9aa5ff;
  --indigo-soft: #141a33;

  --amber:       #e0a54c;
  --amber-ink:   #efbb6d;
  --amber-soft:  #241a09;
  --ok:          #3bc08c;
  --ok-ink:      #63d3a7;
  --ok-soft:     #07261c;

  --header-bg:   rgba(8,13,21,.78);

  --shadow-xs: 0 1px 2px rgba(0,0,0,.5);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.5), 0 6px 16px -12px rgba(0,0,0,.8);
  --shadow-md: 0 1px 2px rgba(0,0,0,.5), 0 20px 44px -26px rgba(0,0,0,.85);
  --shadow-lg: 0 2px 4px rgba(0,0,0,.55), 0 52px 96px -40px rgba(0,0,0,.95);
  --ring:      0 0 0 3px rgba(44,198,222,.38);
}

/* --- Podstawa ------------------------------------------------------------- */
body {
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv05" 1, "cv11" 1;
  overflow-x: hidden;
}

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

:where(a, button, summary, input, select, textarea, [tabindex]):focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: var(--r-xs);
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 24px;
}
.container.is-wide { max-width: var(--maxw-wide); }
.container.is-narrow { max-width: 780px; }

.skip-link {
  position: fixed; left: -9999px; top: 10px; z-index: 200;
  background: var(--ink); color: var(--bg);
  padding: 11px 18px; border-radius: var(--r-sm); font-weight: 600;
}
.skip-link:focus { left: 14px; }

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

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Pasek postępu czytania */
.progress {
  position: fixed; inset: 0 auto auto 0; z-index: 60;
  height: 2px; width: 100%; transform: scaleX(0); transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--brand), var(--indigo));
  pointer-events: none;
}

/* --- Typografia ----------------------------------------------------------- */
h1, h2, h3, h4, h5 { color: var(--ink); font-weight: 600; line-height: 1.18; letter-spacing: -.01em; }

h1 {
  font-family: var(--serif);
  font-size: clamp(2.15rem, 1.5rem + 2.7vw, 3.65rem);
  line-height: 1.08;
  letter-spacing: -.022em;
  font-weight: 600;
}
h2 {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 1.22rem + 1.5vw, 2.3rem);
  line-height: 1.16;
  letter-spacing: -.018em;
}
h3 { font-size: clamp(1.13rem, 1.03rem + .3vw, 1.3rem); font-weight: 600; letter-spacing: -.012em; }
h4 { font-size: 1.02rem; font-weight: 600; letter-spacing: -.008em; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono);
  font-size: .715rem;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--brand-ink);
}
.eyebrow::before {
  content: ""; width: 22px; height: 1px; background: currentColor; opacity: .55; flex: none;
}
.eyebrow.is-plain::before { display: none; }

.lead {
  font-size: clamp(1.06rem, 1rem + .4vw, 1.24rem);
  line-height: 1.62;
  color: var(--text);
}
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.mono { font-family: var(--mono); font-variant-ligatures: none; }
.num { font-variant-numeric: tabular-nums; }

.q { font-family: var(--mono); font-size: .92em; color: var(--ink); font-weight: 500; }

/* --- Przyciski i odnośniki ------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 12px 20px;
  border-radius: var(--r-full);
  border: 1px solid transparent;
  font-size: .94rem; font-weight: 600; letter-spacing: -.005em;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .2s ease, background-color .2s ease, border-color .2s ease, color .2s ease;
  white-space: nowrap;
}
.btn svg { width: 17px; height: 17px; flex: none; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: linear-gradient(135deg, var(--brand) 0%, var(--indigo) 130%);
  color: #fff;
  box-shadow: 0 1px 1px rgba(255,255,255,.22) inset, 0 12px 26px -14px var(--brand-glow);
}
.btn-primary:hover { box-shadow: 0 1px 1px rgba(255,255,255,.28) inset, 0 18px 34px -14px var(--brand-glow); }

.btn-ghost {
  background: var(--card); color: var(--ink);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-xs);
}
.btn-ghost:hover { border-color: var(--ink); background: var(--card-soft); }

.btn-onDark {
  background: rgba(255,255,255,.08); color: #fff;
  border-color: rgba(255,255,255,.26);
  backdrop-filter: blur(6px);
}
.btn-onDark:hover { background: rgba(255,255,255,.15); border-color: rgba(255,255,255,.44); }

.btn-sm { padding: 9px 15px; font-size: .86rem; }
.btn-block { width: 100%; }

.link-arrow {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--brand-ink); font-weight: 600; font-size: .94rem;
}
.link-arrow svg { width: 16px; height: 16px; transition: transform .18s ease; }
.link-arrow:hover svg { transform: translateX(3px); }

.ic { width: 20px; height: 20px; }
.ic-sm { width: 16px; height: 16px; }

/* --- Nagłówek ------------------------------------------------------------- */
.header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, box-shadow .25s ease, background-color .25s ease;
}
.header.is-stuck { border-bottom-color: var(--line); box-shadow: var(--shadow-xs); }

.header-inner {
  min-height: var(--header-h);
  display: flex; align-items: center; gap: 18px;
}

.brand { display: inline-flex; align-items: center; gap: 11px; flex: none; }
.brand-mark { width: 36px; height: 36px; flex: none; border-radius: 10px; }
.brand-text { display: grid; line-height: 1.04; }
.brand-name {
  font-weight: 650; font-size: 1.07rem; letter-spacing: -.024em; color: var(--ink);
}
.brand-name b { font-weight: 650; color: var(--brand-ink); }
.brand-sub {
  font-family: var(--mono);
  font-size: .625rem; letter-spacing: .15em; text-transform: uppercase;
  color: var(--muted); font-weight: 500; margin-top: 3px;
}

.nav { margin-left: auto; }
.nav-list { display: flex; align-items: center; gap: 2px; }
.nav-list > li > a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: var(--r-sm);
  font-size: .905rem; font-weight: 500; color: var(--text);
  transition: color .16s ease, background-color .16s ease;
}
.nav-list > li > a:hover { color: var(--ink); background: var(--bg-soft); }
.nav-list > li > a[aria-current="page"] {
  color: var(--brand-ink); background: var(--brand-soft); font-weight: 600;
}

.header-tools { flex: none; display: flex; align-items: center; gap: 8px; }

.theme-toggle {
  width: 36px; height: 36px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-full);
  border: 1px solid var(--line);
  background: var(--card); color: var(--muted);
  cursor: pointer;
  transition: color .16s ease, border-color .16s ease, background-color .16s ease;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--line-strong); }
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .ic-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .ic-moon { display: block; }
:root[data-theme="dark"] .theme-toggle .ic-sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .ic-moon { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .ic-sun { display: none; }
}

.nav-toggle {
  display: none; width: 40px; height: 40px; flex: none;
  align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--card); cursor: pointer;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: ""; display: block; position: relative;
  width: 17px; height: 1.8px; border-radius: 2px; background: var(--ink);
  transition: transform .22s ease, background-color .22s ease;
}
.nav-toggle span::before { position: absolute; transform: translateY(-5.5px); }
.nav-toggle span::after  { position: absolute; transform: translateY(5.5px); }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after  { transform: rotate(-45deg); }

/* Nagłówek na ciemnym hero */
body.hero-dark .header:not(.is-stuck) {
  background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none;
}
body.hero-dark .header:not(.is-stuck) .brand-name { color: #fff; }
body.hero-dark .header:not(.is-stuck) .brand-name b { color: var(--deep-accent); }
body.hero-dark .header:not(.is-stuck) .brand-sub { color: rgba(255,255,255,.55); }
body.hero-dark .header:not(.is-stuck) .nav-list > li > a { color: rgba(255,255,255,.76); }
body.hero-dark .header:not(.is-stuck) .nav-list > li > a:hover { color: #fff; background: rgba(255,255,255,.09); }
body.hero-dark .header:not(.is-stuck) .nav-list > li > a[aria-current="page"] { color: #fff; background: rgba(255,255,255,.12); }
body.hero-dark .header:not(.is-stuck) .theme-toggle,
body.hero-dark .header:not(.is-stuck) .nav-toggle {
  background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.2); color: rgba(255,255,255,.8);
}
body.hero-dark .header:not(.is-stuck) .nav-toggle span,
body.hero-dark .header:not(.is-stuck) .nav-toggle span::before,
body.hero-dark .header:not(.is-stuck) .nav-toggle span::after { background: #fff; }
body.hero-dark .header:not(.is-stuck)[data-nav-open="true"] { background: var(--deep); }

/* --- Hero ----------------------------------------------------------------- */
.hero {
  position: relative;
  margin-top: calc(var(--header-h) * -1);
  padding: calc(var(--header-h) + 74px) 0 92px;
  background: var(--deep);
  color: var(--deep-text);
  overflow: hidden;
  isolation: isolate;
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background:
    radial-gradient(900px 520px at 18% -8%, rgba(14,159,184,.26), transparent 62%),
    radial-gradient(760px 520px at 88% 6%, rgba(61,90,241,.24), transparent 60%),
    radial-gradient(620px 420px at 62% 108%, rgba(14,159,184,.14), transparent 65%);
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .5;
  background-image:
    linear-gradient(to right, rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 68px 68px;
  -webkit-mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 78%);
  mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 78%);
}
.hero h1 { color: #fff; }
.hero h1 .accent {
  background: linear-gradient(100deg, var(--deep-accent), #b9c4ff 72%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .eyebrow { color: var(--deep-accent); }
.hero-grid {
  display: grid; grid-template-columns: minmax(0, 1.04fr) minmax(0, 1fr);
  gap: 56px; align-items: center;
}
.hero-copy h1 { margin: 18px 0 20px; }
.hero-lead { max-width: 54ch; color: var(--deep-text); font-size: clamp(1.06rem,1rem + .42vw,1.26rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-meta {
  display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 30px;
  padding-top: 24px; border-top: 1px solid var(--deep-line);
}
.hero-meta li {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .86rem; color: var(--deep-muted);
  font-family: var(--mono); letter-spacing: .01em;
}
.hero-meta svg { width: 15px; height: 15px; color: var(--deep-accent); flex: none; }
.hero-art { position: relative; }

/* Nagłówek podstrony */
.pagehead {
  position: relative;
  padding: clamp(34px, 3.4vw, 58px) 0 clamp(26px, 2.6vw, 40px);
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(760px 300px at 8% -30%, var(--brand-soft), transparent 68%),
    var(--bg);
}
.pagehead h1 { margin: 16px 0 18px; max-width: 20ch; }
.pagehead .lead { max-width: 64ch; }
.pagehead-grid { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 32px; align-items: end; }

.crumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 7px;
  font-size: .8rem; color: var(--muted); font-family: var(--mono); letter-spacing: .02em;
}
.crumbs li { display: inline-flex; align-items: center; gap: 7px; }
.crumbs li + li::before { content: "/"; color: var(--line-strong); }
.crumbs a:hover { color: var(--brand-ink); }
.crumbs [aria-current="page"] { color: var(--ink); }

.chapter-tag {
  display: inline-flex; align-items: baseline; gap: 10px;
  font-family: var(--mono); font-size: .72rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--muted);
}
.chapter-tag b { color: var(--brand-ink); font-weight: 500; }

.readmeta {
  display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 22px;
  font-family: var(--mono); font-size: .76rem; color: var(--muted); letter-spacing: .03em;
}
.readmeta li { display: inline-flex; align-items: center; gap: 7px; }
.readmeta svg { width: 14px; height: 14px; color: var(--brand); flex: none; }

/* --- Sekcje --------------------------------------------------------------- */
.section { padding: clamp(56px, 4vw + 30px, 104px) 0; }
.section-tight { padding: clamp(38px, 2.6vw + 22px, 70px) 0; }
.section-soft { background: var(--bg-soft); }
.section-line { border-top: 1px solid var(--line); }
.section-deep { background: var(--deep); color: var(--deep-text); }
.section-deep h2, .section-deep h3 { color: #fff; }
.section-deep .eyebrow { color: var(--deep-accent); }

.section-head { max-width: 740px; margin-bottom: clamp(28px, 3vw, 50px); }
.section-head.is-center { margin-inline: auto; text-align: center; }
.section-head.is-center .eyebrow::before { display: none; }
.section-head h2 { margin: 14px 0 14px; }

.rule { height: 1px; background: var(--line); border: 0; margin: 0; }

/* --- Pasek liczb ---------------------------------------------------------- */
.stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
}
.stat { background: var(--card); padding: 24px 22px; }
.stat dt {
  font-family: var(--mono); font-size: .7rem; letter-spacing: .13em;
  text-transform: uppercase; color: var(--muted);
}
.stat dd {
  margin-top: 10px; color: var(--ink);
  font-size: clamp(1.4rem, 1.15rem + .8vw, 1.85rem);
  font-weight: 600; letter-spacing: -.028em; line-height: 1.12;
  font-variant-numeric: tabular-nums;
}
.stat dd .unit { color: var(--brand); font-size: .62em; margin-left: 3px; font-weight: 500; }
.stat p { margin-top: 8px; font-size: .86rem; color: var(--muted); line-height: 1.5; }

.section-deep .stats { background: var(--deep-line); border-color: var(--deep-line); }
.section-deep .stat { background: var(--deep-2); }
.section-deep .stat dd { color: #fff; }
.section-deep .stat dt, .section-deep .stat p { color: var(--deep-muted); }

/* --- Siatka i karty -------------------------------------------------------- */
.grid { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-sidebar { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(28px, 4vw, 56px); align-items: center; }

.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 26px 24px;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.card h3 { margin-bottom: 9px; }
.card p { font-size: .96rem; }
.card > * + p { margin-top: 9px; }
.card-link { display: block; }
.card-link:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.card-foot { margin-top: 18px; }
.card-hi {
  background: linear-gradient(170deg, var(--brand-soft), var(--card) 62%);
  border-color: rgba(14,159,184,.28);
}
.card-soft { background: var(--card-soft); }

.icon-box {
  width: 44px; height: 44px; margin-bottom: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 13px;
  background: var(--brand-soft); color: var(--brand-ink);
  border: 1px solid rgba(14,159,184,.22);
}
.icon-box svg { width: 21px; height: 21px; }
.icon-box.is-indigo { background: var(--indigo-soft); color: var(--indigo-ink); border-color: rgba(61,90,241,.22); }
.icon-box.is-amber  { background: var(--amber-soft);  color: var(--amber-ink);  border-color: rgba(192,119,8,.22); }
.icon-box.is-ok     { background: var(--ok-soft);     color: var(--ok-ink);     border-color: rgba(18,133,95,.22); }

/* Karta rozdziału (spis treści na stronie głównej) */
.chapter {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 24px 24px 22px;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.chapter:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.chapter-no {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .14em;
  color: var(--brand-ink); font-weight: 500;
}
.chapter h3 { font-size: 1.12rem; letter-spacing: -.016em; }
.chapter p { font-size: .94rem; }
.chapter .link-arrow { margin-top: auto; padding-top: 14px; }

/* Lista z ptaszkiem */
.checks { display: grid; gap: 12px; }
.checks li { position: relative; padding-left: 32px; }
.checks li::before {
  content: ""; position: absolute; left: 0; top: .34em;
  width: 20px; height: 20px; border-radius: var(--r-full);
  background: var(--brand-soft); border: 1px solid rgba(14,159,184,.25);
}
.checks li::after {
  content: ""; position: absolute; left: 6.5px; top: .66em;
  width: 7px; height: 4px;
  border-left: 1.8px solid var(--brand-ink); border-bottom: 1.8px solid var(--brand-ink);
  transform: rotate(-45deg);
}
.checks.is-amber li::before { background: var(--amber-soft); border-color: rgba(192,119,8,.25); }
.checks.is-amber li::after  { border-color: var(--amber-ink); }

/* Lista punktowana w treści */
.bullets { display: grid; gap: 10px; }
.bullets li { position: relative; padding-left: 22px; }
.bullets li::before {
  content: ""; position: absolute; left: 3px; top: .72em;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--brand); opacity: .8;
}

/* Kroki */
.steps { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.steps-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.steps-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.step { background: var(--card); padding: 26px 24px; position: relative; }
.step-no {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: var(--r-full);
  background: var(--deep); color: #fff;
  font-family: var(--mono); font-size: .76rem; font-weight: 500;
  margin-bottom: 16px;
}
.step h3 { font-size: 1.04rem; margin-bottom: 8px; }
.step p { font-size: .94rem; }

/* Tabele */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--card);
  -webkit-overflow-scrolling: touch;
}
table.data { font-size: .94rem; min-width: 540px; }
table.data th, table.data td {
  padding: 14px 18px; text-align: left; vertical-align: top;
  border-bottom: 1px solid var(--line-soft);
}
table.data thead th {
  font-family: var(--mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); font-weight: 500; background: var(--card-soft);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.data tbody th { color: var(--ink); font-weight: 600; }
table.data tbody tr:last-child th, table.data tbody tr:last-child td { border-bottom: 0; }
table.data td.num, table.data th.num { font-variant-numeric: tabular-nums; }
table.data .yes { color: var(--ok); font-weight: 600; }
table.data .opt { color: var(--amber); font-weight: 600; }
table.data .no  { color: var(--muted); }
.table-note { margin-top: 12px; font-size: .86rem; color: var(--muted); }

/* Notki / ramki informacyjne */
.notice {
  display: flex; gap: 15px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: var(--r-md);
  background: var(--card-soft);
  font-size: .96rem;
}
.notice > svg { width: 20px; height: 20px; flex: none; margin-top: 3px; color: var(--brand-ink); }
.notice h4 { margin-bottom: 5px; }
.notice.is-amber { border-left-color: var(--amber); background: var(--amber-soft); }
.notice.is-amber > svg { color: var(--amber-ink); }
.notice.is-ok { border-left-color: var(--ok); background: var(--ok-soft); }
.notice.is-ok > svg { color: var(--ok-ink); }

/* Wyróżnienie kluczowej myśli */
.keypoint {
  margin: 34px 0;
  padding: 4px 0 4px 26px;
  border-left: 2px solid var(--brand);
  font-family: var(--serif);
  font-size: clamp(1.14rem, 1.04rem + .45vw, 1.42rem);
  line-height: 1.45;
  color: var(--ink);
  letter-spacing: -.012em;
}

/* Plakietki */
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: var(--r-full);
  font-family: var(--mono); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase;
  background: var(--bg-soft); color: var(--muted); border: 1px solid var(--line);
}
.tag.is-brand { background: var(--brand-soft); color: var(--brand-ink); border-color: rgba(14,159,184,.24); }
.tag.is-amber { background: var(--amber-soft); color: var(--amber-ink); border-color: rgba(192,119,8,.24); }
.tag.is-ok { background: var(--ok-soft); color: var(--ok-ink); border-color: rgba(18,133,95,.24); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }

/* Definicje wielkości */
.defs { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.defs-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.def { background: var(--card); padding: 24px 22px; }
.def-sym {
  font-family: var(--serif); font-style: italic;
  font-size: 1.9rem; line-height: 1; color: var(--ink); font-weight: 600;
}
.def-sym .u { font-family: var(--mono); font-style: normal; font-size: .46em; color: var(--brand); margin-left: 8px; letter-spacing: .02em; }
.def h3 { margin: 14px 0 7px; font-size: 1rem; }
.def p { font-size: .92rem; }

/* Akordeon */
.acc { display: grid; gap: 12px; }
.acc details {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.acc details[open] { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.acc summary {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 18px 22px;
  font-weight: 600; color: var(--ink); font-size: 1.02rem; line-height: 1.45;
  letter-spacing: -.012em;
}
.acc summary:hover { color: var(--brand-ink); }
.acc summary .chev {
  width: 20px; height: 20px; flex: none; color: var(--muted); margin-top: 2px;
  transition: transform .22s ease;
}
.acc details[open] summary .chev { transform: rotate(180deg); color: var(--brand-ink); }
.acc-body { padding: 0 22px 20px; font-size: .97rem; }
.acc-body > * + * { margin-top: 12px; }

/* Pasek wezwania */
.cta-band {
  position: relative; overflow: hidden;
  background: var(--deep);
  border-radius: var(--r-xl);
  padding: clamp(32px, 4vw, 52px);
  color: var(--deep-text);
}
.cta-band::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(620px 320px at 10% 0%, rgba(14,159,184,.28), transparent 62%),
    radial-gradient(520px 320px at 92% 110%, rgba(61,90,241,.26), transparent 60%);
}
.cta-band > * { position: relative; }
.cta-band h2 { color: #fff; }
.cta-band .eyebrow { color: var(--deep-accent); }

/* Nawigacja poprzedni / następny */
.pager {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px;
  margin-top: clamp(40px, 4vw, 64px);
  padding-top: clamp(28px, 3vw, 40px);
  border-top: 1px solid var(--line);
}
.pager a {
  display: grid; gap: 6px;
  padding: 18px 22px;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--card);
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.pager a:hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.pager .dir {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted);
  display: inline-flex; align-items: center; gap: 7px;
}
.pager .dir svg { width: 13px; height: 13px; }
.pager .ttl { color: var(--ink); font-weight: 600; letter-spacing: -.014em; line-height: 1.35; }
.pager .is-prev { text-align: left; }
.pager .is-next { text-align: right; }
.pager .is-next .dir { justify-content: flex-end; }
.pager a:only-child { grid-column: 1 / -1; }

/* --- Grafika SVG w treści --------------------------------------------------- */
.fig { margin: clamp(30px, 3.2vw, 44px) 0; }
.fig-art {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(16px, 2.4vw, 28px);
  overflow: hidden;
}
.fig-art svg { width: 100%; height: auto; display: block; }
.fig-zoom {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 8px 14px; margin-bottom: 10px;
  border: 1px solid var(--line-strong); border-radius: var(--r-xs);
  background: var(--card); color: var(--brand-ink);
  font-size: .875rem; font-weight: 600; cursor: pointer;
}
.fig-zoom:hover { background: var(--brand-soft); }
.fig.is-expanded .fig-art { overflow: auto; overscroll-behavior-x: contain; }
.fig.is-expanded .fig-art svg { width: max(100%, 1080px); max-width: none; }
.fig .fig-hint { margin: 0 0 10px; font-size: .875rem; color: var(--text); }
.fig-cap {
  margin-top: 13px; font-size: .86rem; color: var(--muted); line-height: 1.6;
  display: flex; gap: 10px; align-items: baseline;
}
.fig-num {
  font-family: var(--mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--brand-ink); flex: none; font-weight: 500;
}
.fig-plain .fig-art { background: transparent; border: 0; padding: 0; }

/* Klasy kolorów dla autorskich ilustracji — reagują na motyw */
.st-line   { stroke: var(--line-strong); }
.st-grid   { stroke: var(--line); }
.st-ink    { stroke: var(--ink); }
.st-muted  { stroke: var(--muted); }
.st-brand  { stroke: var(--brand); }
.st-indigo { stroke: var(--indigo); }
.st-amber  { stroke: var(--amber); }
.st-ok     { stroke: var(--ok); }
.st-white  { stroke: #fff; }

.fl-none   { fill: none; }
.fl-card   { fill: var(--card); }
.fl-soft   { fill: var(--card-soft); }
.fl-tint   { fill: var(--bg-tint); }
.fl-line   { fill: var(--line); }
.fl-ink    { fill: var(--ink); }
.fl-muted  { fill: var(--muted); }
.fl-brand  { fill: var(--brand); }
.fl-indigo { fill: var(--indigo); }
.fl-amber  { fill: var(--amber); }
.fl-ok     { fill: var(--ok); }
.fl-brand-soft  { fill: var(--brand-soft); }
.fl-amber-soft  { fill: var(--amber-soft); }
.fl-ok-soft     { fill: var(--ok-soft); }
.fl-indigo-soft { fill: var(--indigo-soft); }
.fl-deep   { fill: var(--deep); }
.fl-white  { fill: #fff; }

.tx {
  font-family: var(--mono); font-size: 11px; letter-spacing: .04em;
  fill: var(--muted);
}
.tx-ink { fill: var(--ink); }
.tx-brand { fill: var(--brand); }
.tx-indigo { fill: var(--indigo); }
.tx-amber { fill: var(--amber); }
.tx-ok { fill: var(--ok); }
.tx-lg { font-size: 14px; }
.tx-sm { font-size: 9.5px; }
.tx-b { font-weight: 500; }
.tx-serif { font-family: var(--serif); font-style: italic; font-size: 15px; letter-spacing: 0; }

/* Animacje ilustracji */
.flow { stroke-dasharray: 7 9; animation: flow 1.5s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -32; } }
.pulse { animation: pulse 2.6s ease-in-out infinite; transform-origin: center; }
@keyframes pulse { 0%,100% { opacity: .35; } 50% { opacity: 1; } }
.blink { animation: blink 2.2s ease-in-out infinite; }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: .25; } }
.sweep { animation: sweep 5.5s ease-in-out infinite; }
@keyframes sweep { 0%,100% { transform: translateX(0); } 50% { transform: translateX(10px); } }
.draw { stroke-dasharray: 1200; stroke-dashoffset: 1200; animation: draw 2.4s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.float-y { animation: float-y 6s ease-in-out infinite; }
@keyframes float-y { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }

/* --- Układ dokumentu (podstrony) -------------------------------------------- */
.doc {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: clamp(32px, 4vw, 60px);
  align-items: start;
  padding: clamp(40px, 4vw, 66px) 0 clamp(50px, 5vw, 84px);
}
@media (min-width: 1240px) {
  .doc { grid-template-columns: 250px minmax(0, 1fr) 208px; }
}

.doc-side { position: sticky; top: calc(var(--header-h) + 22px); }
.doc-nav-title {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .15em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 14px; padding-left: 14px;
}
.doc-nav ol { display: grid; gap: 1px; border-left: 1px solid var(--line); }
.doc-nav li a {
  display: grid; grid-template-columns: 26px minmax(0,1fr); gap: 8px;
  padding: 7px 12px 7px 13px; margin-left: -1px;
  border-left: 1px solid transparent;
  font-size: .875rem; line-height: 1.45; color: var(--muted);
  transition: color .16s ease, border-color .16s ease;
}
.doc-nav li a .n { font-family: var(--mono); font-size: .72rem; opacity: .7; }
.doc-nav li a:hover { color: var(--ink); }
.doc-nav li a[aria-current="page"] {
  color: var(--ink); font-weight: 600; border-left-color: var(--brand);
}
.doc-nav li a[aria-current="page"] .n { color: var(--brand-ink); opacity: 1; }
.doc-nav-foot { margin-top: 20px; padding-left: 14px; }

.doc-toc { position: sticky; top: calc(var(--header-h) + 22px); display: none; }
@media (min-width: 1240px) { .doc-toc { display: block; } }
.doc-toc-title {
  font-family: var(--mono); font-size: .66rem; letter-spacing: .15em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 12px;
}
.doc-toc ul { display: grid; gap: 2px; border-left: 1px solid var(--line); }
.doc-toc a {
  display: block; padding: 5px 0 5px 14px; margin-left: -1px;
  border-left: 1px solid transparent;
  font-size: .82rem; line-height: 1.45; color: var(--muted);
  transition: color .16s ease, border-color .16s ease;
}
.doc-toc a:hover { color: var(--ink); }
.doc-toc a.is-active { color: var(--brand-ink); border-left-color: var(--brand); font-weight: 500; }

/* --- Proza ----------------------------------------------------------------- */
.prose { max-width: 74ch; font-size: 1.062rem; }
.prose > * + * { margin-top: 20px; }
.prose h2 {
  margin-top: clamp(46px, 4.4vw, 68px);
  margin-bottom: 4px;
  scroll-margin-top: 100px;
  position: relative;
}
.prose h2::before {
  content: ""; display: block; width: 34px; height: 2px;
  background: linear-gradient(90deg, var(--brand), var(--indigo));
  margin-bottom: 20px; border-radius: 2px;
}
.prose h3 {
  margin-top: clamp(32px, 3vw, 44px); margin-bottom: 2px;
  scroll-margin-top: 100px;
  font-size: clamp(1.1rem, 1.02rem + .3vw, 1.24rem);
}
.prose h4 { margin-top: 26px; margin-bottom: 0; }
.prose p { margin-top: 16px; }
.prose > h2 + p, .prose > h3 + p, .prose > h4 + p { margin-top: 14px; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose em { font-style: italic; }
.prose a:not(.btn):not(.link-arrow) {
  color: var(--brand-ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: rgba(14,159,184,.4);
  transition: text-decoration-color .18s ease;
}
.prose a:not(.btn):not(.link-arrow):hover { text-decoration-color: var(--brand); }
.prose ul.bullets, .prose ul.checks, .prose ol.numbered { margin-top: 18px; }
.prose .fig, .prose .notice, .prose .table-wrap, .prose .keypoint,
.prose .defs, .prose .steps, .prose .acc, .prose .grid { margin-top: 28px; }
.prose .lead { margin-top: 0; }
.prose hr { margin: 44px 0; }

.numbered { display: grid; gap: 16px; counter-reset: step; }
.numbered > li { position: relative; padding-left: 44px; counter-increment: step; }
.numbered > li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute; left: 0; top: .1em;
  font-family: var(--mono); font-size: .76rem; font-weight: 500;
  color: var(--brand-ink);
  width: 30px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-soft); border: 1px solid rgba(14,159,184,.2);
  border-radius: var(--r-xs);
}
.numbered > li > strong:first-child { display: block; color: var(--ink); }

/* Słownik */
.glossary { display: grid; gap: 14px; }
.gloss {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 20px 22px;
  scroll-margin-top: 100px;
}
.gloss dt {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px;
  color: var(--ink); font-weight: 600; font-size: 1.04rem; letter-spacing: -.014em;
}
.gloss dt .unit {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .06em;
  color: var(--brand-ink); background: var(--brand-soft);
  border: 1px solid rgba(14,159,184,.22); border-radius: var(--r-full); padding: 2px 9px;
}
.gloss dd { margin-top: 8px; font-size: .96rem; }
.gloss dd + dd { margin-top: 10px; }

.alphabar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 28px; }
.alphabar a {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; padding: 5px 10px;
  border: 1px solid var(--line); border-radius: var(--r-xs);
  font-family: var(--mono); font-size: .78rem; color: var(--muted);
  background: var(--card);
  transition: color .16s ease, border-color .16s ease;
}
.alphabar a:hover { color: var(--brand-ink); border-color: var(--brand); }

/* --- Stopka ---------------------------------------------------------------- */
.footer {
  background: var(--deep);
  color: var(--deep-text);
  padding: clamp(50px, 5vw, 78px) 0 34px;
  margin-top: 0;
}
.footer-grid {
  display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 40px;
  padding-bottom: 42px;
}
.footer .brand-name { color: #fff; }
.footer .brand-name b { color: var(--deep-accent); }
.footer .brand-sub { color: rgba(255,255,255,.45); }
.footer-about { margin-top: 18px; font-size: .93rem; color: var(--deep-muted); max-width: 40ch; }
.footer h4 {
  color: #fff; font-family: var(--mono); font-size: .68rem;
  letter-spacing: .15em; text-transform: uppercase; font-weight: 500;
  margin-bottom: 16px;
}
.footer ul { display: grid; gap: 10px; }
.footer ul a, .footer ul li { font-size: .92rem; color: var(--deep-muted); }
.footer ul a:hover { color: #fff; }
.footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  padding-top: 26px; border-top: 1px solid var(--deep-line);
  font-size: .84rem; color: var(--deep-muted);
}

/* Przycisk „do góry” */
.to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 40;
  width: 44px; height: 44px; border-radius: var(--r-full);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--card); color: var(--ink);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity .22s ease, transform .22s ease, visibility .22s ease;
}
.to-top.is-on { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { color: var(--brand-ink); border-color: var(--brand); }

/* --- Pojawianie się treści --------------------------------------------------- */
.js .reveal { opacity: 0; transform: translateY(14px); }
.js .reveal.is-in {
  opacity: 1; transform: none;
  transition: opacity .6s cubic-bezier(.22,.61,.36,1), transform .6s cubic-bezier(.22,.61,.36,1);
}

/* --- Responsywność ---------------------------------------------------------- */
@media (max-width: 1239px) {
  .doc { grid-template-columns: 230px minmax(0, 1fr); }
}

@media (max-width: 1023px) {
  :root { --gap: 20px; }
  .doc { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .doc-article { order: 1; }
  .doc-side {
    order: 2; position: static;
    margin-top: clamp(38px, 5vw, 56px); padding-top: clamp(28px, 3vw, 38px);
    border-top: 1px solid var(--line);
  }
  .doc-nav-title { font-size: .72rem; padding-left: 0; margin-bottom: 18px; }
  .doc-nav ol { grid-template-columns: repeat(2, minmax(0, 1fr)); border-left: 0; gap: 4px; }
  .doc-nav li a { border-left: 1px solid var(--line); border-radius: 0 var(--r-xs) var(--r-xs) 0; }
  .doc-nav-foot { padding-left: 0; }
  .prose { max-width: none; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 44px; }
  .hero-art { max-width: 560px; }
  .grid-sidebar { grid-template-columns: minmax(0, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 34px; }
}

@media (max-width: 959px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--card);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    padding: 10px 24px 20px;
    display: none;
  }
  .nav.is-open { display: block; }
  body.hero-dark .header:not(.is-stuck) .nav {
    background: var(--deep); border-bottom-color: var(--deep-line);
  }
  .nav-list { flex-direction: column; align-items: stretch; gap: 2px; }
  .nav-list > li > a { padding: 11px 14px; font-size: 1rem; }
  .header-inner { position: relative; }
  .header-tools { margin-left: auto; }
  .nav { margin-left: 0; }
  .grid-3, .grid-4, .steps-4, .steps-3, .defs-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pagehead-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 639px) {
  html { scroll-padding-top: 86px; }
  body { font-size: 16.5px; }
  .container { padding-inline: 18px; }
  .grid-2, .grid-3, .grid-4, .steps-4, .steps-3, .defs-3, .stats,
  .footer-grid, .pager { grid-template-columns: minmax(0, 1fr); }
  .doc-nav ol { grid-template-columns: minmax(0, 1fr); }
  .hero { padding-top: calc(var(--header-h) + 46px); padding-bottom: 64px; }
  .card { padding: 22px 20px; }
  .cta-band { padding: 28px 22px; border-radius: var(--r-lg); }
  .pager .is-next { text-align: left; }
  .pager .is-next .dir { justify-content: flex-start; }
  .keypoint { padding-left: 18px; margin: 28px 0; }
  .to-top { right: 14px; bottom: 14px; }
  .fig-art { padding: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
}

/* --- Druk ------------------------------------------------------------------- */
@media print {
  .fig-zoom, .fig-hint { display: none !important; }
  .fig.is-expanded .fig-art { overflow: visible; }
  .fig.is-expanded .fig-art svg { width: 100%; max-width: 100%; }
  .header, .footer, .to-top, .progress, .doc-side, .doc-toc,
  .nav-toggle, .theme-toggle, .pager, .cta-band, .skip-link { display: none !important; }
  body { font-size: 11pt; color: #000; background: #fff; }
  .doc { grid-template-columns: 1fr; padding: 0; }
  .prose { max-width: none; }
  .card, .fig-art, .table-wrap, .notice { border: 1px solid #ccc; box-shadow: none; }
  .acc details { border: 1px solid #ccc; }
  .acc details > .acc-body { display: block !important; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; color: #555; }
  h1, h2, h3 { break-after: avoid; }
  .fig, .table-wrap, .notice { break-inside: avoid; }
}
