/* Grateria FX v2 — style.
   Kolory strony: tło + napisy/ramki. Zmieniasz tylko te dwie zmienne. */
:root {
  --gfx-bg: #293133;   /* RAL 7016 Szary antracytowy (tło) */
  --gfx-or: #f06e2a;   /* RAL 2004 Pomarańcz czysty, lekko rozjaśniony (napisy i ramki) */
  --gfx-or-dim: rgba(240, 110, 42, .35);
  --gfx-or-glow: rgba(240, 110, 42, .55);
  --gfx-ink: #161a1b;
  --gfx-mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", "Courier New", monospace;
}

/* ---------- kolory całej strony ---------- */
html.fx, html.fx body { background: var(--gfx-bg); color: var(--gfx-or); }
html.fx body font, html.fx body a, html.fx body b, html.fx body td, html.fx body center, html.fx body p { color: var(--gfx-or); }
html.fx body table, html.fx body td { background-color: transparent; }
html.fx body a:hover { color: #ff9a62; }
html.fx ::selection { background: var(--gfx-or); color: var(--gfx-bg); }

/* ---------- 2. górne menu: kontrolki ---------- */
html.fx .gfx-nav {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px;
  width: max-content; max-width: calc(100% - 16px); margin: 8px auto 50px; padding: 6px; border-radius: 6px;
  background: linear-gradient(#20272a, #151a1c); border: 1px solid var(--gfx-or-dim);
  box-shadow: 0 2px 0 #0d1011, 0 6px 14px rgba(0,0,0,.3);
}
html.fx .gfx-nav .gfx-sep { display: none; }
html.fx body .gfx-switch {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 13px 7px 10px; border-radius: 4px;
  font: 700 11px/1 var(--gfx-mono); letter-spacing: .16em; text-transform: uppercase; text-decoration: none;
  color: var(--gfx-or); background: linear-gradient(#323b3e, #1c2224);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 2px 0 #000;
  transition: color .15s, transform .07s, box-shadow .07s, text-shadow .15s;
}
html.fx body .gfx-switch:hover, html.fx body .gfx-switch:focus-visible { color: #ff9a62; text-shadow: 0 0 8px var(--gfx-or-glow); outline: none; }
html.fx .gfx-switch:active { transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 0 0 #000; }
html.fx .gfx-switch * { color: inherit; }
.gfx-lamp {
  display: inline-block; width: 8px; height: 8px; flex: none; border-radius: 50%;
  background: #3a1a08; box-shadow: inset 0 0 2px #000; transition: background .12s, box-shadow .12s;
}
html.fx .gfx-switch:hover .gfx-lamp, html.fx .gfx-switch:focus-visible .gfx-lamp,
html.fx .gfx-switch.is-active .gfx-lamp { background: var(--gfx-or); box-shadow: 0 0 6px 2px var(--gfx-or-glow); }
html.fx .gfx-switch.is-active { box-shadow: inset 0 0 0 1px var(--gfx-or-dim), 0 2px 0 #000; }
.gfx-ext { opacity: .6; font-size: 10px; }

/* ---------- 3. logo: rysunek techniczny w ramce 1 px ---------- */
.gfx-bp { position: relative; display: inline-block; padding: 0; vertical-align: top; }
.gfx-bp > img { display: block; border: 1px solid var(--gfx-or); clip-path: inset(0 100% 0 0); }
.gfx-bp.is-go > img { animation: gfx-reveal 1s 1.05s cubic-bezier(.7,0,.2,1) forwards; }
@keyframes gfx-reveal { to { clip-path: inset(0 0 0 0); } }
.gfx-bp-ov {
  display: block; position: absolute; inset: 0; pointer-events: none;
  font: 600 10px/1 var(--gfx-mono); letter-spacing: .15em; color: var(--gfx-or);
  --mx: 50%; --my: 50%;
}
.gfx-bp-ov > * { position: absolute; opacity: 0; }
.gfx-bp.is-go .gfx-bp-ov > * { animation: gfx-in .35s ease forwards; }
@keyframes gfx-in { to { opacity: 1; } }
/* narożniki */
.gfx-c { position: absolute; width: 12px; height: 12px; border: 0 solid var(--gfx-or); }
.gfx-c-tl { top: -4px; left: -4px; border-top-width: 1px; border-left-width: 1px; }
.gfx-c-tr { top: -4px; right: -4px; border-top-width: 1px; border-right-width: 1px; }
.gfx-c-bl { bottom: -4px; left: -4px; border-bottom-width: 1px; border-left-width: 1px; }
.gfx-c-br { bottom: -4px; right: -4px; border-bottom-width: 1px; border-right-width: 1px; }
/* pasek skanera */
.gfx-scan { top: 0; bottom: 0; left: 0; width: 2px; background: #ffb38a; box-shadow: 0 0 12px 3px var(--gfx-or-glow); }
.gfx-bp.is-go .gfx-scan { animation: gfx-scan 1s 1.05s cubic-bezier(.7,0,.2,1) both; }
@keyframes gfx-scan { 0% { opacity: 1; left: 0; } 92% { opacity: 1; } 100% { opacity: 0; left: 100%; } }

/* układ obrazek + tekst (strona główna, Hugs): wszystko od góry, tuż pod menu */
html.fx body { margin-left: 26px; margin-right: 26px; }   /* boczne marginesy strony */
html.fx .gfx-hero-table { border-spacing: 0; margin-top: 0; width: 100%; }
html.fx .gfx-hero-table > tbody > tr > td:first-child { width: 1%; }
/* obrazki na stronie głównej i w Hugs: wysokość jak obrazek z Hugs (414 px) */
html.fx .gfx-hero-table .gfx-bp > img { height: 414px; width: auto; max-width: 45vw; object-fit: cover; }
html.fx body.gfx-hero-page { margin-left: 15px; margin-right: 15px; }   /* strona główna i Hugs */
html.fx .gfx-hero-table > tbody > tr > td { padding: 0; vertical-align: top; }
html.fx .gfx-hero-table > tbody > tr > td + td { padding-left: 50px; }

/* ===== strona główna i Hugs: obrazek 528×400 + pole tekstowe tej samej wysokości ===== */
html.fx body.gfx-hero-page { margin-left: 0; margin-right: 0; }
.gfx-hero { display: flex; align-items: flex-start; gap: 50px; box-sizing: border-box;
  width: 100%; max-width: 1500px; margin: 0 auto; padding: 0 30px; }
.gfx-hero-img { flex: none; line-height: 0; }
.gfx-hero-img .gfx-bp > img { box-sizing: border-box; width: 528px; height: 400px; max-width: none; object-fit: cover; }  /* proporcje obrazka z Hugs (546×414) */
.gfx-hero-text { flex: 1 1 auto; min-width: 0; height: 400px; display: flex; flex-direction: column; text-align: left; }
.gfx-hero-text > .gfx-sbox { flex: none; }
@media (max-width: 900px) {   /* wąski ekran: tekst pod obrazkiem */
  .gfx-hero { flex-direction: column; gap: 24px; }
  .gfx-hero-img, .gfx-hero-img .gfx-bp { width: 100%; }
  .gfx-hero-img .gfx-bp > img { width: 100%; height: auto; aspect-ratio: 546 / 414; }
  .gfx-hero-text { width: 100%; }
}

/* ---------- 4. tabliczka + dalekopis ---------- */
.gfx-plate {
  display: flex; width: max-content; max-width: 100%; flex-wrap: wrap; align-items: center; gap: 8px;
  margin: 0 0 12px; padding: 5px 10px; border: 1px solid var(--gfx-or);
  font: 700 10px/1.2 var(--gfx-mono); letter-spacing: .2em; text-transform: uppercase; color: var(--gfx-or);
}
html.fx body .gfx-plate b { color: var(--gfx-or); }
.gfx-rivet { width: 5px; height: 5px; border-radius: 50%; border: 1px solid var(--gfx-or); }
.gfx-tw-h { visibility: hidden; }
.gfx-caret {
  display: inline-block; width: .55em; height: 1.05em; margin-left: 1px; vertical-align: text-bottom;
  background: var(--gfx-or); box-shadow: 0 0 6px var(--gfx-or-glow); animation: gfx-blink .9s steps(1) infinite;
}
@keyframes gfx-blink { 50% { opacity: 0; } }

/* licznik wizyt na tabliczce */
.gfx-odo { display: inline-flex; padding: 1px; border: 1px solid var(--gfx-or); font: 700 11px/1 var(--gfx-mono); letter-spacing: 0; }
.gfx-odo-d { position: relative; overflow: hidden; width: .8em; height: 1.25em; margin: 0 1px; text-align: center; color: var(--gfx-or); background: #1c2224; }
.gfx-odo-d:last-child { color: var(--gfx-bg); background: var(--gfx-or); }
.gfx-odo-r { display: block; transition: transform 1.1s cubic-bezier(.3,.6,.2,1); }
.gfx-odo-r > span { display: block; height: 1.25em; line-height: 1.25em; }

/* ---------- 5. galeria: przesuw kliszy + flesz, ramka 1 px ---------- */
.gfx-viewer {
  position: relative; display: inline-block; overflow: hidden; vertical-align: middle;
  border: 1px solid var(--gfx-or);
}
.gfx-viewer > .gfx-photo { display: block; max-width: 100%; height: auto; }
.gfx-ghost {
  position: absolute; inset: 0; opacity: 0; pointer-events: none;
  background: transparent center / cover no-repeat;
}
.gfx-viewer.is-slide > .gfx-photo { animation: gfx-film-in .6s cubic-bezier(.65,0,.3,1) both; }
.gfx-viewer.is-slide > .gfx-ghost { opacity: 1; animation: gfx-film-out .6s cubic-bezier(.65,0,.3,1) both; }
/* --dir: 1 = Next (klisza w lewo), -1 = Prev (klisza w prawo) */
@keyframes gfx-film-in  { from { transform: translateX(calc(var(--dir, 1) * 100%)); } to { transform: translateX(0); } }
@keyframes gfx-film-out { from { transform: translateX(0); } to { transform: translateX(calc(var(--dir, 1) * -100%)); } }
.gfx-flash {
  position: absolute; inset: 0; pointer-events: none; opacity: 0; z-index: 2;
  background: radial-gradient(ellipse at center, #fff 0%, rgba(255,250,240,.85) 45%, rgba(255,240,220,.5) 100%);
}
.gfx-viewer.is-slide .gfx-flash { animation: gfx-flash .38s ease-out both; }
@keyframes gfx-flash { 0% { opacity: 0; } 8% { opacity: .95; } 100% { opacity: 0; } }
.gfx-viewer.is-loading > .gfx-photo { opacity: 0; }
/* okno galerii o stałej wysokości; zdjęcie pośrodku w naturalnych proporcjach, bez pasów */
.gfx-stage { display: flex; align-items: flex-start; justify-content: center; width: 100%;
  height: min(var(--gfx-gh, 1067px), var(--gfx-gvh, 78vh)); }
.gfx-stage > .gfx-viewer { display: block; flex: none; max-width: 100%;
  transition: width .55s cubic-bezier(.65,0,.3,1), height .55s cubic-bezier(.65,0,.3,1); }
.gfx-stage > .gfx-viewer.no-anim { transition: none; }
/* panel opisu: zdjęcie płynnie zjeżdża w lewo, po prawej pojawia się tekst */
.gfx-desc { flex: 0 0 0px; align-self: stretch; overflow: hidden; opacity: 0; margin-left: 0;
  transition: flex-basis .55s cubic-bezier(.65,0,.3,1), margin-left .55s cubic-bezier(.65,0,.3,1), opacity .35s ease; }
.gfx-stage.is-desc .gfx-desc { flex-basis: min(400px, 40%); margin-left: 26px; opacity: 1; transition-delay: 0s, 0s, .25s; }
.gfx-desc-in { display: flex; flex-direction: column; height: 100%; min-width: 240px; text-align: left; color: var(--gfx-or); }
.gfx-desc-t { font-weight: bold; margin-bottom: 6px; flex: none; }
.gfx-desc .gfx-sbox { flex: 1 1 auto; min-height: 0; }
@media (max-width: 760px) {  /* wąski ekran: opis pod zdjęciem */
  .gfx-stage.is-desc { flex-direction: column; height: auto; }
  .gfx-stage.is-desc .gfx-desc { flex-basis: auto; margin: 14px 0 0; width: 100%; }
}
.gfx-stage .gfx-photo { display: block; width: 100% !important; height: 100% !important; max-width: none; object-fit: cover; }
/* PREV i NEXT obok siebie */
.gfx-pn { display: inline-flex; gap: 4px; }
.gfx-pn .gfx-key { margin: 0; }
/* pasek pod zdjęciem: PREV NEXT + OPIS + FILM */
.gfx-gbar { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; margin: 10px auto 6px;
  font: 700 10px/1 var(--gfx-mono); letter-spacing: .18em; color: var(--gfx-or); }
.gfx-viewer.is-swap > .gfx-ghost { opacity: 1; animation: gfx-fadeout .55s ease .08s both; }
.gfx-viewer.is-swap .gfx-flash { animation: gfx-flash .38s ease-out both; }
@keyframes gfx-fadeout { from { opacity: 1; } to { opacity: 0; } }
/* przełącznik filmu na zdjęciu (prawy górny róg) */
.gfx-filmsw { display: flex; align-items: center; gap: 4px;
  padding: 3px 3px 3px 8px; background: rgba(22,26,27,.75); border: 1px solid var(--gfx-or-dim);
  font: 700 10px/1 var(--gfx-mono); letter-spacing: .18em; color: var(--gfx-or); }
.gfx-filmsw-l { margin-right: 4px; opacity: .7; }
.gfx-film-b { padding: 5px 8px; border: 1px solid transparent; border-radius: 2px; cursor: pointer;
  font: inherit; letter-spacing: inherit; color: var(--gfx-or); background: transparent; transition: background .15s, color .15s; }
.gfx-film-b:hover { border-color: var(--gfx-or-dim); }
.gfx-film-b[aria-pressed="true"] { background: var(--gfx-or); color: var(--gfx-bg); }
.gfx-film-b:focus-visible { outline: 1px solid var(--gfx-or); outline-offset: 1px; }
.gfx-hud { position: absolute; inset: 10px; pointer-events: none; z-index: 3; font: 700 10px/1 var(--gfx-mono); letter-spacing: .18em; color: var(--gfx-or); }
html.fx body .gfx-key {
  display: inline-block; padding: 6px 12px; margin: 2px; border-radius: 4px; cursor: pointer; text-decoration: none;
  font: 700 11px/1 var(--gfx-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--gfx-or);
  background: linear-gradient(#323b3e, #1c2224); box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 2px 0 #000;
}
html.fx body .gfx-key:hover { color: #ff9a62; text-shadow: 0 0 8px var(--gfx-or-glow); }
html.fx .gfx-key:active { transform: translateY(2px); box-shadow: 0 0 0 #000; }

/* ---------- przewijane okno tekstu ---------- */
@property --gfx-ft { syntax: '<length>'; inherits: false; initial-value: 0px; }
@property --gfx-fb { syntax: '<length>'; inherits: false; initial-value: 0px; }
.gfx-sbox { position: relative; }
.gfx-scroll {
  overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; outline: none;
  --gfx-ft: 0px; --gfx-fb: 0px;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 var(--gfx-ft), #000 calc(100% - var(--gfx-fb)), transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0, #000 var(--gfx-ft), #000 calc(100% - var(--gfx-fb)), transparent 100%);
  transition: --gfx-ft .35s ease, --gfx-fb .35s ease;
}
.gfx-scroll::-webkit-scrollbar { display: none; }
.gfx-sbox.is-scroll .gfx-scroll { padding-right: 22px; }
.gfx-sbox.is-scroll:not(.at-top) .gfx-scroll { --gfx-ft: var(--gfx-fade, 28px); }
.gfx-sbox.is-scroll:not(.at-end) .gfx-scroll { --gfx-fb: var(--gfx-fade, 28px); }
.gfx-scroll:focus-visible { box-shadow: inset 0 0 0 1px var(--gfx-or-dim); }
/* suwak: szyna 1 px z kreskami na końcach + pomarańczowy suwak */
.gfx-rail { display: none; position: absolute; top: 2px; bottom: 2px; right: 2px; width: 11px; cursor: pointer; }
.gfx-sbox.is-scroll .gfx-rail { display: block; }
.gfx-rail::before { content: ""; position: absolute; left: 5px; top: 0; bottom: 0; width: 1px; background: var(--gfx-or-dim); }
.gfx-rail::after { content: ""; position: absolute; left: 1px; right: 1px; top: 0; bottom: 0;
  border-top: 1px solid var(--gfx-or); border-bottom: 1px solid var(--gfx-or); pointer-events: none; }
.gfx-thumb { position: absolute; left: 2px; width: 7px; top: 0; background: var(--gfx-or); cursor: grab; touch-action: none;
  box-shadow: 0 0 6px var(--gfx-or-glow); transition: background .15s; }
.gfx-thumb:hover, .gfx-sbox.is-drag .gfx-thumb { background: #ff9a62; }
.gfx-sbox.is-drag .gfx-thumb { cursor: grabbing; }
.gfx-sbox.is-drag { user-select: none; }

/* ---------- przełącznik dźwięku ---------- */
.gfx-panel { position: fixed; right: 10px; bottom: 10px; z-index: 2147482200; display: flex; padding: 4px;
  border: 1px solid var(--gfx-or-dim); border-radius: 6px; background: rgba(22,26,27,.9); }
.gfx-tog { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border: 0; border-radius: 4px; cursor: pointer;
  font: 700 10px/1 var(--gfx-mono); letter-spacing: .16em; color: var(--gfx-or-dim); background: linear-gradient(#323b3e, #1c2224);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 2px 0 #000; }
.gfx-tog:active { transform: translateY(1px); }
.gfx-tog[aria-checked="true"] { color: var(--gfx-or); }
.gfx-tog[aria-checked="true"] .gfx-lamp { background: var(--gfx-or); box-shadow: 0 0 5px 1px var(--gfx-or-glow); }

/* ---------- ograniczony ruch / druk ---------- */
@media (prefers-reduced-motion: reduce) {
  .gfx-caret { animation: none; }
  .gfx-viewer.is-slide > .gfx-photo, .gfx-viewer.is-slide > .gfx-ghost { animation-duration: .01s; }
}
@media print { .gfx-panel, .gfx-rail { display: none !important; }
  .gfx-scroll { max-height: none !important; -webkit-mask-image: none !important; mask-image: none !important; } }
