/* ============================================================
   GALILEO — style bazowe (system Liquid Glass)
   Reset, typografia, zorza tła, materiał szkła, nawigacja-pigułka,
   dolny pasek zakładek (mobile), przyciski, animacje sprężynowe,
   linia konstelacji, wyszukiwarka, arkusz kontaktu, toast-wyspa.
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;

  /* ============================================================
     DLACZEGO ANDROID WYGLĄDAŁ INACZEJ NIŻ iPHONE
     ------------------------------------------------------------
     Chrome na Androidzie ma mechanizm „font boosting": sam
     POWIĘKSZA tekst w blokach, które uzna za treść główną,
     ignorując rozmiary z CSS. Miało to ratować strony bez wersji
     mobilnej, ale na stronie responsywnej robi dokładnie to, co
     widać na zrzucie: litery puchną, wiersze się wydłużają,
     wszystko robi się ciasne i poprzesuwane.

     Safari na iOS tego nie robi — stąd ta sama strona wyglądała
     tam poprawnie, a na Androidzie „bardziej ściśnięta".

     `text-size-adjust: 100%` mówi przeglądarce: nie ruszaj moich
     rozmiarów, wiem co robię. To jedna linia, która wyrównuje
     obie platformy. */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  background: var(--page-bg);
  color: var(--ink);
  line-height: 1.65;
  /* overflow-x ustawiony niżej, razem z uzasadnieniem */
  transition: background 600ms ease, color 400ms ease;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink-strong);
  line-height: 1.15;
}
h1, h2 { font-weight: 800; letter-spacing: -0.015em; } /* cięższy display = pazur */

/* ziarno filmowe — tekstura nad całością (statyczne, tanie) */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 3000;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
}
body[data-theme="light"]::after { opacity: 0.035; }
h1 em, h2 em, h3 em { font-style: italic; font-weight: 600; }

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
::selection { background: var(--deep-pink); color: var(--white); }

/* ---------- Zorza za szkłem ---------- */
.theme-aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.theme-aurora i {
  position: absolute;
  border-radius: 50%;
  /* mniejszy promień rozmycia + tylko translate w animacji (bez scale):
     rozmyta plama rasteryzuje się RAZ do warstwy kompozytora i jest tylko
     przesuwana. Wcześniej scale() wymuszał ponowne rozmycie w każdej klatce —
     zawsze, na całej stronie (aurora jest position:fixed). To był główny lag. */
  filter: blur(58px);
  opacity: var(--aur-opacity);
  transition: background 700ms ease;
  animation: aurora-drift 34s ease-in-out infinite alternate;
  will-change: transform;
}
.theme-aurora i:nth-child(1) { width: 44vw; height: 44vw; left: -11vw; top: 2vh; background: var(--aur-1); }
.theme-aurora i:nth-child(2) { width: 36vw; height: 36vw; right: -9vw; top: 24vh; background: var(--aur-2); animation-delay: -9s; }
.theme-aurora i:nth-child(3) { width: 30vw; height: 30vw; left: 28vw; top: 60vh; background: var(--aur-3); animation-delay: -17s; }
@keyframes aurora-drift {
  /* wyłącznie translate — kompozytor tylko przesuwa gotową warstwę (tanio).
     Żadnego scale, które wymuszałoby ponowną rasteryzację rozmycia. */
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(6vw, -5vh, 0); }
}

/* ---------- Materiał: liquid glass ---------- */
.glass {
  position: relative;
  background: var(--panel-bg);
  backdrop-filter: var(--panel-blur);
  -webkit-backdrop-filter: var(--panel-blur);
  border-radius: var(--radius-l);
  box-shadow:
    inset 0 1.5px 0 var(--panel-hi),
    0 0 0 1px var(--panel-ring),
    var(--panel-shadow);
  transition: background 500ms ease, box-shadow 500ms ease;
}
.glass::before { /* smuga refrakcji */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(115deg, rgba(255,255,255,0.13) 0%, rgba(255,255,255,0) 30%, rgba(255,255,255,0) 70%, rgba(255,255,255,0.06) 100%);
}
/* blik ślizgający się za kursorem (ustawiany w JS: --gx, --gy) */
.glass-glare::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(240px circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, 0.22), transparent 60%);
  transition: opacity 350ms ease;
}
.glass-glare:hover::after { opacity: 1; }

/* ---------- Kontenery i sekcje ---------- */
.container { max-width: var(--container); margin: 0 auto; padding: 0 5%; position: relative; z-index: 2; }
.section { padding: var(--space-section) 0; position: relative; }
/* dawne opaque tła sekcji są teraz przezroczyste — wszystko pływa nad zorzą */
.section-lavender, .section-white { background: transparent; }

.section-header { max-width: 780px; margin-bottom: clamp(2.5rem, 4vw, 4rem); }

/* ============================================================
   NAGŁÓWKI SEKCJI — koniec z jedną pozycją dla wszystkich
   ------------------------------------------------------------
   Ta klasa robiła wcześniej `margin: auto` plus `text-align: center`,
   przez co KAŻDY nagłówek na stronie lądował w tym samym punkcie.
   Zmierzone na stronie głównej: cztery nagłówki, wszystkie na
   left: 332px, szerokość 761px — co do piksela identycznie.
   To jest dokładnie ten rytm, który czyta się jako „zrobione
   automatem": nie brak ozdób, tylko powtarzalność pozycji.

   Zamiast tego wcięcie ROTUJE w dół strony. Krok pięciostopniowy,
   nie czterostopniowy, bo sekcje z nagłówkami rzadko stoją co
   równo — przy module 5 kolejne trafienia rozchodzą się szerzej
   i sąsiednie nagłówki nie powtarzają pozycji.

   Klasa `.center` zostaje w HTML: nic nie trzeba przepisywać
   w szesnastu plikach, a nazwa i tak opisuje już tylko to,
   że nagłówek należy do rotacji.
   ============================================================ */
.section-header.center { margin-left: 0; margin-right: 0; text-align: left; }

main > section:nth-of-type(5n+2) .section-header.center { margin-left: 13%; }
main > section:nth-of-type(5n+3) .section-header.center { margin-left: auto; margin-right: 2%; }
main > section:nth-of-type(5n+4) .section-header.center { margin-left: 6%; }
main > section:nth-of-type(5n+5) .section-header.center { margin-left: 19%; }

/* Na wąskim ekranie wcięcia znikają — 19% z 375px to 71px zjedzone
   z i tak wąskiej kolumny. Rotacja ma sens tylko tam, gdzie jest
   czym rotować. */
@media (max-width: 900px) {
  main > section .section-header.center { margin-left: 0; margin-right: 0; }
}
.section-header h2 { font-size: var(--text-h2); margin-bottom: 0.6rem; }
.section-header p { font-size: var(--text-lead); color: var(--ink-soft); }

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}
.kicker::before { content: ""; width: 26px; height: 2px; background: var(--accent); border-radius: 2px; }
.section-header.center .kicker::before { margin-left: auto; }

/* wariacja nagłówka: kursywa Literaty zamiast chipa (różnicuje rytm sekcji) */
.lead-italic {
  display: block;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: clamp(1.15rem, 1.9vw, 1.5rem);
  color: var(--accent);
  margin-bottom: 0.7rem;
}
.cosmic .lead-italic, .section.cosmic .lead-italic { color: var(--pink); }

/* sekcje kosmiczne (hero, stopka) zachowują nocne niebo w obu motywach */
.cosmic { color: var(--lavender); }
.cosmic h1, .cosmic h2, .cosmic h3, .cosmic h4 { color: var(--white); }
.cosmic .section-header p { color: var(--light-blue); }
.cosmic .kicker { color: var(--pink); }
.cosmic .kicker::before { background: var(--pink); }

/* ---------- Przyciski ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.02rem;
  padding: 15px 32px;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  white-space: nowrap;  /* dłuższe napisy nie łamią się na dwie linie */
  transition: transform var(--spring-fast), box-shadow var(--spring-fast), background-color 250ms ease, filter 250ms ease;
  will-change: transform;
}
/* --magx/--magy ustawia efekt magnetyczny (main.js) */
.btn { transform: translate(var(--magx, 0px), var(--magy, 0px)) scale(1); }
.btn:hover { transform: translate(var(--magx, 0px), var(--magy, 0px)) scale(1.045); }
/* wciśnięcie ma być natychmiastowe (100 ms), powrót — sprężynowy (asymetria iOS) */
.btn:active { transform: translate(var(--magx, 0px), var(--magy, 0px)) scale(0.96); transition-duration: 100ms; }
.btn .arrow { transition: transform var(--spring-fast); }
.btn:hover .arrow { transform: translateX(5px); }

.btn-primary {
  background: linear-gradient(135deg, var(--deep-pink), var(--magenta));
  color: var(--white);
  box-shadow: 0 10px 30px rgba(213, 81, 151, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn-primary:hover { box-shadow: 0 14px 38px rgba(164, 50, 135, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.35); }
.btn-deeppink {
  background: var(--deep-pink);
  color: var(--white);
  box-shadow: 0 10px 30px rgba(213, 81, 151, 0.45), inset 0 1px 0 rgba(255,255,255,0.3);
}
.btn-deeppink:hover { background: var(--magenta); }
.btn-magenta {
  background: var(--magenta);
  color: var(--white);
  box-shadow: 0 10px 30px rgba(164, 50, 135, 0.45), inset 0 1px 0 rgba(255,255,255,0.3);
}
.btn-magenta:hover { background: var(--deep-pink); }
.btn-navy { background: var(--navy); color: var(--white); box-shadow: 0 8px 24px rgba(34,53,99,0.3); }
.btn-glass { color: var(--ink-strong); }
.btn-ghost { /* na ciemnych hero */
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(8px);
}

.link-underline { position: relative; font-weight: 600; }
.link-underline::after {
  content: ""; position: absolute; left: 0; bottom: -3px;
  width: 100%; height: 2px; background: currentColor;
  transform: scaleX(0); transform-origin: right;
  transition: transform var(--spring-med);
}
.link-underline:hover::after { transform: scaleX(1); transform-origin: left; }

/* ---------- Nawigacja: pływająca pigułka ---------- */
.nav-pill {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 7px 9px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  max-width: 96vw;
}
.nav-pill .brand-dot { display: flex; align-items: center; margin-right: 4px; flex-shrink: 0; }
.nav-pill .brand-dot img {
  width: 42px; height: 42px; min-width: 42px; /* nie ściska się na węższym ekranie */
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  /* obrączka + cień odcinają logo od szkła w obu motywach (widoczność) */
  box-shadow: 0 0 0 1.5px var(--panel-hi), 0 3px 12px rgba(6, 10, 26, 0.35);
  transition: transform var(--spring-med), box-shadow var(--spring-med);
}
.nav-pill .brand-dot:hover img {
  transform: rotate(-12deg) scale(1.12);
  box-shadow: 0 0 0 2px var(--accent), 0 6px 20px rgba(213, 81, 151, 0.45);
}
.nav-pill a.nl {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink);
  padding: 9px 15px;
  border-radius: var(--radius-pill);
  transition: transform var(--spring-fast), color 200ms ease;
}
/* szklany wskaźnik ślizgający się pod linkami (jak segmented control) */
.nav-ind {
  position: absolute;
  top: 7px;
  height: calc(100% - 14px);
  left: 0;
  width: 0;
  border-radius: var(--radius-pill);
  background: var(--panel-hover-bg);
  box-shadow: inset 0 1px 0 var(--panel-hi);
  opacity: 0;
  pointer-events: none;
  transition: transform var(--spring-med), width var(--spring-med), opacity 250ms ease;
}
.nav-ind.on { opacity: 1; }
.nav-pill a.nl:active, .nav-pill .nl-toggle:active { transform: scale(0.93); transition-duration: 100ms; }
.nav-pill a.nl.active, .nav-pill .nl-toggle.active { color: var(--accent); }

/* przyciski-rozwijaki wyglądają jak zwykłe linki nawigacji */
.nav-pill .nl-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: transparent;
  border: none;
  cursor: pointer;
  /* WAŻNE: <button> NIE dziedziczy koloru — bez tego przeglądarka daje
     czarny domyślny tekst, niewidoczny na nocnej pigułce (kontrast 1.25). */
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 800;      /* wyraźnie grubsze pozycje z rozwijaną strzałką */
  font-size: 0.96rem;
}
.nl-drop { margin: 0 8px; }   /* więcej powietrza między „Dołącz do nas”, „O nas” i „Kontakt” */
.nav-pill > a.nl { margin: 0 4px; }
.nav-pill .nl-toggle .caret { font-size: 0.7em; transition: transform var(--spring-fast); }
.nl-drop { position: relative; }
.nl-drop.open .nl-toggle .caret,
.nl-drop:hover .nl-toggle .caret { transform: rotate(180deg); }

/* menu rozwijane (custom, szklane) */
.nl-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  min-width: 260px;
  padding: 8px;
  background: var(--menu-bg);   /* gęstsze tło niż zwykłe szkło — mniej prześwitu */
  border-radius: var(--radius-m);
  display: grid;
  gap: 2px;
  opacity: 0;
  transform: translateX(-50%) translateY(-8px) scale(0.97);
  transform-origin: top center;
  pointer-events: none;
  transition: opacity var(--spring-fast), transform var(--spring-fast);
  z-index: 1010;
}
.nl-drop:hover .nl-menu,
.nl-drop.open .nl-menu,
.nl-drop:focus-within .nl-menu {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
  pointer-events: auto;
}
/* mostek, żeby najechanie nie gubiło menu w luce */
.nl-drop::after { content: ""; position: absolute; top: 100%; left: 0; right: 0; height: 12px; }
.nl-menu a {
  display: grid;
  gap: 1px;
  padding: 10px 14px;
  border-radius: var(--radius-s);
  color: var(--ink);
  transition: background 150ms ease, transform var(--spring-fast);
}
.nl-menu a:hover { background: var(--panel-hover-bg); }
.nl-menu a:active { transform: scale(0.97); }
.nl-menu a b { font-family: var(--font-display); font-size: 1.02rem; color: var(--ink-strong); font-weight: 800; letter-spacing: -0.01em; }
.nl-menu a small { font-size: 0.8rem; color: var(--ink-soft); font-weight: 600; }
.nav-pill .nav-cta {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--white);
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--deep-pink), var(--magenta));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.3);
  border: none;
  cursor: pointer;
  transition: transform var(--spring-fast);
  margin-left: 4px;
}
.nav-pill .nav-cta { transform: translate(var(--magx, 0px), var(--magy, 0px)) scale(1); }
.nav-pill .nav-cta:hover { transform: translate(var(--magx, 0px), var(--magy, 0px)) scale(1.06); }
.nav-pill .nav-cta:active { transform: translate(var(--magx, 0px), var(--magy, 0px)) scale(0.93); transition-duration: 100ms; }

/* przełącznik wyglądu: segmentowy Dzień/Noc (widoczny, jak przy porównaniu szkół) */
.theme-seg {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: var(--radius-pill);
  background: var(--field-bg);
  box-shadow: inset 0 1px 3px rgba(13, 23, 48, 0.25);
  margin: 0 2px;
  flex-shrink: 0;
}
.theme-opt {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.82rem;
  /* pełny tusz, nie przygaszony: nad ciemnym hero mleczna pigułka schodzi
     do ~rgb(192,195,201), gdzie --ink-soft dawał tylko 3.3:1 (poniżej AA).
     Stan wybrany i tak wyróżnia różowa pigułka. */
  color: var(--ink);
  padding: 7px 13px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  transition: background var(--spring-fast), color 200ms ease, transform var(--spring-fast);
}
.theme-opt:active { transform: scale(0.92); }
.theme-opt.on {
  background: linear-gradient(135deg, var(--deep-pink), var(--magenta));
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.35), 0 2px 8px rgba(213,81,151,0.4);
}
@media (max-width: 560px) { .theme-opt .ts-txt { display: none; } .theme-opt { padding: 7px 10px; } }

@media (max-width: 1080px) {
  .nav-pill a.nl, .nav-pill .nl-drop, .nav-pill .nav-cta { display: none; }
  .nav-pill { left: 16px; transform: none; }
}

/* ---------- Dolny pasek zakładek (mobile, jak w iOS) ---------- */
.tab-bar {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  z-index: 1000;
  display: none;
  gap: 2px;
  padding: 8px 10px;
  border-radius: var(--radius-pill);
}
.tab-bar a, .tab-bar button {
  display: grid;
  justify-items: center;
  gap: 3px;
  min-width: 58px;
  padding: 6px 8px;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  border-radius: 16px;
  font-family: var(--font-display);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: color 200ms ease, transform var(--spring-fast), background var(--spring-fast);
}
.tab-bar a:active, .tab-bar button:active { transform: scale(0.9); transition-duration: 100ms; }
/* podskok ikony po tapnięciu zakładki */
.tab-bar .boing { animation: tab-boing 420ms var(--spring); }
@keyframes tab-boing {
  0% { transform: scale(1); }
  35% { transform: scale(1.28) translateY(-2px); }
  100% { transform: scale(1); }
}
.tab-bar svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tab-bar .active { color: var(--accent); }
@media (max-width: 1080px) {
  .tab-bar { display: flex; }
  body { padding-bottom: 92px; }
}

/* ---------- Stopka (zawsze nocna) ---------- */
.site-footer {
  position: relative;
  z-index: 2;
  background:
    radial-gradient(1.5px 1.5px at 12% 30%, rgba(255,255,255,.7) 50%, transparent 51%),
    radial-gradient(1px 1px at 28% 68%, rgba(255,255,255,.5) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 44% 22%, rgba(255,255,255,.6) 50%, transparent 51%),
    radial-gradient(1px 1px at 61% 55%, rgba(255,255,255,.45) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 76% 30%, rgba(255,255,255,.65) 50%, transparent 51%),
    radial-gradient(1px 1px at 89% 70%, rgba(255,255,255,.5) 50%, transparent 51%),
    linear-gradient(180deg, var(--night-2), var(--night-1));
  color: var(--lavender);
  padding: clamp(3.5rem, 6vw, 5.5rem) 0 2rem;
  overflow: hidden;
  border-radius: var(--radius-l) var(--radius-l) 0 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: clamp(2rem, 4vw, 4rem);
  margin-bottom: 3rem;
}
.footer-brand img { height: 84px; margin-bottom: 1.1rem; }
.footer-brand p { font-size: 0.98rem; color: var(--light-blue); max-width: 30ch; }
.site-footer h4 { color: var(--white); font-size: 1.05rem; margin-bottom: 1.1rem; letter-spacing: 0.04em; }
.site-footer ul { list-style: none; display: grid; gap: 0.55rem; font-size: 0.98rem; }
.site-footer ul a { color: var(--lavender); transition: color var(--dur-fast) ease; }
.site-footer ul a:hover { color: var(--pink); }
.footer-contact li { color: var(--light-blue); }
.footer-contact strong { color: var(--white); font-weight: 600; }
.footer-social { display: flex; gap: 0.8rem; margin-top: 1.2rem; }
.footer-social a {
  display: grid; place-items: center;
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid rgba(168, 195, 207, 0.35);
  transition: transform var(--spring-fast), background 250ms ease, border-color 250ms ease;
}
.footer-social a:hover { border-color: var(--pink); background: rgba(225, 121, 159, 0.14); transform: scale(1.12); }
.footer-social a:active { transform: scale(0.92); }
.footer-social svg { width: 18px; height: 18px; fill: var(--lavender); }
.footer-social a:hover svg { fill: var(--pink); }
.footer-bottom {
  border-top: 1px solid rgba(168, 195, 207, 0.18);
  padding-top: 1.6rem;
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between;
  font-size: 0.9rem; color: var(--light-blue);
}
.footer-bottom a { color: var(--lavender); }
.footer-bottom a:hover { color: var(--pink); }
@media (max-width: 960px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Animacje wejścia — sprężynowe, subtelne (iOS) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px) scale(0.975);
  filter: blur(6px);
  transition: opacity 550ms ease, transform var(--spring-slow), filter 500ms ease;
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform, filter;
}
.reveal.in { opacity: 1; transform: none; filter: blur(0); }
.reveal-left { transform: translateX(-22px) scale(0.975); }
.reveal-right { transform: translateX(22px) scale(0.975); }
.reveal-scale { transform: scale(0.94); }
.reveal-left.in, .reveal-right.in, .reveal-scale.in { transform: none; }

/* ---------- Linia konstelacji ---------- */
.constellation-rail {
  position: absolute;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 5;
  overflow: visible;
  /* własna warstwa GPU: scroll nie przemalowuje linii, tylko ją przesuwa */
  will-change: transform;
  contain: layout;
}
/* łuna bez filtrów SVG (wydajność!): coraz węższe, coraz jaśniejsze
   pociągnięcia tej samej ścieżki imitują poświatę */
.constellation-rail path { fill: none; stroke-linecap: round; }
.constellation-rail .line-halo { stroke: #7d2ba0; stroke-width: 13; opacity: 0.16; }
.constellation-rail .line-glow { stroke: url(#constellationGradient); stroke-width: 6.5; opacity: 0.34; }
.constellation-rail .line-soft { stroke: url(#constellationGradient); stroke-width: 3.2; opacity: 0.62; }
.constellation-rail .line-core { stroke: url(#constellationGradient); stroke-width: 1.8; }
.constellation-rail .comet-halo, .constellation-rail .comet-core { transition: opacity 0.45s ease; }
.constellation-rail .comet-core { filter: drop-shadow(0 0 9px rgba(255, 255, 255, 0.95)); }
.constellation-rail .c-star { opacity: 0.45; transition: opacity var(--dur-med) ease; }
.constellation-rail .star-inner {
  transform: scale(0.5);
  transform-box: fill-box;
  transform-origin: center;
  transition: transform var(--spring-slow);
}
.constellation-rail .star-shape {
  fill: var(--white);
  stroke: var(--navy);
  stroke-width: 1.4;
  paint-order: stroke;
  filter: drop-shadow(0 0 7px rgba(168, 195, 207, 0.95));
}
.constellation-rail .star-halo {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  transition: opacity var(--dur-med) ease;
}
.constellation-rail .c-star.lit { opacity: 1; }
.constellation-rail .c-star.lit .star-inner { transform: scale(1); }
.constellation-rail .c-star.lit .star-halo { opacity: 0.85; animation: halo-pulse 2.6s ease-in-out infinite; }
@keyframes halo-pulse {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.4); opacity: 0.4; }
}
@media (max-width: 1100px) { .constellation-rail { display: none; } }

/* panele leżą nad linią — linia nurkuje pod szkło (i prześwituje przez nie) */
.value-card, .photo-card, .time-card, .faq-item, .contact-card,
.gallery-ph, .video-frame, .qr-card, .contact-form, .map-frame,
.compare-card, .solar-stage, .counter {
  position: relative;
  z-index: 6;
}

/* ---------- Wskaźnik postępu — fazy księżyca ---------- */
.moon-progress {
  position: fixed;
  right: 22px; bottom: 22px;
  width: 50px; height: 50px;
  z-index: 900;
  border-radius: 50%;
  box-shadow: 0 6px 24px rgba(13, 23, 48, 0.45), 0 0 18px rgba(168, 195, 207, 0.25);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--spring-med), transform var(--spring-med);
  cursor: pointer;
}
.moon-progress.visible { opacity: 1; transform: translateY(0); }
.moon-progress:hover { transform: scale(1.1); }
.moon-progress:active { transform: scale(0.92); }
@media (max-width: 1080px) {
  .moon-progress { right: 14px; bottom: 104px; width: 42px; height: 42px; }
}

/* ---------- Toast: kapsuła jak Dynamic Island ---------- */
.toast {
  position: fixed;
  left: 50%; top: 16px;
  transform: translate(-50%, -80px) scale(0.8);
  background: rgba(6, 11, 26, 0.94);
  color: var(--white);
  font-family: var(--font-display);
  font-size: 0.95rem;
  padding: 14px 28px;
  border-radius: var(--radius-pill);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  opacity: 0;
  pointer-events: none;
  transition: transform var(--spring-med), opacity 300ms ease;
  z-index: 1600;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translate(-50%, 52px) scale(1); }

/* ---------- Arkusz kontaktu (iOS bottom sheet) ---------- */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1400;
  background: rgba(13, 23, 48, 0.45);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 350ms ease;
}
.sheet-backdrop.open { opacity: 1; pointer-events: auto; }
.contact-sheet {
  position: fixed;
  left: 50%; bottom: 0;
  transform: translate(-50%, 110%);
  z-index: 1500;
  width: min(480px, 96vw);
  border-radius: var(--radius-l) var(--radius-l) 0 0;
  padding: 14px 22px calc(22px + env(safe-area-inset-bottom, 0px));
  transition: transform var(--spring-slow);
}
.contact-sheet.open { transform: translate(-50%, 0); }
.contact-sheet .grabber {
  width: 42px; height: 5px;
  border-radius: 3px;
  background: var(--hairline);
  margin: 0 auto 14px;
}
.contact-sheet h3 { font-size: 1.25rem; text-align: center; margin-bottom: 0.3rem; }
.contact-sheet .sub { text-align: center; font-size: 0.9rem; color: var(--ink-soft); margin-bottom: 1.1rem; }
.sheet-actions { display: grid; gap: 9px; }
.sheet-actions a {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px;
  border-radius: var(--radius-m);
  background: var(--panel-hover-bg);
  transition: transform var(--spring-fast), background 200ms ease;
}
.sheet-actions a:hover { background: var(--panel-bg); }
.sheet-actions a:active { transform: scale(0.965); }
.sheet-actions .ico {
  width: 42px; height: 42px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--deep-pink), var(--magenta));
  color: var(--white);
  font-size: 1.1rem;
}
.sheet-actions b { font-family: var(--font-display); font-size: 1rem; color: var(--ink-strong); display: block; }
.sheet-actions small { font-size: 0.82rem; color: var(--ink-soft); }
.sheet-close {
  width: 100%;
  margin-top: 12px;
  padding: 13px;
  border: none;
  border-radius: var(--radius-m);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--ink-strong);
  background: var(--panel-hover-bg);
  cursor: pointer;
  transition: transform var(--spring-fast);
}
.sheet-close:active { transform: scale(0.97); }

/* ---------- Wyszukiwarka (pływający dok / overlay) ---------- */
.search-dock {
  position: fixed;
  left: 50%; bottom: 20px;
  transform: translateX(-50%);
  z-index: 950;
  width: min(540px, 92vw);
}
@media (max-width: 1080px) {
  /* na mobile dok chowa się — otwiera go zakładka "Szukaj" jako overlay */
  .search-dock { display: none; bottom: auto; top: 12vh; z-index: 1300; }
  .search-dock.overlay-open { display: block; }
}
.search-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 21px;
  border-radius: var(--radius-pill);
  transition: transform var(--spring-fast);
}
.search-dock:focus-within .search-bar { transform: scale(1.03); }
.search-bar svg { width: 19px; height: 19px; stroke: var(--ink-soft); fill: none; stroke-width: 2.2; stroke-linecap: round; flex-shrink: 0; }
.search-bar input {
  flex: 1;
  background: none; border: none; outline: none;
  font-family: var(--font-body);
  font-size: 1.02rem;
  color: var(--ink-strong);
}
.search-bar input::placeholder { color: var(--ink-soft); opacity: 0.95; }
.search-bar kbd {
  font-family: var(--font-display);
  font-size: 0.72rem;
  color: var(--ink-soft);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 2px 7px;
}
@media (max-width: 1080px) { .search-bar kbd { display: none; } }
.search-results {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 0; right: 0;
  padding: 9px;
  border-radius: var(--radius-m);
  opacity: 0;
  transform: translateY(14px) scale(0.97);
  pointer-events: none;
  transition: opacity var(--spring-fast), transform var(--spring-fast);
  max-height: min(340px, 46vh);
  overflow: auto;
}
@media (max-width: 1080px) {
  .search-results { bottom: auto; top: calc(100% + 12px); transform: translateY(-14px) scale(0.97); }
}
.search-dock.open .search-results { opacity: 1; transform: none; pointer-events: auto; }
.search-results a {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 12px 15px;
  border-radius: var(--radius-s);
  color: var(--ink);
  font-size: 0.96rem;
  transition: background 150ms ease, transform var(--spring-fast);
  /* wyniki wchodzą kaskadą (opóźnienie ustawia search.js) */
  animation: result-pop 380ms var(--spring) both;
  animation-delay: var(--stagger, 0ms);
}
@keyframes result-pop {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.search-results a:hover { background: var(--panel-hover-bg); }
.search-results a:active { transform: scale(0.97); }
.search-results a small {
  color: var(--accent);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  flex-shrink: 0;
}
.search-results .empty { padding: 13px 15px; color: var(--ink-soft); font-style: italic; font-size: 0.95rem; }

/* ---------- Światło podążające za kursorem (kinowe oświetlenie nocy) ---------- */
.mouse-light {
  position: fixed;
  top: 0; left: 0;
  width: 560px; height: 560px;
  margin: -280px 0 0 -280px;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(225, 121, 159, 0.13) 0%,
    rgba(168, 195, 207, 0.07) 42%,
    transparent 70%);
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: 2500;
  opacity: 0;
  transition: opacity 500ms ease;
  will-change: transform;
}
body[data-theme="dark"] .mouse-light.on { opacity: 1; }

/* ---------- Drobiazgi ---------- */
.text-pink { color: var(--deep-pink); }
.text-blue { color: var(--light-blue); }

/* ============================================================
   BRAK BUJANIA W BOK NA TELEFONIE
   ------------------------------------------------------------
   Zmierzone na 390px: o-nas dawało się przesunąć w bok o 22px,
   dolacz o 52px, index o 8px. Źródłem są dekoracje (zorza,
   wzgórza, poświata za kursorem) — każda siedzi w kontenerze
   z `overflow: hidden`, więc nic nie wystaje wizualnie, ale
   dokument i tak liczy je do swojej szerokości i pozwala
   przewijać w bok. Na telefonie czuć to jako luźną stronę.

   Sprawdzone pomiarem, nie z pamięci. Każde ustawienie przycinania
   na poziomie dokumentu unieruchamia `position: sticky` u potomków
   — a mamy taki spis treści w Kopalni Wiedzy:

     tylko html { clip }          bok zablokowany, sticky PADA
     tylko body { clip }          sticky działa, ale bok wraca
     tylko body { hidden }        sticky PADA
     html + body { clip }         bok zablokowany, sticky PADA

   Nie da się mieć obu naraz w jednej regule, więc rozdzielamy je
   po szerokości ekranu. Bujanie w bok występuje wyłącznie na wąskich
   ekranach (zmierzone: 8px, 22px i 52px przy 390px), a układ ze
   sticky i tak zwija się do jednej kolumny poniżej 960px — więc
   poniżej 900px nie ma czego psuć, a powyżej nie ma czego naprawiać.

   `clip`, nie `hidden`: `hidden` tworzy kontener przewijania,
   `clip` tylko przycina.
   ============================================================ */
@media (max-width: 900px) {
  html, body { overflow-x: clip; }
}

@supports not (overflow-x: clip) {
  @media (max-width: 900px) {
    html, body { overflow-x: hidden; }
  }
}
