/* =========================================================
   pantaran · ciemny, oszczędny styl
   ========================================================= */
:root {
  --bg: #050506;
  --ink: #dbe4e6;
  --muted: #7e8a8e;
  --dim: #48514f;
  --accent: #9fe3ee;
  --line: rgba(219, 228, 230, 0.1);
  --wood-1: #2b1e17;
  --wood-2: #1a120e;
  --wood-3: #120c09;
  --brass: #b49762;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Inter", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --header-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
/* blokada przewijania (otwarta książka): miejsce po pasku przewijania (--sbw, liczy js/shelf.js) zajmuje
   margines, więc strona pod spodem nie przeskakuje i nic nie musi się przerysować */
body.is-locked { overflow: hidden; padding-right: var(--sbw, 0px); }
body.is-locked .site-header { right: var(--sbw, 0px); }
body.is-locked .bg-canvas { width: calc(100% - var(--sbw, 0px)); }
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: rgba(159, 227, 238, 0.25); color: #fff; }
:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.container { width: min(1120px, 100% - 2.5rem); margin-inline: auto; }
.mono { font-family: var(--mono); }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; left: 1rem; top: -4rem; z-index: 300;
  padding: 0.6rem 1rem; background: var(--ink); color: var(--bg); transition: top 0.2s;
}
.skip-link:focus { top: 1rem; }

/* ---------- Tło: pył, ziarno, winieta ---------- */
.bg-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -2; pointer-events: none; }
.grain {
  position: fixed; inset: -48px; z-index: 80; pointer-events: none; opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 0.9s steps(4) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-36px, 24px); }
  50% { transform: translate(24px, -36px); }
  75% { transform: translate(-12px, -24px); }
}
.vignette {
  position: fixed; inset: 0; z-index: 79; pointer-events: none;
  background: radial-gradient(ellipse at 50% 40%, transparent 45%, rgba(0, 0, 0, 0.75) 100%);
}

/* ---------- Nagłówek ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 60;
  transition: background 0.4s, border-color 0.4s;
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled { background: rgba(5, 5, 6, 0.82); border-bottom-color: var(--line); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.nav {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--header-h); width: min(1240px, 100% - 2.5rem); margin-inline: auto;
}
.brand { display: inline-flex; align-items: center; gap: 0.75rem; }
.brand__mark {
  position: relative; width: 18px; height: 18px; border: 1px solid var(--ink); border-radius: 50%;
}
.brand__mark::after {
  content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--ink);
  animation: blinkeye 7s infinite;
}
@keyframes blinkeye { 0%, 46%, 50%, 100% { transform: scaleY(1); } 48% { transform: scaleY(0.1); } }
.brand__name { font-family: var(--serif); font-style: italic; font-size: 1.35rem; letter-spacing: 0.02em; }
.nav__menu { display: flex; gap: 2rem; margin: 0; padding: 0; list-style: none; }
.nav__link {
  position: relative; display: block; padding: 0.4rem 0;
  color: var(--muted); font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.14em; text-transform: lowercase;
  transition: color 0.3s;
}
.nav__link i { font-style: normal; color: var(--dim); margin-right: 0.35rem; }
.nav__link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--ink);
  transform: scaleX(0); transform-origin: right; transition: transform 0.5s var(--ease);
}
.nav__link:hover, .nav__link.is-active { color: var(--ink); }
.nav__link:hover::after, .nav__link.is-active::after { transform: scaleX(1); transform-origin: left; }
.nav__toggle { display: none; }

@media (max-width: 760px) {
  .nav__toggle {
    display: grid; place-content: center; gap: 6px; width: 42px; height: 42px; padding: 0;
    background: none; border: 1px solid var(--line);
  }
  .nav__toggle span { display: block; width: 18px; height: 1px; background: var(--ink); transition: transform 0.3s var(--ease); }
  .menu-open .nav__toggle span:first-child { transform: translateY(3.5px) rotate(45deg); }
  .menu-open .nav__toggle span:last-child { transform: translateY(-3.5px) rotate(-45deg); }
  .nav__menu {
    position: fixed; top: var(--header-h); left: 0; right: 0; flex-direction: column; gap: 0;
    padding: 0.5rem 1.25rem 1.5rem; background: #050506; border-bottom: 1px solid var(--line);
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity 0.25s, transform 0.25s var(--ease), visibility 0.25s;
  }
  .menu-open .nav__menu { opacity: 1; visibility: visible; transform: none; }
  .menu-open .site-header { background: #050506; border-bottom-color: var(--line); }
  .nav__link { padding: 1rem 0; font-size: 0.85rem; border-bottom: 1px solid var(--line); }
  .nav__link::after { display: none; }
}

/* ---------- Wspólne ---------- */
.kicker {
  margin: 0 0 1rem; color: var(--muted);
  font-size: 0.72rem; letter-spacing: 0.24em; text-transform: lowercase;
}
.section { position: relative; padding: clamp(6rem, 12vw, 10rem) 0; }
.section__head { max-width: 620px; margin-bottom: 3.5rem; }
.section__head--center { margin-inline: auto; text-align: center; }
.section__title {
  margin: 0; font-family: var(--serif); font-weight: 400; font-style: italic;
  font-size: clamp(2.6rem, 6vw, 4.4rem); line-height: 1; letter-spacing: -0.01em;
}
.section__lead { margin: 1.2rem 0 0; color: var(--muted); font-size: 1.02rem; }

.js-reveal [data-reveal] {
  opacity: 0; translate: 0 24px; filter: blur(6px);
  transition: opacity 1.2s var(--ease), translate 1.2s var(--ease), filter 1.2s var(--ease);
  transition-delay: var(--d, 0s);
}
.js-reveal [data-reveal].is-visible { opacity: 1; translate: 0 0; filter: none; }

/* ---------- 01 · Hologram ---------- */
.hero { position: relative; height: 100vh; height: 100svh; min-height: 640px; overflow: hidden; }
.holo-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  cursor: grab; touch-action: pan-y; outline: none;
}
.holo-canvas.is-dragging { cursor: grabbing; }
.holo-canvas:focus-visible { box-shadow: inset 0 0 0 1px var(--accent); }
.hero__text, .holo-hud, .holo-hint { pointer-events: none; }
.hero__text {
  position: absolute; left: max(1.25rem, (100% - 1240px) / 2); bottom: 13vh;
  animation: surface 2.2s var(--ease) 0.2s both;
}
.hero__title {
  margin: 0; font-family: var(--serif); font-weight: 400; font-style: italic;
  font-size: clamp(3.8rem, 11vw, 9.5rem); line-height: 0.85; letter-spacing: -0.02em;
}
.hero__title { pointer-events: auto; display: inline-block; }
.hero__sub { margin: 2.2rem 0 0; color: var(--muted); font-size: 1rem; }
@keyframes surface { from { opacity: 0; filter: blur(14px); transform: translateY(20px); } to { opacity: 1; filter: none; transform: none; } }

.holo-hud {
  position: absolute; top: calc(var(--header-h) + 2.5rem); right: max(1.25rem, (100% - 1240px) / 2);
  display: flex; flex-direction: column; align-items: flex-end; gap: 0.2rem;
  color: var(--muted); font-size: 0.7rem; letter-spacing: 0.2em;
}
.holo-hud b { color: var(--ink); font-weight: 400; }
.holo-hud__name {
  font-family: var(--serif); font-style: italic; font-size: 2rem; letter-spacing: 0; color: var(--ink);
  transition: opacity 0.4s, filter 0.4s;
}
.holo-hud__name.is-changing { opacity: 0; filter: blur(6px); }

.holo-forms {
  position: absolute; right: max(1.25rem, (100% - 1240px) / 2); bottom: 13vh;
  display: flex; gap: 0.5rem;
}
/* przełącznik form: aktywny kafelek jest ciemny i szklany (bez białego wypełnienia), żeby nie odciągał wzroku od hologramu */
.holo-form {
  width: 36px; height: 36px; padding: 0; border: 1px solid rgba(255, 255, 255, 0.12); background: rgba(5, 5, 6, 0.4);
  color: var(--dim); font-family: var(--mono); font-size: 0.62rem;
  transition: color 0.35s ease, border-color 0.35s ease, background-color 0.35s ease, box-shadow 0.35s ease;
}
.holo-form:hover { color: var(--ink); border-color: rgba(255, 255, 255, 0.34); background-color: rgba(255, 255, 255, 0.04); }
.holo-form.is-active {
  color: #f2f7f8; background-color: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.65);
  box-shadow: 0 0 14px rgba(159, 227, 238, 0.18), inset 0 0 10px rgba(255, 255, 255, 0.05);
  text-shadow: 0 0 8px rgba(159, 227, 238, 0.45);
}

/* podpowiedź: jasny tekst przy kryciu 0.55; pulsuje powoli, aż ktoś kliknie albo obróci hologram
   (wtedy js/hologram.js dodaje .is-calm i jasność płynnie wraca do 0.55) */
.holo-hint {
  position: absolute; left: 50%; bottom: 6.6rem; margin: 0; transform: translateX(-50%);
  color: var(--ink); font-size: 0.66rem; letter-spacing: 0.2em; white-space: nowrap;
  opacity: 0.55; transition: opacity 0.9s ease;
  animation: hint-pulse 4.8s ease-in-out infinite;
}
.holo-hint.is-calm { animation: none; }
@keyframes hint-pulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 0.75; } }

.scroll-cue {
  position: absolute; left: 50%; bottom: 1.3rem; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 0.6rem;
  color: var(--muted); font-size: 0.62rem; letter-spacing: 0.24em;
}
/* kreska pod „zejdź niżej”: cienka szyna (::before) i spadająca po niej kropla światła (::after).
   Kropla jest gradientem z jasną główką i jedzie przez transform, więc animację liczy kompozytor. */
.scroll-cue i { position: relative; width: 11px; height: 34px; overflow: hidden; }
.scroll-cue i::before {
  content: ""; position: absolute; left: 5px; top: 0; bottom: 0; width: 1px;
  background: linear-gradient(to bottom, rgba(219, 228, 230, 0.05), rgba(219, 228, 230, 0.16) 45%, rgba(219, 228, 230, 0.05));
}
.scroll-cue i::after {
  content: ""; position: absolute; left: 5px; top: 0; width: 1px; height: 16px;
  background: linear-gradient(to bottom, rgba(159, 227, 238, 0), rgba(159, 227, 238, 0.6) 65%, #f4fdff);
  filter: drop-shadow(0 0 2px rgba(159, 227, 238, 0.9));
  opacity: 0; transform: translateY(-16px); will-change: transform, opacity;
  animation: cue-drop 2.4s cubic-bezier(0.55, 0, 0.35, 1) infinite;
}
@keyframes cue-drop {
  0% { opacity: 0; transform: translateY(-16px); }
  15% { opacity: 1; }
  78% { opacity: 1; }
  100% { opacity: 0; transform: translateY(34px); }
}

@media (max-width: 760px) {
  .hero__text { bottom: calc(9rem + 2vh); }
  .holo-hud { top: calc(var(--header-h) + 1.2rem); }
  .holo-hud__name { font-size: 1.5rem; }
  .holo-forms { left: 1.25rem; right: auto; bottom: 5.4rem; }
  .holo-hint { display: none; }
}

/* ---------- Liquid glass (wspólne) ----------
   Warstwy: lekko zabarwione tło, rozmycie z nasyceniem, fazowanie krawędzi (jasne u góry z lewej,
   ciemne u dołu z prawej), obwódka Fresnela (::before) i połysk podążający za kursorem (::after).
   W Chromium js/glass.js dokłada prawdziwe załamanie tła na krawędziach. */
.glass {
  position: relative; isolation: isolate;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.02) 42%, rgba(255, 255, 255, 0.01) 60%, rgba(255, 255, 255, 0.07));
  -webkit-backdrop-filter: blur(12px) saturate(170%) brightness(1.06); backdrop-filter: blur(12px) saturate(170%) brightness(1.06);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55), inset 1px 0 0 rgba(255, 255, 255, 0.2),
    inset 0 -1px 0 rgba(255, 255, 255, 0.08), inset -1px 0 0 rgba(255, 255, 255, 0.06),
    inset 14px 18px 32px -26px rgba(255, 255, 255, 0.5), inset -16px -20px 34px -24px rgba(0, 0, 0, 0.55),
    0 34px 70px -34px rgba(0, 0, 0, 0.9);
}
.glass::before, .spine::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; padding: 1.2px; pointer-events: none;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.18) 22%, rgba(255, 255, 255, 0) 45%, rgba(255, 255, 255, 0) 62%, rgba(180, 210, 255, 0.3) 82%, rgba(255, 255, 255, 0.6));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.glass::after {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: radial-gradient(260px circle at var(--mx, 22%) var(--my, 0%), rgba(255, 255, 255, 0.14), transparent 62%);
}

/* ---------- 02 · Profile: półka w kosmosie ---------- */
.profiles { padding: 0; }
/* overflow: clip przycina jak hidden, ale kontenera nie da się przewinąć,
   więc fizyka slime'a i układ półki zawsze się zgadzają */
.wall {
  position: relative; display: flow-root; overflow: hidden; overflow: clip;
  min-height: 100vh; min-height: 100svh; padding: clamp(7rem, 13vw, 10rem) 0 clamp(9rem, 16vw, 12rem);
}
/* kosmos w pixel art: canvas w niskiej rozdzielczości, powiększany bez wygładzania (rozmiar ustawia js/space.js) */
.space {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%; max-width: none; pointer-events: none;
  image-rendering: crisp-edges; image-rendering: pixelated;
  opacity: 0.25; transition: opacity 1.4s var(--ease);
}
.theme-space .space { opacity: 1; }
.slime-canvas { position: absolute; inset: 0; z-index: 5; width: 100%; height: 100%; pointer-events: none; }
.wall.is-slime-hover, .wall.is-slime-hover * { cursor: grab !important; }
.wall.is-slime-held, .wall.is-slime-held * { cursor: grabbing !important; }

.space-head { position: relative; z-index: 2; max-width: 560px; margin-bottom: clamp(2.5rem, 6vw, 4rem); }
.space-head__panel { padding: 2rem 2.4rem 2.2rem; border-radius: 30px; }
.space-head .kicker { color: rgba(200, 222, 255, 0.72); }
.space-head .section__title { text-shadow: 0 0 34px rgba(160, 200, 255, 0.28); }
.space-head .section__lead { color: rgba(214, 226, 240, 0.72); }
@media (max-width: 560px) { .space-head__panel { padding: 1.6rem 1.4rem 1.7rem; border-radius: 24px; } }

/* motyw strony, gdy półka jest na środku ekranu */
.site-header { transition: background 0.6s, border-color 0.6s, box-shadow 0.6s; }
.theme-space .site-header.is-scrolled {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
  border-bottom-color: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 10px 30px -12px rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(18px) saturate(180%); backdrop-filter: blur(18px) saturate(180%);
}
.bg-canvas, .grain { transition: opacity 1.2s; }
.theme-space .bg-canvas { opacity: 0; }
.theme-space .grain { opacity: 0.03; }

.shelf { position: relative; z-index: 3; width: min(720px, 92vw); margin: 0 auto; }
/* półka unosi się w próżni */
.shelf__float { position: relative; animation: levitate 7s ease-in-out infinite; }
@keyframes levitate { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
.shelf__books {
  --books-h: clamp(270px, 42vw, 370px); --gap: 12px;
  position: relative; display: flex; align-items: flex-end; justify-content: center; gap: var(--gap);
  height: var(--books-h); padding: 0 8%; perspective: 900px;
}
/* gruba tafla szkła podświetlona od krawędzi */
.shelf__plank {
  position: relative; height: 24px; border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.34) 0, rgba(255, 255, 255, 0.08) 3px, rgba(190, 225, 255, 0.05) 40%, rgba(120, 170, 255, 0.14) 100%);
  -webkit-backdrop-filter: blur(3px) saturate(180%); backdrop-filter: blur(3px) saturate(180%);
  box-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, 0.8), inset 0 -1px 0 rgba(160, 210, 255, 0.4),
    inset 0 -8px 14px -8px rgba(140, 200, 255, 0.4), inset 0 0 0 1px rgba(255, 255, 255, 0.14),
    0 0 30px -6px rgba(150, 205, 255, 0.4), 0 40px 50px -26px rgba(0, 0, 0, 0.9);
}
.shelf__plank::before {
  content: ""; position: absolute; left: 14px; right: 14px; top: 50%; height: 1px; opacity: 0.6;
  background: linear-gradient(90deg, transparent, rgba(190, 230, 255, 0.6) 20%, #fff 50%, rgba(190, 230, 255, 0.6) 80%, transparent);
}
.shelf__plank::after {
  content: ""; position: absolute; left: 6%; width: 30%; top: 2px; height: 5px; border-radius: 99px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent); filter: blur(1.5px);
}
/* dwa emitery antygrawitacji pod półką */
.shelf__emitters { position: absolute; left: 0; right: 0; top: 100%; height: 0; pointer-events: none; }
.shelf__emitters i {
  position: absolute; top: 4px; width: 46px; height: 12px; border-radius: 50%;
  background: radial-gradient(ellipse at 50% 30%, #fff, rgba(150, 215, 255, 0.65) 35%, rgba(120, 170, 255, 0) 70%);
  animation: emit 2.6s ease-in-out infinite;
}
.shelf__emitters i:nth-child(1) { left: calc(16% - 23px); }
.shelf__emitters i:nth-child(2) { right: calc(16% - 23px); animation-delay: -1.3s; }
.shelf__emitters i::after {
  content: ""; position: absolute; left: 50%; top: 6px; width: 130px; height: 160px; transform: translateX(-50%);
  background: radial-gradient(ellipse 50% 100% at 50% 0, rgba(140, 200, 255, 0.24), rgba(140, 200, 255, 0) 72%);
  clip-path: polygon(42% 0, 58% 0, 100% 100%, 0 100%);
}
@keyframes emit { 0%, 100% { opacity: 0.7; } 50% { opacity: 1; } }
.shelf__whisper {
  position: relative; z-index: 3; min-height: 1.5em; margin: 7rem 0 0; color: rgba(200, 220, 255, 0.62); text-align: center;
  font-size: 0.72rem; letter-spacing: 0.22em; transition: opacity 0.6s;
}

/* grzbiety: przezroczyste, zabarwione bloki szkła. Boki są ciemniej zabarwione (grubsza warstwa szkła),
   lewa krawędź łapie światło słońca, pod spodem pada kolorowe światło przechodzące przez szkło */
.spine {
  --lift: 0px; --tilt: 0deg;
  position: relative; flex: none; width: var(--wd); height: var(--h); padding: 14px 0 12px; isolation: isolate;
  display: flex; flex-direction: column; align-items: center; overflow: hidden;
  border: 0; border-radius: 8px 8px 5px 5px;
  color: rgba(245, 250, 255, 0.92);
  background:
    linear-gradient(90deg, rgba(var(--tint), 0.36) 0%, rgba(var(--tint), 0.12) 18%, rgba(var(--tint), 0.05) 50%, rgba(var(--tint), 0.1) 80%, rgba(var(--tint), 0.32) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0) 30%, rgba(var(--tint), 0.08));
  -webkit-backdrop-filter: blur(2.5px) saturate(190%) brightness(1.1); backdrop-filter: blur(2.5px) saturate(190%) brightness(1.1);
  box-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, 0.75), inset 1.5px 0 0 rgba(255, 255, 255, 0.4),
    inset -1px 0 0 rgba(255, 255, 255, 0.18), inset 0 -1px 0 rgba(var(--tint), 0.5),
    inset 7px 0 12px -8px rgba(255, 255, 255, 0.35), inset -9px 0 14px -9px rgba(var(--tint), 0.6),
    0 0 34px -12px rgba(var(--tint), 0.85), 0 16px 24px -14px rgba(var(--tint), 0.7);
  transform: translateY(var(--lift)) rotate(var(--tilt));
  transform-origin: 100% 100%;
  transition: transform 0.5s var(--ease), box-shadow 0.4s, opacity 0.5s;
}
.spine::before { padding: 1px; background: linear-gradient(160deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.2) 20%, rgba(255, 255, 255, 0) 45%, rgba(var(--tint), 0.4) 75%, rgba(255, 255, 255, 0.55)); }
.spine::after {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background:
    radial-gradient(130px circle at var(--mx, 30%) var(--my, 12%), rgba(255, 255, 255, 0.3), transparent 55%),
    linear-gradient(90deg, transparent 9%, rgba(255, 255, 255, 0.32) 13%, rgba(255, 255, 255, 0.06) 19%, transparent 26%),
    linear-gradient(90deg, transparent 74%, rgba(255, 255, 255, 0.12) 80%, transparent 86%),
    linear-gradient(170deg, transparent 42%, rgba(255, 255, 255, 0.22) 50%, transparent 58%) 0 120% / 100% 300% no-repeat;
  animation: sheen 8s var(--ease) infinite;
}
.spine:nth-child(2)::after { animation-delay: -2s; }
.spine:nth-child(3)::after { animation-delay: -4s; }
.spine:nth-child(4)::after { animation-delay: -6s; }
@keyframes sheen {
  0%, 60% { background-position: 0 0, 0 0, 0 0, 0 120%; }
  100% { background-position: 0 0, 0 0, 0 0, 0 -120%; }
}
.spine__cap {
  flex: none; width: 72%; height: 5px; border-radius: 3px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.08));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35), 0 0 10px rgba(var(--tint), 0.75);
}
.spine__cap--b { margin-top: auto; }
.spine__logo { flex: none; width: 26px; height: 26px; margin-top: 16px; filter: drop-shadow(0 0 6px rgba(var(--tint), 0.95)); }
.spine__title {
  flex: 1; display: flex; align-items: center; margin: 14px 0;
  writing-mode: vertical-rl; transform: rotate(180deg);
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.32em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9); text-shadow: 0 0 10px rgba(var(--tint), 0.95), 0 1px 0 rgba(0, 0, 0, 0.35);
}
.spine:hover, .spine:focus-visible {
  --lift: -16px;
  box-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, 0.85), inset 1.5px 0 0 rgba(255, 255, 255, 0.5),
    inset -1px 0 0 rgba(255, 255, 255, 0.25), inset 0 -1px 0 rgba(var(--tint), 0.6),
    inset 8px 0 14px -8px rgba(255, 255, 255, 0.45), inset -10px 0 16px -9px rgba(var(--tint), 0.75),
    0 0 50px -10px rgba(var(--tint), 1), 0 30px 40px -20px rgba(var(--tint), 0.6);
}
/* ostatni tom opiera się o sąsiada: obrót wokół lewego dolnego rogu,
   a odstęp u dołu jest tak dobrany, żeby lewa krawędź dotykała górnego rogu sąsiedniej książki */
.spine--lean { --tilt: -7deg; transform-origin: 0 100%; margin-left: calc(var(--books-h) * 0.1 - var(--gap)); }
.spine--lean:hover, .spine--lean:focus-visible { --tilt: -2deg; }
/* wyjęty tom: na jego miejscu zostaje luka, a książkę rysuje js/tome.js */
.spine.is-pulled { visibility: hidden; opacity: 0; transition: none; }
/* odłożony tom: grzbiet przenika się z książką, która właśnie stanęła w luce (czas = Tome.LAND_MS) */
.spine.is-landing { transition: opacity 0.26s linear, transform 0.5s var(--ease), box-shadow 0.4s; }
/* fokus wraca na odłożony tom: obwódka zostaje, ale książka nie podskakuje zaraz po odłożeniu */
.spine.is-returned:focus-visible:not(:hover) { --lift: 0px; }
.spine--lean.is-returned:focus-visible:not(:hover) { --tilt: -7deg; }
/* gdy książki nie ma na półce, półka nie unosi się: luka czeka w tym samym miejscu */
.shelf.is-reading .shelf__float { animation-play-state: paused; }
@media (max-width: 560px) {
  .shelf__books { --gap: 8px; padding: 0 4%; }
  .spine { width: calc(var(--wd) * 0.78); }
  .spine__logo { width: 22px; height: 22px; }
  .spine__title { font-size: 0.62rem; letter-spacing: 0.22em; }
}

/* ---------- Otwierana książka w 3D (js/tome.js) ----------
   Cała książka jest ze szkła, jak grzbiety na półce: zabarwione tafle z jasnymi krawędziami,
   przez które widać rozmyte tło, i szklane kartki. Pudełko z sześciu ścian: okładki, grzbiet
   i trzy krawędzie bloku kartek. Rozmiary podaje JS: --w (szerokość okładki), --h (wysokość), --t (grubość),
   a --kx/--ky dopasowują zawartość grzbietu (ma rozmiar grzbietu z półki) do ścianki grzbietu. */
@keyframes blink { 50% { opacity: 0; } }
.tome { --tint: 159, 227, 238; position: fixed; inset: 0; z-index: 140; overflow: hidden; perspective: 1700px; }
.tome[hidden] { display: none; }
.tome__dim {
  position: absolute; inset: 0; opacity: 0;
  background: radial-gradient(ellipse 62% 56% at 50% 50%, rgba(var(--tint), 0.12), rgba(3, 3, 8, 0.6) 62%, rgba(3, 3, 8, 0.85));
  -webkit-backdrop-filter: blur(6px) saturate(130%); backdrop-filter: blur(6px) saturate(130%);
}
.tome__flash {
  position: absolute; inset: 0; opacity: 0; pointer-events: none;
  background: radial-gradient(circle at 50% 50%, #fff 0, rgba(var(--tint), 0.95) 16%, rgba(var(--tint), 0.35) 42%, #020203 78%);
}
.tome__book {
  position: absolute; left: 50%; top: 50%; width: var(--w); height: var(--h);
  margin: calc(var(--h) / -2) 0 0 calc(var(--w) / -2); transform-style: preserve-3d; will-change: transform;
}
.tome__face { position: absolute; -webkit-backface-visibility: hidden; backface-visibility: hidden; }

/* tylna okładka */
.tome__back {
  inset: 0; border-radius: 16px 4px 4px 16px; transform: rotateY(180deg) translateZ(calc(var(--t) / 2));
  background:
    linear-gradient(200deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.03) 45%, rgba(255, 255, 255, 0.08)),
    linear-gradient(160deg, rgba(var(--tint), 0.26), rgba(var(--tint), 0.1));
  -webkit-backdrop-filter: blur(14px) saturate(170%); backdrop-filter: blur(14px) saturate(170%);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.7), inset -1.5px 0 0 rgba(255, 255, 255, 0.4), inset 1px 0 0 rgba(255, 255, 255, 0.2), inset 0 0 50px rgba(var(--tint), 0.2);
}

/* grzbiet: ścianka jest tylko ramą, a jej zawartość wygląda dokładnie jak szklany grzbiet na półce
   (ten sam rozmiar, tło, krawędzie), więc przy odkładaniu oba się pokrywają */
.tome__spine {
  left: calc(50% - var(--t) / 2); top: 0; width: var(--t); height: var(--h);
  transform: rotateY(-90deg) translateZ(calc(var(--w) / 2));
}
.tome__spine-in {
  position: absolute; left: 0; top: 0; width: var(--sw); height: var(--sh); padding: 14px 0 12px; isolation: isolate;
  display: flex; flex-direction: column; align-items: center; overflow: hidden; border-radius: 8px 8px 5px 5px;
  color: rgba(245, 250, 255, 0.92);
  transform: scale(var(--kx), var(--ky)); transform-origin: 0 0;
  background:
    linear-gradient(90deg, rgba(var(--tint), 0.36) 0%, rgba(var(--tint), 0.12) 18%, rgba(var(--tint), 0.05) 50%, rgba(var(--tint), 0.1) 80%, rgba(var(--tint), 0.32) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0) 30%, rgba(var(--tint), 0.08));
  -webkit-backdrop-filter: blur(2.5px) saturate(190%) brightness(1.1); backdrop-filter: blur(2.5px) saturate(190%) brightness(1.1);
  box-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, 0.75), inset 1.5px 0 0 rgba(255, 255, 255, 0.4),
    inset -1px 0 0 rgba(255, 255, 255, 0.18), inset 0 -1px 0 rgba(var(--tint), 0.5),
    inset 7px 0 12px -8px rgba(255, 255, 255, 0.35), inset -9px 0 14px -9px rgba(var(--tint), 0.6);
}
.tome__spine-in::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.2) 20%, rgba(255, 255, 255, 0) 45%, rgba(var(--tint), 0.4) 75%, rgba(255, 255, 255, 0.55));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.tome__spine-in::after {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background:
    radial-gradient(130px circle at 30% 12%, rgba(255, 255, 255, 0.3), transparent 55%),
    linear-gradient(90deg, transparent 9%, rgba(255, 255, 255, 0.32) 13%, rgba(255, 255, 255, 0.06) 19%, transparent 26%),
    linear-gradient(90deg, transparent 74%, rgba(255, 255, 255, 0.12) 80%, transparent 86%);
}

/* krawędzie bloku kartek: warstwy szklanych tafli, w których świeci światło */
.tome__edge--fore {
  left: calc(50% - var(--t) / 2); top: 5px; width: var(--t); height: calc(var(--h) - 10px);
  transform: rotateY(90deg) translateZ(calc(var(--w) / 2 - 4px));
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.55) 0 1px, rgba(var(--tint), 0.08) 1px 5px),
    linear-gradient(90deg, rgba(var(--tint), 0.32), rgba(255, 255, 255, 0.1) 50%, rgba(var(--tint), 0.32));
  box-shadow: inset 0 0 14px rgba(var(--tint), 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}
.tome__edge--top, .tome__edge--bottom {
  left: 2px; top: calc(50% - var(--t) / 2); width: calc(var(--w) - 6px); height: var(--t);
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.55) 0 1px, rgba(var(--tint), 0.08) 1px 5px),
    linear-gradient(0deg, rgba(var(--tint), 0.32), rgba(255, 255, 255, 0.1) 50%, rgba(var(--tint), 0.32));
  box-shadow: inset 0 0 14px rgba(var(--tint), 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}
.tome__edge--top { transform: rotateX(90deg) translateZ(calc(var(--h) / 2 - 5px)); }
.tome__edge--bottom { transform: rotateX(-90deg) translateZ(calc(var(--h) / 2 - 5px)); }

/* pierwsza strona: matowa, jasna tafla z jarzącym się portalem */
.tome__page, .tome__leaf { left: 1px; top: 5px; width: calc(var(--w) - 5px); height: calc(var(--h) - 10px); }
.tome__page {
  transform: translateZ(calc(var(--t) / 2 - 3px)); overflow: hidden; border-radius: 2px 12px 12px 2px;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 9% 10% 10%;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.2) 0, rgba(255, 255, 255, 0.07) 7%, rgba(255, 255, 255, 0.1) 70%, rgba(255, 255, 255, 0.18) 100%),
    rgba(var(--tint), 0.06);
  -webkit-backdrop-filter: blur(18px) saturate(160%) brightness(1.08); backdrop-filter: blur(18px) saturate(160%) brightness(1.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), inset -1px 0 0 rgba(255, 255, 255, 0.45), inset 0 -1px 0 rgba(255, 255, 255, 0.25), inset 0 0 40px rgba(var(--tint), 0.12);
  color: #fff; text-align: center;
}
.tome__pg-vol { position: relative; z-index: 1; margin: 0; font-family: var(--mono); font-size: calc(var(--h) * 0.021); letter-spacing: 0.24em; text-transform: uppercase; color: rgba(255, 255, 255, 0.75); }
.tome__pg-line { position: relative; z-index: 1; margin: 0; font-family: var(--serif); font-style: italic; font-size: calc(var(--h) * 0.05); text-shadow: 0 0 18px rgba(var(--tint), 0.9); }
.tome__portal {
  position: absolute; left: 50%; top: 50%; width: 66%; aspect-ratio: 1; border-radius: 50%; transform: translate(-50%, -50%);
  background: radial-gradient(circle, #fff 0, rgba(var(--tint), 1) 14%, rgba(var(--tint), 0.55) 34%, rgba(var(--tint), 0.12) 56%, rgba(var(--tint), 0) 70%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35), 0 0 0 calc(var(--h) * 0.028) rgba(var(--tint), 0.1);
}
/* przewracane kartki: cienkie szklane tafle z delikatnymi liniami */
.tome__leaf { position: absolute; transform-style: preserve-3d; transform-origin: left center; }
.tome__leaf-a, .tome__leaf-b {
  inset: 0; border-radius: 2px 12px 12px 2px;
  background:
    repeating-linear-gradient(180deg, transparent 0 calc(var(--h) * 0.028), rgba(255, 255, 255, 0.13) calc(var(--h) * 0.028) calc(var(--h) * 0.028 + 1px)) 50% 50% / 72% 66% no-repeat,
    linear-gradient(90deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.04) 12%, rgba(var(--tint), 0.05) 80%, rgba(255, 255, 255, 0.12));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.65);
}
.tome__leaf-b { transform: rotateY(180deg); border-radius: 12px 2px 2px 12px; }

/* okładka: na zewnątrz zabarwione szkło z projektem tomu, w środku szklana wyklejka z ekslibrisem */
.tome__cover { position: absolute; inset: 0; transform-origin: left center; translate: 0 0 calc(var(--t) / 2); transform-style: preserve-3d; }
.tome__cover-out {
  inset: 0; overflow: hidden; border-radius: 4px 16px 16px 4px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(var(--h) * 0.02);
  padding: 10%; text-align: center; color: #fff;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.26) 0%, rgba(255, 255, 255, 0.07) 30%, rgba(255, 255, 255, 0) 52%, rgba(255, 255, 255, 0.05) 80%, rgba(255, 255, 255, 0.14) 100%),
    linear-gradient(170deg, rgba(var(--tint), 0.34), rgba(var(--tint), 0.1) 55%, rgba(var(--tint), 0.24));
  -webkit-backdrop-filter: blur(14px) saturate(180%) brightness(1.08); backdrop-filter: blur(14px) saturate(180%) brightness(1.08);
  box-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, 0.8), inset 1.5px 0 0 rgba(255, 255, 255, 0.45),
    inset -1px 0 0 rgba(255, 255, 255, 0.28), inset 0 -1px 0 rgba(var(--tint), 0.7),
    inset 14px 0 22px -16px rgba(255, 255, 255, 0.5), inset -16px 0 26px -18px rgba(var(--tint), 0.8),
    inset 0 0 60px rgba(var(--tint), 0.18), 0 0 60px -14px rgba(var(--tint), 0.75);
}
/* szklany „zawias” przy grzbiecie */
.tome__cover-out::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.3) 0, rgba(255, 255, 255, 0.04) 2.6%, transparent 5%, rgba(255, 255, 255, 0.3) 5.6%, rgba(255, 255, 255, 0.04) 6.6%, transparent 8%);
}
.tome__art { position: absolute; inset: 0; pointer-events: none; }
/* odblask, który przesuwa się po szkle */
.tome__gloss {
  position: absolute; inset: -20% -60%; pointer-events: none;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.26) 46.5%, rgba(255, 255, 255, 0.05) 52%, transparent 60%);
  animation: tome-sheen 3.4s var(--ease) infinite;
}
@keyframes tome-sheen { 0% { transform: translateX(-45%); } 60%, 100% { transform: translateX(45%); } }
.tome__mark {
  position: relative; flex: none; display: grid; place-items: center; width: calc(var(--h) * 0.2); height: calc(var(--h) * 0.2); border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0.08) 45%, rgba(var(--tint), 0.2) 78%);
  box-shadow: 0 0 calc(var(--h) * 0.06) rgba(var(--tint), 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.7), inset 0 -6px 14px rgba(var(--tint), 0.35);
}
.tome__mark-svg { width: calc(var(--h) * 0.1); height: calc(var(--h) * 0.1); color: #fff; filter: drop-shadow(0 0 8px rgba(var(--tint), 1)); }
.tome__vol { position: relative; margin: 0; font-family: var(--mono); font-size: calc(var(--h) * 0.022); letter-spacing: 0.3em; text-transform: uppercase; color: rgba(255, 255, 255, 0.85); text-shadow: 0 0 10px rgba(var(--tint), 0.9); }
.tome__name { position: relative; margin: 0; font-family: var(--serif); font-style: italic; font-size: calc(var(--h) * 0.1); line-height: 1; text-shadow: 0 0 24px rgba(var(--tint), 0.8), 0 1px 0 rgba(0, 0, 0, 0.25); }
.tome__sub { position: relative; margin: 0; font-family: var(--mono); font-size: calc(var(--h) * 0.02); letter-spacing: 0.26em; color: rgba(255, 255, 255, 0.7); }
.tome__cover-in {
  inset: 0; transform: rotateY(180deg); overflow: hidden; border-radius: 16px 4px 4px 16px; display: grid; place-items: center;
  background:
    radial-gradient(circle at 30% 22%, rgba(var(--tint), 0.3), transparent 60%),
    linear-gradient(200deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.03) 50%, rgba(255, 255, 255, 0.1)),
    rgba(var(--tint), 0.08);
  -webkit-backdrop-filter: blur(14px) saturate(170%); backdrop-filter: blur(14px) saturate(170%);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.6), inset -1.5px 0 0 rgba(255, 255, 255, 0.35), inset 1px 0 0 rgba(255, 255, 255, 0.2), inset -16px 0 24px -16px rgba(255, 255, 255, 0.35), inset 0 0 50px rgba(var(--tint), 0.16);
}
.tome__exlibris {
  padding: 10% 12%; border: 1px solid rgba(255, 255, 255, 0.4); border-radius: 14px; color: #fff; text-align: center;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.04));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 0 30px -8px rgba(var(--tint), 0.6);
}
.tome__ex-small { margin: 0; font-family: var(--mono); font-size: calc(var(--h) * 0.018); letter-spacing: 0.3em; text-transform: uppercase; color: rgba(255, 255, 255, 0.85); }
.tome__ex-name { margin: 0.25em 0; font-family: var(--serif); font-style: italic; font-size: calc(var(--h) * 0.07); line-height: 1.1; text-shadow: 0 0 18px rgba(var(--tint), 0.8); }
.tome__ex-rule { width: 70%; height: 1px; margin: 0.7em auto; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9), transparent); }

/* okładki tomów: to samo szkło, inny wzór */
.tome[data-book="steam"] .tome__art {
  background:
    repeating-linear-gradient(0deg, rgba(190, 230, 255, 0.22) 0 1px, transparent 1px calc(var(--h) * 0.045)),
    repeating-linear-gradient(90deg, rgba(190, 230, 255, 0.22) 0 1px, transparent 1px calc(var(--h) * 0.045));
  -webkit-mask: linear-gradient(transparent 52%, #000); mask: linear-gradient(transparent 52%, #000);
}
.tome[data-book="steam"] .tome__name { font-family: "Orbitron", var(--sans); font-style: normal; font-weight: 900; font-size: calc(var(--h) * 0.075); letter-spacing: 0.12em; padding-left: 0.12em; }
.tome[data-book="github"] .tome__cover-out { justify-content: flex-start; padding-top: 16%; }
.tome[data-book="github"] .tome__art { inset: auto 12% 8% 12%; display: grid; grid-template-columns: repeat(14, 1fr); gap: calc(var(--h) * 0.007); }
.tome__cell { aspect-ratio: 1; border-radius: 2px; background: rgba(225, 215, 255, calc(0.06 + var(--l) * 0.17)); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12); }
.tome[data-book="github"] .tome__name { font-family: var(--mono); font-style: normal; font-size: calc(var(--h) * 0.068); }
.tome[data-book="instagram"] .tome__cover-out {
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.26) 0%, rgba(255, 255, 255, 0.06) 32%, rgba(255, 255, 255, 0) 52%, rgba(255, 255, 255, 0.12) 100%),
    radial-gradient(circle at 18% 112%, rgba(254, 218, 117, 0.55) 0, rgba(250, 126, 30, 0.45) 24%, rgba(214, 41, 118, 0.42) 46%, rgba(150, 47, 191, 0.4) 70%, rgba(79, 91, 213, 0.4) 94%);
}
.tome[data-book="instagram"] .tome__art { inset: 8% 9% 8% 12%; border: 1px solid rgba(255, 255, 255, 0.6); border-radius: 16%; box-shadow: inset 0 0 40px rgba(255, 255, 255, 0.16), 0 0 18px rgba(255, 255, 255, 0.12); }
.tome[data-book="onlyfans"] .tome__art {
  inset: auto 8% 9% auto; width: 34%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 28%, #fff3b0, #ffd23f 45%, #f2b600); transform: rotate(-14deg);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
.tome[data-book="onlyfans"] .tome__art::after { content: "18+?"; color: #1a1300; font-family: var(--sans); font-weight: 800; font-size: calc(var(--h) * 0.04); }

/* ---------- Otwarta książka: światy (js/worlds.js) ---------- */
.vault { --tint: 159, 227, 238; position: fixed; inset: 0; z-index: 150; overflow: hidden; background: #020203; opacity: 0; transition: opacity 0.5s var(--ease); }
.vault.is-in { opacity: 1; }
.vault[hidden] { display: none; }
.vault__fx { position: absolute; inset: 0; width: 100%; height: 100%; }
.world { position: absolute; inset: 0; display: none; }
.vault[data-world="steam"] .world--steam { display: block; }
.vault[data-world="github"] .world--github { display: grid; }
.vault[data-world="instagram"] .world--instagram { display: flex; }
.vault__close {
  position: absolute; top: 1.2rem; right: 1.2rem; z-index: 5; display: grid; place-items: center;
  width: 46px; height: 46px; padding: 0; border: 0; border-radius: 50%; color: #fff;
}
.vault__close svg { width: 18px; height: 18px; }

/* tom I · Steam: HUD z gry nad neonowym horyzontem */
.world--steam { color: #eaf6ff; }
.hud { position: absolute; inset: clamp(14px, 3vw, 34px); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.hud__bar {
  position: absolute; top: 0; left: 0; right: 4.2rem; display: flex; justify-content: space-between; gap: 1rem; padding: 0.5rem 0.2rem;
  font-size: 0.64rem; letter-spacing: 0.22em; text-transform: uppercase; color: rgba(var(--tint), 0.85);
}
.hud__sig { display: inline-flex; align-items: flex-end; gap: 3px; }
.hud__sig i { width: 4px; background: rgb(var(--tint)); box-shadow: 0 0 6px rgba(var(--tint), 0.9); animation: sig 1.8s steps(1) infinite; }
.hud__sig i:nth-child(1) { height: 5px; }
.hud__sig i:nth-child(2) { height: 8px; animation-delay: 0.2s; }
.hud__sig i:nth-child(3) { height: 11px; animation-delay: 0.4s; }
.hud__sig i:nth-child(4) { height: 14px; animation-delay: 0.6s; }
@keyframes sig { 0%, 70% { opacity: 1; } 85% { opacity: 0.25; } }
.hud__corner { position: absolute; width: 28px; height: 28px; border: 2px solid rgba(var(--tint), 0.8); filter: drop-shadow(0 0 6px rgba(var(--tint), 0.8)); }
.hud__corner--tl { top: 2.6rem; left: 0; border-right: 0; border-bottom: 0; }
.hud__corner--tr { top: 2.6rem; right: 0; border-left: 0; border-bottom: 0; }
.hud__corner--bl { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.hud__corner--br { bottom: 0; right: 0; border-left: 0; border-top: 0; }
.hud__panel {
  --cut: 20px; position: relative; isolation: isolate; width: min(460px, 100%);
  display: flex; flex-direction: column; align-items: center; gap: 0.7rem; text-align: center;
  padding: clamp(1.6rem, 4vw, 2.4rem) clamp(1.3rem, 4vw, 2.4rem);
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  background: linear-gradient(160deg, rgba(var(--tint), 0.9), rgba(var(--tint), 0.15) 35%, rgba(var(--tint), 0.15) 65%, rgba(var(--tint), 0.8));
  opacity: 0;
}
.hud__panel::before {
  content: ""; position: absolute; inset: 1px; z-index: -1;
  clip-path: polygon(calc(var(--cut) - 0.4px) 0, 100% 0, 100% calc(100% - var(--cut) + 0.4px), calc(100% - var(--cut) + 0.4px) 100%, 0 100%, 0 calc(var(--cut) - 0.4px));
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 3px), linear-gradient(180deg, rgba(8, 24, 46, 0.88), rgba(3, 9, 20, 0.94));
}
.hud__emblem { position: relative; display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; border: 1px solid rgba(var(--tint), 0.7); box-shadow: 0 0 26px rgba(var(--tint), 0.6), inset 0 0 18px rgba(var(--tint), 0.35); }
.hud__emblem::before { content: ""; position: absolute; inset: -9px; border-radius: 50%; border: 1px dashed rgba(var(--tint), 0.55); animation: spin 14s linear infinite; }
.hud__emblem svg { width: 36px; height: 36px; color: #fff; filter: drop-shadow(0 0 8px rgba(var(--tint), 1)); }
.hud__kicker { margin: 0.4rem 0 0; font-size: 0.64rem; letter-spacing: 0.3em; text-transform: uppercase; color: rgba(var(--tint), 0.95); }
.hud__title {
  position: relative; margin: 0; padding-left: 0.14em; font-family: "Orbitron", var(--sans); font-weight: 900;
  font-size: clamp(2.6rem, 9vw, 4.4rem); line-height: 1; letter-spacing: 0.14em; color: #f2faff;
  text-shadow: 0 0 22px rgba(var(--tint), 0.9), 0 0 2px #fff;
}
.hud__title::before, .hud__title::after { content: attr(data-text); position: absolute; inset: 0; padding-left: 0.14em; opacity: 0; }
.hud__title::before { color: #ff4fd8; clip-path: inset(8% 0 56% 0); animation: glitch 4.2s steps(1) infinite; }
.hud__title::after { color: #4ff6ff; clip-path: inset(56% 0 10% 0); animation: glitch 4.2s steps(1) 0.12s infinite; }
@keyframes glitch {
  0%, 90%, 100% { opacity: 0; transform: none; }
  91% { opacity: 0.85; transform: translate(-5px, 1px); }
  93% { opacity: 0.85; transform: translate(4px, -1px); }
  95% { opacity: 0; }
}
.hud__btn {
  --cut: 12px; display: inline-flex; align-items: center; gap: 0.9rem; margin-top: 0.9rem; padding: 0.8rem 1.6rem 0.8rem 1.1rem;
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  background: linear-gradient(90deg, rgb(var(--tint)), #a8ecff); color: #04101e;
  font-family: "Orbitron", var(--sans); font-weight: 700; font-size: 0.82rem; letter-spacing: 0.16em; text-transform: uppercase;
  transition: filter 0.25s, transform 0.25s;
}
.hud__btn:hover, .hud__btn:focus-visible { filter: brightness(1.18); transform: translateY(-2px); }
.hud__btn-key { animation: blink 1.1s steps(1) infinite; }
.hud__btn-txt { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.hud__btn-txt small { font-family: var(--mono); font-weight: 500; font-size: 0.6rem; letter-spacing: 0.2em; opacity: 0.72; }
.hud__hint { position: absolute; left: 0; right: 0; bottom: 0.3rem; margin: 0; text-align: center; font-size: 0.62rem; letter-spacing: 0.24em; text-transform: uppercase; color: rgba(var(--tint), 0.6); }
@media (max-width: 560px) {
  .hud__bar { right: 3.6rem; font-size: 0.56rem; letter-spacing: 0.14em; }
  .hud__corner--tl, .hud__corner--tr { top: 4.4rem; }
}
@media (hover: none) { .hud__hint { display: none; } }
.world--steam .hud__bar, .world--steam .hud__corner, .world--steam .hud__hint { opacity: 0; transition: opacity 0.8s 0.6s; }
.vault.is-revealed .world--steam .hud__bar, .vault.is-revealed .world--steam .hud__corner, .vault.is-revealed .world--steam .hud__hint { opacity: 1; }
.vault.is-revealed .world--steam .hud__panel { animation: hud-in 0.9s var(--ease) 0.2s both; }
@keyframes hud-in {
  0% { opacity: 0; transform: translateY(16px) scaleY(0.02); }
  35% { opacity: 1; transform: translateY(0) scaleY(0.02); }
  100% { opacity: 1; transform: none; }
}

/* tom II · GitHub: terminal nad miastem commitów */
.world--github { align-items: center; justify-items: start; padding: 0 0 0 max(6vw, 2rem); }
.term {
  position: relative; width: min(560px, 92vw); overflow: hidden; border-radius: 14px;
  background: rgba(12, 9, 24, 0.74); border: 1px solid rgba(190, 170, 255, 0.28);
  -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.9), 0 0 60px -20px rgba(150, 120, 255, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  opacity: 0;
}
.vault.is-revealed .term { animation: term-in 0.7s var(--ease) both; }
@keyframes term-in { from { opacity: 0; transform: translateY(18px) scale(0.98); } to { opacity: 1; transform: none; } }
.term__bar { position: relative; display: flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; background: rgba(255, 255, 255, 0.04); border-bottom: 1px solid rgba(190, 170, 255, 0.16); }
.term__bar i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.term__bar i:nth-child(2) { background: #febc2e; }
.term__bar i:nth-child(3) { background: #28c840; }
.term__title { position: absolute; left: 0; right: 0; margin: 0; pointer-events: none; text-align: center; font-size: 0.72rem; font-weight: 500; letter-spacing: 0.08em; color: rgba(220, 212, 255, 0.7); }
.term__body { min-height: 10.5em; padding: 1.1rem 1.25rem 0.6rem; font-size: clamp(0.76rem, 2.4vw, 0.88rem); line-height: 1.75; color: #e6e1ff; white-space: pre-wrap; word-break: break-word; }
.term__ps { color: #8be9b0; }
.term__path { color: #b9a8ff; }
.term__cmd { color: #fff; }
.term__out { color: rgba(220, 212, 255, 0.72); }
.term__cursor { display: inline-block; width: 0.6em; height: 1.1em; margin-left: 1px; vertical-align: -0.18em; background: #cfc2ff; box-shadow: 0 0 10px rgba(190, 170, 255, 0.9); animation: blink 1s steps(1) infinite; }
.term__cta {
  display: flex; align-items: center; gap: 0.7rem; margin: 0.4rem 1.25rem 1.25rem; padding: 0.8rem 1rem;
  border: 1px dashed rgba(190, 170, 255, 0.5); border-radius: 10px; color: #e6e1ff; font-size: 0.8rem; letter-spacing: 0.04em;
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease), background 0.25s, border-color 0.25s, visibility 0s 0.5s;
}
.term.is-ready .term__cta { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.term__cta span { color: #8be9b0; }
.term__cta svg { width: 15px; height: 15px; margin-left: auto; }
.term__cta:hover, .term__cta:focus-visible { background: rgba(190, 170, 255, 0.14); border-color: rgba(190, 170, 255, 0.9); border-style: solid; }
@media (max-width: 900px) {
  .world--github { justify-items: center; align-items: start; padding: calc(var(--header-h) + 0.5rem) 0 0; }
}

/* tom III · Instagram: szklany pryzmat rozszczepia światło (scenę rysuje canvas w js/worlds.js) */
.world--instagram { flex-direction: column; align-items: center; justify-content: space-between; padding: clamp(4.6rem, 10vh, 6.2rem) 1rem clamp(1.4rem, 4.5vh, 2.6rem); color: #fff; pointer-events: none; }
.ig-gl { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; display: block; }
.ig-gl[hidden] { display: none; }
.ig-stage { position: absolute; inset: 0; z-index: 1; pointer-events: auto; touch-action: none; cursor: grab; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.ig-stage.is-drag { cursor: grabbing; }
.ig-head { position: relative; z-index: 2; text-align: center; opacity: 0; }
.vault.is-revealed .ig-head { animation: ig-in 1.1s var(--ease) 0.5s both; }
.ig-title {
  margin: 0; padding: 0 0.12em; font-family: var(--serif); font-style: italic; font-weight: 500; font-size: clamp(2.8rem, 8vw, 5rem); line-height: 1.05;
  background: linear-gradient(100deg, #feda75 0%, #fa7e1e 18%, #d62976 38%, #962fbf 58%, #4f5bd5 78%, #feda75 100%) 0 0 / 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 28px rgba(214, 41, 118, 0.42));
  animation: ig-flow 12s linear infinite;
}
@keyframes ig-flow { to { background-position: 200% 0; } }
.ig-handle { margin: 0.55rem 0 0; font-size: 0.78rem; letter-spacing: 0.34em; color: rgba(255, 255, 255, 0.7); }
.ig-foot { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 0.9rem; }
@property --ig-a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.ig-cta {
  position: relative; display: inline-flex; align-items: center; gap: 0.8rem; padding: 0.95rem 1.5rem 0.95rem 1.25rem; border-radius: 999px;
  pointer-events: auto; color: #fff; font-size: 0.72rem; letter-spacing: 0.26em; text-transform: uppercase;
  background: rgba(16, 10, 26, 0.45); -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 18px 48px -16px rgba(214, 41, 118, 0.55);
  opacity: 0; transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
/* tęczowa obwódka, która powoli obiega przycisk */
.ig-cta::before {
  content: ""; position: absolute; inset: 0; padding: 1.5px; border-radius: inherit; pointer-events: none;
  background: conic-gradient(from var(--ig-a), #feda75, #fa7e1e, #d62976, #962fbf, #4f5bd5, #feda75);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: ig-spin 5s linear infinite;
}
@keyframes ig-spin { to { --ig-a: 360deg; } }
.ig-cta svg { width: 18px; height: 18px; flex: none; }
.ig-cta__go { transition: transform 0.35s var(--ease); }
.ig-cta:hover, .ig-cta:focus-visible { transform: scale(1.04); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 18px 54px -12px rgba(214, 41, 118, 0.8), 0 0 36px -6px rgba(150, 47, 191, 0.6); }
.ig-cta:hover .ig-cta__go, .ig-cta:focus-visible .ig-cta__go { transform: translateX(3px); }
.vault.is-revealed .ig-cta { animation: ig-in 1s var(--ease) 1.3s both; }
.ig-hint { margin: 0; font-size: 0.58rem; letter-spacing: 0.2em; text-transform: uppercase; text-align: center; color: rgba(255, 255, 255, 0.5); opacity: 0; }
.vault.is-revealed .ig-hint { animation: ig-in 1s var(--ease) 2.4s both; }
.ig-hint__touch { display: none; }
@media (hover: none) {
  .ig-hint__mouse { display: none; }
  .ig-hint__touch { display: inline; }
}
/* wjazd tylko przez opacity i translate, żeby nie blokować powiększenia przycisku po najechaniu */
@keyframes ig-in { from { opacity: 0; translate: 0 14px; } to { opacity: 1; translate: none; } }
@media (max-width: 560px) {
  .world--instagram { padding-top: 5.2rem; }
  .ig-handle { font-size: 0.7rem; letter-spacing: 0.26em; }
}

/* ---------- Niespodzianka (WebGL) ---------- */
.of { position: fixed; inset: 0; z-index: 200; background: #000; }
.of[hidden] { display: none; }
.of.is-on { animation: crt-on 0.55s var(--ease) both; }
.of.is-off { pointer-events: none; animation: of-off 0.34s ease-in both; }
@keyframes of-off { to { opacity: 0; transform: scale(1.03); } }
@keyframes crt-on {
  0% { transform: scale(1, 0.004); filter: brightness(6); }
  45% { transform: scale(1, 0.004); filter: brightness(6); }
  100% { transform: none; filter: none; }
}
.of__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.of__fallback { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); margin: 0; padding: 0; }
.of.no-gl .of__fallback {
  position: static !important; width: auto; height: 100%; clip: auto; overflow: auto;
  display: flex; flex-direction: column; justify-content: center; gap: 0.6rem; padding: 2rem; list-style: none;
  color: #ff5fd2; font-family: var(--mono); text-align: center; text-shadow: 0 0 8px #ff2fb3, 0 0 22px #ff2fb3;
}
.of.no-gl .of__fallback li:first-child { font-size: 1.6rem; }
.of__close {
  position: absolute; top: 1.2rem; right: 1.2rem; z-index: 2; padding: 0.55rem 0.8rem;
  background: rgba(0, 0, 0, 0.5); border: 1px solid rgba(255, 95, 210, 0.6); color: #ff8be0;
  font-size: 0.72rem; letter-spacing: 0.2em; text-shadow: 0 0 8px rgba(255, 47, 179, 0.9);
}
.of__close:hover { background: #ff5fd2; color: #000; text-shadow: none; }

/* ---------- 04 · Kontakt: Cinematic Ambient ----------
   Głęboka czerń z ciepłym ziarnem, ciemnozłote łuny w prawym górnym i lewym dolnym rogu
   i ciepłe światło idące za kursorem i aktywnym polem (pył w świetle rysuje js/contact-fx.js).
   Tło jest malowane raz i stoi w miejscu; w każdej klatce porusza się tylko warstwa światła
   (transformacją, ustawia ją js/contact.js), więc tło nic nie kosztuje przy 60 FPS. */
.contact {
  --amber-1: #b45309; --amber-2: #f59e0b; --cream: #f3e7d1;
  /* clip zamiast samego hidden: wystające światło nie robi z sekcji pola przewijania,
     więc fokus pola (np. na telefonie) nie przesuwa treści w górę i nie odsłania pasa bez tła */
  isolation: isolate; overflow: hidden; overflow: clip;
}
.contact__ambient {
  position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; background: #030302;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 16%);
          mask-image: linear-gradient(to bottom, transparent 0, #000 16%);
}
.contact__ambient i { position: absolute; display: block; }
.contact__glow { border-radius: 50%; }
.contact__glow--tr {
  top: -34%; right: -26%; width: min(90vw, 1100px); aspect-ratio: 1;
  background: radial-gradient(closest-side, rgba(150, 98, 26, 0.26), rgba(122, 74, 16, 0.13) 38%, rgba(90, 52, 10, 0.05) 62%, transparent 100%);
}
.contact__glow--bl {
  bottom: -40%; left: -30%; width: min(84vw, 1000px); aspect-ratio: 1;
  background: radial-gradient(closest-side, rgba(138, 84, 18, 0.22), rgba(110, 62, 12, 0.11) 40%, rgba(80, 44, 8, 0.04) 64%, transparent 100%);
}
.contact__grain {
  inset: 0; opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.05' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 0.86 0 0 0 0 0.62 0 0 0 1.5 -0.3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}
/* światło leży poza maskowaną warstwą tła: tło z maską maluje się raz, a światło jeździ osobno */
.contact__light {
  position: absolute; z-index: -1; display: block; pointer-events: none;
  left: 0; top: 0; width: 1040px; height: 1040px; margin: -520px 0 0 -520px; opacity: 0; will-change: transform, opacity;
  background:
    radial-gradient(closest-side, rgba(255, 214, 150, 0.05), transparent 21.5%),
    radial-gradient(closest-side, rgba(245, 158, 11, 0.085), rgba(180, 83, 9, 0.04) 38%, transparent 72%);
}

.contact__grid { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: clamp(2.5rem, 6vw, 6rem); align-items: start; }
@media (max-width: 880px) { .contact__grid { grid-template-columns: 1fr; } }
.contact .kicker { color: rgba(217, 164, 65, 0.62); }
.contact .section__lead { color: #8c8372; }
/* żarzenie: stały, miękki blask plus druga warstwa blasku (::after), która tylko zmienia przezroczystość */
.contact__title {
  position: relative; color: var(--cream);
  text-shadow: 0 0 1px rgba(255, 240, 214, 0.35), 0 0 14px rgba(245, 158, 11, 0.12), 0 0 38px rgba(180, 83, 9, 0.12);
}
.contact__title::after {
  content: attr(data-glow);
  content: attr(data-glow) / "";
  position: absolute; inset: 0; color: transparent; pointer-events: none;
  text-shadow: 0 0 18px rgba(245, 158, 11, 0.2), 0 0 48px rgba(180, 83, 9, 0.18), 0 0 100px rgba(180, 83, 9, 0.13);
  opacity: 0.35; will-change: opacity; animation: contact-ember 7s ease-in-out infinite alternate;
}
@keyframes contact-ember { to { opacity: 1; } }
.contact__rule { position: relative; width: 88px; height: 1px; margin-top: 2.6rem; }

.contact-form { display: grid; gap: 1.9rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.9rem; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }
.field label {
  display: block; margin-bottom: 0.2rem; color: #6f675a; font-family: var(--mono); font-size: 0.66rem;
  letter-spacing: 0.22em; text-transform: lowercase; transition: color 0.9s var(--ease), letter-spacing 0.9s var(--ease);
}
.field:focus-within label { color: #e9b45a; letter-spacing: 0.26em; }
.field__box { position: relative; }
.field input, .field select, .field textarea {
  width: 100%; padding: 0.75rem 0 0.7rem; border: 0; border-radius: 0; outline: none;
  background: transparent; color: var(--cream); caret-color: var(--amber-2); font-size: 1.02rem;
}
.field textarea {
  display: block; min-height: 130px; resize: vertical; line-height: 1.55;
  scrollbar-width: thin; scrollbar-color: rgba(245, 158, 11, 0.35) transparent;
}
.field select {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 2rem;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a58a5c' stroke-width='1.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right center / 16px;
}
.field select option { background: #0a0806; color: var(--cream); }
.field input:-webkit-autofill, .field textarea:-webkit-autofill {
  -webkit-text-fill-color: var(--cream); caret-color: var(--amber-2);
  box-shadow: 0 0 0 1000px #060503 inset; transition: background-color 9999s;
}
.field input { display: block; }
.field input::placeholder { color: #4a443b; opacity: 1; transition: color 0.9s ease; }
.field input:focus::placeholder { color: #5e5446; }

/* struny: linia pod polem to krzywa Béziera w SVG; js/contact-fx.js ugina ją za kursorem.
   W spoczynku przygaszona, przy fokusie i pisaniu zapala się bursztynowym gradientem. */
.string {
  position: absolute; left: 0; bottom: -20px; width: 100%; height: 40px; overflow: visible; pointer-events: none;
  filter: none; transition: filter 0.9s ease;
}
.string__path { fill: none; stroke-width: 1; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.string__a, .string__b { stop-color: #e8dcc8; stop-opacity: 0.3; transition: stop-color 0.9s ease, stop-opacity 0.9s ease; }
.field.is-filled .string__a { stop-color: #b45309; stop-opacity: 0.5; }
.field.is-filled .string__b { stop-color: #f59e0b; stop-opacity: 0.5; }
.field:focus-within .string__a { stop-color: #b45309; stop-opacity: 1; }
.field:focus-within .string__b { stop-color: #f59e0b; stop-opacity: 1; }
.field:focus-within .string { filter: drop-shadow(0 1px 4px rgba(245, 158, 11, 0.55)); }
.field.is-typing .string { filter: drop-shadow(0 2px 7px rgba(245, 158, 11, 0.85)); transition-duration: 0.12s; }
.string.is-ringing { filter: drop-shadow(0 1px 5px rgba(245, 158, 11, 0.5)); transition-duration: 0.2s; }
.field [aria-invalid="true"] + .string .string__a { stop-color: #8f3241; stop-opacity: 0.8; }
.field [aria-invalid="true"] + .string .string__b { stop-color: #e0808f; stop-opacity: 0.8; }
.contact-form.is-sent .string { animation: string-flash 1.8s var(--ease); }
@keyframes string-flash { 30% { filter: drop-shadow(0 1px 9px rgba(245, 158, 11, 0.95)); } }
.string--rule .string__a { stop-color: #b45309; stop-opacity: 0.9; }
.string--rule .string__b { stop-color: #f59e0b; stop-opacity: 0; }
.string--rule { filter: drop-shadow(0 0 5px rgba(245, 158, 11, 0.35)); }

/* poświata pod polem wiadomości rośnie z mnożnikiem flow (--flow od 0 do 1 ustawia JS) */
.field__flow {
  position: absolute; left: 4%; right: 4%; bottom: -28px; height: 56px; pointer-events: none;
  background: radial-gradient(50% 50% at 50% 50%, rgba(245, 158, 11, 0.32), rgba(180, 83, 9, 0.12) 45%, transparent 75%);
  opacity: calc(var(--flow, 0) * 0.95); filter: blur(6px);
}
.field__stats { display: inline-flex; align-items: baseline; gap: 1.1rem; margin-top: 0.45rem; }
.field__stats .counter { margin-top: 0; }
.flow {
  color: rgba(233, 180, 90, 0.8); font-size: 0.68rem; letter-spacing: 0.14em; white-space: nowrap;
  opacity: 0; transform: translateX(6px); transition: opacity 0.7s ease, transform 0.7s var(--ease);
  text-shadow: 0 0 calc(4px + var(--flow, 0) * 12px) rgba(245, 158, 11, 0.6);
}
.flow.is-on { opacity: 1; transform: none; }
.flow b { display: inline-block; min-width: 2.4ch; font-weight: 400; color: #f5b544; text-align: right; transition: color 0.4s ease; }
.flow.is-hot b { color: #ffd89a; }

/* licznik złapanych świetlików obok „03 // kontakt” */
.ff-score { margin-left: 0.8rem; color: rgba(245, 175, 80, 0.78); opacity: 0; letter-spacing: 0.14em; transition: opacity 1.2s ease; }
.ff-score.is-on { opacity: 1; text-shadow: 0 0 10px rgba(245, 158, 11, 0.4); }
.ff-score.is-bump { animation: ff-bump 1s var(--ease); }
@keyframes ff-bump { 0% { color: #ffe6b5; text-shadow: 0 0 16px rgba(255, 200, 110, 1); } }

/* iskry i ślad świetlika (canvas) nad formularzem, świetlik nad wszystkim */
.contact > .container { position: relative; z-index: 1; }
.contact__fx { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }
.firefly {
  position: absolute; left: 0; top: 0; z-index: 3; width: 44px; height: 44px; margin: -22px 0 0 -22px;
  border-radius: 50%; cursor: pointer; will-change: transform, opacity; -webkit-tap-highlight-color: transparent;
}
.firefly[hidden] { display: none; }
.firefly::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; border-radius: 50%;
  background: #fff1c9;
  box-shadow: 0 0 4px 1px #ffd27a, 0 0 12px 3px rgba(245, 158, 11, 0.75), 0 0 30px 9px rgba(217, 119, 6, 0.32);
}
.firefly::after {
  content: ""; position: absolute; inset: 4px; border-radius: 50%; opacity: 0.9;
  background: radial-gradient(closest-side, rgba(245, 158, 11, 0.2), transparent);
}

/* przycisk po złapaniu świetlika: fala uderzeniowa i trwale mocniejsza obwódka */
.btn.is-charged:not(:hover):not(:focus-visible) {
  border-color: rgba(245, 170, 60, calc(0.55 + var(--charge, 0) * 0.4));
  box-shadow: 0 0 calc(10px + var(--charge, 0) * 26px) -4px rgba(245, 158, 11, calc(0.22 + var(--charge, 0) * 0.35)), inset 0 -8px 20px -14px rgba(245, 158, 11, 0.5);
}
.btn.is-burst { animation: btn-burst 1s cubic-bezier(0.2, 0.7, 0.2, 1); }
@keyframes btn-burst {
  0% { box-shadow: 0 0 0 0 rgba(255, 210, 130, 0.95), 0 0 70px 14px rgba(245, 158, 11, 0.85); border-color: #ffd89a; }
  100% { box-shadow: 0 0 0 28px rgba(245, 158, 11, 0), 0 0 30px 0 rgba(245, 158, 11, 0); }
}
.btn__ripple {
  position: absolute; left: var(--rx, 50%); top: var(--ry, 50%); z-index: -1; width: 12px; height: 12px; margin: -6px 0 0 -6px;
  border: 1px solid rgba(255, 214, 150, 0.9); border-radius: 50%; pointer-events: none;
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.8), inset 0 0 12px rgba(245, 158, 11, 0.6);
  animation: btn-ripple 1s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}
@keyframes btn-ripple { to { transform: scale(42); opacity: 0; } }
.field__error { min-height: 1.1em; margin: 0.4rem 0 0; color: #e0808f; font-size: 0.8rem; }
.field__meta { display: flex; justify-content: space-between; gap: 1rem; }
.counter {
  margin-top: 0.45rem; color: #4d473e; font-size: 0.68rem; letter-spacing: 0.14em; white-space: nowrap;
  transition: color 0.9s ease, text-shadow 0.9s ease;
}
.counter b { font-weight: 400; transition: color 0.9s ease, text-shadow 0.4s ease; }
.counter.is-active { color: rgba(233, 180, 90, 0.7); text-shadow: 0 0 10px rgba(245, 158, 11, 0.3); }
.counter.is-active b { color: #f5b544; }
.field.is-typing .counter.is-active b { text-shadow: 0 0 12px rgba(245, 158, 11, 0.85); }
.counter.is-near b { color: #ffd38a; text-shadow: 0 0 12px rgba(245, 158, 11, 0.6); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* bursztynowy przycisk: cienka złota obwódka, po najechaniu łuna od spodu i strzałka w prawo */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: space-between; gap: 2.2rem;
  justify-self: start; min-width: 260px; padding: 1.05rem 1.4rem; overflow: hidden; isolation: isolate; cursor: pointer;
  background: rgba(22, 13, 4, 0.35); border: 1px solid rgba(217, 164, 65, 0.42); border-radius: 2px; color: #e6d0a3;
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.2em; text-transform: lowercase;
  box-shadow: 0 0 0 rgba(245, 158, 11, 0), inset 0 0 0 rgba(245, 158, 11, 0);
  transition: color 1s var(--ease), border-color 1s var(--ease), box-shadow 1.3s var(--ease), background-color 1.3s var(--ease);
}
.btn::before {
  content: ""; position: absolute; left: -15%; right: -15%; bottom: -70%; height: 140%; z-index: -1;
  background: radial-gradient(55% 60% at 50% 100%, rgba(245, 158, 11, 0.5), rgba(180, 83, 9, 0.22) 45%, transparent 75%);
  opacity: 0; transform: translateY(35%); transition: opacity 1.3s var(--ease), transform 1.3s var(--ease);
}
.btn::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(110deg, transparent 35%, rgba(255, 222, 165, 0.12) 50%, transparent 65%);
  transform: translateX(-120%); transition: transform 1.8s var(--ease);
}
.btn:hover, .btn:focus-visible {
  outline: none; color: #fff3da; border-color: rgba(245, 170, 60, 0.85); background-color: rgba(30, 17, 4, 0.5);
  box-shadow: 0 24px 60px -18px rgba(245, 158, 11, 0.55), 0 10px 30px -14px rgba(180, 83, 9, 0.6), inset 0 -12px 26px -14px rgba(245, 158, 11, 0.55);
}
.btn:hover::before, .btn:focus-visible::before { opacity: 1; transform: translateY(0); }
.btn:hover::after, .btn:focus-visible::after { transform: translateX(120%); }
.btn:active { translate: 0 1px; }
.btn__icon { width: 18px; height: 18px; transition: transform 0.9s var(--ease); }
.btn:hover .btn__icon, .btn:focus-visible .btn__icon { transform: translateX(6px); }
.btn__spinner {
  display: none; width: 16px; height: 16px; border: 1px solid currentColor; border-top-color: transparent;
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn.is-sending .btn__spinner { display: inline-block; }
.btn.is-sending .btn__icon { display: none; }
.btn[disabled] { cursor: progress; opacity: 0.7; }

.form-status { margin: 0; font-size: 0.92rem; }
.form-status:empty { display: none; }
.form-status:not(:empty) {
  padding: 0.95rem 1.1rem; border-left: 1px solid;
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.06), transparent 70%);
  animation: contact-rise 0.9s var(--ease) both;
}
.form-status[data-type="success"] { color: #f3d9a4; border-color: #f59e0b; box-shadow: -6px 0 18px -10px rgba(245, 158, 11, 0.8); }
.form-status[data-type="error"] { color: #eba0ab; border-color: #d4697a; background: linear-gradient(90deg, rgba(212, 105, 122, 0.07), transparent 70%); }
.form-status[data-type="info"] { color: #d9c8a8; border-color: rgba(217, 164, 65, 0.6); }
@keyframes contact-rise { from { opacity: 0; transform: translateY(6px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
.form-note { margin: 0; color: #5a5347; font-size: 0.78rem; }

/* ---------- Stopka ---------- */
.site-footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem;
  width: min(1240px, 100% - 2.5rem); margin: 0 auto; padding: 2.5rem 0;
  border-top: 1px solid var(--line); color: var(--dim); font-size: 0.7rem; letter-spacing: 0.16em;
}
.site-footer p { margin: 0; }

/* ---------- Ograniczony ruch ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; transition-delay: 0s !important; }
}

/* ---------- Kurze kasyno (js/casino.js, js/casino-games.js) ---------- */
/* przezroczysty przycisk nad planetą z szyldem; rozmiar i pozycję ustawia js/space.js */
.casino-door {
  position: absolute; left: 0; top: 0; z-index: 4; padding: 0; border: 0; border-radius: 14px;
  background: transparent; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.casino-door:focus-visible { outline: 2px dashed #ffd34a; outline-offset: 2px; }

.casino {
  --px-ink: #1a0f22; --px-gold: #ffd34a; --px-pink: #ff8af0; --px-teal: #4ad1ff; --px-green: #7dff8a;
  position: fixed; inset: 0; z-index: 190; overflow: hidden; background: #08040c; color: #f3eefc;
  font-family: "Pixelify Sans", var(--mono); -webkit-font-smoothing: auto; user-select: none; -webkit-user-select: none;
}
.casino[hidden], .casino [hidden] { display: none !important; }
@media (hover: none) { .casino .px-btn small { display: none; } }
.casino__world, .casino__fx { position: absolute; left: 0; top: 0; max-width: none; image-rendering: pixelated; image-rendering: crisp-edges; }
.casino__world { touch-action: none; cursor: pointer; }
.casino__world:focus { outline: none; }
.casino__fx { z-index: 2; pointer-events: none; }
.casino__fx[hidden] { display: none; }

.casino__hud {
  position: absolute; top: max(12px, env(safe-area-inset-top)); left: 12px; right: 12px; z-index: 3;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  opacity: 0; transition: opacity 0.4s; pointer-events: none;
}
.casino.is-ready .casino__hud { opacity: 1; pointer-events: auto; }
.casino__hud-r { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.snd-ico { width: 18px; height: 15px; flex: none; }
#casino-sound[aria-pressed="true"] .snd-off, #casino-sound[aria-pressed="false"] .snd-on { display: none; }
#casino-sound[aria-pressed="false"] { color: #b9a4e0; }
.casino__eggs, .cg__eggs {
  position: relative; display: inline-flex; align-items: center; gap: 0.5rem; margin: 0; padding: 0.35rem 0.8rem 0.35rem 0.6rem;
  background: #1a0d24; color: #fff; font-size: 1.25rem; font-weight: 700; line-height: 1;
  box-shadow: 0 0 0 3px var(--px-gold), 0 0 0 6px var(--px-ink), 0 6px 0 6px rgba(0, 0, 0, 0.3);
}
.egg-ico { display: inline-block; flex: none; width: 18px; height: 22px; background: var(--egg) center / contain no-repeat; image-rendering: pixelated; }
.egg-fly {
  position: absolute; left: 100%; top: 50%; margin-left: 10px; font-size: 1rem; font-weight: 700; white-space: nowrap; pointer-events: none;
  text-shadow: 2px 2px 0 var(--px-ink); animation: egg-fly 1.25s steps(10) forwards;
}
.cg__eggs .egg-fly { left: auto; right: 100%; margin: 0 10px 0 0; }
.egg-fly.is-up { color: var(--px-green); }
.egg-fly.is-down { color: #ff8a9a; animation-name: egg-drop; }
@keyframes egg-fly { from { opacity: 1; transform: translateY(-50%); } to { opacity: 0; transform: translateY(-190%); } }
@keyframes egg-drop { from { opacity: 1; transform: translateY(-50%); } to { opacity: 0; transform: translateY(90%); } }

/* przyciski w stylu pixel art: obrys z cienia, wciśnięcie o 2 piksele */
.px-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; min-height: 38px; margin: 3px; padding: 0.45rem 0.95rem;
  border: 0; border-radius: 0; background: #e8e4f0; color: var(--px-ink); font-family: "Pixelify Sans", var(--mono); font-size: 1rem; font-weight: 600; line-height: 1.1;
  box-shadow: inset -3px -3px 0 rgba(0, 0, 0, 0.22), inset 3px 3px 0 rgba(255, 255, 255, 0.55), 0 0 0 3px var(--px-ink);
  cursor: pointer; transition: transform 0.06s, filter 0.15s; touch-action: manipulation;
}
.px-btn:hover:not(:disabled) { filter: brightness(1.12); }
.px-btn:active:not(:disabled) { transform: translateY(2px); box-shadow: inset 3px 3px 0 rgba(0, 0, 0, 0.22), 0 0 0 3px var(--px-ink); }
.px-btn:focus-visible { outline: 3px solid var(--px-teal); outline-offset: 4px; }
.px-btn:disabled { opacity: 0.42; cursor: not-allowed; }
.px-btn small { font-size: 0.72em; opacity: 0.7; }
.px-btn--gold { background: var(--px-gold); }
.px-btn--green { background: var(--px-green); }
.px-btn--dark { background: #2a1640; color: #fff; box-shadow: inset -3px -3px 0 rgba(0, 0, 0, 0.35), inset 3px 3px 0 rgba(255, 255, 255, 0.15), 0 0 0 3px var(--px-gold); }
.px-btn--sm { min-height: 32px; padding: 0.3rem 0.6rem; font-size: 0.9rem; }
.px-btn[aria-pressed="true"] { background: var(--px-pink); box-shadow: inset -3px -3px 0 rgba(0, 0, 0, 0.22), inset 3px 3px 0 rgba(255, 255, 255, 0.55), 0 0 0 3px var(--px-ink), 0 0 0 5px var(--px-gold); }

.casino__hint {
  position: absolute; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); z-index: 3; margin: 0; padding: 0.4rem 0.8rem;
  transform: translateX(-50%); max-width: calc(100% - 24px); background: rgba(26, 13, 36, 0.82); color: rgba(255, 255, 255, 0.86);
  font-size: 0.85rem; text-align: center; box-shadow: 0 0 0 2px #3a2050; opacity: 0; transition: opacity 0.6s;
}
.casino.is-ready .casino__hint { opacity: 1; }
.casino.is-ready .casino__hint.is-hidden { opacity: 0; }
.casino__near { position: absolute; left: 50%; bottom: calc(max(14px, env(safe-area-inset-bottom)) + 46px); z-index: 3; transform: translateX(-50%); }
.casino__near[hidden] { display: none; }
.casino__near .px-btn { font-size: 1.1rem; padding: 0.55rem 1.2rem; }

/* panel gry */
.cg { position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; padding: 12px; background: rgba(8, 4, 12, 0.55); }
.cg[hidden] { display: none; }
.cg__box {
  width: min(700px, 100%); max-height: calc(100% - 12px); overflow: auto; padding: 14px 18px 16px; background: #1a0d24;
  box-shadow: 0 0 0 3px var(--px-gold), 0 0 0 6px var(--px-ink), 0 14px 0 6px rgba(0, 0, 0, 0.35);
  user-select: text; -webkit-user-select: text;
}
.cg__head { display: flex; align-items: center; gap: 14px; margin: 0 0 12px; }
.cg__title { margin: 0; color: var(--px-gold); font-size: 1.6rem; font-weight: 700; letter-spacing: 0.04em; text-shadow: 3px 3px 0 #5a1a6a; }
.cg__eggs { margin-left: auto; font-size: 1.05rem; }
.cg__close {
  display: grid; place-items: center; flex: none; width: 40px; height: 40px; padding: 0; border: 0; background: #ff6a7a; color: var(--px-ink); cursor: pointer;
  box-shadow: inset -3px -3px 0 rgba(0, 0, 0, 0.22), inset 3px 3px 0 rgba(255, 255, 255, 0.5), 0 0 0 3px var(--px-ink);
}
.cg__close svg { width: 20px; height: 20px; }
.cg__close:focus-visible { outline: 3px solid var(--px-teal); outline-offset: 4px; }
.cg__status { min-height: 1.4em; margin: 12px 0 0; text-align: center; font-size: 1rem; }
.cg__status[data-tone="good"] { color: var(--px-green); }
.cg__status[data-tone="bad"] { color: #ff8a9a; }
.cg-game[hidden] { display: none; }
.cg-screen { display: flex; justify-content: center; }
.cg-screen canvas { max-width: none; image-rendering: pixelated; image-rendering: crisp-edges; box-shadow: 0 0 0 3px var(--px-ink), 0 0 0 6px #5a1a6a; }
.cg-screen canvas:focus-visible { outline: 3px solid var(--px-teal); outline-offset: 8px; }
.cg-ctrl { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 12px; margin-top: 16px; }
.cg-acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.bet, .seg, .rl-num { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px; padding: 4px 8px; background: #120a1a; box-shadow: 0 0 0 2px #3a2050; }
.bet__lbl { margin: 0 6px 0 2px; color: #b9a4e0; font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; }
.bet__val, .rl-num__v { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-width: 5.5ch; color: var(--px-gold); font-size: 1.15rem; font-weight: 700; }
.rl-num__v { min-width: 3ch; }
.rl-grid { display: grid; grid-template-columns: repeat(5, auto); justify-content: center; gap: 2px; }
.rl-b--red { background: #ff7a8a; }
.rl-b--black { background: #5c5574; color: #fff; }
.rl-b--num { background: #7dff8a; }
.rl-b[aria-pressed="true"] { filter: brightness(1.15); }
.crash-top { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: center; gap: 14px; }
.crash-side { width: 190px; }
.crash-side .bet__lbl { display: block; margin: 0 0 4px; }
.crash-list { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.crash-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; padding: 4px 8px; background: #120a1a; font-size: 0.85rem; }
.crash-list__n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crash-list__b { color: var(--px-gold); }
.crash-list__s { min-width: 4ch; text-align: right; }
.crash-list .is-out { color: var(--px-green); }
.crash-list .is-lost { color: #ff8a9a; opacity: 0.75; }
.slot-pay { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 14px; margin: 14px 0 0; padding: 0; list-style: none; font-size: 0.85rem; color: #d8cfee; }
.slot-pay li { display: flex; align-items: center; gap: 3px; white-space: nowrap; }
.slot-pay img { width: 24px; height: 24px; image-rendering: pixelated; }
.slot-pay span { margin-left: 6px; }
.kn-info { margin: 10px 0 0; text-align: center; color: var(--px-gold); font-size: 0.95rem; }
@media (max-width: 640px) {
  .casino__eggs { font-size: 1.05rem; }
  .cg { padding: 6px; align-items: end; }
  .cg__box { padding: 12px 10px 14px; max-height: calc(100% - 4px); }
  .cg__title { font-size: 1.3rem; }
  .crash-side { width: 100%; }
  .rl-grid { grid-template-columns: repeat(3, auto); }
  .px-btn { font-size: 0.95rem; }
}
