/* =========================================================
   KELLER · warstwa shaderów (tylko index-shader.html)
   Każde płótno startuje niewidoczne i pojawia się dopiero,
   gdy js/shaders.js skompiluje program (.is-live).
   Bez WebGL2 strona wygląda dokładnie jak index.html.
   ========================================================= */

.fx {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.2s var(--ease-out);
}
.fx.is-live { opacity: 1; }

/* HERO: tło (wnętrze) pod treścią, brama nad treścią */
.hero { isolation: isolate; overflow: hidden; }
.hero > :not(.fx):not(.hero__bg) { position: relative; z-index: 1; }
.fx-hero { z-index: 0; }

/* Zdjęcie za bramą. Wersja CSS (bez WebGL) = przyciemnione zdjęcie + gradient;
   z WebGL płótno .fx-hero przykrywa je własnym gradingiem. */
.hero__bg {
  position: absolute; inset: 0; z-index: -1;
  width: 100%; height: 100%;
  object-fit: cover; object-position: 64% 58%;
  filter: brightness(.62) saturate(.85);
}
.hero--fx::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(13,14,15,.92) 0%, rgba(13,14,15,.7) 38%, rgba(13,14,15,.15) 75%),
    linear-gradient(0deg, var(--ink) 0%, rgba(13,14,15,0) 32%),
    linear-gradient(180deg, rgba(13,14,15,.7) 0%, rgba(13,14,15,0) 22%);
}
@media (max-width: 960px) {
  .hero__bg { object-position: 62% 50%; }
  .hero--fx::before { background: linear-gradient(0deg, var(--ink) 0%, rgba(13,14,15,.78) 45%, rgba(13,14,15,.6) 100%); }
}

/* Bez ramy ze zdjęciem: treść na całą szerokość, większy nagłówek */
.hero--fx { min-height: 100svh; }
.hero--fx .hero__grid { align-items: end; }
.hero--fx .hero__copy { grid-column: 1 / -1; gap: clamp(24px, 3vw, 40px); padding-bottom: clamp(24px, 4vw, 56px); }
.hero--fx .hero__title { font-size: clamp(3.2rem, 9.4vw, 12.5rem); }
.hero--fx .hero__lead { max-width: 44ch; }

/* Brama: zasłania hero od pierwszej klatki (tylko z JS i bez reduced motion).
   Zanim WebGL się skompiluje, rysuje ją CSS: antracyt + wpusty segmentów. */
.fx-door {
  z-index: 3;
  display: none;
  opacity: 1;
  transition: none;
  will-change: transform;
  background:
    repeating-linear-gradient(180deg,
      transparent 0 calc(100% / 6 - 3px),
      rgba(0, 0, 0, .55) calc(100% / 6 - 3px) calc(100% / 6 - 1px),
      rgba(255, 255, 255, .05) calc(100% / 6 - 1px) calc(100% / 6)),
    linear-gradient(90deg, #1d2124, #262b2e 45%, #1f2326);
}
.js .fx-door { display: block; }
.fx-door.is-live { background: none; }
.fx-door.is-open { display: none; }

/* OGRODZENIA: zdjęcia na pełną szerokość karty, wyrównane do tekstu.
   (style.css ma tu contain + lighten z czasów zdjęć produktowych na czarnym tle;
   obecne zdjęcia 3:2 to pełne sceny, więc wypełniają kafel.) */
.fence-card__img { aspect-ratio: 3 / 2; }
.fence-card__img img { object-fit: cover; mix-blend-mode: normal; }

/* BRAMY: przejście „segmentami” nad zdjęciami sceny */
.fx-stage { z-index: 5; transition-duration: .4s; }

/* KINETYKA: cień żaluzji na papierowej ścianie */
.kinetic { position: relative; isolation: isolate; }
.kinetic > :not(.fx) { position: relative; z-index: 1; }
.fx-paper { z-index: 0; }

/* STOPKA: szczotkowane, frezowane litery KELLER */
.footer__word { position: relative; }
.fx-word {
  /* Napis (19.6vw) wystaje poza pole treści: płótno sięga po krawędzie stopki */
  inset: auto;
  left: calc(var(--pad) * -1);
  width: calc(100% + var(--pad) * 2);
  top: -0.2em;
  height: calc(100% + 0.4em);
}
.footer__word.is-fx { color: transparent; }

@media (prefers-reduced-motion: reduce) {
  .fx { transition: none; }
  .js .fx-door { display: none; }
}
