/* ==========================================================================
   I.MAGINE — Studio Architektury
   Design tokens & global styles
   ========================================================================== */

:root {
  /* Hero gradient fallback (when intro_gfx is empty) — neutral grays */
  --hero-fallback-1: #d8d8d8;
  --hero-fallback-2: #a8a8a8;
  --hero-fallback-3: #c4c4c4;

  /* Light theme (default) — pure white with black marks */
  --bg:           #ffffff;
  --bg-alt:       #f5f5f5;
  --bg-elev:      #ffffff;
  --fg:           #000000;
  --fg-muted:     #555555;
  --fg-faint:     #999999;
  --line:         rgba(0, 0, 0, 0.10);
  --line-strong:  rgba(0, 0, 0, 0.22);
  --accent:       #000000;
  --on-accent:    #ffffff;

  --nav-bg:       rgba(255, 255, 255, 0.78);
  --nav-bg-solid: rgba(255, 255, 255, 0.96);
  --nav-fg:       #000000;

  --hero-overlay: rgba(0, 0, 0, 0.18);
  --hero-fg:      #ffffff;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04), 0 2px 8px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 18px rgba(0,0,0,0.08);

  /* Type */
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Fraunces", "Cormorant Garamond", Georgia, serif;

  /* Layout */
  --content-max: 1280px;
  --gutter: clamp(20px, 4vw, 56px);
  --nav-h: 76px;

  /* Motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

[data-theme="dark"] {
  --bg:           #0f0f0f;
  --bg-alt:       #161616;
  --bg-elev:      #1c1c1c;
  --fg:           #f0f0f0;
  --fg-muted:     #a8a8a8;
  --fg-faint:     #6a6a6a;
  --line:         rgba(255, 255, 255, 0.12);
  --line-strong:  rgba(255, 255, 255, 0.28);
  --accent:       #f0f0f0;
  --on-accent:    #0f0f0f;

  --nav-bg:       rgba(15, 15, 15, 0.62);
  --nav-bg-solid: rgba(15, 15, 15, 0.92);
  --nav-fg:       #f0f0f0;

  --hero-overlay: rgba(0, 0, 0, 0.42);
  --hero-fg:      #ffffff;
}

/* Respect system preference on first visit (no stored choice) */
@media (prefers-color-scheme: dark) {
  html:not([data-theme-user]) { color-scheme: dark; }
}

/* ==========================================================================
   Reset & base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.5s var(--ease), color 0.5s var(--ease);
  overflow-x: hidden;
}
/* Landing page: lock to viewport, no scrolling */
body.is-landing {
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  overscroll-behavior: none;
}

/* Leave room below the fixed nav — na WSZYSTKICH stronach, łącznie z
   landing page. `.hero` (patrz niżej) ma wysokość `calc(100vh -
   var(--nav-h))`, więc ten padding + wysokość hero = dokładnie 100vh,
   bez dodatkowego scrolla. Wcześniej landing był tu świadomie wykluczony
   (`body:not(.is-landing)`) z czasów, gdy karuzela była pełnoekranowym
   tłem POD tekstem, a nav miał na niej celowo nakładać się jako
   półprzezroczysty pasek. Po przebudowie hero na małą ramkę ze zdjęciem
   NAD tekstem (2026-09-11) `.hero` zaczyna się w normalnym flow od góry
   strony — bez tego paddingu zaczynał się pod position:fixed navem
   (z-index:100), więc przy odpowiednio dużej treści (duży tytuł, mniej
   pustego miejsca do wyśrodkowania) górna część ramki z karuzelą realnie
   chowała się pod navem. Naprawione 2026-09-17. */
body {
  padding-top: var(--nav-h);
}

/* Lock body scroll while mobile menu is open */
body.menu-open { overflow: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; transition: opacity 0.2s var(--ease), color 0.2s var(--ease); }
a:hover { opacity: 0.65; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

::selection { background: var(--accent); color: var(--on-accent); }

.serif { font-family: var(--font-serif); font-weight: 300; font-style: italic; }

/* ==========================================================================
   Navigation (sticky, always visible)
   ========================================================================== */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--gutter);
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease), height 0.3s var(--ease);
}
.nav.is-scrolled {
  background: var(--nav-bg-solid);
  border-bottom-color: var(--line);
  height: 64px;
}
/* Landing page nigdy nie scrolluje (body.is-landing ma overflow:hidden),
   więc .nav.is-scrolled nigdy się naturalnie nie włączy — bez tego nav
   zostaje na zawsze w half-transparent stanie, który nad zdjęciem w tle
   (karuzela) wygląda inaczej niż nad jednolitym tłem strony na podstronach.
   Wymuszamy tu ten sam "solidny" wygląd, do którego subpage'y dochodzą
   po przewinięciu 24px — bez zmiany wysokości/rozmiaru logo, tylko kolor. */
body.is-landing .nav {
  background: var(--nav-bg-solid);
  border-bottom-color: var(--line);
}

.nav__logo { display: inline-flex; align-items: center; }
.nav__logo img {
  display: block;
  height: 56px;
  width: auto;
  transition: height 0.3s var(--ease), filter 0.5s var(--ease);
  /* Drop the white PNG background on light theme so only the dark mark shows */
  mix-blend-mode: multiply;
}
.nav.is-scrolled .nav__logo img { height: 48px; }

[data-theme="dark"] .nav__logo img {
  /* Invert dark mark to light, then screen-blend to drop the (now black) background */
  filter: invert(1) brightness(1.05);
  mix-blend-mode: screen;
}

.nav__menu {
  display: flex;
  align-items: center;
  gap: 36px;
}
.nav__menu ul {
  list-style: none;
  display: flex;
  gap: 32px;
  margin: 0; padding: 0;
}
.nav__menu a {
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--nav-fg);
  position: relative;
  padding: 6px 0;
}
.nav__menu a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: 0;
  height: 1px;
  background: currentColor;
  transition: right 0.3s var(--ease);
}
.nav__menu a:hover { opacity: 1; }
.nav__menu a:hover::after { right: 0; }
.nav__menu a[aria-current="page"]::after { right: 0; }

/* Theme toggle */
.theme-toggle {
  width: 40px; height: 40px;
  border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-strong);
  color: var(--nav-fg);
  background: transparent;
  transition: background 0.25s var(--ease), color 0.25s var(--ease),
              border-color 0.25s var(--ease), transform 0.15s var(--ease);
}
/* Subtle hover only on devices that actually hover (mouse).
   Touch devices skip this — :hover sticking after a tap was making the button
   look "filled" until the next tap somewhere else. */
@media (hover: hover) {
  .theme-toggle:hover {
    border-color: var(--accent);
    background: var(--bg-alt);
  }
}
/* Tactile feedback on actual press, regardless of input type */
.theme-toggle:active { transform: scale(0.92); }
.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.theme-toggle .icon { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; }
.theme-toggle .icon--moon { display: none; }
[data-theme="dark"] .theme-toggle .icon--sun  { display: none; }
[data-theme="dark"] .theme-toggle .icon--moon { display: block; }

/* Hamburger (mobile) */
.hamburger {
  display: none;
  width: 40px; height: 40px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
}
.hamburger span {
  display: block;
  width: 22px; height: 1.5px;
  background: var(--nav-fg);
  transition: transform 0.3s var(--ease), opacity 0.2s var(--ease);
}
.hamburger.is-open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.hamburger.is-open span:nth-child(2) { opacity: 0; }
.hamburger.is-open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ==========================================================================
   Hero / Slideshow
   ========================================================================== */
/* ============================================================
   Layout wg uwag Magdy (2026-09-11): mniejszy kontener ze zdjęciem
   NAD napisem I.MAGINE, zamiast tła pod tekstem. Tekst wraca do
   zwykłych kolorów strony (czarny na białym w jasnym motywie) —
   nie stoi już na zdjęciu, więc nie potrzebuje białego/kontrastowego
   wariantu. Poprzednie dwa warianty (pełny ekran / kontener-jako-tło)
   zostały zastąpione tym układem po rundzie testów z Magdą.
   ============================================================ */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(28px, 4.5vh, 56px);
  height: calc(100vh - var(--nav-h));
  height: calc(100svh - var(--nav-h));
  min-height: 480px;
  padding: clamp(20px, 3vh, 40px) var(--gutter) clamp(32px, 5vh, 64px);
  background: var(--bg);
  text-align: left;
}

.hero__frame {
  position: relative;
  isolation: isolate;
  width: 100%;
  max-width: 760px;
  aspect-ratio: 16 / 10;
  max-height: clamp(180px, 36vh, 420px);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-alt);
}

.slideshow {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: var(--bg-alt);
}
.slideshow__slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 1.6s var(--ease);
}
.slideshow__slide.is-active {
  opacity: 1;
  animation: kenburns 8s linear forwards;
}
@keyframes kenburns {
  from { transform: scale(1.06); }
  to   { transform: scale(1.14); }
}

/* Fallback when intro_gfx is empty — clean page background, matches subpages */
.slideshow__fallback {
  position: absolute;
  inset: 0;
  background: var(--bg);
  opacity: 1;
  transition: opacity 0.6s var(--ease);
}
.slideshow.has-images .slideshow__fallback { opacity: 0; }

.hero__content {
  width: 100%;
  max-width: 900px;
  color: var(--fg);
}
.hero__eyebrow {
  margin: 0 0 16px;
  font-size: 12px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--fg-muted);
}
.hero__title {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 300;
  font-style: italic;
  font-size: clamp(60px, 12vw, 192px);
  line-height: 0.94;
  letter-spacing: -0.02em;
}
.hero__lede {
  margin: 22px 0 0;
  max-width: 520px;
  font-size: clamp(16px, 1.5vw, 19px);
  font-weight: 300;
  line-height: 1.6;
  color: var(--fg-muted);
}
.hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 36px;
  padding: 14px 24px 14px 28px;
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--hero-fg);
  transition: background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.hero__cta:hover { opacity: 1; background: var(--hero-fg); color: #000; border-color: var(--hero-fg); }
.hero__cta svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.slideshow__dots {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  gap: 10px;
}
.slideshow__dot {
  width: 28px; height: 2px;
  background: rgba(255,255,255,0.4);
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.3s var(--ease), width 0.3s var(--ease);
}
.slideshow__dot.is-active { background: rgba(255,255,255,1); width: 44px; }

/* ==========================================================================
   Sections
   ========================================================================== */
.section {
  padding: clamp(80px, 12vh, 140px) var(--gutter);
  max-width: var(--content-max);
  margin: 0 auto;
}
.section--alt { background: var(--bg-alt); max-width: none; }
.section--alt > * { max-width: var(--content-max); margin-left: auto; margin-right: auto; }

.section__head { margin-bottom: clamp(40px, 6vh, 72px); max-width: 720px; }
.section__eyebrow {
  margin: 0 0 20px;
  font-size: 12px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--fg-muted);
}
.section__title {
  margin: 0;
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.section__title .serif { font-style: italic; font-weight: 300; }
.section__lede {
  margin: 24px 0 0;
  font-size: clamp(16px, 1.4vw, 19px);
  font-weight: 300;
  color: var(--fg-muted);
  max-width: 560px;
}

/* Project grid */
.grid--projects {
  display: grid;
  gap: clamp(24px, 3vw, 40px);
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: transform 0.5s var(--ease);
}
.card:not(.card--empty) { cursor: pointer; }
.card:not(.card--empty):hover { transform: translateY(-4px); }
.card:not(.card--empty):focus-visible { outline: 2px solid var(--fg); outline-offset: 4px; }
.card__media {
  aspect-ratio: 4 / 3;
  background:
    linear-gradient(135deg, var(--bg-alt) 0%, var(--bg-elev) 100%);
  background-size: cover;
  background-position: center;
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,0,0,0.04) 0%, rgba(0,0,0,0.10) 100%);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}
.card:not(.card--empty):hover .card__media::after { opacity: 1; }
.card__body h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.card__location {
  margin: 4px 0 0;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.card__collab {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 8px 0 0;
}
.card__collab-label {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-faint);
}
.card__collab-name {
  font-size: 13px;
  color: var(--fg-muted);
}

/* Publications */
.publications {
  list-style: none;
  margin: 0; padding: 0;
  border-top: 1px solid var(--line);
}
.publications li {
  border-bottom: 1px solid var(--line);
}
.publications__row {
  display: grid;
  grid-template-columns: 90px 1fr 2fr;
  gap: 24px;
  align-items: baseline;
  padding: 28px 0;
  color: inherit;
  text-decoration: none;
  transition: padding 0.3s var(--ease);
}
a.publications__row { cursor: pointer; }
.publications__row:hover { padding-left: 12px; }
.publications__row:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.publications__row:hover .publications__title { color: var(--accent); }
.publications__year {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 300;
  font-size: 24px;
  color: var(--fg-muted);
}
.publications__title {
  font-weight: 500;
  font-size: 16px;
  letter-spacing: -0.01em;
}
.publications__desc {
  color: var(--fg-muted);
  font-weight: 300;
}

/* Contact */
.contact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 6vw, 96px);
  align-items: start;
}
.contact__label {
  margin: 28px 0 4px;
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--fg-faint);
}
.contact__label:first-child { margin-top: 0; }
.contact__value {
  margin: 0;
  font-size: 18px;
  font-weight: 400;
}
.contact__form {
  display: grid;
  gap: 20px;
}
.contact__form label {
  display: grid;
  gap: 8px;
}
.contact__form span {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.contact__form input,
.contact__form textarea {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  color: var(--fg);
  font: inherit;
  font-size: 15px;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
  resize: vertical;
}
.contact__form input:focus,
.contact__form textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.btn {
  justify-self: start;
  padding: 14px 32px;
  background: var(--accent);
  color: var(--on-accent);
  border: 1px solid var(--accent);
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}
.btn:hover { background: transparent; color: var(--accent); }

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  border-top: 1px solid var(--line);
  padding: 32px var(--gutter);
}
.footer__inner {
  max-width: var(--content-max);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--fg-muted);
  letter-spacing: 0.04em;
}

/* ==========================================================================
   Responsive — mobile menu (< 860px) + layout collapsing
   ==========================================================================
   Mobile menu: compact popover anchored top-right + blurred backdrop scrim.
   Desktop (>= 860px): inline nav as default — no overrides needed.
   ========================================================================== */
@media (max-width: 860px) {
  :root { --nav-h: 64px; }

  .hamburger { display: flex; }

  /* The popover panel itself */
  .nav__menu {
    position: fixed;
    top: var(--nav-h);
    right: 0;
    left: auto;
    width: min(360px, 100vw);
    height: auto;
    max-height: calc(100vh - var(--nav-h));
    max-height: calc(100dvh - var(--nav-h));  /* respects iOS URL bar */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    background: var(--bg-elev);
    border-left: 1px solid var(--line-strong);
    border-bottom: 1px solid var(--line-strong);
    box-shadow:
      -16px 0 40px rgba(0, 0, 0, 0.10),
       0  16px 40px rgba(0, 0, 0, 0.08);
    padding: 24px var(--gutter);
    gap: 20px;
    transform: translateX(100%);
    transition: transform 0.4s var(--ease);
    overflow-y: auto;
    z-index: 90;
  }
  [data-theme="dark"] .nav__menu {
    box-shadow:
      -16px 0 40px rgba(0, 0, 0, 0.55),
       0  16px 40px rgba(0, 0, 0, 0.45),
      -1px 0 0 rgba(255, 255, 255, 0.06);
  }
  .nav__menu.is-open { transform: translateX(0); }

  /* Backdrop blur scrim — fades in when the menu opens, dims+blurs the page */
  body::before {
    content: '';
    position: fixed;
    inset: var(--nav-h) 0 0 0;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(10px) saturate(120%);
    -webkit-backdrop-filter: blur(10px) saturate(120%);
    z-index: 89;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s var(--ease);
  }
  body.menu-open::before {
    opacity: 1;
    pointer-events: auto;
  }

  .nav__menu ul {
    flex-direction: column;
    gap: 0;
    width: 100%;
  }
  .nav__menu li {
    border-bottom: 1px solid var(--line-strong);
  }
  .nav__menu a {
    display: block;
    padding: 20px 0;
    font-size: 16px;
  }
  .nav__menu a::after { display: none; }

  .theme-toggle {
    align-self: flex-start;
    margin-top: 8px;
  }

  /* === Layout collapsing on narrow viewports === */
  .hero__frame { aspect-ratio: 4 / 3; }

  .publications__row {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 6px;
    padding: 24px 0;
  }
  .publications__year,
  .publications__title,
  .publications__desc {
    grid-column: 1;
  }

  .contact { grid-template-columns: 1fr; }

  .footer__inner { flex-direction: column; gap: 6px; text-align: center; }
}

@media (max-width: 480px) {
  .nav__logo img { height: 36px; }
  .nav.is-scrolled .nav__logo img { height: 32px; }
  .hero__lede { font-size: 15px; }
}

/* ==========================================================================
   Reveal-on-scroll
   ========================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  .slideshow__slide.is-active { animation: none; transform: none; }
}


/* ==========================================================================
   Lightbox — fullscreen project gallery
   ========================================================================== */
body.lightbox-open { overflow: hidden; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s var(--ease), visibility 0s linear 0.35s;
}
.lightbox.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.35s var(--ease);
}
.lightbox__scrim {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.94);
}
.lightbox__stage {
  /* Wartości paddingu jako custom properties — .lightbox__img odejmuje je
     jawnie przez calc() poniżej, bo position:absolute + max-height:100%
     ignoruje padding własnego rodzica przy liczeniu procentów (to była
     przyczyna nakładania się zdjęć pionowych na podpis w stopce). */
  --stage-pad-x:   clamp(20px, 8vw, 96px);
  --stage-pad-top: clamp(64px, 9vh, 96px);
  --stage-pad-bot: clamp(96px, 14vh, 140px);

  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--stage-pad-top) var(--stage-pad-x) var(--stage-pad-bot);
}
/* Projekty ze współpracą mają dodatkową linię (etykieta + nazwa pracowni)
   w stopce lightboxa — bez większego marginesu obraz (zwłaszcza pionowy,
   rozciągnięty do max-height) mógł zachodzić na tę dodatkową linię.
   Klasa dodawana/usuwana w js/projects.js (Lightbox.render) zależnie od
   project.collaboration. */
.lightbox.has-collab .lightbox__stage {
  --stage-pad-bot: clamp(136px, 18vh, 184px);
}
.lightbox__img {
  position: absolute;
  max-width: calc(100% - 2 * var(--stage-pad-x));
  max-height: calc(100% - var(--stage-pad-top) - var(--stage-pad-bot));
  width: auto;
  height: auto;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.5s var(--ease);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}
.lightbox__img.is-active { opacity: 1; z-index: 1; }

.lightbox__close,
.lightbox__arrow {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.86);
  cursor: pointer;
  transition: color 0.25s var(--ease), opacity 0.25s var(--ease);
}
.lightbox__close:hover,
.lightbox__arrow:hover { color: #fff; }

.lightbox__close {
  top: clamp(16px, 3vh, 28px);
  right: clamp(16px, 3vw, 32px);
  width: 44px;
  height: 44px;
}
.lightbox__close svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; }

.lightbox__arrow {
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
}
.lightbox__arrow svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.lightbox__arrow--prev { left: clamp(4px, 2vw, 24px); }
.lightbox__arrow--next { right: clamp(4px, 2vw, 24px); }

.lightbox__foot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 0 clamp(20px, 6vw, 64px) clamp(20px, 3.5vh, 36px);
  text-align: center;
}
.lightbox__caption { color: rgba(255, 255, 255, 0.9); }
.lightbox__caption-title {
  display: block;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(17px, 2vw, 22px);
}
.lightbox__caption-location {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}
.lightbox__caption-collab {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 6px;
}
/* `display: flex` powyżej ma tę samą specyficzność co domyślna reguła
   przeglądarki `[hidden] { display: none }`, a style autora zawsze
   wygrywają z UA stylesheet przy remisie — więc samo ustawienie
   atrybutu `hidden` w JS (Lightbox.render) nie chowało tego elementu,
   napis "Współpraca" był zawsze widoczny. Ten selektor ma wyższą
   specyficzność (klasa + atrybut) i poprawnie chowa element. */
.lightbox__caption-collab[hidden] {
  display: none;
}
.lightbox__caption-collab-label {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}
.lightbox__caption-collab-name {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
}
.lightbox__dots { display: flex; gap: 8px; }
.lightbox__dot {
  width: 22px; height: 2px;
  background: rgba(255, 255, 255, 0.35);
  border: none;
  border-radius: 2px;
  cursor: pointer;
  padding: 0;
  transition: background 0.3s var(--ease), width 0.3s var(--ease);
}
.lightbox__dot.is-active { background: #fff; width: 34px; }

@media (max-width: 640px) {
  .lightbox__arrow { width: 44px; height: 44px; }
  .lightbox__arrow svg { width: 20px; height: 20px; }
  .lightbox__foot { gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .lightbox__img { transition: none; }
}

/* ==========================================================================
   Ochrona zdjęć — utrudnia zaznaczanie/przeciąganie i long-press-save
   na iOS/Androidzie. Działa razem z blokadą prawego kliku w js/app.js
   (sekcja 7). Nie daje 100% ochrony (zrzut ekranu zawsze możliwy),
   ale podnosi poprzeczkę dla zwykłego kopiowania. Scoped tylko do
   elementów z realnymi zdjęciami projektów.
   ========================================================================== */
.card__media,
.slideshow__slide,
.lightbox__img {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;   /* blokuje menu "Zapisz zdjęcie" na long-press w iOS Safari */
  -webkit-user-drag: none;       /* dodatkowa blokada przeciągania w Safari, ponad dragstart w JS */
}

