:root{--map-surface:#e4e6dc;--map-grid:#bac0b066;--preview-grid:#cfd0c544;--button-ink:#fff;--button-hover:#8f2a21;color-scheme:light}
html[data-theme=dark]{--paper:#1b1e1c;--ink:#eeeae1;--muted:#b8bcb3;--accent:#ec9782;--line:#4b514b;--subtle:#282d29;--map-surface:#242c26;--map-grid:#6e806044;--preview-grid:#6e806044;--button-ink:#1b1e1c;--button-hover:#f0ad99;color-scheme:dark}
.theme-control{display:flex;align-items:center}
.theme-control select{max-width:100px;min-height:44px;padding:5px 18px 5px 8px;border:1px solid var(--line);border-radius:0;background:var(--paper);color:var(--ink);font-size:12px}
.header-tools{gap:16px}.site-header{gap:24px}.desktop-nav{gap:18px}
.atlas,.map-place>span:last-child{background:var(--map-surface)}
.atlas-grid{background-image:linear-gradient(var(--map-grid) 1px,transparent 1px),linear-gradient(90deg,var(--map-grid) 1px,transparent 1px)}
.atlas-preview{background-image:linear-gradient(var(--preview-grid) 1px,transparent 1px),linear-gradient(90deg,var(--preview-grid) 1px,transparent 1px)}
.button,.search-form button{color:var(--button-ink)!important}.button:hover{background:var(--button-hover)}
.skip{color:var(--paper)}
html[data-theme=dark] .brand img{filter:brightness(0) invert(.92)}
input,select{background:var(--paper);color:var(--ink)}
.editorial-illustration{margin:0 0 56px;max-width:1100px;margin-left:auto}
.editorial-illustration img{width:100%;height:auto}
.editorial-illustration figcaption{display:block;max-width:85ch}
.editorial-illustration figcaption strong{display:block;color:var(--accent);font-weight:600;margin-bottom:4px}
@media(max-width:600px){.header-tools{gap:10px}.theme-control select{max-width:85px;font-size:11px;padding-left:5px}.site-header{gap:12px}.brand{font-size:16px;gap:6px}.brand img{width:23px;height:22px}.editorial-illustration{margin-bottom:36px}}
@media print{html[data-theme=dark]{--paper:#fff;--ink:#191b1a;--muted:#565a55;--accent:#ad382c;--line:#d1d2ca;--subtle:#e7e8df;color-scheme:light}}

@media(max-width:360px){.site-header{padding-left:12px;padding-right:12px;gap:8px}.brand{font-size:15px}.dotcom{display:none}.header-tools{gap:8px}.theme-control select{max-width:76px}}

/* Imagined scenes add atmosphere; the reading column keeps a plain surface. */
.hero-heading{position:relative;isolation:isolate;padding:12px 0 1px}
.hero-heading::before{content:'';position:absolute;z-index:-1;inset:-28px calc(-1 * var(--space)) 0;background:url('/assets/illustrations/uprising-1921-ai.webp') center 44%/cover no-repeat;opacity:.11;mask-image:linear-gradient(to bottom,#000 40%,transparent)}
html[data-theme=dark] .hero-heading::before{opacity:.16}
.chapter-entrances>a{display:flex;flex-direction:column}
.chapter-entrances .chapter-year{margin-bottom:18px}
.chapter-illustration{width:100%;margin:0 0 24px;max-width:none}
.chapter-illustration img{aspect-ratio:3/2;object-fit:cover;filter:saturate(.85)}
.chapter-illustration figcaption{font-size:10px;line-height:1.5;padding-top:8px;letter-spacing:.035em}
.chapter-illustration figcaption strong{margin:0;color:var(--muted);font-weight:400}
.editorial-illustration:not(.chapter-illustration) figcaption span{margin-top:6px}
.chapter-entrances>a img{transition:filter .2s ease}
.chapter-entrances>a:hover img{filter:saturate(1)}
.home-context{position:relative;isolation:isolate}
.home-context::before{content:'';position:absolute;z-index:-1;inset:-40px calc(-1 * var(--space));background:url('/assets/illustrations/industrial-silesia-ai.webp') right center/auto 100% no-repeat;opacity:.07;mask-image:linear-gradient(to right,transparent 35%,#000)}
html[data-theme=dark] .home-context::before{opacity:.1}
@media(max-width:767px){.chapter-entrances>a{display:grid;grid-template-columns:82px minmax(0,1fr);gap:14px}.chapter-entrances .chapter-year{grid-column:1;grid-row:1;margin:0;font-size:52px}.chapter-illustration{grid-column:2;grid-row:1;margin:0}.chapter-entrances>a>div{grid-column:2}.chapter-illustration figcaption{font-size:9px;letter-spacing:0}.home-context::before{inset:-28px calc(-1 * var(--space));background-position:right top;mask-image:linear-gradient(to bottom,transparent 35%,#000)}.hero-heading::before{opacity:.09}}
@media(prefers-reduced-motion:reduce){.chapter-entrances>a img{transition:none}}
@media print{.hero-heading::before,.home-context::before{display:none}.chapter-entrances>a{display:block}}
/* Geographic map with a keyboard-accessible settlement list. */
#geographic-map{height:520px;width:100%;min-width:0;background:#e7e4db;isolation:isolate;border:1px solid var(--line)}
.atlas-layout>div{min-width:0}.map-choices{display:flex;flex-wrap:wrap;gap:.5rem;padding:1rem 0}.map-choices button{font:inherit;padding:.5rem .7rem;border:1px solid var(--line);color:var(--ink);background:var(--paper);cursor:pointer}.map-choices button[aria-pressed=true]{outline:2px solid var(--red);outline-offset:1px}
.leaflet-container{font-family:inherit}.leaflet-container a{color:#17466b}.leaflet-control-attribution{color:#222}.leaflet-control-attribution a{color:#17466b}.leaflet-bar a{color:#222!important;background:#fff!important}.leaflet-tooltip{color:#222;background:#fff}.leaflet-marker-icon:focus{outline:3px solid #a83127;outline-offset:3px}
@media(max-width:767px){#geographic-map{height:390px}.atlas-layout{display:block}}
/* A document leaf turns over the next scanned page. */
.viewer-canvas{position:relative;perspective:1400px}
.turning-sheet{position:absolute;pointer-events:none;z-index:2;background:#e9e1cf;box-shadow:12px 6px 28px #0005;backface-visibility:hidden;will-change:transform,opacity}
.viewer-canvas .turning-sheet img{width:100%!important;height:100%!important;object-fit:fill;margin:0;transform:none!important}
.turning-sheet:after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,#0002,transparent 15%,transparent 75%,#fff2);pointer-events:none}
@media(prefers-reduced-motion:reduce){.turning-sheet{display:none}}
/* Document reader: quiet desk, paper, and navigation beside the scan. */
#media-viewer{border:1px solid var(--line);box-shadow:0 24px 90px #0007;border-radius:4px}
.viewer-stage{position:relative;background:var(--subtle)}
.viewer-stage .viewer-canvas{padding:24px 76px;background:radial-gradient(ellipse at center,#0000,#00000012)}
.page-edge{position:absolute;top:50%;transform:translateY(-50%);z-index:3;display:grid;place-items:center;width:48px;height:64px;border:1px solid var(--line);border-radius:3px;background:var(--paper);color:var(--ink);cursor:pointer;box-shadow:0 3px 12px #0002}
.page-edge svg{width:26px;height:26px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.previous-edge{left:16px}.next-edge{right:16px}.page-edge:hover{background:var(--subtle)}.page-edge:active{scale:.96}
.reader-page{margin:0;text-align:center;padding:.7rem;font-size:13px;color:var(--muted);border-bottom:1px solid var(--line)}
.reader-page:empty{display:none}.document-reader .viewer-controls [data-prev],.document-reader .viewer-controls [data-next]{display:none}
.document-reader .viewer-canvas{height:60dvh}.document-reader #viewer-image{filter:drop-shadow(0 5px 10px #0004)}
.viewer-details{font-size:13px;padding:14px 26px}.viewer-details p{margin:0 0 8px}.viewer-details a{text-decoration:underline;text-underline-offset:3px}
@media(max-width:767px){.viewer-stage .viewer-canvas{padding:16px 44px}.page-edge{width:34px;height:54px}.previous-edge{left:5px}.next-edge{right:5px}.document-reader .viewer-canvas{height:53dvh}.viewer-header h2{font-size:16px}.viewer-details{padding:12px 16px}}
.portrait-unavailable{min-height:110px;display:flex;align-items:flex-end;padding:18px 0;border-top:1px solid var(--line);margin-bottom:20px;color:var(--muted);font-size:12px}.map-choices button[aria-pressed=true]{outline-color:var(--accent)}
.map-cluster{background:#ad382c;color:#fff;border:2px solid #fff;border-radius:50%;display:grid;place-items:center;font-weight:700;font-size:14px;box-shadow:0 2px 5px #0004}
