/* ==========================================================================
   kudu.pl — arkusz stylów
   Kolejność: reset → tokeny → podstawa → typografia → nagłówek → hero →
   komponenty (liczby, proza, zdjęcia, anatomia, mapa, oś czasu, skala,
   tabela, galeria, FAQ, źródła, CTA) → stopka → ruch → responsywność → druk.
   Kolory wyłącznie przez tokeny; motyw ciemny = prefers-color-scheme
   albo atrybut data-theme na <html> (ręczny przełącznik).
   ========================================================================== */

/* --- Reset ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body { margin: 0; }
img, svg, video, picture { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, 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%; }
button { background: none; border: 0; padding: 0; cursor: pointer; }

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

  --bg:            #f5f0e7;   /* kość słoniowa — papier */
  --bg-soft:       #ece5d8;
  --bg-tint:       #e2d9c8;
  --card:          #fbf8f2;
  --deep:          #15110d;   /* płyta ciemna (hero, stopka) — stała w obu motywach */
  --deep-2:        #201a15;

  --ink:           #1b1611;
  --text:          #4a4137;
  --muted:         #6b6052;
  --line:          #dbd1c0;
  --line-strong:   #bfb09a;

  --brand:         #a8642a;   /* ochra — kolor sierści w słońcu */
  --brand-ink:     #8a4f1d;
  --brand-soft:    #f0e2cf;
  --gold:          #b8863a;   /* mosiądz — detale */
  --gold-soft:     #f1e6cd;
  --sage:          #4e5c40;   /* szałwia — busz, drugi akcent (kudu małe) */
  --sage-soft:     #e2e6d6;

  --on-deep:       #efe7da;   /* tekst na płycie ciemnej */
  --on-deep-muted: rgba(239, 231, 218, .72);
  --on-deep-line:  rgba(239, 231, 218, .14);
  --gold-on-deep:  #d9b26a;
  --sage-on-deep:  #a8b791;

  --shadow-sm: 0 1px 2px rgba(27, 22, 17, .05), 0 8px 20px -12px rgba(27, 22, 17, .18);
  --shadow-md: 0 2px 4px rgba(27, 22, 17, .05), 0 24px 48px -24px rgba(27, 22, 17, .32);
  --shadow-lg: 0 2px 6px rgba(27, 22, 17, .06), 0 60px 100px -40px rgba(27, 22, 17, .45);

  --r-xs: 3px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 18px;
  --r-full: 999px;

  --header-h: 78px;
  --maxw: 1260px;
  --narrow: 780px;
  --gap: 32px;
  --gutter: clamp(18px, 3vw, 44px);

  --font-display: "Cormorant Garamond", "Times New Roman", Georgia, serif;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;

  --ease: cubic-bezier(.2, .65, .25, 1);
}

/* Motyw ciemny — automatyczny (bez ręcznego wyboru) i ręczny (data-theme). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg:            #100e0b;
    --bg-soft:       #171310;
    --bg-tint:       #221c16;
    --card:          #1a1612;
    --deep:          #0a0806;
    --deep-2:        #15110d;
    --ink:           #f2ebdf;
    --text:          #c9bfaf;
    --muted:         #a1927e;
    --line:          #2d2721;
    --line-strong:   #443c32;
    --brand:         #d9a45e;
    --brand-ink:     #e5b978;
    --brand-soft:    #2b2013;
    --gold:          #d9b26a;
    --gold-soft:     #2c2415;
    --sage:          #a8b791;
    --sage-soft:     #1e2319;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5), 0 8px 20px -12px rgba(0, 0, 0, .7);
    --shadow-md: 0 2px 4px rgba(0, 0, 0, .5), 0 24px 48px -24px rgba(0, 0, 0, .85);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, .55), 0 60px 100px -40px rgba(0, 0, 0, .9);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg:            #100e0b;
  --bg-soft:       #171310;
  --bg-tint:       #221c16;
  --card:          #1a1612;
  --deep:          #0a0806;
  --deep-2:        #15110d;
  --ink:           #f2ebdf;
  --text:          #c9bfaf;
  --muted:         #a1927e;
  --line:          #2d2721;
  --line-strong:   #443c32;
  --brand:         #d9a45e;
  --brand-ink:     #e5b978;
  --brand-soft:    #2b2013;
  --gold:          #d9b26a;
  --gold-soft:     #2c2415;
  --sage:          #a8b791;
  --sage-soft:     #1e2319;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5), 0 8px 20px -12px rgba(0, 0, 0, .7);
  --shadow-md: 0 2px 4px rgba(0, 0, 0, .5), 0 24px 48px -24px rgba(0, 0, 0, .85);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, .55), 0 60px 100px -40px rgba(0, 0, 0, .9);
}

/* Płyta ciemna: te same komponenty, przemapowane tokeny. */
.on-deep {
  --bg: var(--deep);
  --bg-soft: var(--deep-2);
  --bg-tint: #2a231c;
  --card: var(--deep-2);
  --ink: var(--on-deep);
  --text: var(--on-deep-muted);
  --muted: rgba(239, 231, 218, .62);
  --line: var(--on-deep-line);
  --line-strong: rgba(239, 231, 218, .3);
  --brand-ink: var(--gold-on-deep);
  --brand: #d9a45e;
  --brand-soft: rgba(217, 164, 94, .16);
  --sage: var(--sage-on-deep);
  --sage-soft: rgba(168, 183, 145, .16);
  background: var(--deep);
  color: var(--text);
}

/* --- Podstawa ------------------------------------------------------------- */
body {
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

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

:where(a, button, summary, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.container-narrow { max-width: calc(var(--narrow) + 2 * var(--gutter)); }
.container-wide { max-width: 1520px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--ink); color: var(--bg); padding: 12px 18px;
  font-weight: 600; font-size: .9rem;
}
.skip-link:focus { left: 0; }

.sr-only {
  position: absolute; 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;
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 20px; height: 20px; flex: none; }
.ic-sm { width: 16px; height: 16px; flex: none; }

/* --- Typografia ----------------------------------------------------------- */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--ink);
  line-height: 1.02;
  letter-spacing: -.012em;
  text-wrap: balance;
}
h1 { font-size: clamp(3rem, 1.6rem + 5.4vw, 7rem); }
h2 { font-size: clamp(2.3rem, 1.5rem + 2.8vw, 4rem); }
h3 { font-size: clamp(1.5rem, 1.25rem + .8vw, 2rem); font-weight: 600; line-height: 1.12; }
h4 {
  font-family: var(--font); font-size: .78rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: var(--ink);
}
h1 em, h2 em, h3 em, .lead em { font-style: italic; font-weight: 400; color: var(--brand-ink); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: .74rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase;
  color: var(--brand-ink);
}
.eyebrow .roman {
  font-family: var(--font-display); font-size: 1.15rem; font-weight: 600;
  letter-spacing: .02em; text-transform: none; color: var(--ink); line-height: 1;
}
.eyebrow .roman::after {
  content: ""; display: inline-block; width: 22px; height: 1px;
  background: var(--brand); margin: 0 0 .28em 12px; vertical-align: middle;
}

.lead {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 1.1rem + .8vw, 1.75rem);
  line-height: 1.38; color: var(--ink); font-weight: 500;
  text-wrap: pretty;
}
.lead-sans {
  font-family: var(--font); font-size: clamp(1.05rem, 1rem + .3vw, 1.2rem);
  font-weight: 400; color: var(--text); line-height: 1.6;
}
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.sci { font-style: italic; }
.nowrap { white-space: nowrap; }

/* --- Przyciski ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  padding: 15px 28px;
  border: 1px solid var(--ink); border-radius: var(--r-full);
  font-size: .76rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink); background: transparent; line-height: 1.2;
  white-space: nowrap;
  transition: background-color .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
}
.btn svg { width: 15px; height: 15px; flex: none; transition: transform .25s var(--ease); }
.btn:hover { background: var(--ink); color: var(--bg); }
.btn:hover svg { transform: translateX(3px); }
.btn-fill { background: var(--ink); color: var(--bg); }
.btn-fill:hover { background: var(--brand-ink); border-color: var(--brand-ink); color: #fff; }
.btn-light { border-color: rgba(255, 255, 255, .6); color: #fff; }
.btn-light:hover { background: #fff; border-color: #fff; color: var(--deep); }
.btn-light.btn-fill { background: #fff; color: var(--deep); border-color: #fff; }
.btn-light.btn-fill:hover { background: var(--gold-on-deep); border-color: var(--gold-on-deep); color: var(--deep); }
.btn-sm { padding: 11px 20px; font-size: .7rem; }

.link-arrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink); padding-bottom: 4px;
  border-bottom: 1px solid var(--line-strong);
  transition: border-color .2s, color .2s;
}
.link-arrow svg { width: 15px; height: 15px; transition: transform .25s var(--ease); }
.link-arrow:hover { color: var(--brand-ink); border-color: var(--brand); }
.link-arrow:hover svg { transform: translateX(3px); }

/* --- Pasek postępu i nagłówek --------------------------------------------- */
.progress {
  position: fixed; top: 0; left: 0; z-index: 70;
  width: 100%; height: 2px; background: var(--brand);
  transform: scaleX(var(--p, 0)); transform-origin: left center;
  pointer-events: none;
}

.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  color: var(--ink);
  transition: color .35s var(--ease);
}
.header::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--line);
  transition: opacity .35s var(--ease);
}
@supports not (backdrop-filter: blur(1px)) { .header::before { background: var(--bg); } }
/* Nad hero (tylko z JS, który mierzy przewinięcie) nagłówek jest przezroczysty i jasny. */
.js .header.is-top { color: var(--on-deep); }
.js .header.is-top::before { opacity: 0; }

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

.brand {
  display: inline-flex; align-items: baseline; gap: 7px; flex: none;
  font-family: var(--font-display); font-size: 1.75rem; font-weight: 600; letter-spacing: -.01em;
  color: inherit; line-height: 1;
}
.brand .tld {
  font-family: var(--font); font-size: .66rem; font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase; opacity: .75;
}

.nav { margin-left: auto; }
.nav-list { display: flex; align-items: center; gap: 2px; }
.nav-list a {
  display: block; padding: 8px 12px; border-radius: var(--r-full);
  font-size: .84rem; font-weight: 500; letter-spacing: .03em; color: inherit; opacity: .85;
  transition: opacity .2s, background-color .2s;
}
.nav-list a:hover { opacity: 1; background: color-mix(in srgb, currentColor 9%, transparent); }
.nav-list a[aria-current] {
  opacity: 1; text-decoration: underline; text-decoration-color: var(--brand);
  text-decoration-thickness: 1px; text-underline-offset: 7px;
}
.js .header.is-top .nav-list a[aria-current] { text-decoration-color: var(--gold-on-deep); }

.header-tools { display: flex; align-items: center; gap: 8px; flex: none; }
.icon-btn {
  width: 42px; height: 42px; border-radius: var(--r-full);
  border: 1px solid color-mix(in srgb, currentColor 30%, transparent);
  display: grid; place-items: center; color: inherit; background: transparent;
  transition: background-color .2s, border-color .2s;
}
.icon-btn:hover { background: color-mix(in srgb, currentColor 9%, transparent); border-color: currentColor; }
.icon-btn svg { width: 18px; height: 18px; }
.theme-toggle { display: none; }
.js .theme-toggle { display: grid; }
.theme-toggle .ic-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .ic-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .ic-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .ic-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .ic-moon { display: none; }
}

.nav-toggle { display: none; position: relative; z-index: 2; }
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: ""; display: block; width: 18px; height: 1.5px; border-radius: 2px;
  background: currentColor; transition: transform .25s var(--ease), opacity .2s;
}
.nav-toggle span { position: relative; }
.nav-toggle span::before { position: absolute; transform: translateY(-6px); }
.nav-toggle span::after  { position: absolute; transform: translateY(6px); }
.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); }

/* --- Boczna listwa rozdziałów (szerokie ekrany) --------------------------- */
/* Listwa jest przyklejona i przepływa nad tłami o skrajnie różnej jasności:
   jasny papier sekcji, ciemne płyty hero, pasy ze zdjęciem i stopka. Jeden
   zestaw barw nie może działać wszędzie — ciemny numer z jasną poświatą na
   fotografii rozmywa się w plamę. Dlatego barwy siedzą w tokenach, a skrypt
   przestawia je klasą `is-on-dark`, gdy środek listwy wypada na ciemnej płycie.
   Bez JS listwa i tak się nie pokazuje, więc wariant jasny jest bezpieczny. */
.rail {
  position: fixed; right: 26px; top: 50%; transform: translateY(-50%);
  z-index: 40; display: none;

  --rail-ink:    color-mix(in srgb, var(--ink) 62%, transparent);
  --rail-active: var(--ink);
  --rail-line:   var(--brand);
  --rail-halo:   var(--bg);
}
/* Klasę dostaje pojedynczy odnośnik, nie cała listwa: przy granicy sekcji
   listwa potrafi leżeć w poprzek dwóch teł naraz (np. koniec jasnej sekcji
   i początek stopki), więc górne numery bywają na jasnym, a dolne na ciemnym. */
.rail a.is-on-dark {
  --rail-ink:    rgba(239, 231, 218, .82);
  --rail-active: #fff;
  --rail-line:   var(--gold-on-deep);
  --rail-halo:   rgba(10, 8, 6, .92);
}
.rail ol { display: grid; gap: 2px; }
.rail a {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding: 4px 0; font-family: var(--font-display); font-size: 1.02rem; font-weight: 600;
  color: var(--rail-ink);
  /* Filtr obejmuje też kreskę (pseudoelement), czego text-shadow by nie zrobił.
     Dwa ciasne cienie zamiast jednego rozległego — poświata ma odcinać glif od
     tła, a nie tworzyć wokół niego mgłę. */
  filter: drop-shadow(0 0 2px var(--rail-halo)) drop-shadow(0 0 5px var(--rail-halo));
  transition: color .25s var(--ease), filter .25s var(--ease);
}
.rail a::after {
  content: ""; width: 16px; height: 1px; background: currentColor;
  transition: width .25s var(--ease), background-color .2s;
}
.rail a:hover, .rail a[aria-current] { color: var(--rail-active); }
.rail a[aria-current]::after { width: 34px; background: var(--rail-line); }

/* --- Sekcje i głowy rozdziałów ------------------------------------------- */
.section { padding-block: clamp(72px, 7vw, 140px); position: relative; }
.section-tight { padding-block: clamp(44px, 4.5vw, 84px); }
.section-line { border-top: 1px solid var(--line); }
.section-soft { background: var(--bg-soft); }

.chapter-head {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(20px, 3vw, 48px); align-items: end;
  margin-bottom: clamp(44px, 5vw, 80px);
}
.chapter-head h2 { margin-top: 18px; }
.chapter-head .lead { padding-bottom: .4em; }
.chapter-head.is-narrow { grid-template-columns: 1fr; max-width: var(--narrow); }
.chapter-head .watermark {
  position: absolute; right: -.05em; top: -.35em; z-index: 0;
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(7rem, 16vw, 15rem); line-height: 1; color: var(--bg-tint);
  user-select: none; pointer-events: none;
}
.section-soft .chapter-head .watermark { color: color-mix(in srgb, var(--bg-tint) 55%, var(--bg-soft)); }
.chapter-head > *:not(.watermark) { position: relative; z-index: 1; }

/* --- Hero pełnoekranowy --------------------------------------------------- */
.hero {
  position: relative; isolation: isolate;
  min-height: 100svh; display: flex; align-items: flex-end;
  color: var(--on-deep); background: var(--deep);
  overflow: hidden;
}
.hero-media { position: absolute; inset: 0; z-index: -2; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: 44% 48%; }
.hero-shade {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(10, 8, 6, .55) 0%, rgba(10, 8, 6, .05) 26%, rgba(10, 8, 6, .1) 44%, rgba(10, 8, 6, .86) 100%),
    linear-gradient(90deg, rgba(10, 8, 6, .5) 0%, rgba(10, 8, 6, 0) 58%);
}
.hero-body { position: relative; width: 100%; padding: calc(var(--header-h) + 48px) 0 clamp(52px, 6vw, 92px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--gap); align-items: end; }
.hero .eyebrow { color: var(--gold-on-deep); }
.hero .eyebrow .roman { color: #fff; }
.hero .eyebrow .roman::after { background: var(--gold-on-deep); }
.hero h1 {
  margin-top: 22px; color: #fff;
  font-size: clamp(4.2rem, 2.2rem + 9vw, 10.5rem); line-height: .92; letter-spacing: -.02em;
}
.hero h1 em { color: var(--gold-on-deep); }
.hero-sci {
  font-family: var(--font); font-size: .74rem; font-weight: 500; font-style: italic;
  letter-spacing: .2em; text-transform: uppercase; color: rgba(255, 255, 255, .62); margin-top: 18px;
}
.hero-lead {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(1.3rem, 1.1rem + .9vw, 1.9rem); line-height: 1.32;
  color: rgba(255, 255, 255, .92); max-width: 32ch; text-wrap: pretty;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-meta {
  display: flex; flex-wrap: wrap; gap: 8px 34px; margin-top: 30px;
  font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: rgba(255, 255, 255, .68);
}
.hero-meta b { color: #fff; font-weight: 600; }
.hero-caption {
  position: absolute; right: var(--gutter); bottom: 18px;
  font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: rgba(255, 255, 255, .55);
}
.scroll-hint {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%);
  width: 1px; height: 54px; background: rgba(255, 255, 255, .3); overflow: hidden;
}
.scroll-hint::after {
  content: ""; position: absolute; left: 0; top: -100%; width: 100%; height: 100%;
  background: #fff; animation: hint 2.4s var(--ease) infinite;
}
@keyframes hint { 0% { top: -100%; } 60% { top: 100%; } 100% { top: 100%; } }

/* Głowa podstrony */
.pagehead { position: relative; padding: calc(var(--header-h) + clamp(40px, 6vw, 96px)) 0 clamp(36px, 4vw, 64px); }
.pagehead h1 { margin-top: 18px; font-size: clamp(3rem, 1.6rem + 5vw, 6.4rem); }
.pagehead .lead { margin-top: 26px; max-width: 36ch; }
.crumbs { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: .78rem; letter-spacing: .06em; color: var(--muted); }
.crumbs a:hover { color: var(--brand-ink); }
.crumbs .sep { opacity: .5; }

/* --- Pasek liczb ---------------------------------------------------------- */
.stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong);
}
.stats.is-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stat { padding: 30px 26px 28px; border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; padding-left: 0; }
.stat dt { font-size: .72rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.stat dd {
  font-family: var(--font-display); font-weight: 500; font-variant-numeric: lining-nums;
  font-size: clamp(2.4rem, 1.6rem + 2.6vw, 3.9rem); line-height: 1; color: var(--ink); margin-top: 12px;
  letter-spacing: -.02em;
}
.stat dd small {
  font-family: var(--font); font-size: .74rem; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--brand-ink); margin-left: 8px; vertical-align: .55em;
}
.stat .stat-note { font-size: .82rem; color: var(--muted); margin-top: 10px; line-height: 1.45; }

/* --- Proza ---------------------------------------------------------------- */
.prose { max-width: 64ch; font-size: 1.06rem; text-wrap: pretty; }
.prose > * + * { margin-top: 1.2em; }
.prose h3 { margin-top: 2.2em; }
.prose h3 + * { margin-top: .7em; }
.prose h4 { margin-top: 2em; }
.prose a { color: var(--brand-ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose a:hover { color: var(--ink); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose ul > li, .prose ol > li { position: relative; padding-left: 26px; }
.prose ul > li + li, .prose ol > li + li { margin-top: .55em; }
.prose ul > li::before { content: ""; position: absolute; left: 0; top: .85em; width: 12px; height: 1px; background: var(--brand); }
.prose ol { counter-reset: li; }
.prose ol > li::before {
  counter-increment: li; content: counter(li); position: absolute; left: 0; top: .05em;
  font-family: var(--font-display); font-weight: 600; font-size: 1.05em; color: var(--brand-ink);
}
.prose sup { font-size: .68em; line-height: 0; }
.prose sup a { text-decoration: none; color: var(--brand-ink); font-weight: 600; }
.prose .note { font-size: .92rem; color: var(--muted); border-left: 1px solid var(--line-strong); padding-left: 16px; }
.has-dropcap > p:first-of-type::first-letter {
  font-family: var(--font-display); font-weight: 500; font-size: 4.9em; line-height: .78;
  float: left; margin: .06em .14em 0 0; color: var(--brand-ink);
}

.pull {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(1.7rem, 1.25rem + 1.8vw, 2.9rem); line-height: 1.16; letter-spacing: -.01em;
  color: var(--ink); text-wrap: balance;
  border-left: 1px solid var(--brand); padding-left: clamp(20px, 3vw, 36px);
}
.pull em { color: var(--brand-ink); }
.pull footer {
  font-family: var(--font); font-size: .74rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); margin-top: 18px; font-weight: 600;
}
/* Cytat leżący wprost na zdjęciu. Ciemny brąz wyróżnienia ginął na jasnych
   partiach fotografii, więc na zdjęciu używamy mosiądzu. */
.pull.is-on-photo { color: #fff; border-color: rgba(217, 178, 106, .8); }
.pull.is-on-photo em { color: var(--gold-on-deep); }
.pull.is-on-photo footer { color: rgba(255, 255, 255, .72); }
.pull.is-on-photo footer sup { font-size: .72em; }
.pull.is-on-photo footer a { color: inherit; }

/* Układy dwukolumnowe */
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 88px); align-items: start; }
.split.is-even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.split.is-wide-text { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.split.is-rev > :first-child { order: 2; }
.sticky { position: sticky; top: calc(var(--header-h) + 28px); }

/* Karta gatunku */
.spec { border-top: 1px solid var(--ink); padding-top: 22px; }
.spec .spec-title { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; color: var(--ink); margin-bottom: 14px; }
.spec dl { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr); gap: 0 22px; }
.spec dt {
  font-size: .7rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); padding: 12px 0; border-bottom: 1px solid var(--line);
}
.spec dd { color: var(--ink); font-weight: 500; font-size: .95rem; padding: 11px 0; border-bottom: 1px solid var(--line); }
.spec dt:last-of-type, .spec dd:last-of-type { border-bottom: 0; }
.status {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: var(--r-full);
  font-size: .72rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  background: var(--sage-soft); color: var(--sage); border: 1px solid color-mix(in srgb, var(--sage) 32%, transparent);
}
.status.is-nt { background: var(--gold-soft); color: var(--brand-ink); border-color: color-mix(in srgb, var(--brand) 34%, transparent); }
.status .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* --- Zdjęcia -------------------------------------------------------------- */
.photo { position: relative; overflow: hidden; border-radius: var(--r-md); background: var(--bg-tint); }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(20, 14, 8, .1), inset 0 -90px 120px -70px rgba(20, 14, 8, .4);
}
.photo.is-4x3 { aspect-ratio: 4 / 3; }
.photo.is-3x2 { aspect-ratio: 3 / 2; }
.photo.is-3x4 { aspect-ratio: 3 / 4; }
.photo.is-1x1 { aspect-ratio: 1; }
.photo.is-21x9 { aspect-ratio: 21 / 9; }
.photo.is-5x4 { aspect-ratio: 5 / 4; }
figure > figcaption, .caption {
  display: flex; justify-content: space-between; gap: 18px; align-items: baseline;
  margin-top: 12px; font-size: .82rem; color: var(--muted); line-height: 1.5;
}
figcaption .cap-num { font-family: var(--font-display); font-size: 1rem; font-weight: 600; color: var(--brand-ink); flex: none; }
/* Podpis wypełnia miejsce po numerze — bez tego przy szerokim zdjęciu
   między numerem a tekstem zostawała pusta rynna. */
figcaption .cap-text { flex: 1 1 auto; }
figcaption i { font-style: italic; }
figcaption .cap-meta { flex: none; font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; }

/* Pas zdjęcia na pełną szerokość */
.band { position: relative; isolation: isolate; color: var(--on-deep); background: var(--deep); overflow: hidden; }
.band .band-media { position: absolute; inset: 0; z-index: -2; }
.band .band-media img { width: 100%; height: 100%; object-fit: cover; }
/* Dwa gradienty: poziomy pod tekst i pionowy, który wyrównuje jasne partie
   nieba w górnej części kadru. Na samym poziomym napis gubił się na jasnym tle. */
.band .band-shade {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgba(10, 8, 6, .88) 0%, rgba(10, 8, 6, .62) 48%, rgba(10, 8, 6, .3) 100%),
    linear-gradient(180deg, rgba(10, 8, 6, .35) 0%, rgba(10, 8, 6, 0) 45%);
}
.band .band-body { padding: clamp(80px, 12vw, 200px) 0; }
.band h2 { color: #fff; }
.band .lead { color: rgba(255, 255, 255, .9); }
.band .eyebrow { color: var(--gold-on-deep); }
.band .eyebrow .roman { color: #fff; }
.band .eyebrow .roman::after { background: var(--gold-on-deep); }

/* --- Anatomia z punktami ------------------------------------------------- */
.anatomy { position: relative; }
.hotspots { position: absolute; inset: 0; margin: 0; z-index: 2; }
.hotspot { position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%); }
.hotspot-btn {
  position: relative;
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .8);
  background: rgba(20, 14, 8, .6); color: #fff;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; line-height: 1;
  display: grid; place-items: center;
  transition: background-color .2s, transform .2s var(--ease);
}
.hotspot-btn::before {
  content: ""; position: absolute; inset: -1px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .7); animation: hs 3.2s ease-out infinite;
}
.hotspot:nth-child(2) .hotspot-btn::before { animation-delay: .5s; }
.hotspot:nth-child(3) .hotspot-btn::before { animation-delay: 1s; }
.hotspot:nth-child(4) .hotspot-btn::before { animation-delay: 1.5s; }
.hotspot:nth-child(5) .hotspot-btn::before { animation-delay: 2s; }
.hotspot:nth-child(6) .hotspot-btn::before { animation-delay: 2.5s; }
@keyframes hs {
  0% { transform: scale(1); opacity: .7; }
  70% { transform: scale(1.9); opacity: 0; }
  100% { transform: scale(1.9); opacity: 0; }
}
.hotspot:hover .hotspot-btn,
.hotspot:focus-within .hotspot-btn,
.hotspot.is-active .hotspot-btn { background: var(--brand); border-color: #fff; transform: scale(1.08); }
.hotspot-label {
  position: absolute; left: 50%; top: calc(100% + 10px); transform: translate(-50%, 4px);
  min-width: 170px; max-width: 240px; padding: 10px 14px; border-radius: var(--r-sm);
  background: var(--card); color: var(--ink); font-size: .82rem; line-height: 1.45; font-weight: 500;
  box-shadow: var(--shadow-md); border: 1px solid var(--line);
  opacity: 0; visibility: hidden; transition: opacity .2s, transform .25s var(--ease), visibility .2s;
  z-index: 3;
}
.hotspot-label b { display: block; font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; margin-bottom: 2px; }
.hotspot.is-up .hotspot-label { top: auto; bottom: calc(100% + 10px); transform: translate(-50%, -4px); }
.hotspot:hover .hotspot-label,
.hotspot:focus-within .hotspot-label,
.hotspot.is-active .hotspot-label { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

.anatomy-list { counter-reset: an; display: grid; gap: 0; }
.anatomy-list li { position: relative; padding: 18px 0 18px 54px; border-top: 1px solid var(--line); }
.anatomy-list li:last-child { border-bottom: 1px solid var(--line); }
.anatomy-list li::before {
  counter-increment: an; content: counter(an);
  position: absolute; left: 0; top: 18px; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line-strong); color: var(--ink);
  font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; display: grid; place-items: center;
  transition: background-color .2s, border-color .2s, color .2s;
}
.anatomy-list li.is-active::before { background: var(--brand); border-color: var(--brand); color: #fff; }
.anatomy-list b {
  display: block; font-family: var(--font-display); font-size: 1.3rem; font-weight: 600;
  color: var(--ink); line-height: 1.15; margin-bottom: 4px;
}
.anatomy-list p { font-size: .95rem; }

/* --- Rysunek rogu (SVG z nie-wgrywac/narzedzia/rog.js) -------------------- */
/* Bryła rogu jest pocięta na sześć warstw głębokości (rog-d0 = najdalsza)
   i trzy pasma w poprzek (r-a krawędź w cieniu, r-b grzbiet, r-c krawędź
   bliższa). Kolor liczy color-mix z dwóch tokenów, więc rysunek sam
   przestawia się na motyw ciemny. */
.horn-figure { position: relative; --rog-jasny: #d8b071; --rog-ciemny: #221607; }
.horn-figure svg { width: 100%; height: auto; }

.horn-figure .rog-d0 .r-a { fill: color-mix(in srgb, var(--rog-jasny) 21%, var(--rog-ciemny)); }
.horn-figure .rog-d0 .r-b { fill: color-mix(in srgb, var(--rog-jasny) 45%, var(--rog-ciemny)); }
.horn-figure .rog-d0 .r-c { fill: color-mix(in srgb, var(--rog-jasny) 31%, var(--rog-ciemny)); }
.horn-figure .rog-d1 .r-a { fill: color-mix(in srgb, var(--rog-jasny) 26%, var(--rog-ciemny)); }
.horn-figure .rog-d1 .r-b { fill: color-mix(in srgb, var(--rog-jasny) 56%, var(--rog-ciemny)); }
.horn-figure .rog-d1 .r-c { fill: color-mix(in srgb, var(--rog-jasny) 38%, var(--rog-ciemny)); }
.horn-figure .rog-d2 .r-a { fill: color-mix(in srgb, var(--rog-jasny) 31%, var(--rog-ciemny)); }
.horn-figure .rog-d2 .r-b { fill: color-mix(in srgb, var(--rog-jasny) 67%, var(--rog-ciemny)); }
.horn-figure .rog-d2 .r-c { fill: color-mix(in srgb, var(--rog-jasny) 46%, var(--rog-ciemny)); }
.horn-figure .rog-d3 .r-a { fill: color-mix(in srgb, var(--rog-jasny) 36%, var(--rog-ciemny)); }
.horn-figure .rog-d3 .r-b { fill: color-mix(in srgb, var(--rog-jasny) 78%, var(--rog-ciemny)); }
.horn-figure .rog-d3 .r-c { fill: color-mix(in srgb, var(--rog-jasny) 53%, var(--rog-ciemny)); }
.horn-figure .rog-d4 .r-a { fill: color-mix(in srgb, var(--rog-jasny) 41%, var(--rog-ciemny)); }
.horn-figure .rog-d4 .r-b { fill: color-mix(in srgb, var(--rog-jasny) 89%, var(--rog-ciemny)); }
.horn-figure .rog-d4 .r-c { fill: color-mix(in srgb, var(--rog-jasny) 60%, var(--rog-ciemny)); }
.horn-figure .rog-d5 .r-a { fill: color-mix(in srgb, var(--rog-jasny) 46%, var(--rog-ciemny)); }
.horn-figure .rog-d5 .r-b { fill: var(--rog-jasny); }
.horn-figure .rog-d5 .r-c { fill: color-mix(in srgb, var(--rog-jasny) 68%, var(--rog-ciemny)); }

.horn-figure .rog-gran { stroke: color-mix(in srgb, var(--rog-jasny) 85%, #fff); stroke-width: 1.2; opacity: .5; }

/* Opis przy rysunku: oś pomiaru, wyniesienia i podpisy. */
.horn-figure .rog-os { stroke: var(--line-strong); stroke-dasharray: 3 5; fill: none; }
.horn-figure .rog-mark { stroke: var(--brand); stroke-width: 1; fill: none; }
.horn-figure .rog-txt {
  font-family: var(--font); font-size: 11px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; fill: var(--muted);
}
.horn-figure .rog-num { font-family: var(--font-display); font-size: 30px; font-weight: 600; fill: var(--ink); }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .horn-figure { --rog-jasny: #e8c68c; --rog-ciemny: #17100a; }
}
:root[data-theme="dark"] .horn-figure { --rog-jasny: #e8c68c; --rog-ciemny: #17100a; }

/* --- Mapa ----------------------------------------------------------------- */
.map { position: relative; }
.map svg { width: 100%; height: auto; overflow: visible; }
.map .c { fill: var(--bg-tint); stroke: var(--bg); stroke-width: .7; stroke-linejoin: round; transition: fill .2s; }
.section-soft .map .c { stroke: var(--bg-soft); }
.map .c.is-w { fill: var(--brand); }
.map .c.is-m { fill: var(--sage); }
.map .c.is-wm { fill: url(#hatch); }
.map .c.is-x { fill: var(--line-strong); }
.map .hatch-a { fill: var(--brand); }
.map .hatch-b { fill: var(--sage); }
.map .m-label { font-family: var(--font-display); font-size: 15px; font-weight: 600; fill: var(--ink); }
.map .m-ocean {
  font-family: var(--font); font-size: 10px; letter-spacing: .18em;
  text-transform: uppercase; fill: var(--muted);
}
.legend { display: flex; flex-wrap: wrap; gap: 12px 26px; font-size: .82rem; color: var(--text); margin-top: 18px; }
.legend li { display: inline-flex; align-items: center; gap: 10px; }
.legend .sw { width: 18px; height: 18px; border-radius: 4px; flex: none; }
.legend .sw.is-w { background: var(--brand); }
.legend .sw.is-m { background: var(--sage); }
.legend .sw.is-wm { background: repeating-linear-gradient(135deg, var(--brand) 0 4px, var(--sage) 4px 8px); }
.legend .sw.is-x { background: var(--line-strong); }
.map-note { font-size: .8rem; color: var(--muted); margin-top: 10px; }
.country-list { columns: 3; column-gap: 28px; font-size: .9rem; }
.country-list li {
  break-inside: avoid; padding: 6px 0; border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 10px;
}
.country-list li span:last-child { color: var(--muted); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; }

/* --- Oś czasu (cykl życia) ----------------------------------------------- */
.timeline { position: relative; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 24px; }
.timeline::before { content: ""; position: absolute; left: 0; right: 0; top: 7px; height: 1px; background: var(--line-strong); }
.timeline li { position: relative; padding-top: 32px; }
.timeline li::before {
  content: ""; position: absolute; left: 0; top: 1px; width: 13px; height: 13px; border-radius: 50%;
  background: var(--bg); border: 1px solid var(--brand); box-shadow: 0 0 0 5px var(--bg);
}
.section-soft .timeline li::before { background: var(--bg-soft); box-shadow: 0 0 0 5px var(--bg-soft); }
.timeline li:first-child::before, .timeline li.is-key::before { background: var(--brand); }
.timeline .tl-when {
  font-family: var(--font-display); font-size: clamp(1.5rem, 1.2rem + .9vw, 2.1rem);
  font-weight: 500; color: var(--ink); line-height: 1; letter-spacing: -.01em;
}
.timeline .tl-what { font-size: .72rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--brand-ink); margin-top: 10px; }
.timeline .tl-desc { font-size: .9rem; margin-top: 8px; line-height: 1.55; }

/* --- Skala wielkości ------------------------------------------------------ */
.scale { --max: 200; --h: 320px; position: relative; padding-left: 52px; }
.scale-grid {
  position: relative; height: var(--h); border-bottom: 1px solid var(--ink);
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; align-items: end; padding: 0 12px;
}
.scale-grid::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(
    to top,
    transparent 0 calc(var(--h) * 50 / var(--max) - 1px),
    var(--line) calc(var(--h) * 50 / var(--max) - 1px) calc(var(--h) * 50 / var(--max))
  );
}
.scale-tick { position: absolute; left: -52px; transform: translateY(50%); font-size: .68rem; letter-spacing: .1em; color: var(--muted); font-variant-numeric: tabular-nums; }
.scale-bar { position: relative; display: grid; justify-items: center; align-items: end; height: calc(var(--h) * var(--cm) / var(--max)); }
.scale-bar .bar { width: min(100%, 92px); height: 100%; border-radius: 6px 6px 0 0; background: var(--bg-tint); border: 1px solid var(--line-strong); border-bottom: 0; }
.scale-bar.is-w .bar { background: linear-gradient(180deg, var(--brand), var(--brand-ink)); border-color: var(--brand-ink); }
.scale-bar.is-m .bar { background: linear-gradient(180deg, var(--sage), color-mix(in srgb, var(--sage) 70%, #000)); border-color: var(--sage); }
.scale-bar .val {
  position: absolute; bottom: calc(100% + 8px);
  font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; color: var(--ink);
  line-height: 1; white-space: nowrap;
}
.scale-bar .val small {
  font-family: var(--font); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); margin-left: 4px; font-weight: 600;
}
.scale-labels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; padding: 14px 12px 0; }
.scale-labels li { font-size: .8rem; text-align: center; color: var(--text); line-height: 1.4; }
.scale-labels b { display: block; font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; color: var(--ink); }

/* --- Tabela porównawcza --------------------------------------------------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.compare { min-width: 640px; font-size: .95rem; }
table.compare th, table.compare td { padding: 15px 18px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
table.compare thead th {
  font-family: var(--font-display); font-size: 1.45rem; font-weight: 600; color: var(--ink);
  border-bottom: 1px solid var(--ink); padding-bottom: 12px; line-height: 1.1;
}
table.compare thead th small {
  display: block; font-family: var(--font); font-size: .7rem; font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-top: 6px; font-style: italic;
}
table.compare tbody th {
  font-family: var(--font); font-size: .72rem; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted); width: 22%; padding-top: 18px;
}
table.compare tbody td { color: var(--ink); }
table.compare tbody tr:hover td { background: color-mix(in srgb, var(--brand) 5%, transparent); }
table.compare .col-w { border-left: 2px solid var(--brand); }
table.compare .col-m { border-left: 2px solid var(--sage); }
.table-note { font-size: .82rem; color: var(--muted); margin-top: 12px; }

/* --- Siatka treści (kafle bez ikon) -------------------------------------- */
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line); }
.facts > li { padding: 30px 28px 32px 0; border-bottom: 1px solid var(--line); }
.facts > li:nth-child(3n+2) { padding-inline: 28px; border-inline: 1px solid var(--line); }
.facts > li:nth-child(3n) { padding-inline: 28px 0; }
.facts .f-num { font-family: var(--font-display); font-size: 1rem; font-weight: 600; color: var(--brand-ink); letter-spacing: .04em; }
.facts h3 { margin-top: 10px; font-size: 1.45rem; }
.facts p { margin-top: 10px; font-size: .95rem; }

/* --- Galeria -------------------------------------------------------------- */
.gallery { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(12px, 2vw, 26px); }
.gallery figure { grid-column: span 4; margin: 0; }
.gallery .g-6 { grid-column: span 6; }
.gallery .g-8 { grid-column: span 8; }
.gallery .g-12 { grid-column: span 12; }
.gallery a { display: block; border-radius: var(--r-md); }
.gallery .photo img { transition: transform 1.1s var(--ease); }
.gallery a:hover .photo img { transform: scale(1.035); }
.gallery figcaption { margin-top: 10px; }

/* Lightbox */
.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; color: #fff; }
.lightbox::backdrop { background: rgba(8, 6, 4, .95); }
.lightbox[open] { display: grid; place-items: center; }
.lb-frame { display: grid; gap: 14px; justify-items: center; padding: 64px 24px 32px; width: 100%; }
.lb-frame img {
  max-width: min(96vw, 1500px); max-height: 78vh; width: auto; height: auto; object-fit: contain;
  border-radius: var(--r-sm); box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .8);
}
.lb-cap { font-family: var(--font-display); font-size: 1.15rem; color: rgba(255, 255, 255, .88); text-align: center; max-width: 70ch; }
.lb-cap small {
  display: block; font-family: var(--font); font-size: .7rem; letter-spacing: .14em;
  text-transform: uppercase; color: rgba(255, 255, 255, .55); margin-top: 6px;
}
.lb-close { position: fixed; top: 18px; right: 18px; }
.lb-prev, .lb-next { position: fixed; top: 50%; transform: translateY(-50%); }
.lb-prev { left: 16px; }
.lb-next { right: 16px; }
.lightbox .icon-btn { color: #fff; border-color: rgba(255, 255, 255, .4); width: 48px; height: 48px; }
.lightbox .icon-btn:hover { background: rgba(255, 255, 255, .14); border-color: #fff; }
.lb-count { position: fixed; top: 30px; left: 24px; font-size: .74rem; letter-spacing: .16em; color: rgba(255, 255, 255, .65); }

/* --- FAQ ------------------------------------------------------------------ */
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: baseline; gap: 22px; padding: 24px 0;
  font-family: var(--font-display); font-size: clamp(1.3rem, 1.1rem + .7vw, 1.7rem);
  font-weight: 500; color: var(--ink); line-height: 1.2;
  transition: color .2s;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--brand-ink); }
.faq summary .q-num { font-size: .92rem; font-weight: 600; color: var(--brand-ink); flex: none; width: 2ch; font-family: var(--font-display); }
/* Treść pytania musi być jednym elementem elastycznym — inaczej kursywa
   z nazwą gatunku staje się osobnym elementem i pytanie się rozjeżdża. */
.faq summary .q-text { flex: 1 1 auto; }
.faq summary .plus { margin-left: auto; flex: none; position: relative; width: 22px; height: 22px; align-self: center; }
.faq summary .plus::before, .faq summary .plus::after { content: ""; position: absolute; background: currentColor; transition: transform .3s var(--ease); }
.faq summary .plus::before { left: 0; top: 10px; width: 22px; height: 1px; }
.faq summary .plus::after { left: 10px; top: 0; width: 1px; height: 22px; }
.faq details[open] summary .plus::after { transform: rotate(90deg); }
.faq .faq-body { padding: 0 0 28px calc(2ch + 22px); max-width: 68ch; color: var(--text); }
.faq .faq-body > * + * { margin-top: .8em; }

/* --- Źródła --------------------------------------------------------------- */
.sources { counter-reset: src; display: grid; gap: 12px; font-size: .9rem; line-height: 1.55; }
.sources li { position: relative; padding-left: 44px; }
.sources li::before {
  counter-increment: src; content: "[" counter(src) "]"; position: absolute; left: 0; top: 0;
  font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; color: var(--brand-ink);
}
.sources a {
  color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px;
  text-underline-offset: 3px; text-decoration-color: var(--line-strong); word-break: break-word;
}
.sources a:hover { color: var(--brand-ink); text-decoration-color: var(--brand); }
.sources .src-meta { color: var(--muted); }

/* --- Pas CTA / karta ciemna ----------------------------------------------- */
.cta-band { position: relative; overflow: hidden; border-radius: var(--r-lg); padding: clamp(36px, 5vw, 72px); box-shadow: var(--shadow-lg); }
.cta-band .grid-2 { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: var(--gap); align-items: center; }
.cta-band h2 { color: var(--on-deep); }
.cta-band .actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; }
.cta-band::after {
  content: ""; position: absolute; right: -120px; top: -140px; width: 420px; height: 420px; border-radius: 50%;
  border: 1px solid rgba(239, 231, 218, .12);
  box-shadow: 0 0 0 60px rgba(239, 231, 218, .035), 0 0 0 130px rgba(239, 231, 218, .02);
  pointer-events: none;
}

/* --- Stopka --------------------------------------------------------------- */
.footer { padding: clamp(60px, 7vw, 110px) 0 32px; font-size: .92rem; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 40px; }
.footer .brand { color: var(--on-deep); }
.footer-about { max-width: 36ch; margin-top: 18px; color: var(--on-deep-muted); }
.footer h4 { color: var(--on-deep); margin-bottom: 16px; }
.footer ul { display: grid; gap: 10px; }
.footer a { transition: color .2s; }
.footer a:hover { color: var(--gold-on-deep); }
.footer-bottom {
  margin-top: 56px; padding-top: 22px; border-top: 1px solid var(--on-deep-line);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px;
  font-size: .78rem; color: rgba(239, 231, 218, .6); letter-spacing: .02em;
}

.to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 40;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--card); color: var(--ink); border: 1px solid var(--line);
  box-shadow: var(--shadow-md); display: grid; place-items: center;
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity .25s, transform .25s var(--ease), visibility .25s;
}
.to-top.is-on { opacity: 1; visibility: visible; transform: none; }
.to-top svg { width: 18px; height: 18px; }

/* --- Ruch ----------------------------------------------------------------- */
/* Ukrywamy wyłącznie, gdy działa JS — bez skryptu cała treść jest widoczna. */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }
.js .reveal-img { clip-path: inset(0 0 100% 0); transition: clip-path 1.2s cubic-bezier(.7, 0, .2, 1); }
.js .reveal-img.is-in { clip-path: inset(0 0 0 0); }
.js .reveal-img img { transform: scale(1.08); transition: transform 1.6s var(--ease); }
.js .reveal-img.is-in img { transform: none; }

@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, .js .reveal-img { opacity: 1; transform: none; clip-path: none; }
  .js .reveal-img img { transform: none; }
  .scroll-hint, .hotspot-btn::before { display: none; }
}

/* --- Responsywność -------------------------------------------------------- */
@media (min-width: 1440px) {
  .js .rail { display: block; }
  /* Listwa zajmuje ok. 80 px przy prawej krawędzi (numer + kreska + odstęp).
     Szeroki kontener galerii musi zostawić na nią miejsce — symetrycznie,
     żeby galeria nie zjechała ze środka. Poniżej 1440 px listwy nie ma,
     więc kontener może być pełnej szerokości. */
  .js .container-wide { max-width: min(1520px, calc(100vw - 260px)); }
}

@media (max-width: 1080px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts > li { padding: 26px 24px 28px 0 !important; border-inline: 0 !important; }
  .facts > li:nth-child(2n) { padding-left: 24px !important; border-left: 1px solid var(--line) !important; }
  .country-list { columns: 2; }
}

@media (max-width: 960px) {
  :root { --header-h: 68px; }
  /* Warianty .split muszą być wymienione z nazwy: zapytanie medialne nie
     podnosi swoistości, więc samo `.split` przegrywa z `.split.is-wide-text`
     i układ zostawał dwukolumnowy na telefonie. */
  .hero-grid, .chapter-head,
  .split, .split.is-even, .split.is-wide-text, .split.is-rev { grid-template-columns: 1fr; }
  .split.is-rev > :first-child { order: 0; }
  .sticky { position: static; }
  .chapter-head .lead { padding-bottom: 0; }
  .stats, .stats.is-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 22px 18px; }
  .stat:nth-child(2n+1) { border-left: 0; padding-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .timeline { grid-template-columns: 1fr; gap: 0; padding-left: 30px; }
  .timeline::before { top: 0; bottom: 0; left: 6px; right: auto; width: 1px; height: auto; }
  .timeline li { padding: 0 0 30px; }
  .timeline li::before { left: -30px; top: 6px; }
  .gallery figure, .gallery .g-6, .gallery .g-8 { grid-column: span 6; }
  .gallery .g-12 { grid-column: span 12; }
  .cta-band .grid-2 { grid-template-columns: 1fr; }
  .cta-band .actions { justify-content: flex-start; }

  .nav-toggle { display: grid; }
  .nav {
    position: fixed; inset: 0; z-index: 1; display: none;
    background: var(--bg); color: var(--ink);
    padding: calc(var(--header-h) + 20px) var(--gutter) 40px;
    overflow-y: auto;
  }
  .nav.is-open { display: block; }
  .nav-list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-list a {
    padding: 16px 0; border-radius: 0; border-bottom: 1px solid var(--line); opacity: 1;
    font-family: var(--font-display); font-size: 2rem; font-weight: 500; letter-spacing: -.01em;
  }
  .nav-list a:hover { background: transparent; color: var(--brand-ink); }
  .nav-list a[aria-current] { text-decoration: none; color: var(--brand-ink); }
  .js .header.is-open { color: var(--ink); }
  .js .header.is-open::before { opacity: 1; }
}

@media (max-width: 720px) {
  body { font-size: 16px; }
  .prose { font-size: 1.02rem; }
  .facts { grid-template-columns: 1fr; }
  .facts > li { padding: 22px 0 !important; border-left: 0 !important; }
  .gallery figure, .gallery .g-6, .gallery .g-8 { grid-column: span 12; }
  .scale { --h: 260px; }
  .scale-grid { gap: 14px; }
  .scale-labels { gap: 14px; }
  .country-list { columns: 1; }
  .hero-media img { object-position: 38% 50%; }
  .hero-caption { display: none; }
  .hero-actions .btn { width: 100%; }
  .hotspot-label { min-width: 150px; max-width: 200px; font-size: .78rem; }
  .cta-band { padding: 30px 22px; border-radius: var(--r-md); }
  /* Dymki przy punktach anatomii nie mieszczą się obok zdjęcia na telefonie
     i wychodziłyby poza ekran. Ta sama treść stoi w numerowanej liście pod
     zdjęciem, a kliknięcie punktu podświetla w niej właściwą pozycję. */
  .hotspot-label { display: none; }
  .footer-grid { grid-template-columns: 1fr; gap: 30px; }
  .to-top { right: 14px; bottom: 14px; }
  .rail { display: none !important; }
}

@media (max-width: 520px) {
  .stats, .stats.is-5 { grid-template-columns: 1fr 1fr; }
  .stat dd { font-size: 2rem; }
  .spec dl { grid-template-columns: 1fr; gap: 0; }
  .spec dt { border-bottom: 0; padding-bottom: 2px; }
  .spec dd { padding-top: 0; }
  .lb-frame { padding: 64px 12px 24px; }
  .lb-prev { left: 8px; }
  .lb-next { right: 8px; }
}

/* --- Druk ----------------------------------------------------------------- */
@media print {
  :root,
  :root[data-theme="dark"] {
    --bg: #fff; --bg-soft: #fff; --bg-tint: #eee; --card: #fff;
    --deep: #fff; --deep-2: #fff;
    --ink: #000; --text: #222; --muted: #555;
    --line: #ccc; --line-strong: #999;
    --brand-ink: #000; --brand: #666; --gold: #999; --sage: #666;
    --on-deep: #000; --on-deep-muted: #333; --on-deep-line: #ccc;
    --gold-on-deep: #000; --sage-on-deep: #333;
  }
  .header, .footer, .to-top, .rail, .progress, .scroll-hint,
  .hotspots, .theme-toggle, .nav-toggle, .cta-band, .lightbox { display: none !important; }
  body { font-size: 11pt; color: #000; background: #fff; }
  .hero { min-height: auto; color: #000; background: #fff; }
  .hero h1, .hero-lead, .hero-meta, .hero-meta b, .hero-sci { color: #000; }
  .hero-media, .hero-shade, .band-media, .band-shade { display: none; }
  .band, .band h2, .band .lead { color: #000; background: #fff; }
  .section { padding: 14pt 0; }
  .js .reveal, .js .reveal-img { opacity: 1 !important; transform: none !important; clip-path: none !important; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 8.5pt; color: #555; }
  .photo, .table-wrap { break-inside: avoid; }
  .faq details { break-inside: avoid; }
}
