/* ============================================================
   REFORMA FX — warstwa wizualna (v19)
   Wspólny arkusz dla wszystkich podstron.
   Używa zmiennych CSS zdefiniowanych w każdej podstronie
   (--brass, --bg, --panel, --line, --text), więc automatycznie
   działa w motywie jasnym i ciemnym.
   ============================================================ */

/* ---------- 2. MAGNETIC BUTTONS ---------- */
.fx-mag {
  will-change: transform;
  position: relative;
}
/* poświata pod przyciskiem przy hover — sam przycisk, nie kursor */
.fx-mag::after {
  content: ''; position: absolute; inset: -2px; z-index: -1;
  background: radial-gradient(circle at 50% 50%, rgba(176,141,87,.34), transparent 72%);
  opacity: 0; transition: opacity .3s ease;
  pointer-events: none; filter: blur(12px);
}
.fx-mag:hover::after { opacity: 1; }

/* ---------- 3. TILT 3D ---------- */
.fx-tiltable {
  will-change: transform;
  transform-style: preserve-3d;
  /* nadpisuje ewentualne transform-transition ze strony, żeby JS miał kontrolę */
  transition: box-shadow .3s ease, border-color .3s ease;
}
.fx-tiltable:hover {
  box-shadow: 0 30px 60px -24px rgba(0,0,0,.62), 0 0 0 1px var(--brass, #B08D57);
  z-index: 3;
}
[data-theme="light"] .fx-tiltable:hover {
  box-shadow: 0 30px 60px -26px rgba(0,0,0,.26), 0 0 0 1px var(--brass, #8F6D3B);
}
/* wewnętrzna warstwa "unosi się" nad kartą przy tilcie */
.fx-tiltable > * { transform: translateZ(0); }

/* ---------- 4. REVEAL (fade + wjazd, BEZ filter:blur) ----------
   Wcześniejsza wersja używała filter:blur() do efektu "blur-to-focus".
   USUNIĘTE 30.07.2026 — potwierdzony na żywej produkcji realny problem:
   blur() na kilkudziesięciu elementach naraz (38+ na samej stronie głównej,
   animowanych masowo przy scrollu) powodował silne zacinanie na telefonach.
   Zostaje tańszy dla GPU fade+translateY+scale (samo compositing,
   bez przeliczania rozmycia). NIE przywracać filter:blur w tym miejscu. */
.fx-in {
  opacity: 0;
  transform: translate3d(0, 34px, 0) scale(.985);
  transition:
    opacity .6s cubic-bezier(.16,.84,.28,1),
    transform .6s cubic-bezier(.16,.84,.28,1);
  will-change: opacity, transform;
}
.fx-in.fx-vis {
  opacity: 1;
  transform: translate3d(0,0,0) scale(1);
}
/* wariant: wjazd z boku */
.fx-in.fx-left  { transform: translate3d(-42px, 14px, 0) scale(.985); }
.fx-in.fx-right { transform: translate3d(42px, 14px, 0) scale(.985); }
.fx-in.fx-left.fx-vis, .fx-in.fx-right.fx-vis { transform: translate3d(0,0,0) scale(1); }
/* wariant: skala (dla obrazów/kart) */
.fx-in.fx-scale { transform: scale(.9); }
.fx-in.fx-scale.fx-vis { transform: scale(1); }

/* dopalenie istniejącej klasy .reveal (index.html/ebooki) — zostaje tylko
   szybszy czas przejścia, bez blur */
.reveal { transition-duration: .6s; }

/* ---------- 5. SPLIT-TEXT ---------- */
.fx-char {
  display: inline-block;
  opacity: 0;
  transform: translate3d(0, 0.7em, 0) rotateX(-72deg);
  transform-origin: 50% 100%;
  transition:
    opacity .62s cubic-bezier(.16,.84,.28,1),
    transform .62s cubic-bezier(.16,.84,.28,1);
  will-change: opacity, transform;
}
.fx-chars-in .fx-char {
  opacity: 1;
  transform: translate3d(0,0,0) rotateX(0);
}

/* ---------- 6. MARQUEE ---------- */
.fx-marquee {
  width: 100vw; margin-left: calc(50% - 50vw);
  overflow: hidden; padding: 60px 0;
  border-top: 1px solid var(--line, #232323);
  border-bottom: 1px solid var(--line, #232323);
}
.fx-marquee-track {
  display: flex; width: max-content; white-space: nowrap;
  will-change: transform;
  font-size: clamp(40px, 8vw, 96px); font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px var(--stroke, #3A3A34);
}
.fx-marquee-track b {
  color: var(--brass, #B08D57);
  -webkit-text-stroke: 0;
  font-weight: 700;
}
.fx-marquee-track > span { padding-right: .4em; }

/* ---------- 7. SCROLL PROGRESS ---------- */
.fx-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px;
  z-index: 300; pointer-events: none;
}
.fx-progress i {
  display: block; height: 100%; width: 100%;
  background: linear-gradient(90deg, var(--brass, #B08D57), rgba(176,141,87,.35));
  transform-origin: 0 50%; transform: scaleX(0);
  will-change: transform;
}

/* ---------- 8. PAGE VEIL ---------- */
.fx-veil {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg, #0A0A0A);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .35s ease;
}
.fx-veil.in { opacity: 1; pointer-events: all; }
.fx-veil span {
  font-family: 'Poppins', sans-serif;
  font-size: 14px; font-weight: 700; letter-spacing: .34em;
  text-transform: uppercase; color: var(--text, #EDEDE1);
}
.fx-veil span::after { content: '.'; color: var(--brass, #B08D57); }

/* ---------- 9. SEKCJE — mocniejsze wejście nagłówków ---------- */
.fx-eyebrow {
  font-size: 10px; font-weight: 600; letter-spacing: .3em;
  text-transform: uppercase; color: var(--brass, #B08D57);
  margin-bottom: 18px;
}

/* ---------- 10. FOCUS-VISIBLE — dostępność ---------- */
.fx-mag:focus-visible, .fx-tiltable:focus-visible {
  outline: 2px solid var(--brass, #B08D57);
  outline-offset: 3px;
}

/* ---------- REDUCED MOTION / PRINT ---------- */
@media (prefers-reduced-motion: reduce) {
  .fx-veil { display: none; }
  .fx-in, .reveal { opacity: 1 !important; transform: none !important; filter: none !important; transition: none !important; }
  .fx-char { opacity: 1 !important; transform: none !important; transition: none !important; }
  .fx-tiltable { transform: none !important; }
  .fx-mag { transform: none !important; }
}

/* Wydruk: żadnych efektów, jasne tło — PDF-y muszą być czytelne.
   To wymóg twardy z CLAUDE.md (bug ciemnego PDF-a zgłoszony realnie). */
@media print {
  .fx-veil, .fx-progress, .fx-marquee { display: none !important; }
  .fx-in, .reveal { opacity: 1 !important; transform: none !important; filter: none !important; }
  .fx-char { opacity: 1 !important; transform: none !important; }
  .fx-tiltable { transform: none !important; box-shadow: none !important; }
}
