/* Gemmae – atlas rosiczek pigmejskich. Bez bibliotek zewnętrznych. */
:root {
    --bg: #0b100d;
    --bg-2: #111913;
    --bg-3: #18231b;
    --ink: #f1ead9;
    --ink-2: #c9d1c0;
    --line: #2d3b31;
    --accent: #ffb59a;
    --accent-2: #ffd9c7;
    --moss: #a8d58f;
    --hot: #ff9b6a;
    --cold: #8ec5e6;
    --focus: #ffd166;
    --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
    --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --gutter: clamp(1.25rem, 5vw, 4rem);
    --max: 78rem;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 1.0625rem/1.7 var(--serif); text-rendering: optimizeLegibility; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: .2em; text-decoration-thickness: .08em; }
a:hover { color: var(--accent-2); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3, h4 { font-weight: 400; line-height: 1.08; margin: 0 0 .5em; letter-spacing: -.01em; }
p { margin: 0 0 1.1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 100; background: var(--accent); color: var(--bg); padding: .8rem 1.2rem; font: 600 1rem var(--sans); text-decoration: none; border-radius: 0 0 .5rem .5rem; }
.skip-link:focus { top: 0; }
[lang="la"], .species-name { font-style: italic; }

.eyebrow { font: 600 .8rem/1 var(--sans); letter-spacing: .22em; text-transform: uppercase; color: var(--moss); margin: 0 0 1.1rem; }
.eyebrow a { color: inherit; }
.lead { font-size: clamp(1.15rem, 2vw, 1.45rem); line-height: 1.55; color: var(--ink-2); max-width: 44rem; }
.btn, .link-button { font: 600 1rem/1 var(--sans); }
.btn { display: inline-flex; align-items: center; min-height: 3rem; padding: .85rem 1.5rem; background: var(--accent); color: var(--bg); text-decoration: none; border: 2px solid var(--accent); border-radius: 999px; cursor: pointer; transition: background .2s, color .2s; }
.btn:hover { background: var(--accent-2); border-color: var(--accent-2); color: var(--bg); }
.btn--ghost { background: transparent; color: var(--accent); }
.btn--ghost:hover { background: var(--accent); color: var(--bg); }
.link-button { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; text-underline-offset: .2em; }

/* Nagłówek */
.site-header { position: sticky; top: 0; z-index: 50; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 2rem; padding: .85rem var(--gutter); background: rgba(11, 16, 13, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--ink); text-decoration: none; font: 600 1.25rem/1 var(--serif); }
.brand__mark { width: .9rem; height: .9rem; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: radial-gradient(circle at 35% 35%, #fff 0 12%, var(--accent) 40%, #d9735a); }
.brand__dot { color: var(--accent); }
.site-nav ul { display: flex; flex-wrap: wrap; gap: .25rem 1.4rem; }
.site-nav a { display: inline-block; padding: .55rem 0; font: 500 .95rem/1.2 var(--sans); color: var(--ink); text-decoration: none; border-bottom: 2px solid transparent; }
.site-nav a:hover, .site-nav a[aria-current] { border-bottom-color: var(--accent); color: var(--accent-2); }

/* Zgoda na cookies */
.consent { background: var(--bg-3); border-bottom: 2px solid var(--accent); }
.consent[hidden] { display: none; }
.consent__inner { max-width: var(--max); margin: 0 auto; padding: 1.25rem var(--gutter); display: grid; gap: 1rem 2rem; align-items: center; }
@media (min-width: 800px) { .consent__inner { grid-template-columns: 1fr auto; } }
.consent__title { font: 600 1.1rem/1.2 var(--sans); margin: 0 0 .4rem; }
.consent p { margin: 0; font: 400 .95rem/1.5 var(--sans); color: var(--ink-2); }
.consent__actions { display: flex; flex-wrap: wrap; gap: .75rem; }

/* Hero */
.hero { position: relative; min-height: min(100svh, 62rem); display: grid; align-items: end; overflow: hidden; isolation: isolate; }
.hero__media { position: absolute; inset: 0; z-index: -2; }
.hero__img { width: 100%; height: 100%; object-fit: cover; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(11,16,13,.93) 0%, rgba(11,16,13,.72) 38%, rgba(11,16,13,.12) 100%), linear-gradient(0deg, var(--bg) 0%, rgba(11,16,13,0) 35%); }
@media (max-width: 760px) { .hero::before { background: linear-gradient(0deg, rgba(11,16,13,.96) 0%, rgba(11,16,13,.78) 55%, rgba(11,16,13,.45) 100%); } }
.hero__text { padding: 6rem var(--gutter) 5rem; max-width: 62rem; }
.hero h1 { font-size: clamp(3.4rem, 12vw, 10rem); line-height: .86; margin-bottom: .3em; }
.hero h1 em { color: var(--accent); }
.hero__links { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; }
.hero__scroll { position: absolute; right: var(--gutter); bottom: 1.5rem; margin: 0; writing-mode: vertical-rl; font: 500 .75rem var(--sans); letter-spacing: .3em; text-transform: uppercase; color: var(--ink-2); }
@media (max-width: 760px) { .hero__scroll { display: none; } }

/* Rozdziały tekstowe */
.chapter { display: grid; gap: 2.5rem 5rem; max-width: var(--max); margin: 0 auto; padding: clamp(4rem, 10vw, 9rem) var(--gutter); align-items: center; }
@media (min-width: 900px) { .chapter { grid-template-columns: 1.15fr .85fr; } .chapter--flip { grid-template-columns: .85fr 1.15fr; } .chapter--flip .chapter__text { order: 2; } }
.chapter h2, .atlas__head h2, .climate__head h2 { font-size: clamp(2.2rem, 5vw, 4rem); }
.chapter__figure img { border-radius: .25rem; box-shadow: 0 2rem 4rem rgba(0,0,0,.5); }
.prose { max-width: 42rem; }
.prose--large { font-size: 1.2rem; }
.prose p:last-child { margin-bottom: 0; }
.prose ul, .prose ol { margin: 0 0 1.1em 1.2em; list-style: revert; }
.prose h2 { font-size: 1.7rem; margin-top: 1.6em; }
.prose code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9em; }

/* Atlas */
.atlas { padding: clamp(3rem, 8vw, 7rem) 0 2rem; background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 8%, var(--bg-2) 100%); }
.atlas__head { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.atlas__index { max-width: var(--max); margin: 2.5rem auto 4rem; padding: 0 var(--gutter); }
.atlas__index ol { display: flex; flex-wrap: wrap; gap: .4rem .6rem; }
.atlas__index a { display: inline-flex; gap: .5rem; align-items: baseline; padding: .5rem .85rem; min-height: 2.75rem; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); text-decoration: none; font: 500 .9rem/1.2 var(--sans); }
.atlas__index a:hover { border-color: var(--accent); color: var(--accent-2); }
.idx { color: var(--moss); font-variant-numeric: tabular-nums; font-size: .75rem; }

.plate { max-width: 96rem; margin: 0 auto; padding: clamp(3rem, 7vw, 6rem) var(--gutter); border-top: 1px solid var(--line); }
.plate__head { position: relative; margin-bottom: 2.5rem; padding-top: 1rem; }
.plate__no { position: absolute; right: 0; top: -.6em; font: 400 clamp(5rem, 16vw, 13rem)/1 var(--serif); color: transparent; -webkit-text-stroke: 1px var(--line); user-select: none; pointer-events: none; }
.plate__head h3 { position: relative; font-size: clamp(2rem, 5.5vw, 4.4rem); margin-bottom: .2em; }
.plate__meta { position: relative; font: 500 .9rem var(--sans); color: var(--ink-2); letter-spacing: .04em; }
.variant { display: grid; gap: 1.75rem 3rem; margin-bottom: clamp(3rem, 6vw, 5rem); }
@media (min-width: 1000px) { .variant { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; } .variant__text { position: sticky; top: 6rem; } }
.variant__text h4 { font: 600 .8rem/1.2 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--moss); margin-bottom: 1rem; }
.variant .prose { font-size: 1.02rem; }
.variant__map { margin: 1.5rem 0 0; max-width: 14rem; }
.variant__map figcaption { font: 500 .8rem var(--sans); color: var(--ink-2); margin-top: .4rem; }

.mosaic { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); grid-auto-flow: dense; gap: .5rem; }
.mosaic__item { aspect-ratio: 1; overflow: hidden; background: var(--bg-3); border-radius: .2rem; }
.mosaic__item--lead { grid-column: span 2; grid-row: span 2; }
@media (min-width: 900px) { .mosaic { grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); } }
.shot { position: relative; display: block; width: 100%; height: 100%; color: var(--ink); }
.shot img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.2,.7,.2,1), filter .4s; }
.shot::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(11,16,13,.78) 0%, rgba(11,16,13,0) 45%); opacity: 0; transition: opacity .3s; }
.shot__label { position: absolute; z-index: 1; left: .75rem; right: .75rem; bottom: .6rem; font: 600 .8rem/1.2 var(--sans); opacity: 0; transform: translateY(.4rem); transition: opacity .3s, transform .3s; }
.shot:hover img { transform: scale(1.06); }
.shot:hover::after, .shot:focus-visible::after, .shot:hover .shot__label, .shot:focus-visible .shot__label { opacity: 1; }
.shot:hover .shot__label, .shot:focus-visible .shot__label { transform: none; }
.shot:focus-visible { outline-offset: -4px; }
@media (hover: none) { .shot__label, .shot::after { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .shot img, .shot__label, .shot::after { transition: none; } .shot:hover img { transform: none; } }

/* Klimat */
.climate { max-width: var(--max); margin: 0 auto; padding: clamp(4rem, 9vw, 8rem) var(--gutter); }
.climate__overview { margin: 3rem 0; padding: 1.5rem; background: var(--bg-2); border: 1px solid var(--line); border-radius: .5rem; }
.climate__overview figcaption { max-width: 52rem; margin-bottom: 1rem; font: 400 1rem/1.6 var(--sans); color: var(--ink-2); }
.climate__overview figcaption strong { color: var(--ink); }
.climate__cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .75rem; }
.card { display: grid; gap: .3rem; height: 100%; padding: 1.1rem 1.2rem; background: var(--bg-2); border: 1px solid var(--line); border-radius: .4rem; color: var(--ink); text-decoration: none; transition: border-color .2s, background .2s; }
.card:hover { border-color: var(--accent); background: var(--bg-3); color: var(--ink); }
.card__name { font: italic 1.2rem/1.2 var(--serif); }
.card__stat { font: 600 1.1rem var(--sans); color: var(--accent-2); }
.card__meta { font: 400 .85rem var(--sans); color: var(--ink-2); }
.spark { width: 100%; height: 2.25rem; fill: none; stroke: var(--moss); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.legend { margin: 1rem 0 0; font: 400 .9rem var(--sans); color: var(--ink-2); display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; align-items: center; }
.legend__dot { display: inline-block; width: .8rem; height: .8rem; border-radius: 50%; margin-right: .3rem; vertical-align: -.05em; }
.legend__dot--cold, .chart__dot--cold { background: var(--cold); fill: var(--cold); }
.legend__dot--hot, .chart__dot--hot { background: var(--hot); fill: var(--hot); }

.chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { font-family: var(--sans); font-size: 12.5px; fill: var(--ink-2); }
.chart__grid { stroke: var(--line); stroke-width: 1; }
.chart__grid--zero { stroke: var(--ink-2); stroke-dasharray: 4 4; }
.chart__band { fill: rgba(142, 197, 230, .14); stroke: none; }
.chart__line { fill: none; stroke: rgba(241, 234, 217, .38); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.chart__line--median { stroke: var(--ink); stroke-width: 3; }
.chart__line--hot { stroke: var(--hot); stroke-width: 2.5; }
.chart__line--cold { stroke: var(--cold); stroke-width: 2.5; }
.chart text.chart__label { font-size: 13px; font-weight: 600; fill: var(--ink); }
.chart text.chart__label--hot { fill: var(--hot); }
.chart text.chart__label--cold { fill: var(--cold); }
.chart text.chart__rowlabel { font-size: 14px; fill: var(--ink); }
.chart a:hover text.chart__rowlabel, .chart a:focus text.chart__rowlabel { fill: var(--accent-2); text-decoration: underline; }
.chart a:focus-visible { outline: 3px solid var(--focus); }
.chart__range { stroke: var(--ink-2); stroke-width: 3; stroke-linecap: round; }
.chart--mini text { font-size: 11px; }

/* Wpis o klimacie */
.entry__inner { max-width: 62rem; margin: 0 auto; padding: clamp(3rem, 7vw, 6rem) var(--gutter); }
.entry h1 { font-size: clamp(2.3rem, 6vw, 4.6rem); }
.entry__section { margin-top: clamp(3rem, 6vw, 5rem); }
.entry__section h2, .facts h2 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); }
.entry__section > p { color: var(--ink-2); max-width: 44rem; }
.facts { margin-top: 3rem; }
.facts dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: .75rem; margin: 0; }
.facts dl > div { background: var(--bg-2); border: 1px solid var(--line); border-radius: .3rem; padding: 1.1rem 1.2rem; }
.facts dt { font: 400 .85rem/1.4 var(--sans); color: var(--ink-2); }
.facts dd { margin: .35rem 0 0; font: 400 1.9rem/1.1 var(--serif); color: var(--accent-2); }
.facts dd small { display: block; font: 400 .85rem var(--sans); color: var(--ink-2); margin-top: .2rem; }
.minis { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1.25rem; margin-top: 1.5rem; }
.mini { padding: 1rem; background: var(--bg-2); border: 1px solid var(--line); border-radius: .4rem; }
.mini h3 { font: 600 1rem/1.2 var(--sans); margin-bottom: .6rem; }
.mini__stat { margin: .5rem 0 0; font: 400 .85rem/1.4 var(--sans); color: var(--ink-2); }
.data-details { margin-top: 1rem; font-family: var(--sans); }
.data-details summary { cursor: pointer; padding: .6rem 0; min-height: 2.75rem; color: var(--accent); }
.table-wrap { overflow-x: auto; margin-top: .75rem; border: 1px solid var(--line); }
table.data { border-collapse: collapse; width: 100%; font: 400 .88rem/1.4 var(--sans); }
table.data caption { text-align: left; padding: .6rem .8rem; color: var(--ink-2); font-weight: 600; }
table.data th, table.data td { padding: .5rem .8rem; border-top: 1px solid var(--line); text-align: right; white-space: nowrap; }
table.data thead th { background: var(--bg-3); font-weight: 600; }
table.data th:first-child, table.data tbody th { text-align: left; font-weight: 600; }
.entry__method ul { list-style: disc; padding-left: 1.2rem; max-width: 46rem; color: var(--ink-2); }
.entry__method li { margin-bottom: .6rem; }

/* Strony proste i 404 */
.page-simple { min-height: 60vh; }
.page-simple__inner { max-width: 46rem; margin: 0 auto; padding: clamp(3rem, 8vw, 7rem) var(--gutter); }
.page-simple h1 { font-size: clamp(2.4rem, 6vw, 4rem); }
.meta { color: var(--ink-2); font-size: .95rem; }

/* Stopka */
.site-footer { border-top: 1px solid var(--line); background: var(--bg); }
.site-footer__inner { max-width: var(--max); margin: 0 auto; padding: 2.5rem var(--gutter) 3rem; display: grid; gap: 1rem; font: 400 .95rem/1.5 var(--sans); color: var(--ink-2); }
.site-footer ul { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
.site-footer a, .site-footer .link-button { display: inline-block; padding: .5rem 0; min-height: 2.5rem; }
.site-footer p { margin: 0; }

/* Podgląd zdjęcia */
.lightbox { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; padding: 0; border: 0; background: rgba(5, 8, 6, .97); color: var(--ink); }
.lightbox[open] { display: grid; grid-template-rows: 1fr auto; }
.lightbox::backdrop { background: rgba(0, 0, 0, .9); }
.lightbox__figure { margin: 0; min-height: 0; display: grid; grid-template-rows: 1fr auto; padding: 1rem 1rem 0; }
.lightbox__img { max-width: 100%; max-height: 100%; width: auto; height: auto; margin: auto; object-fit: contain; min-height: 0; }
.lightbox__caption { text-align: center; padding: .8rem; font: 400 1rem var(--sans); color: var(--ink-2); }
.lightbox__bar { display: flex; align-items: center; justify-content: center; gap: .75rem; padding: .75rem 1rem 1.25rem; }
.lightbox__btn { min-width: 3rem; min-height: 3rem; border-radius: 999px; border: 2px solid var(--ink-2); background: transparent; color: var(--ink); font: 600 1.2rem var(--sans); cursor: pointer; }
.lightbox__btn:hover { border-color: var(--accent); color: var(--accent-2); }
.lightbox__count { margin: 0; min-width: 5rem; text-align: center; font: 500 .95rem var(--sans); color: var(--ink-2); }
.lightbox__close { margin-left: 1.5rem; }
body.lb-open { overflow: hidden; }

/* Pojawianie się sekcji – tylko gdy użytkownik nie ograniczył ruchu i działa JS */
@media (prefers-reduced-motion: no-preference) {
    .js [data-reveal] { opacity: 0; transform: translateY(2rem); transition: opacity .9s ease, transform .9s cubic-bezier(.2,.7,.2,1); }
    .js [data-reveal].is-in { opacity: 1; transform: none; }
}
@media print {
    .site-header, .consent, .lightbox, .hero__scroll, .skip-link { display: none !important; }
    body { background: #fff; color: #000; }
}
@media (forced-colors: active) { .btn { border: 2px solid ButtonText; } .chart__line { stroke: CanvasText; } }
