/* ───────── typografia: dwa kroje na całą stronę ─────────
   EB Garamond 400 / kursywa · Inter 300 / 400 / 500 / 600
   światło −0,018 em antykwa, −0,03 em grotesk · interlinia 0,98 w nagłówkach, 1,5 w tekście */
:root {
  --serif: "EB Garamond", "Apple Garamond", Garamond, "Times New Roman", serif;
  --grot: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --cond: var(--grot);                 /* jeden krój bezszeryfowy na całą stronę: Inter */
  --garamond: "EB Garamond", "Apple Garamond", Garamond, serif;
  --signal: #e2532f;
  --ink: #111214;
  --night: #07080b;
  --paper: #e9e6df;
  --white: #f7f5f0;
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --bar: 56px;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 1.4 -.2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
/* --ekran: wysokość sceny przy schowanych paskach przeglądarki (na iPhonie poprawia ją skrypt w <head>); --pod: ile sceny leży w tej chwili pod dolnym paskiem */
:root { --ekran: 100lvh; --pod: max(0px, calc(var(--ekran) - 100dvh)); }
html { background: var(--night); color: var(--white); -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 14px/1.5 var(--grot); letter-spacing: -.006em; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body::after { content: ""; position: fixed; inset: 0; z-index: 95; pointer-events: none; background: var(--grain); opacity: .09; mix-blend-mode: overlay; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
em { font-family: var(--serif); font-style: italic; letter-spacing: -.01em; }
:focus-visible { outline: 1.5px solid currentColor; outline-offset: 4px; border-radius: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 100; background: var(--white); color: var(--ink); padding: 8px 12px; border-radius: 99px; font: 500 12px var(--grot); }
.skip:focus { top: 12px; }

/* kapsuła z numerem — wspólny znak całej strony */
.pill { display: inline-flex; align-items: center; justify-content: center; min-width: 2.4em; height: 1.75em; padding: 0 .65em; border: 1px solid currentColor; border-radius: 99px; font: 500 10px/1 var(--grot); letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.capsule { display: inline-block; width: 3.1em; height: 1.2em; border: 1.5px solid currentColor; border-radius: 99px; flex: none; }
.star { width: 1.15em; height: 1.15em; flex: none; filter: invert(1); }

/* ───────── loader ───────── */
.loader { position: fixed; inset: 0; z-index: 90; background: var(--night); display: grid; place-items: center; align-content: center; gap: 14px; transition: opacity .9s var(--ease-out), visibility 0s .9s; }
.ready .loader { opacity: 0; visibility: hidden; }

/* ───────── pasek ───────── */
.bar { position: fixed; inset: 0 0 auto; height: var(--bar); z-index: 40; display: flex; align-items: center; justify-content: space-between; padding: 0 26px; color: #fff; transition: color .45s ease; }
.bar::before { content: ""; position: absolute; z-index: -1; inset: 0 0 auto; height: 132px; pointer-events: none; opacity: 0; transition: opacity .6s ease; background: linear-gradient(rgba(38,62,50,.66), rgba(38,62,50,.5) 34%, rgba(38,62,50,.16) 74%, transparent); }
.bar.na-mgle::before { opacity: 1; }
.bar.on-light, .levels.on-light { color: var(--ink); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-badge { width: 14px; height: 24px; background: currentColor; -webkit-mask: url(twin.svg) center / contain no-repeat; mask: url(twin.svg) center / contain no-repeat; }
.brand-name { font: 500 12.5px var(--grot); letter-spacing: .02em; }
.brand-studio { white-space: nowrap; }
.bar-nav { display: flex; gap: 26px; align-items: center; font: 500 10.5px var(--grot); text-transform: uppercase; letter-spacing: .08em; }
.bar-nav a { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.lang { position: relative; display: inline-flex; gap: 7px; padding: 0; font: inherit; letter-spacing: .08em; }
.lang::after { content: ""; position: absolute; inset: -16px -8px; }
.lang span { opacity: .5; transition: opacity .2s ease; }
.lang [data-on] { opacity: 1; box-shadow: 0 3px 0 -2px currentColor; }
@media (hover: hover) { .lang:hover span { opacity: 1; } }
.sound-box { display: inline-flex; align-items: center; gap: 8px; }
.sound { position: relative; display: inline-flex; align-items: center; padding: 0; font: inherit; text-transform: uppercase; letter-spacing: .08em; }
.sound::after { content: ""; position: absolute; inset: -16px -4px; }
/* głośność: osiem schodków. Zgaszone leżą jako kropki, włączone wstają i są suwakiem; szerokość stała, więc napis nie ucieka spod kursora */
.vol { position: relative; display: inline-flex; align-items: flex-end; gap: 2px; height: 13px; cursor: pointer; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.vol::after { content: ""; position: absolute; inset: -16px -7px; }
.vol b { width: 3px; height: calc(3px + var(--n) * 1.4px); background: currentColor; opacity: .3; transform-origin: bottom; transition: opacity .14s ease, transform .22s cubic-bezier(.23,1,.32,1); }
.vol b:nth-child(1) { --n: 0; } .vol b:nth-child(2) { --n: 1; } .vol b:nth-child(3) { --n: 2; } .vol b:nth-child(4) { --n: 3; }
.vol b:nth-child(5) { --n: 4; } .vol b:nth-child(6) { --n: 5; } .vol b:nth-child(7) { --n: 6; } .vol b:nth-child(8) { --n: 7; }
.vol b.on { opacity: 1; }
.sound[aria-pressed="false"] + .vol b { opacity: .8; transform: scaleY(.18); height: 13px; }
.sound[aria-pressed="true"] + .vol:not(.ciagnie) b.on { animation: eq .9s ease-in-out calc(var(--n) * -.31s) infinite alternate; }
.vol.ciagnie { cursor: ew-resize; }
@media (hover: hover) { .vol:hover b { opacity: .55; } .vol:hover b.on { opacity: 1; } }
@keyframes eq { from { transform: scaleY(.4); } to { transform: scaleY(1); } }

/* ───────── poziomy ───────── */
.levels { position: fixed; right: 26px; top: 50%; transform: translateY(-50%); z-index: 40; color: #fff; transition: opacity .3s ease, visibility 0s, color .45s ease; }
.levels.off { opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility 0s .3s; }
.levels ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.levels a { display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-height: 24px; text-decoration: none; opacity: .4; transition: opacity .25s ease; }
.levels a b { font: 500 11px var(--cond); font-variant-numeric: tabular-nums; width: 1.6em; text-align: right; }
.levels a span { font: 500 9.5px var(--grot); text-transform: uppercase; letter-spacing: .1em; opacity: 0; transform: translateX(6px); transition: opacity .25s ease, transform .25s var(--ease-out); }
.levels a::before { content: ""; order: 1; width: 5px; height: 5px; border-radius: 50%; border: 1px solid currentColor; transition: background .25s ease; }
.levels a[aria-current="step"] { opacity: 1; }

.levels a[aria-current="step"]::before { background: currentColor; }
.levels a[aria-current="step"] span { opacity: 1; transform: none; }
@media (hover: hover) and (pointer: fine) { .levels a:hover { opacity: 1; } .levels a:hover span { opacity: 1; transform: none; } }

/* ───────── podróż ───────── */
.journey { position: relative; height: calc(var(--worlds, 9) * 216svh); }
.stage { position: sticky; top: 0; height: var(--ekran); overflow: hidden; background: var(--night); }
.gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.shot-trace { position: absolute; inset: 0; pointer-events: none; }
.shot-trace svg { display: block; width: 100%; height: 100%; }
.no-gl .gl { display: none; }
.no-gl .stage { background: var(--night) var(--fallback-shot, none) center / cover; }
/* ława optyczna: rysunek anatomy nad płótnem, w kamerze świata */
.lawa { position: absolute; inset: 0; pointer-events: none; visibility: hidden; background: transparent; }
.lawa .lawa-svg { width: 100%; height: 100%; }
.stage.lawa-on { cursor: grab; }
.stage.lawa-drag { cursor: grabbing; user-select: none; }
.lawa .lw-beam { fill: #ff7a1a; opacity: .06; }
.lawa .lw-idea { fill: #ff5a12; }
.lawa .lw-blade { fill: #1a1a1a; }
.lawa .lw-ray { fill: none; stroke: #ffb070; stroke-width: .7px; opacity: .75; vector-effect: non-scaling-stroke; }
.no-gl .stage.room-night { background: var(--night) url(swiaty/pokoj.webp) center / cover; }
.scroll-hint { position: absolute; left: 50%; bottom: 30px; z-index: 9; margin: 0; transform: translateX(-50%); display: flex; align-items: baseline; gap: 10px; color: #fff; }
.scroll-hint span { font: 500 10px var(--grot); text-transform: uppercase; letter-spacing: .12em; }
.scroll-hint em { font: 400 11px var(--cond); text-transform: uppercase; letter-spacing: .1em; }

/* ───────── rozdziały ───────── */
.chapters { position: absolute; inset: 0; z-index: 8; pointer-events: none; color: #fff; }
.chapter.ink-dark { color: #121212; }   /* plansza 09 Puf: jasne tło, tekst na czarno */
.chapter { --t: 0; --vis: clamp(0, calc(min(var(--t), 2 - var(--t)) * 3), 1); position: absolute; visibility: hidden; }
.chapter.on { visibility: visible; }
.chapter > * { opacity: var(--vis); transform: translate3d(0, calc((1 - var(--vis)) * 10px), 0); }
.chapter > .mod-head { transition-delay: 0s; }

.chapter .label, .mod .label { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; font: 500 10px var(--grot); text-transform: uppercase; letter-spacing: .1em; }
.label .rule { flex: 0 1 110px; height: 1px; background: currentColor; opacity: .6; }
.mod .label .rule { flex: 1 1 110px; }
.label .dots { width: 18px; height: 7px; background: radial-gradient(circle at 3.5px 3.5px, transparent 2.4px, currentColor 2.6px 3.4px, transparent 3.6px), radial-gradient(circle at 14.5px 3.5px, currentColor 3.4px, transparent 3.6px); }
.label .of { opacity: .55; font-variant-numeric: tabular-nums; }

.pos-bl { left: 5vw; bottom: 8svh; }
.pos-tl { left: 5vw; top: 13svh; }
.pos-br { right: 140px; bottom: 8svh; }
.pos-tr { right: 140px; top: 13svh; }

/* ───────── moduł: jeden mały, gęsty blok informacji dla całej strony ─────────
   siatka 4 px · jedna linia (wiersz z numerem), reszta trzyma się na odstępach
   nagłówek antykwą, dane wąskim groteskiem z cyframi tabelarycznymi */
.mod { width: min(360px, calc(100vw - 40px)); font: 400 11px/1.36 var(--cond); font-variant-numeric: tabular-nums; }
.mod-head { display: grid; grid-template-columns: 1fr auto; align-items: start; column-gap: 16px; }
.mod-title { margin: 0; font-weight: 400; }
/* nagłówki z charakterem: litery wskakują po kolei, pod kursorem podskakują */
.mod-title-play { font: 400 44px/.92 var(--serif); letter-spacing: -.02em; text-wrap: balance; }
.mod-title-play .ch { display: inline-block; transition: transform .5s cubic-bezier(.34, 1.56, .64, 1); }
.chapter .mod-title-play .ch { opacity: var(--vis); transform: translate3d(0, calc((1 - var(--vis)) * .5em), 0) rotate(calc((1 - var(--vis)) * -8deg)); transition-delay: calc(var(--n) * 28ms); }
@media (hover: hover) { .mod-title-play:hover .ch:nth-child(odd) { transform: translateY(-.06em) rotate(-3deg); } .mod-title-play:hover .ch:nth-child(even) { transform: translateY(.04em) rotate(2deg); } }
.mod-title-play .ch:first-child { font-style: italic; }
/* dwie gwiazdki Sparka, każda obraca się po swojemu */
.mod-twin { justify-self: end; width: 27px; height: 44px; fill: currentColor; overflow: visible; }
.mod-twin path { transform-box: fill-box; transform-origin: center; animation: twin-turn 9s cubic-bezier(.65, 0, .35, 1) infinite; }
.mod-twin .tw-b { animation-delay: -4.5s; }
@keyframes twin-turn { 0%, 70% { transform: rotate(0); } 100% { transform: rotate(90deg); } }
.mod-kick { margin: 12px 0 0; font: 600 9.5px/1.2 var(--cond); text-transform: uppercase; letter-spacing: .12em; }
.mod-quote { margin: 8px 0 0; font: 400 12.5px/1.42 var(--cond); text-wrap: pretty; opacity: .92; }
.mod-head + .mod-quote { margin-top: 12px; }
.mod-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); column-gap: 16px; margin: 14px 0 0; }
.mod-cols > div { min-width: 0; }
.mod-cols dt { font: 500 9px/1.2 var(--cond); text-transform: uppercase; letter-spacing: .1em; opacity: .6; }
.mod-cols dd { display: flex; align-items: center; gap: 6px; margin: 3px 0 0; font: 500 11.5px/1.25 var(--cond); }
.mod-music { grid-template-columns: 1fr 1.3fr auto; }

/* drobne znaki: matryca kropek i kapsuła, nic więcej */
.mod-foot { display: flex; align-items: center; gap: 10px; margin-top: 16px; height: 9px; }
/* kropki z lewej, kapsuła równo z prawą krawędzią modułu (i przycisku 05), między nimi linia */
.mod-route { flex: 1 1 auto; height: 1px; background: currentColor; opacity: .45; }
.mod-matrix { display: grid; grid-template-columns: repeat(5, 3px); gap: 2px; }
.mod-matrix i { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .35; animation: mod-blink 3.2s steps(1) infinite; }
.mod-matrix i:nth-child(3n) { animation-delay: -.8s; } .mod-matrix i:nth-child(4n+1) { animation-delay: -1.9s; } .mod-matrix i:nth-child(7) { animation-delay: -2.6s; }
.mod-capsule { position: relative; width: 26px; height: 9px; border: 1px solid currentColor; border-radius: 9px; flex: none; }
.mod-capsule i { position: absolute; top: 1.5px; left: 2px; width: 4px; height: 4px; border-radius: 50%; background: currentColor; animation: mod-slide 5.5s cubic-bezier(.65, 0, .35, 1) infinite alternate; }
.mod-eq { display: inline-flex; align-items: flex-end; gap: 1.5px; height: 9px; }
.mod-eq i { width: 2px; height: 100%; background: var(--signal); transform-origin: bottom; animation: eq .8s ease-in-out infinite alternate; }
.mod-eq i:nth-child(2) { animation-duration: .55s; } .mod-eq i:nth-child(3) { animation-duration: 1.1s; }
@keyframes mod-blink { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@keyframes mod-slide { to { transform: translateX(16px); } }

/* znak: SPARK bezszeryfowym Interem, HU+AI Garamondem tej samej wysokości wersalików
   (wersalik Intera 0,727 em, Garamonda 0,653 em → Garamond 1,113 em) */
.wm { white-space: nowrap; }
.wm-spark { font-family: var(--grot); font-weight: 400; text-transform: uppercase; letter-spacing: .02em; }
.wm-hu { font-family: var(--garamond); font-weight: 400; font-size: 1.113em; letter-spacing: .03em; margin-left: .12em; }
.mod-title.wm { font-size: 40px; line-height: .9; letter-spacing: -.01em; }

/* ───────── moduł poziomu 7 ───────── */

/* ───────── archiwum: papier, Garamond, malutkie numery ───────── */
.archive { position: relative; z-index: 2; background: var(--paper); color: var(--ink); padding: calc(var(--bar) + 12vh) 5vw 0; min-height: 100svh; }
.archive::before { content: ""; position: absolute; inset: 0; background: var(--grain); opacity: .22; mix-blend-mode: multiply; pointer-events: none; }
.arch-head { position: relative; padding-bottom: 30px; color: var(--ink); }
.arch-head .mod-title-play { max-width: 12ch; }
.hint-touch { display: none; }
@media (hover: none) { .hint-mouse { display: none; } .hint-touch { display: inline; } }

.arch-index { position: relative; list-style: none; margin: 0; padding: 26px 0 18vh; border-top: 1px solid var(--ink); display: grid; grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); }
.arch-index button { position: relative; display: block; width: 100%; padding: 5px 0; text-align: left; font: 400 16px/1.4 var(--serif); font-feature-settings: "onum", "tnum"; letter-spacing: .01em; color: var(--ink); }
.arch-index button sup { margin-left: 3px; font: 500 7.5px var(--grot); letter-spacing: .02em; vertical-align: 6px; opacity: .6; }
.arch-index button[data-on] { font-style: italic; }
.arch-index li { opacity: 0; transform: translateY(6px); }
.arch-index.in li { opacity: 1; transform: none; transition: opacity .6s var(--ease-out), transform .6s var(--ease-out); transition-delay: calc(min(var(--i), 80) * 6ms); }
@media (hover: hover) and (pointer: fine) {
  .arch-index:hover button:not([data-on]) { opacity: .22; }
  .arch-index button { transition: opacity .2s ease; cursor: none; }
  .arch-index { cursor: none; }
}

/* od 640 px opis stoi obok tytułu, na tych samych kolumnach co numery: linia na wysokości linii */
@media (min-width: 640px) {
  .arch-head.mod { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--kol, 54px), 1fr)); grid-template-rows: auto auto 1fr; width: auto; padding-bottom: 26px; }
  .arch-head .label { grid-column: 1 / 7; grid-row: 1; }
  .arch-head .mod-head { grid-column: 1 / 7; grid-row: 2 / 4; align-self: start; }
  .arch-head .mod-foot { grid-column: 8 / -1; grid-row: 1; align-self: start; height: 17.5px; margin: 0; }
  .arch-head .arch-meta { grid-column: 8 / -1; grid-row: 2; display: grid; grid-template-columns: subgrid; column-gap: 0; margin: 0; }
  .arch-head .arch-meta > div { grid-column: span 2; }
  .arch-head .arch-meta dt { white-space: nowrap; }
  .arch-head .arch-hint { grid-column: 8 / -1; grid-row: 3; margin-top: 8px; }
}
@media (min-width: 640px) and (max-width: 760px) { .archive { --kol: 46px; } }
@media (hover: none), (pointer: coarse) { .arch-index { touch-action: pan-y; } .arch-index button { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; } .arch-index.stos button:not([data-on]) { opacity: .22; } }

/* stos pod kursorem — bez ramek, same arkusze */
.trail { position: fixed; inset: 0; z-index: 30; pointer-events: none; overflow: hidden; }
.trail img { position: absolute; left: 0; top: 0; opacity: 0; object-fit: cover; will-change: transform, opacity; }

.end { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 24px 20px; align-items: center; padding: 30px 0 calc(36px + env(safe-area-inset-bottom)); border-top: 1px solid var(--ink); }
.end-badge { width: 48px; }
.end strong { display: block; font: 500 14px/1.2 var(--grot); letter-spacing: .02em; }   /* jak w nagłówku przy logo */
.end p { margin: 5px 0 0; font: 400 12.5px var(--grot); color: #55534e; }
.end-links { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0 8px; }
/* pastylki: widać 30 px, dotyk ma 44 px */
.end a, .mod-cta a { position: relative; display: inline-flex; align-items: center; height: 30px; margin: 7px 0; padding: 0 14px; border: 1px solid currentColor; border-radius: 99px; font: 500 10.5px/1 var(--grot); letter-spacing: .08em; text-transform: uppercase; text-decoration: none; white-space: nowrap; color: inherit; transition: background .2s ease, color .2s ease, transform .16s ease-out; }
.end a { color: var(--ink); }
.end a::after, .mod-cta a::after { content: ""; position: absolute; inset: -8px -4px; }
.end a.end-mail { height: auto; margin: 5px 0 0; padding: 0; border: 0; border-radius: 2px; font: 400 12.5px/1.5 var(--grot); letter-spacing: 0; text-transform: none; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.end a.end-mail::after { inset: -6px -8px -20px; }
.end-top { grid-column: 1 / -1; justify-self: start; }
.mod-cta { display: flex; gap: 8px; margin: 8px 0 0; }
.mod-cta a { margin: 4px 0; pointer-events: auto; }
.mod-cta a.full { background: #121212; border-color: #121212; color: #f4f2d8; }
@media (hover: hover) { .end-mail:hover { text-decoration-color: var(--signal); } .end a:not(.end-mail):hover, .mod-cta a:hover { background: var(--ink); color: var(--paper); } .mod-cta a.full:hover { background: var(--signal); border-color: var(--signal); color: var(--ink); } }
.end a:active, .mod-cta a:active { transform: scale(.97); }
.end { align-items: start; }
@media (min-width: 760px) {
  .end { grid-template-columns: auto 1fr auto auto; }
  .end-links, .end-top { grid-column: auto; }
}

/* ───────── przeglądarka ───────── */
.viewer { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: var(--night); color: var(--white); display: none; grid-template: 1fr / minmax(240px, 300px) 56px 1fr 56px; }
.viewer[open] { display: grid; animation: vin .3s var(--ease-out); }
.viewer::backdrop { background: rgba(7, 8, 11, .6); }
@media (hover: none) { .viewer::backdrop { background: var(--night); } }
@keyframes vin { from { opacity: 0; transform: scale(.985); } }
.viewer-close { position: absolute; top: 18px; right: 26px; z-index: 2; display: inline-flex; gap: 8px; align-items: center; min-height: 44px; font: 500 10px var(--grot); color: var(--white); text-transform: uppercase; letter-spacing: .08em; }
.viewer-close kbd { font: inherit; padding: 2px 7px; border: 1px solid currentColor; border-radius: 99px; opacity: .6; }
/* opis pracy w lewym górnym rogu: pastylka numeru w jednej linii z „Zamknij”, ta sama odległość od krawędzi; kolory dokładają rzędy w dół */
.viewer-info { grid-column: 1 / -1; grid-row: 1; position: relative; z-index: 1; align-self: start; justify-self: start; width: 232px; padding: 31px 0 0 26px; }
.viewer-info .pill { padding: 0 .95em; }
.viewer-info .label { margin-bottom: 14px; }
.viewer-count:empty { display: none; }
.viewer-count { margin-top: 6px !important; text-transform: uppercase; font-size: 9.5px !important; letter-spacing: .1em; opacity: .6 !important; }
/* obraz na środku ekranu, nie kolumny: opis i strzałki leżą obok, nad nim */
.viewer figure { grid-column: 1 / -1; grid-row: 1; margin: 0; min-height: 0; position: relative; }
.viewer figure img { position: absolute; inset: 0; margin: auto; height: min(calc(100% - 64px), calc(var(--viewer-h, 100vh) * 1.15)); width: calc(100% - 2 * (min(300px, 25vw) + 56px)); object-fit: contain; }
/* strzałki w tej samej odległości od krawędzi ekranu, po obu stronach */
.viewer-prev, .viewer-next { position: absolute; top: 50%; z-index: 1; width: 56px; height: 88px; translate: 0 -50%; }
.viewer-prev { left: 12px; } .viewer-next { right: 12px; }
.viewer-prev, .viewer-next { font: 400 22px var(--cond); opacity: .6; transition: opacity .2s ease; }
.viewer-prev:hover, .viewer-next:hover { opacity: 1; }
.viewer-thumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.viewer-thumbs:empty { display: none; }
.viewer-thumbs button { width: 30px; height: 30px; opacity: .4; overflow: hidden; transition: opacity .2s ease; }
.viewer-thumbs button img { width: 100%; height: 100%; object-fit: cover; }
.viewer-thumbs button[aria-current="true"] { opacity: 1; outline: 1px solid currentColor; outline-offset: 1px; }

@media (max-width: 760px) {
  .bar { padding: 0 16px; }
  .brand { gap: 8px; }
  .brand-name { font-size: 10.5px; line-height: 1.1; }
  .brand-studio { display: block; }
  .bar-nav { gap: 13px; }
  .lang { gap: 5px; }
  .levels { right: 12px; }
  .levels a span { display: none; }
  .chapter { left: 20px !important; right: 52px !important; width: auto; top: auto !important; bottom: 10svh !important; }
  .arch-index { grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); }
  .arch-meta { grid-column: 1; grid-row: 3; }
}

/* komputer: pastylki w lewym dolnym rogu, na linii dołu pracy; puste miejsce nad nimi dalej zamyka podgląd */
@media (min-width: 761px) and (min-height: 520px) {
  .viewer-info { align-self: stretch; display: flex; flex-direction: column; align-items: flex-start; padding-bottom: 32px; pointer-events: none; }
  .viewer-info > * { pointer-events: auto; }
  .viewer .viewer-palette { margin-top: auto; }
}
@media (max-width: 760px) and (orientation: portrait) {
  /* podgląd pracy w pionie: obraz, pod nim strzałki na krawędziach siatki, niżej opis; opis ma stałe miejsce, więc strzałki nie skaczą pod palcem */
  .viewer { grid-template: minmax(0, 1fr) 48px minmax(var(--viewer-opis, 72px), auto) / 1fr 1fr; padding: 0 16px calc(16px + env(safe-area-inset-bottom)); }
  .viewer figure { grid-column: 1 / -1; grid-row: 1; }
  .viewer figure img { inset: 56px 0 4px; margin: 0; width: 100%; height: calc(100% - 60px); }
  .viewer-prev, .viewer-next { position: static; grid-row: 2; width: 64px; height: 48px; translate: none; opacity: .9; }
  .viewer-prev { grid-column: 1; justify-self: start; text-align: left; } .viewer-next { grid-column: 2; justify-self: end; text-align: right; }
  .viewer-prev, .viewer-next { z-index: 2; }
  /* numer stoi między strzałkami, pod nim kolory w dwóch rzędach, niżej arkusze i utwór */
  .viewer-info { grid-column: 1 / -1; grid-row: 2 / 4; align-self: start; justify-self: stretch; width: auto; padding: 0; display: grid; grid-template: 48px auto / minmax(0, 1fr); }
  .viewer-info > * { grid-column: 1; align-self: start; }
  .viewer-close { top: calc(6px + env(safe-area-inset-top)); right: 16px; }
  .viewer-close kbd { display: none; }
  .viewer-info .label { grid-column: 1 / -1; grid-row: 1; height: 48px; margin: 0 64px; } .viewer .viewer-palette { grid-column: 1; grid-row: 2; grid-template-columns: repeat(3, 88px); justify-content: center; margin: 4px 0 0; }
  .viewer-info .viewer-thumbs { margin-top: 10px; } .viewer-info .viewer-track { margin: 10px 0 0; }
  .no-gl .stage.room-night { background-size: contain; background-repeat: no-repeat; }
}

@media (prefers-reduced-motion: reduce) {
  .sound[aria-pressed="true"] + .vol b.on, .mod-twin path, .mod-matrix i, .mod-capsule i, .mod-eq i { animation: none; }
  .chapter .mod-title-play .ch { transform: none; }
  .chapter > * { transform: none; }
  .room-toggle .capsule::after { transition: none; }
  .arch-index.in li { transition: opacity .3s ease; transform: none; }
}


@media (max-width: 760px) {
  .journey { height: calc(var(--worlds, 9) * 175svh); }
}
@media (prefers-reduced-motion: reduce) {
  .journey { height: calc(var(--worlds, 9) * 118svh); }
}
/* supermoc i tagi epoki pod hasłem rozdziału (jak w prologu) */
.mod-tags { margin: 10px 0 0; font: 500 9.5px/1.5 var(--cond); text-transform: uppercase; letter-spacing: .1em; opacity: .7; text-wrap: pretty; }
@media (max-width: 520px) { .chapter .mod-tags { display: none; } }
/* bloki rozdziału: hasło | muzyka | książka i film, rozdzielone cienką kreską; kolumny książki i filmu stoją pod muzyką i utworem */
.mod-music, .mod-recs { position: relative; margin-top: 14px; padding-top: 13px; }
.mod-music::before, .mod-recs::before { content: ""; position: absolute; inset: 0 0 auto; height: 1px; background: currentColor; opacity: .32; }
.mod-recs { grid-template-columns: 1fr 1.3fr auto; }
.mod-recs dd { display: block; }
.mod-recs small { display: block; margin-top: 2px; font: 400 10px/1.25 var(--cond); opacity: .62; }
.mod-tags + .mod-music, .mod-quote + .mod-music { margin-top: 16px; }
/* tytuł utworu = link do teledysku */
.mod-song { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); pointer-events: auto; transition: text-decoration-color .2s; }
.mod-song::after { content: " ↗"; font-size: .85em; opacity: .7; }
.mod-song:hover { text-decoration-color: currentColor; }
.mod-song:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; border-radius: 2px; }
/* SPARK STATION: liczniki na żywo */
.mod-live { position: relative; margin-top: 14px; padding-top: 13px; }
.mod-live::before { content: ""; position: absolute; inset: 0 0 auto; height: 1px; background: currentColor; opacity: .32; }
.mod-live dd { font-variant-numeric: tabular-nums; }
.mod-live div:first-child dd::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--signal); animation: live-dot 1.2s ease-in-out infinite; }
@keyframes live-dot { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .mod-live div:first-child dd::before { animation: none; } }
.mod-title-play .w { display: inline-block; white-space: nowrap; }
.mod-title-play .w:not(:first-child) > .ch:first-child { font-style: normal; }   /* pochyła tylko pierwsza litera tytułu */
/* liquid glass pod blokiem tekstu: tafla wystaje poza tekst, więc tekst zostaje na siatce, a blok podnosimy o grubość ramki */
.chapter, .room-controls, .pz-text { isolation: isolate; --glass-x: 24px; --glass-y: 22px; }
.chapter::before, .room-controls::before, .pz-text::before {
  content: ""; position: absolute; inset: calc(var(--glass-y) * -1) calc(var(--glass-x) * -1); z-index: -1; pointer-events: none;
  border-radius: 20px;
  background: linear-gradient(140deg, rgba(255,255,255,.13), rgba(255,255,255,.02) 42%, rgba(255,255,255,.07));
  -webkit-backdrop-filter: blur(9px) saturate(160%) brightness(.93); backdrop-filter: blur(9px) saturate(160%) brightness(.93);
  border: 1px solid rgba(255,255,255,.26);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5), inset 0 -1px 0 rgba(255,255,255,.1), inset 0 0 24px rgba(255,255,255,.06), 0 20px 50px rgba(0,0,0,.22);
}
.chapter::before { opacity: var(--vis); }
.room-controls::before { opacity: var(--pz-in, 1); }
.chapter.ink-dark::before { background: linear-gradient(140deg, rgba(255,255,255,.36), rgba(255,255,255,.16) 45%, rgba(255,255,255,.26)); -webkit-backdrop-filter: blur(10px) saturate(150%) brightness(1.08); backdrop-filter: blur(10px) saturate(150%) brightness(1.08); }
.pos-bl { bottom: calc(8svh + var(--glass-y)); } .pos-tl { top: calc(13svh + var(--glass-y)); }
.pos-br { bottom: calc(8svh + var(--glass-y)); } .pos-tr { top: calc(13svh + var(--glass-y)); }
.pos-bl, .pos-tl { left: calc(5vw + 6px); }
@media (prefers-reduced-transparency: reduce) { .chapter::before, .room-controls::before, .pz-text::before { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(20,18,24,.86); } .chapter.ink-dark::before { background: rgba(250,247,240,.92); } }
@media (max-width: 760px) { .chapter { --glass-x: 14px; --glass-y: 14px; } }

/* pasek ładowania: cienka linia, która rośnie z pobranych bajtów */
.loader-star { position: relative; width: clamp(72px, 9vmin, 104px); aspect-ratio: 1; color: #f7f5f0; }
.loader-star svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ls-line path { fill: none; stroke: currentColor; stroke-width: 1.25px; vector-effect: non-scaling-stroke; stroke-linejoin: round; opacity: .75; }
.ls-fill path { fill: currentColor; }
.ls-level { position: absolute; inset: 0; clip-path: inset(94.5% 0 0); transition: clip-path .4s cubic-bezier(.23, 1, .32, 1); }
/* zachęta do scrolla: pokazuje się po chwili bezruchu, znika przy ruchu */
.zacheta { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 60; width: 18px; height: 30px; margin-left: -9px; opacity: 0; transform: translateY(6px); transition: opacity .25s ease, transform .5s cubic-bezier(.23, 1, .32, 1); pointer-events: none; color: #fff; filter: drop-shadow(0 0 1px rgba(0, 0, 0, .75)) drop-shadow(0 1px 5px rgba(0, 0, 0, .45)); }
.zacheta.in { opacity: .92; transform: none; transition-duration: .7s; }
.zacheta svg { display: block; width: 100%; height: 100%; overflow: visible; }
.zacheta rect { fill: none; stroke: currentColor; stroke-width: 1.8; }
.zacheta .zk { fill: currentColor; }
.zacheta.in .zk { animation: zacheta 1.9s cubic-bezier(.65, 0, .35, 1) infinite; }
@keyframes zacheta { 0% { transform: translateY(-3px); opacity: 0; } 25% { opacity: 1; } 65% { transform: translateY(13px); opacity: 1; } 85%, 100% { transform: translateY(17px); opacity: 0; } }
html:has(.station.on) .zacheta { bottom: calc(92px + env(safe-area-inset-bottom)); }
.scroll-hint { display: none !important; }
@media (prefers-reduced-motion: reduce) { .zacheta.in .zk { animation: none; transform: translateY(6px); } .ls-level { transition: none; } }

/* wąski telefon: przełącznik języka mieści się kosztem licznika prac */
@media (max-width: 385px) { .bar-nav .arch-count { display: none; } }
@media (max-height: 500px) and (orientation: landscape) { .mod-cta { margin-top: 4px; gap: 6px; } .mod-cta a { height: 26px; padding: 0 10px; font-size: 9px; letter-spacing: .06em; } }
@media (max-width: 480px) { .end-links { gap: 0 5px; justify-content: space-between; } .end-links a { padding: 0 8px; letter-spacing: .05em; } }
