/* ============================================================
   Ezoterium — Portal Wróżb
   ============================================================ */

:root {
  --bg: #07061a;
  --ink: #f4eefe;
  --ink-soft: rgba(238, 233, 252, .9);
  --ink-mute: rgba(226, 220, 248, .78);
  --ink-faint: rgba(214, 208, 240, .6);
  --gold: #f3e6c4;
  --line: rgba(232, 196, 120, .16);
  --serif-display: 'Cormorant Garamond', Georgia, serif;
  --serif-text: 'Manrope', 'Segoe UI', system-ui, sans-serif;
  /* akcenty sceny (motto, podpisy glifów, doradcy) zostają w klimacie serif */
  --serif-accent: 'EB Garamond', Georgia, serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif-text);
  -webkit-text-size-adjust: 100%;
}

body { overflow-x: hidden; }

h1, h2 { font-family: var(--serif-display); font-weight: 500; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  padding: 12px 20px;
  background: #12092e;
  color: var(--gold);
  border: 1px solid var(--line);
  text-decoration: none;
}
.skip-link:focus { left: 12px; top: 12px; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* ---------- animacje ---------- */
@keyframes tw     { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
@keyframes fl     { 0%, 100% { transform: translateY(8px);  opacity: .35; } 50% { transform: translateY(-8px);  opacity: .7; } }
@keyframes dr     { 0%, 100% { transform: translateY(6px) rotate(var(--r, 0deg)); opacity: .3; } 50% { transform: translateY(-10px) rotate(var(--r, 0deg)); opacity: .6; } }
@keyframes nebula { 0%, 100% { transform: scale(1) translate(0, 0); } 50% { transform: scale(1.08) translate(2%, -2%); } }
@keyframes spin   { to { transform: rotate(360deg); } }
@keyframes pulse  { 0%, 100% { opacity: .35; transform: scale(.9); } 50% { opacity: 1; transform: scale(1.1); } }

/* ============================================================
   LOADER — zasłania scenę, dopóki orbita nie jest gotowa,
   i wraca przy przejściu do systemu
   ============================================================ */

.loader {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  background: radial-gradient(120% 90% at 50% 18%, #1a1142 0%, #0d0930 45%, #07061a 100%);
  transition: opacity .5s ease, visibility .5s ease;
}
.loader.is-gone {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.loader[hidden] { display: none; }

.loader__ring {
  position: relative;
  width: clamp(96px, 24vmin, 132px);
  height: clamp(96px, 24vmin, 132px);
  border: 1px dashed rgba(255, 255, 255, .12);
  border-radius: 50%;
}
.loader__orbits {
  position: absolute;
  inset: 0;
  animation: spin 3.2s linear infinite;
}
.loader__orb {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: var(--o);
  box-shadow: 0 0 14px var(--o-70);
  transform: rotate(var(--a)) translateY(calc(clamp(96px, 24vmin, 132px) / -2));
}
.loader__mark {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: rgba(243, 230, 196, .9);
  text-shadow: 0 0 18px rgba(243, 230, 196, .55);
  animation: pulse 2.2s ease-in-out infinite;
}
.loader__text {
  margin: 0;
  font-family: var(--serif-display);
  font-size: 13px;
  letter-spacing: .38em;
  text-indent: .38em;
  text-transform: uppercase;
  color: rgba(228, 221, 250, .85);
}

/* bez JS loader nigdy by nie zniknął */
.no-js .loader { display: none; }

/* ============================================================
   KOSMOS — wspólne dynamiczne tło orbity i sekcji doradców
   ============================================================ */

.cosmos {
  position: relative;
  /* clip zamiast hidden: hidden robi z kontenera przewijalny programowo box
     i scrollIntoView / fokus potrafiły „wwinąć" orbitę do środka bez powrotu */
  overflow: hidden;
  overflow: clip;
  background: radial-gradient(120% 90% at 50% 18%, #1a1142 0%, #0d0930 45%, #07061a 100%);
}

/* ============================================================
   SCENA
   ============================================================ */

.stage {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}
.stage.is-dragging { cursor: grabbing; }

/* w trakcie obracania orbity nic poniżej nie powinno się zaznaczać */
body.is-orbit-dragging {
  cursor: grabbing;
  user-select: none;
  -webkit-user-select: none;
}

.nebula {
  position: absolute;
  inset: -10%;
  pointer-events: none;
  animation: nebula 26s ease-in-out infinite;
  background:
    radial-gradient(40% 30% at 22% 30%, rgba(126, 80, 200, .30), transparent 70%),
    radial-gradient(45% 35% at 80% 26%, rgba(70, 90, 210, .22), transparent 70%),
    radial-gradient(50% 40% at 60% 78%, rgba(180, 70, 150, .16), transparent 72%);
}

.stage__wash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(60% 50% at 50% 40%, rgba(255, 255, 255, .04), transparent 70%);
}

.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(120% 120% at 50% 45%, transparent 55%, rgba(4, 3, 14, .7) 100%);
}

/* ---------- warstwy nieba ----------
   Nieaktywne warstwy nie tylko gasną: znikają z renderowania (visibility)
   i wstrzymują animacje dzieci (--play) — na raz pracuje jedna warstwa,
   nie pięć, co na słabszych urządzeniach robi ogromną różnicę. */
.sky {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  --play: paused;
  transition: opacity 1.1s ease, visibility 1.1s;
}
.cosmos[data-system="astrologia"]  .sky--astrologia,
.cosmos[data-system="tarot"]       .sky--tarot,
.cosmos[data-system="runy"]        .sky--runy,
.cosmos[data-system="numerologia"] .sky--numerologia,
.cosmos[data-system="kabala"]      .sky--kabala {
  opacity: 1;
  visibility: visible;
  --play: running;
}

/* poświata siedzi za orbitą (pierwszy ekran), nie w połowie całego tła */
.sky__halo {
  position: absolute;
  left: 50%;
  top: 40vh;
  width: 86vmin;
  height: 86vmin;
  transform: translate(-50%, -50%);
  filter: blur(8px);
  border-radius: 50%;
}
.sky--astrologia  .sky__halo { background: radial-gradient(circle, rgba(232, 184, 75, .20), transparent 60%); }
.sky--tarot       .sky__halo { background: radial-gradient(circle, rgba(212, 90, 168, .20), transparent 60%); }
.sky--runy        .sky__halo { background: radial-gradient(circle, rgba(69, 201, 176, .18), transparent 60%); }
.sky--numerologia .sky__halo { background: radial-gradient(circle, rgba(90, 160, 232, .18), transparent 60%); }
.sky--kabala      .sky__halo { background: radial-gradient(circle, rgba(154, 124, 232, .18), transparent 60%); }

.constellation { position: absolute; height: auto; overflow: visible; }
.constellation circle { fill: #f7e2a0; }
.constellation--a { left: 14%; top: 16vh; width: 24vmin; opacity: .5; }
.constellation--b { right: 12%; bottom: 22%; width: 22vmin; opacity: .45; }

.star, .spark {
  position: absolute;
  left: var(--l);
  top: var(--t);
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  animation: tw var(--du) ease-in-out var(--d) infinite;
  animation-play-state: var(--play, running);
}
.star  { background: #fff;     box-shadow: 0 0 6px #fff; }
.spark { background: #f2aad4;  box-shadow: 0 0 7px #f2aad4; }

/* dryfujące karty w tle — ten sam rewers co karty działu tarota, przygaszony */
.tcard {
  position: absolute;
  left: var(--l);
  top: var(--t);
  width: var(--s);
  height: calc(var(--s) * 1.6);
  border-radius: calc(var(--s) * .07);
  color: rgba(236, 150, 204, .9);
  opacity: .62;
  box-shadow: 0 0 14px rgba(212, 90, 168, .24);
  animation: dr var(--du) ease-in-out var(--d) infinite;
  animation-play-state: var(--play, running);
}

/* rewers karty tarota (symbol #tarot-card-back z ezo_tarot_back_sprite) */
.tback {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.glyph {
  position: absolute;
  left: var(--l);
  top: var(--t);
  font-size: var(--s);
  font-style: normal;
  line-height: 1;
  animation: fl var(--du) ease-in-out var(--d) infinite;
  animation-play-state: var(--play, running);
}
.glyph--rune { font-family: var(--serif-text);    color: rgba(69, 201, 176, .55);  text-shadow: 0 0 12px rgba(69, 201, 176, .5); }
.glyph--num  { font-family: var(--serif-display); color: rgba(90, 160, 232, .5);   text-shadow: 0 0 12px rgba(90, 160, 232, .5); }
.glyph--heb  { font-family: var(--serif-display), 'Times New Roman', serif; color: rgba(178, 150, 244, .55); text-shadow: 0 0 14px rgba(154, 124, 232, .6); }

/* ---------- nagłówek sceny ---------- */
.stage__header {
  position: absolute;
  top: clamp(12px, 2.6vh, 26px);
  left: 0;
  width: 100%;
  padding: 0 18px;
  text-align: center;
  pointer-events: none;
  z-index: 50;
}
.stage__brand {
  font-family: var(--serif-display);
  font-weight: 500;
  font-size: clamp(22px, 3.4vw, 32px);
  letter-spacing: .42em;
  text-indent: .42em;
  color: #efeaff;
  text-transform: uppercase;
}
.stage__tagline {
  max-width: 46ch;
  margin: 14px auto 0;
  font-family: var(--serif-accent);
  font-size: clamp(15px, 1.9vw, 18px);
  line-height: 1.55;
  letter-spacing: .1em;
  color: rgba(232, 226, 252, .9);
  text-wrap: pretty;
}
/* każde zdanie w osobnym wierszu — bez przypadkowych łamań */
.stage__tagline span { display: block; }

/* ---------- orbita ---------- */
.orbit {
  position: absolute;
  transform: translate(-50%, -50%);
  border: 1px dashed rgba(255, 255, 255, .10);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transition: opacity .5s ease;
}
.orbit.is-ready { opacity: 1; }

/* ---------- planety / glify ---------- */
.planets {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.planet {
  position: absolute;
  left: 0;
  top: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  pointer-events: auto;
  transform: translate(-50%, -50%);
  /* animacja orbity idzie wyłącznie po transform/opacity — trzymaj glify
     na własnych warstwach kompozytora (płynność na telefonach) */
  will-change: transform, opacity;
  visibility: hidden; /* do czasu wyliczenia geometrii przez JS */
}
.planets.is-ready .planet { visibility: visible; }

.planet__face {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1.5px solid var(--c-60);
  background: radial-gradient(circle at 50% 50%, var(--c-16), transparent 72%);
  box-shadow: 0 0 16px var(--c-28), inset 0 0 22px var(--c-22);
  transition: box-shadow .45s ease, border-color .45s ease;
}
.planet.is-selected .planet__face {
  border-color: var(--c-95);
  box-shadow: 0 0 44px var(--c-60), inset 0 0 22px var(--c-22);
}
.planet.is-boosting .planet__face {
  box-shadow: 0 0 70px var(--c-60), inset 0 0 26px var(--c-22);
}
/* wybrany glif istniejącego systemu — klik otwiera go, więc wyraźniej reaguje */
.planet.is-open:hover .planet__face,
.planet.is-open:focus-visible .planet__face {
  border-color: var(--c-light);
  box-shadow: 0 0 64px var(--c-60), inset 0 0 26px var(--c-28);
}

/* wektorowy sigil systemu — rysuje się w currentColor */
.sigil {
  display: block;
  width: 100%;
  height: 100%;
  color: var(--c);
  overflow: visible;
}
.planet__face .sigil {
  width: 78%;
  height: 78%;
  filter: drop-shadow(0 0 5px var(--c-60));
  transition: filter .45s ease;
}
.planet.is-selected .planet__face .sigil {
  filter: drop-shadow(0 0 10px var(--c-90));
}

.planet__name {
  position: absolute;
  top: 112%;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-family: var(--serif-accent);
  font-size: 13px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .66);
  pointer-events: none;
}
.planet.is-selected .planet__name {
  font-size: 15px;
  color: rgba(255, 255, 255, .95);
  text-shadow: 0 0 18px var(--c-60);
}

/* zachęta pod nazwą wybranego glifu — widoczna, gdy orbita czeka na klik */
.planet__cta {
  position: absolute;
  top: calc(112% + 24px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-family: var(--serif-accent);
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: rgba(218, 211, 244, .82);
  opacity: 0;
  transition: opacity .35s ease;
  pointer-events: none;
}
.stage.is-waiting .planet.is-selected.is-open .planet__cta { opacity: 1; }

/* ---------- działy systemu (rząd zamiast orbity) ---------- */
.planets, .orbit.is-ready, .arrow {
  transition: opacity .45s ease, transform .45s ease;
}
.stage.is-branching .planets {
  opacity: 0;
  transform: scale(.82);
  pointer-events: none;
}
.stage.is-branching .planets .planet { pointer-events: none; }
.stage.is-branching .orbit.is-ready,
.stage.is-branching .arrow { opacity: 0; pointer-events: none; }

/* przy działach cały nagłówek („Ezoterium” i motto) ustępuje miejsca
   nazwie systemu i podtytułowi działu — w tym samym miejscu i kroju */
.stage__header > .stage__brand,
.stage__header > .stage__tagline { transition: opacity .45s ease, transform .45s ease; }
.stage.is-branching .stage__header > .stage__brand,
.stage.is-branching .stage__header > .stage__tagline {
  opacity: 0;
  transform: translateY(-8px);
}

.stage__branch-head {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 0 18px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .5s ease .12s, transform .5s ease .12s;
}
.stage__branch-head.is-on { opacity: 1; transform: none; }

.stage__brand--branch {
  color: var(--c-light);
  text-shadow: 0 0 24px var(--c-60);
}
.stage.is-branching { cursor: default; }

.branches {
  --size: var(--branch-size, 120px);
  position: absolute;
  left: 0;
  right: 0;
  top: var(--branch-y, 45%);
  z-index: 55;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(14px, 3vh, 30px);
  padding: 0 16px;
  pointer-events: none;
}
.branches.is-open { pointer-events: auto; }

/* Kolejne rzędy działów stoją pod pierwszym, w mniejszej skali — pierwszy
   rząd ma zostać tym głównym. Przy mniejszym glifie pełna nazwa łamałaby
   się na cztery wiersze, a zachęty sąsiadów zachodziłyby na siebie, więc
   dalsze rzędy noszą sam temat działu i obywają się bez zachęty. */
.branches__row--dalszy {
  --size: calc(var(--branch-size, 120px) * .74);
  gap: clamp(20px, 7vw, 90px);
}
/* w dalszych rzędach nazwa jest szersza od glifu — pełne „Horoskop dla
   prezydenta USA" mieści się wtedy w trzech wierszach, a nie w czterech,
   i nie zahacza o sąsiada */
.branches__row--dalszy .branch__name {
  /* 13ch (jednostka „0" kroju, wąska) przy wersalikach z rozstrzeleniem łamało
     nazwę na cztery wiersze („Horoskop / dla / prezydenta / USA") — 13em daje
     dwa; na węższych oknach nie szerzej niż glif z odstępem, by nie wejść na sąsiada */
  width: min(13em, calc(var(--size) + clamp(20px, 7vw, 90px) - 8px));
  max-width: 38vw;
  font-size: 11px;
  letter-spacing: .1em;
}
.branches__row--dalszy .branch__name--short { display: none; }
.branches__row--dalszy .branch__cta { display: none; }

.branches__row {
  display: flex;
  align-items: center;
  justify-content: center;
  /* odstęp musi pomieścić nazwy działów, szersze od samych glifów;
     przy pięciu glifach w rzędzie nie może już być tak hojny */
  gap: clamp(12px, 4.5vw, 64px);
}

.branch {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* przy pięciu działach o szerokości decyduje okno, nie sama geometria orbity */
  width: min(var(--size), 17vw);
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  opacity: 0;
  transform: scale(.4);
  transition: opacity .5s ease, transform .6s cubic-bezier(.34, 1.3, .5, 1);
  transition-delay: calc(.08s + var(--k, 0) * .09s);
}
/* działy boczne wychodzą spod środkowego — jak rozłożone skrzydła */
.branch--left  { transform: translateX(80%) scale(.4); }
.branch--right { transform: translateX(-80%) scale(.4); }
.branch--center { order: 2; }
.branch--left   { order: 1; }
.branch--right  { order: 3; }

.branches.is-open .branch { opacity: 1; transform: none; }
.branches.is-open .branch.is-soon { opacity: .55; }

.branch__face {
  display: flex;
  width: 100%;
  aspect-ratio: 1;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1.5px solid var(--c-60);
  background: radial-gradient(circle at 50% 50%, var(--c-16), transparent 72%);
  box-shadow: 0 0 20px var(--c-28), inset 0 0 22px var(--c-22);
  transition: box-shadow .4s ease, border-color .4s ease;
  /* glify delikatnie „oddychają” — przybliżają się do widza i odsuwają,
     każdy we własnej fazie */
  animation: branch-breathe 5.2s ease-in-out infinite;
  animation-delay: calc(var(--k, 0) * -1.7s);
}
@keyframes branch-breathe {
  0%, 100% { transform: scale(.95); }
  50%      { transform: scale(1.06); }
}
@media (prefers-reduced-motion: reduce) {
  .branch__face { animation: none; }
}
a.branch:hover .branch__face,
a.branch:focus-visible .branch__face {
  border-color: var(--c-light);
  box-shadow: 0 0 64px var(--c-60), inset 0 0 26px var(--c-28);
}
a.branch:focus-visible { outline: none; }
.branch.is-soon { cursor: default; }

.branch__face .sigil {
  width: 78%;
  height: 78%;
  filter: drop-shadow(0 0 7px var(--c-60));
}

.branch__name {
  margin-top: 14px;
  font-family: var(--serif-accent);
  font-size: 13px;
  line-height: 1.35;
  letter-spacing: .16em;
  text-transform: uppercase;
  text-align: center;
  text-wrap: balance;
  color: rgba(255, 255, 255, .88);
}
/* przy pięciu działach pełne nazwy nie mieszczą się pod glifami na wąskim
   ekranie — zastępuje je wtedy sam temat działu */
.branch__name--short { display: none; }
.branch__cta {
  margin-top: 8px;
  /* przy pięciu glifach w rzędzie zachęta nie zmieści się w jednej linii
     bez zachodzenia na sąsiadów — łamie ją <br> w znaczniku na dokładnie
     dwa wiersze; sztywne 12ch rozbijało ją na trzy krzywe („kliknij, / by / rozpocząć") */
  white-space: nowrap;
  text-align: center;
  font-family: var(--serif-accent);
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(218, 211, 244, .74);
  transition: color .3s ease;
}
a.branch:hover .branch__cta,
a.branch:focus-visible .branch__cta { color: var(--c-light); }
/* tablety / wąskie okna: „by rozpocząć" sąsiednich działów prawie się stykały */
@media (max-width: 860px) {
  .branch__cta { letter-spacing: .05em; }
}
/* siedem kart tarota w rzędzie: na średnich oknach zachęty sąsiednich kart
   nachodziły na siebie — zostaje tylko pod kartą „w świetle" */
@media (max-width: 1100px) {
  .branches--cards .branch:not(.is-spot) .branch__cta { visibility: hidden; }
}

/* ---------- działy jako karty (tarot) ----------
   Zamiast okrągłych glifów — rewersy kart rozłożone łukiem jak rozkład
   na stole: środkowa większa, boczne coraz niżej i lekko odchylone. */
.branches--cards .branches__row {
  align-items: flex-start;
  gap: clamp(6px, 1.5vw, 26px);
}
/* większa jest karta „w świetle” (.is-spot) — na starcie środkowa; gdy
   działów aktywnych jest więcej, portal.js co chwilę przenosi światło
   i karty płynnie zamieniają się wielkością */
.branches--cards .branch {
  width: min(var(--size), 11.5vw);
  transition: opacity .5s ease, transform .6s cubic-bezier(.34, 1.3, .5, 1), width 1s cubic-bezier(.45, 0, .2, 1);
}
.branches--cards .branch.is-spot {
  width: min(calc(var(--size) * 1.3), 16vw);
}
.branches--cards.is-open .branch--left {
  transform: translateY(calc(var(--k) * 12px)) rotate(calc(var(--k) * -2.2deg));
}
.branches--cards.is-open .branch--right {
  transform: translateY(calc(var(--k) * 12px)) rotate(calc(var(--k) * 2.2deg));
}

.branches--cards .branch__face {
  width: 82%;
  aspect-ratio: 100 / 160;
  border: 0;
  border-radius: 7% / 4.4%;
  background: none;
  color: var(--c-light);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .5), 0 0 22px var(--c-28);
  animation: card-float 6s ease-in-out infinite;
  animation-delay: calc(var(--k, 0) * -1.9s);
  transition: box-shadow .6s ease, filter .4s ease, width 1s cubic-bezier(.45, 0, .2, 1), scale 1s cubic-bezier(.45, 0, .2, 1);
}
.branches--cards .branch.is-spot .branch__face {
  width: 88%;
  box-shadow: 0 16px 36px rgba(0, 0, 0, .55), 0 0 40px var(--c-60);
}
@keyframes card-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-7px); }
}
@media (prefers-reduced-motion: reduce) {
  .branches--cards .branch__face { animation: none; }
}
.branches--cards a.branch:hover .branch__face,
.branches--cards a.branch:focus-visible .branch__face {
  filter: brightness(1.18);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .55), 0 0 70px var(--c-60);
}
.branches--cards .branch.is-soon .branch__face {
  filter: saturate(.55);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .5);
}

.branches--cards .branch__name {
  font-size: 11.5px;
  letter-spacing: .1em;
}
.branches--cards .branch__name { transition: font-size 1s ease, color .6s ease; }
.branches--cards .branch.is-spot .branch__name {
  font-size: 14px;
  letter-spacing: .14em;
  color: #fff;
  text-shadow: 0 0 18px var(--c-60);
}

/* „‹ Ezoterium” — ten sam link powrotu co w lewym górnym rogu podstron */
.stage__back {
  position: absolute;
  top: clamp(12px, 2.4vh, 24px);
  left: clamp(16px, 4vw, 44px);
  z-index: 60;
  font-size: 13px;
  letter-spacing: .2em;
  color: var(--ink-mute);
  text-transform: uppercase;
  text-decoration: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity .5s ease .3s, visibility 0s linear .8s, color .3s ease;
}
.stage.is-branching .stage__back {
  opacity: 1;
  visibility: visible;
  transition: opacity .5s ease .3s, visibility 0s, color .3s ease;
}
.stage__back:hover { color: var(--ink); }

/* „Nasze przepowiednie” — archiwum, w tym samym rogu co link powrotu,
   więc przy rozłożonych działach znika */
.stage__archiwum {
  position: absolute;
  top: clamp(12px, 2.4vh, 24px);
  left: clamp(16px, 4vw, 44px);
  z-index: 60;
  font-family: var(--serif-accent);
  font-size: 13px;
  letter-spacing: .2em;
  color: var(--ink-mute, rgba(214, 205, 244, .72));
  text-transform: uppercase;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: opacity .4s ease, color .3s ease, border-color .3s ease;
}
.stage__archiwum:hover {
  color: #fff;
  border-bottom-color: rgba(255, 255, 255, .4);
}
.stage.is-branching .stage__archiwum {
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 639px) {
  /* nazwa systemu schodzi pod link „‹ Ezoterium” */
  .stage__branch-head { top: 30px; }
  .branches__row { gap: 8px; }
  .branch__name { font-size: 10px; letter-spacing: .06em; margin-top: 10px; }
  .branch__name:not(.branch__name--short) { display: none; }
  .branch__name--short { display: block; }
  /* dalsze rzędy chowają skróty na desktopie — bez tego na telefonie
     glify prezydentów zostawały całkiem bez podpisu */
  .branches__row--dalszy .branch__name--short { display: block; }
  /* „Prezydent USA" / „Prezydent Rosji" są szersze od glifów — 8px odstępu sklejał podpisy */
  .branches__row--dalszy { gap: 40px; }
  .branch__cta { display: none; }

  /* karty tarota: duża środkowa na górze, sześć rozkładów rzędem pod nią */
  .branches--cards .branches__row {
    flex-wrap: wrap;
    align-items: flex-start;
    column-gap: 6px;
    row-gap: 18px;
  }
  .branches--cards .branch,
  .branches--cards .branch.is-spot { width: calc((100vw - 32px - 30px) / 6); }
  .branches--cards .branch--center,
  .branches--cards .branch--center.is-spot { order: 0; flex-basis: 100%; width: auto; }
  .branches--cards .branch__face,
  .branches--cards .branch.is-spot .branch__face { width: 92%; }
  .branches--cards .branch--center .branch__face,
  .branches--cards .branch--center.is-spot .branch__face { width: min(30vw, 124px); }
  /* na telefonie rzędy stoją w miejscu — zamiana wielkości idzie przez skalę */
  .branches--cards .branch--center:not(.is-spot) .branch__face { scale: .88; }
  .branches--cards .branch:not(.branch--center).is-spot .branch__face { scale: 1.25; transform-origin: 50% 100%; }
  .branches--cards .branch:not(.branch--center).is-spot { z-index: 2; }
  .branches--cards.is-open .branch--left,
  .branches--cards.is-open .branch--right { transform: none; }
  .branches--cards .branch__name { font-size: 9px; letter-spacing: .02em; white-space: nowrap; }
  .branches--cards .branch.is-spot .branch__name { font-size: 9px; letter-spacing: .02em; }
  .branches--cards .branch.branch--center .branch__name { font-size: 12px; letter-spacing: .1em; }
  .branches--cards .branch--center .branch__name:not(.branch__name--short) { display: block; }
  .branches--cards .branch--center .branch__name--short { display: none; }
  /* środkowa karta ma na telefonie cały rząd dla siebie — zachęta w jednej linii
     (12ch + <br> łamały ją na trzy krzywe wiersze) */
  .branches--cards .branch--center .branch__cta { display: block; width: auto; }
  .branches--cards .branch--center .branch__cta br { display: none; }
}

/* ---------- strzałki ---------- */
.arrow {
  position: absolute;
  top: 40%;
  transform: translateY(-50%);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .18);
  color: rgba(255, 255, 255, .7);
  font-family: var(--serif-display);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  /* bez backdrop-filter — rozmywanie tła pod strzałką przy każdej klatce
     animacji orbity potrafiło zarżnąć słabsze GPU */
  background: rgba(20, 16, 48, .55);
  transition: background .3s ease, color .3s ease;
}
.arrow:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.arrow--left  { left: clamp(10px, 4vw, 56px); }
.arrow--right { right: clamp(10px, 4vw, 56px); }

/* ---------- pulsująca strzałka u dołu sceny ---------- */
@keyframes cue-bob { 0%, 100% { transform: translate(-50%, 0); opacity: .7; } 50% { transform: translate(-50%, 9px); opacity: 1; } }

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: clamp(18px, 4vh, 42px);
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .22);
  background: rgba(20, 16, 48, .55);
  color: rgba(238, 233, 252, .85);
  cursor: pointer;
  animation: cue-bob 2.4s ease-in-out infinite;
  transition: background .3s ease, color .3s ease, border-color .3s ease;
}
.scroll-cue:hover { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .4); }
.scroll-cue[hidden] { display: none; }
/* przy rozłożonych działach zachęta do przewijania nie ma sensu */
.stage.is-branching .scroll-cue { display: none; }

/* ============================================================
   DORADCY — sekcja pod sceną, wszyscy w siatce po 5 w rzędzie
   ============================================================ */

.advisors {
  position: relative;
  padding: clamp(48px, 8vh, 92px) 18px clamp(56px, 9vh, 104px);
  /* tło daje wspólny .cosmos — sekcja leży na nim przezroczyście */
  text-align: center;
}
.advisors__head {
  margin: 0 0 clamp(30px, 5vh, 52px);
  font-family: var(--serif-display);
  font-weight: 500;
  font-size: clamp(17px, 2.4vw, 23px);
  letter-spacing: .4em;
  text-indent: .4em;
  text-transform: uppercase;
  color: rgba(243, 230, 196, .85);
}

/* szerokość dobrana tak, by rząd mieścił dokładnie pięciu doradców */
.advisors__grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(26px, 4vh, 42px) clamp(16px, 2.4vw, 30px);
  max-width: calc(5 * 158px + 4 * 30px);
  margin: 0 auto;
}

.advisor {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 158px;
  text-decoration: none;
}

/* kolisty glif w kolorze systemu doradcy (--ac ustawiane przy każdym z osobna) —
   ta sama konstrukcja co glify orbity: obwódka, poświata i wewnętrzny blask */
.advisor__ring {
  display: block;
  width: 104px;
  height: 104px;
  padding: 4px;
  border-radius: 50%;
  border: 1.5px solid var(--ac-60, rgba(232, 196, 120, .6));
  box-shadow: 0 0 22px var(--ac-28, rgba(232, 184, 75, .28)), inset 0 0 16px var(--ac-14, rgba(232, 184, 75, .12));
  background: radial-gradient(circle at 50% 50%, var(--ac-10, rgba(232, 184, 75, .10)), transparent 72%);
  transition: box-shadow .4s ease, border-color .4s ease;
}
.advisor:hover .advisor__ring,
.advisor:focus-visible .advisor__ring {
  border-color: var(--ac, #e8c478);
  box-shadow: 0 0 46px var(--ac-60, rgba(232, 196, 120, .6)), inset 0 0 16px var(--ac-14, rgba(232, 184, 75, .12));
}
.advisor__photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  border-radius: 50%;
  filter: saturate(.8);
}
.advisor:hover .advisor__photo { filter: saturate(1); }
.advisor__name {
  max-width: 100%;
  margin-top: 4px;
  font-family: var(--serif-accent);
  font-size: 13px;
  line-height: 1.35;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(244, 238, 254, .9);
}

/* druga linijka — specjalizacja doradcy */
.advisor__role {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: -4px;
  font-family: var(--serif-accent);
  font-style: italic;
  font-size: 13px;
  white-space: nowrap;
  color: rgba(222, 215, 246, .72);
}

/* ============================================================
   STOPKA
   ============================================================ */

.footer {
  position: relative;
  background: #050412;
  color: rgba(226, 220, 248, .84);
  border-top: 1px solid var(--line);
  padding: clamp(44px, 6vw, 72px) clamp(18px, 5vw, 56px) 0;
}
.footer__inner {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: clamp(28px, 4vw, 48px);
  padding-bottom: clamp(36px, 5vw, 56px);
}
.footer__brand { display: flex; align-items: center; gap: 10px; }
.footer__seal {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 34% 28%, #e8c478, #9a7ce8 100%);
  box-shadow: 0 0 14px rgba(232, 196, 120, .35);
  color: #1c1030;
  font-weight: 700;
  font-family: var(--serif-display);
}
.footer__name {
  font-family: var(--serif-display);
  font-size: 20px;
  letter-spacing: .24em;
  color: #efeaff;
  text-transform: uppercase;
}
.footer__about {
  margin: 16px 0 0;
  max-width: 280px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--ink-mute);
  text-wrap: pretty;
}
.footer__head {
  margin: 0 0 14px;
  font-family: var(--serif-display);
  font-weight: 600;
  font-size: 11px;
  line-height: 1;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold);
}
.footer__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 13.5px;
}
.footer__list a,
.footer__mini a {
  color: rgba(226, 220, 248, .84);
  text-decoration: none;
  transition: color .25s ease;
}
.footer__list a:hover,
.footer__mini a:hover { color: #fff; }

.footer__bar {
  max-width: 1180px;
  margin: 0 auto;
  border-top: 1px solid rgba(232, 196, 120, .12);
  padding: 20px 0 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--ink-faint);
}
.footer__mini { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.footer__mini a { color: rgba(214, 208, 240, .7); }

/* ============================================================
   RESPONSYWNOŚĆ
   ============================================================ */

@media (max-width: 900px) {
  .arrow { width: 44px; height: 44px; font-size: 20px; }
}

@media (max-width: 639px) {
  .stage { min-height: 600px; }
  /* tytuł schodzi pod narożny link „Nasze przepowiednie” */
  .stage__header { top: 52px; }
  .arrow { display: none; }
  .planet__name { font-size: 11px; letter-spacing: .14em; }
  .planet.is-selected .planet__name { font-size: 13px; }
  .planet__cta { font-size: 10px; letter-spacing: .16em; top: calc(112% + 20px); }

  .advisors__head { letter-spacing: .28em; text-indent: .28em; }
  .advisor { width: 136px; }
  .advisor__ring { width: 86px; height: 86px; padding: 3px; }
  .advisor__name { font-size: 11px; letter-spacing: .08em; }
  .advisor__role { font-size: 12px; }

  /* rzadsze tło — mniej pracy dla słabszych urządzeń */
  .star:nth-child(2n),
  .spark:nth-child(2n),
  .tcard:nth-child(2n),
  .glyph:nth-child(3n) { display: none; }

  .footer__bar { justify-content: center; text-align: center; }
}

/* ---------- brak JS: statyczna lista systemów ---------- */
.no-js .planets {
  position: absolute;
  inset: auto 0 auto 0;
  top: 34%;
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  justify-content: center;
  padding: 0 18px;
}
.no-js .planet {
  position: relative;
  transform: none;
  visibility: visible;
  width: 84px;
  height: 84px;
}
.no-js .orbit,
.no-js .arrow,
.no-js .planet__cta { display: none; }

/* ---------- ograniczenie ruchu ---------- */
@media (prefers-reduced-motion: reduce) {
  .nebula, .star, .spark, .tcard, .glyph, .scroll-cue { animation: none; }
  .sky, .planet__face, .arrow { transition-duration: .01ms; }
  .loader__orbits, .loader__mark { animation-duration: 6s; }
}
