/* =========================================================
   julianzielonka.com — wspólny plik stylów
   Kolory, font, odstępy, nagłówek, stopka, siatka.
   Każda podstrona dołącza TEN plik.
   ========================================================= */

/* ---------- Font: Jost (lokalnie, bez Google Fonts = bez zewnętrznych zapytań) ---------- */
@font-face { font-family: "Jost"; font-weight: 300; font-display: swap;
  src: url("../assets/fonts/jost-latin-300-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Jost"; font-weight: 300; font-display: swap;
  src: url("../assets/fonts/jost-latin-ext-300-normal.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
/* Jost Light Italic (16.11) - kursywa w zwykłym tekście (np. nazwy łacińskie), wcześniej przeglądarka brała 700 italic */
@font-face { font-family: "Jost"; font-weight: 300; font-style: italic; font-display: swap;
  src: url("../assets/fonts/jost-latin-300-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Jost"; font-weight: 300; font-style: italic; font-display: swap;
  src: url("../assets/fonts/jost-latin-ext-300-italic.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Jost"; font-weight: 400; font-display: swap;
  src: url("../assets/fonts/jost-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Jost"; font-weight: 400; font-display: swap;
  src: url("../assets/fonts/jost-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Jost"; font-weight: 500; font-display: swap;
  src: url("../assets/fonts/jost-latin-500-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Jost"; font-weight: 500; font-display: swap;
  src: url("../assets/fonts/jost-latin-ext-500-normal.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Jost"; font-weight: 700; font-display: swap;
  src: url("../assets/fonts/jost-latin-700-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Jost"; font-weight: 700; font-display: swap;
  src: url("../assets/fonts/jost-latin-ext-700-normal.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
/* Jost pogrubiona kursywa (nagłówki sekcji na stronach projektów) */
@font-face { font-family: "Jost"; font-weight: 700; font-style: italic; font-display: swap;
  src: url("../assets/fonts/jost-latin-700-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Jost"; font-weight: 700; font-style: italic; font-display: swap;
  src: url("../assets/fonts/jost-latin-ext-700-italic.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ---------- Zmienne (zmieniasz tu = zmienia się cała strona) ---------- */
:root {
  /* kolory */
  --bg:            #222222;   /* tło strony */
  --text:          #ffffff;   /* tekst główny */
  --text-muted:    #a8a8a8;   /* linki pomocnicze, "Music:" */
  --icon-muted:    #8a8a8a;   /* szare ikony i menu (po najechaniu: białe) */
  --red:           #ee221e;   /* logo */
  --yellow:        #fbd710;   /* logo */
  --link:          #2db5f0;   /* linki na liście Reel */
  --dot:           #f5a623;   /* kropka-separator */
  --accent:        #36e3a0;   /* zielone nagłówki sekcji na stronach projektów */
  --text-en:       #b4b4b4;   /* tekst angielski (szary) na stronach projektów */
  --link-pink:     #e040e8;   /* link na końcu strony projektu */

  /* typografia */
  --font: "Jost", "Futura PT", Futura, "Century Gothic", system-ui, sans-serif;
  --fs-body: 1.125rem;        /* 18 px */
  --fs-nav:  1.25rem;         /* 20 px */
  --fs-h1:   2.75rem;         /* 44 px */

  /* odstępy i wymiary */
  --gutter:        58px;      /* margines boczny nagłówka */
  --header-h:      70px;
  --logo-size:     42px;   /* logo mniejsze o ~40%, wyśrodkowane w pasku */
  --content-max:   1200px;    /* szerokość odtwarzacza */
  --text-max:      800px;     /* szerokość kolumny z listą */
  --grid-cols:     4;         /* siatka Work / Personal */

  /* formularz kontaktowy */
  --radius:        8px;       /* zaokrąglenie pól i przycisku (Adobe miało 0; 6–8 px = standard UI) */
  --field-bg:      #ffffff;
  --field-text:    #222222;
  --field-border:  #ffffff;
}

/* ---------- Reset i baza ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 300;
  font-size: var(--fs-body);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img, svg, iframe { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--yellow); outline-offset: 3px; }

/* ---------- Nagłówek (menu | logo | ikony) ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  padding: 0 var(--gutter);
  background: var(--header-bg, var(--bg));
  box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}
.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 24px;
}
.site-nav a {
  text-decoration: none;
  text-transform: uppercase;
  font-size: var(--fs-nav);
  font-weight: 300;
  letter-spacing: .01em;
}
.site-nav a { color: var(--icon-muted); transition: color .15s; }
.site-nav a:hover { color: var(--text); }
.site-nav a[aria-current="page"] { font-weight: 700; color: var(--text); }

.site-logo { display: block; width: var(--logo-size); height: var(--logo-size); }
.site-logo img { width: 100%; height: 100%; }

.header-right { justify-self: end; display: flex; align-items: center; }
.social { display: flex; gap: 20px; align-items: center; }
.social a { display: block; color: var(--icon-muted); transition: color .15s; }
.social a:hover { color: var(--text); }
.social svg { width: 22px; height: 20px; fill: currentColor; }

/* ---------- Menu mobilne (hamburger + pełnoekranowa nakładka) ---------- */
.nav-toggle,
.menu-close {
  background: none;
  border: 0;
  padding: 8px;
  color: var(--text);
  cursor: pointer;
}
.nav-toggle { display: none; margin-right: -8px; }
.nav-toggle svg { width: 28px; height: 28px; }
.menu-close svg { width: 24px; height: 24px; }

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--header-bg, var(--bg));
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s, visibility .25s;
}
.mobile-menu.is-open { opacity: 1; visibility: visible; }
.menu-close { position: absolute; top: 24px; right: calc(var(--gutter) - 8px); }

.mobile-nav { flex: 1; display: flex; align-items: center; justify-content: center; }
.mobile-nav ul { list-style: none; margin: 0; padding: 0; text-align: center; }
.mobile-nav li { margin: 0 0 26px; }
.mobile-nav li:last-child { margin-bottom: 0; }
.mobile-nav a {
  text-decoration: none;
  text-transform: uppercase;
  font-size: 1.375rem;
  font-weight: 400;
}
.mobile-nav a { color: var(--icon-muted); transition: color .15s; }
.mobile-nav a[aria-current="page"] { font-weight: 700; color: var(--text); }
.mobile-nav a:hover { color: var(--text); }

.mobile-social {
  padding: 32px 24px 40px;
  border-top: 1px solid rgba(255, 255, 255, .06);
}
.mobile-social .social { justify-content: center; gap: 34px; }
.mobile-social .social svg { width: 26px; height: 24px; }

body.menu-open { overflow: hidden; }

/* ---------- Tytuł strony ---------- */
.page-title {
  margin: 80px 0 64px;
  text-align: center;
  text-transform: uppercase;
  font-size: var(--fs-h1);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: .02em;
}

/* ---------- Kontenery ---------- */
.container { width: min(var(--content-max), 100% - 2 * 24px); margin-inline: auto; }
.prose     { width: min(var(--text-max),    100% - 2 * 24px); margin-inline: auto; }

/* Osadzone wideo 16:9 */
.video {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #111;
  overflow: hidden;
}
.video iframe, .video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video video { display: block; background: #000; object-fit: contain; }

/* ---------- Strona REEL: lista ujęć ---------- */
.reel-list { list-style: none; margin: 72px 0 0; padding: 0; }
.reel-list li { margin: 0 0 28px; }
.reel-list li::before { content: "- "; }
.reel-list .time { font-variant-numeric: tabular-nums; }
.reel-list .title { text-transform: uppercase; color: var(--link); }
.reel-list a.title { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.reel-list a.title:hover { color: var(--text); }
.reel-list .dot { color: var(--dot); margin: 0 .3em; font-size: .7em; vertical-align: .15em; }

.reel-meta { margin: 40px 0 0; color: var(--text-muted); }
.reel-meta p { margin: 0 0 20px; }
.reel-meta a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.reel-meta a:hover { color: var(--text); }

/* ---------- Siatka Work / Personal ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(var(--grid-cols), 1fr);
  gap: 0;
}
.tile { position: relative; display: block; aspect-ratio: 808 / 632; overflow: hidden; background: #2c2c2c; text-decoration: none; }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.tile .tile-ph { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px;
  color: #666; font-size: .85rem; text-align: center; border: 1px dashed #444; }
.tile-info {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px; text-align: center;
  background: rgba(20, 20, 20, .72);
  opacity: 0; transition: opacity .25s;
}
.tile-info strong { font-weight: 500; font-size: 1.25rem; text-transform: uppercase; line-height: 1.25; }
.tile-info span { margin-top: 6px; font-size: .9rem; color: var(--text-muted); }
.tile:hover .tile-info, .tile:focus-visible .tile-info { opacity: 1; }
.tile:hover img { transform: scale(1.04); }
@media (hover: none) {           /* na dotyku podpis zawsze widoczny na dole kafelka */
  .tile-info { opacity: 1; justify-content: flex-end; background: linear-gradient(transparent 50%, rgba(0,0,0,.75)); }
}
/* Personal: niepełny ostatni rząd kafelków wyśrodkowany (18.11, prośba Juliana; Work bez zmian) */
.grid[data-section="personal"] { display: flex; flex-wrap: wrap; justify-content: center; }
.grid[data-section="personal"] .tile { flex: 0 0 calc(100% / var(--grid-cols)); }
.grid-empty { padding: 40px 24px; text-align: center; color: var(--text-muted); }

/* ---------- Strona projektu ---------- */
.block.is-tight { margin-bottom: 8px; }   /* tight: true (18.11) = blok obrazków tuż nad następnym, jak jeden ciąg mozaiki */
.project-title {
  width: min(820px, 100% - 48px);
  margin: 80px auto 90px;
  text-align: center;
  font-size: 3.25rem;
  font-weight: 700;
  line-height: 1.12;
}
.project-meta {
  width: min(820px, 100% - 48px);
  margin: -60px auto 80px;
  text-align: center;
  color: var(--text-muted);
  font-size: .95rem;
}
.project-meta .meta-line { display: block; line-height: 1.7; }
.project-meta b { font-weight: 500; color: var(--text); margin-right: .25em; }
.project-meta .nw { white-space: nowrap; }

.block { margin: 0 auto 64px; }
.block-text { width: min(800px, 100% - 48px); font-size: 1rem; line-height: 1.6; }
.block-text.is-center { text-align: center; }
.block-text h2 {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 2rem;
  font-weight: 700;
  font-style: italic;            /* kursywa nagłówków sekcji - zatwierdzona 13.11 (usuń tę linię, żeby wrócić do prostych) */
  text-transform: uppercase;
  line-height: 1.2;
}
.block-text h2::before { content: "• "; }
.block-text p { margin: 0 0 28px; }
.block-text .lang { color: var(--text); }
.block-text .lang.en { color: var(--text-en); }
.block-text .lang > :last-child { margin-bottom: 0; }
.block-text .sep { margin: 36px 0; color: var(--text-muted); }
.block-text .label { color: var(--accent); font-weight: 500; margin-bottom: 8px; }
/* opcja compact: true = krótki podpis nad filmem: PL i EN ciasno pod sobą, bez "---", mniejszy odstęp do filmu */
.block-text.is-compact { margin-bottom: 20px; }
.block-text.is-compact .sep { display: none; }
.block-text.is-compact .lang.en { margin-top: 4px; }
.block-text .accent { color: var(--accent); }
.block-text strong { color: var(--accent); font-weight: 500; }   /* <strong> = zielone wyróżnienie w tekście */
.block-text b { font-weight: 500; }                              /* <b> = zwykłe pogrubienie */
.block-text ul, .block-text ol { margin: 0 0 28px; padding-left: 20px; }
.block-text li { margin: 0 0 22px; }
.block-text a { color: var(--link); text-underline-offset: 3px; }
.block-text a:hover { color: var(--text); }
.flag { display: inline-block; width: 16px; height: 11px; margin-right: 6px; vertical-align: -1px; }

.block-spacer { text-align: center; color: var(--text-muted); letter-spacing: .1em; font-size: .7rem; margin-bottom: 64px; }

.block-media { width: min(1200px, 100% - 48px); }
.block-media.is-medium { width: min(900px, 100% - 48px); }
.block-media.is-small  { width: min(620px, 100% - 48px); }

/* videoPair (16.11): dwa filmy obok siebie, ta sama wysokość (flex proporcjonalny do proporcji filmu) */
.vpair { display: flex; gap: 16px; align-items: flex-start; }
.vpair-cell { min-width: 0; }
.vpair .video video { width: 100%; height: 100%; display: block; }
.vpair-cap { text-align: center; }
@media (max-width: 860px) { .vpair { flex-direction: column; gap: 28px; } .vpair-cell { flex: none !important; width: 100%; } }

.img-row { display: flex; gap: 8px; margin-bottom: 8px; }
.img-row:last-child { margin-bottom: 0; }
.img-cell { position: relative; flex: 1 1 0; min-width: 0; background: #2c2c2c; overflow: hidden; }
/* przezroczyste PNG: bez szarego tła, widać tło strony */
.img-cell:has(img[src$=".png"]) { background: none; }
.img-cell img { width: 100%; height: 100%; object-fit: cover; }
.img-ph { position: absolute; inset: 0; display: grid; place-items: center; padding: 12px;
  border: 1px dashed #4a4a4a; color: #777; font-size: .8rem; text-align: center; word-break: break-all; }

.palette { display: flex; gap: 0; }
.palette span { flex: 1; aspect-ratio: 1; }
.palette span + span { margin-left: clamp(4px, 1.6vw, 28px); }

/* paleta z kodami HEX pod próbkami (opcja labels: true) */
.palette.has-labels span { aspect-ratio: auto; }
.palette.has-labels i { display: block; aspect-ratio: 1; border-radius: 50%; }
.palette.has-labels small { display: block; margin-top: 10px; text-align: center; font-size: .8rem; color: var(--icon-muted); letter-spacing: .04em; }

/* rząd obrazków bez szarego tła komórek (np. GIF-y z przezroczystymi rogami) */
.is-transparent .img-cell { background: none; }
.img-cell video { display: block; width: 100%; height: 100%; object-fit: cover; }

/* blok "frames": kadry z podpisami */
.frame-row { display: flex; gap: 12px; margin-bottom: 20px; }
.frame-row:last-child { margin-bottom: 0; }
.frame { flex: 1 1 0; min-width: 0; margin: 0; }
.frame .img-cell { background: none; }
.frame figcaption { margin-top: 8px; font-size: .8rem; color: var(--icon-muted); letter-spacing: .04em; }
.frame figcaption strong { color: var(--accent); font-weight: 600; }
.frames[class*="cols-"] .frame-row { justify-content: center; flex-wrap: wrap; row-gap: 20px; }
.frames.cols-2 .frame { flex: 0 0 calc((100% - 12px) / 2) !important; }
.frames.cols-3 .frame { flex: 0 0 calc((100% - 24px) / 3) !important; }
.frames.cols-4 .frame { flex: 0 0 calc((100% - 36px) / 4) !important; }
.frames.cols-6 .frame-row { gap: 10px; row-gap: 14px; }
.frames.cols-6 .frame { flex: 0 0 calc((100% - 50px) / 6) !important; }
.frames.cols-6 figcaption { margin-top: 5px; font-size: .72rem; }
.frames.is-cards.cols-6 figcaption { font-size: .78rem; }
.frames.is-left .frame-row { justify-content: flex-start; }
/* opcja cards: true = każdy kadr jako czarna karta z zaokrąglonymi rogami, podpis wyśrodkowany (np. ikony) */
.frames.is-cards .frame .img-cell { background: #000; border-radius: 14px; }
.frames.is-cards figcaption { text-align: center; }   /* ostatni rząd od lewej (kolejność czytania, np. storyboard) */
/* opcja white: true = białe tło pod kadrami (np. przezroczyste szkice z czarną kreską) */
.frames.is-white .frame .img-cell { background: #fff; }

.video-link { margin: 12px 0 0; text-align: center; font-size: .9rem; }
.video-row { display: flex; gap: 16px; }                  /* blok "videos": filmy obok siebie */
.video-cell { flex: 1 1 0; min-width: 0; }
.video-cap { color: var(--icon-muted); margin-right: 4px; }
.video-link a { color: var(--icon-muted); text-underline-offset: 3px; text-decoration-thickness: 0.5px; text-decoration-color: rgba(138, 138, 138, .5); }   /* kreska cienka i półprzezroczysta (cieńszej niż 1 piksel ekranu przeglądarka nie narysuje) */   /* jak ikony w górnym pasku; po najechaniu białe */
.video-link a:hover { color: var(--text); text-decoration-color: rgba(255, 255, 255, .5); }

/* ---------- Powiększanie obrazków (lightbox) ---------- */
.img-cell img, .img-cell video { cursor: zoom-in; }
.lightbox {
  position: fixed; inset: 0; z-index: 1000;
  display: none; align-items: center; justify-content: center;
  background: #111;
}
.lightbox:focus { outline: none; }
.lightbox img.is-white { background: #fff; }
/* animacja MP4 w podglądzie: oryginalny rozmiar (najwyżej do krawędzi ekranu) */
.lightbox video {
  max-width: calc(100vw - 140px); max-height: calc(100vh - 80px);
  width: auto; height: auto; cursor: zoom-out; box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
}
.lightbox.is-open { display: flex; }
.lightbox img {
  max-width: calc(100vw - 140px); max-height: calc(100vh - 80px);
  width: auto; height: auto; object-fit: contain; cursor: zoom-out;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
}
.lightbox button {
  position: absolute; border: 0; background: none; color: var(--text);
  font: 300 2.5rem/1 var(--font, "Jost", sans-serif); cursor: pointer;
  width: 56px; height: 56px; display: grid; place-items: center; opacity: .75;
}
.lightbox button:hover { opacity: 1; }
.lightbox .lb-close { top: 12px; right: 16px; }
.lightbox .lb-prev  { left: 12px;  top: 50%; transform: translateY(-50%); }
.lightbox .lb-next  { right: 12px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-count { position: absolute; bottom: 16px; left: 0; right: 0; text-align: center; color: var(--text-muted); font-size: .85rem; }
body.lb-lock { overflow: hidden; }
@media (max-width: 860px) {
  .lightbox img, .lightbox video { max-width: 100vw; max-height: calc(100vh - 120px); }
  .lightbox .lb-prev, .lightbox .lb-next { top: auto; bottom: 4px; transform: none; }
}

.video-ph { position: absolute; inset: 0; display: grid; place-items: center; color: #777; font-size: .9rem; border: 1px dashed #444; }

.block-thanks { text-align: center; font-size: 1rem; }
.block-thanks p { margin: 0 0 12px; }
.block-thanks .thanks-en { color: var(--text-en); margin-bottom: 40px; }
.block-thanks a { color: var(--link-pink); text-underline-offset: 3px; }

@media (max-width: 860px) {
  .project-title { font-size: 2.25rem; margin: 40px auto 60px; }
  .project-meta { margin: -36px auto 56px; }
  .block-text h2 { font-size: 1.5rem; }
  .block-media, .block-media.is-medium, .block-media.is-small { width: 100%; }
}
@media (max-width: 520px) {
  .img-row { flex-direction: column; }
  .img-cell { flex: none !important; }
  .img-cell.is-empty { display: none; }   /* puste komórki (empty: true) tylko na komputerze */
  .video-row { flex-direction: column; gap: 32px; }
  /* opcja mobileCols w bloku images: na telefonie kilka obrazków w rzędzie zamiast jeden pod drugim */
  .mcols-2 .img-row, .mcols-3 .img-row { flex-direction: row; flex-wrap: wrap; }
  .mcols-2 .img-cell { flex: 0 0 calc((100% - 8px) / 2) !important; aspect-ratio: 1 !important; }
  .mcols-3 .img-cell { flex: 0 0 calc((100% - 16px) / 3) !important; aspect-ratio: 1 !important; }
  .mcols-2 .img-cell img, .mcols-3 .img-cell img { object-fit: contain; background: #fff; }
  .project-title { font-size: 1.85rem; }
  .palette { flex-wrap: wrap; gap: 6px; }
  .palette span { flex: 0 0 calc((100% - 6 * 6px) / 7); }
  .palette span + span { margin-left: 0; }
  .palette.has-labels { gap: 14px 10px; }
  .palette.has-labels span { flex: 0 0 calc((100% - 2 * 10px) / 3); }
  .palette.has-labels i { width: 64%; margin: 0 auto; }
  .is-transparent.mcols-2 .img-cell img, .is-transparent.mcols-3 .img-cell img { background: none; }
  /* mobileKeepRatio (od 16.11): obrazki po 2/3 w rzędzie, ale w swoich proporcjach (bez kwadratów i białego tła) */
  .mcols-keep { display: flex; flex-wrap: wrap; gap: 8px; }
  .mcols-keep .img-row { display: contents; }
  .mcols-keep .img-cell { aspect-ratio: auto !important; }
  .mcols-keep .img-cell img { background: none; }
  /* mobileMasonry: true (od 18.11, Ilustracje do magazynów) = na telefonie 2 kolumny, każdy obrazek w swoich proporcjach, bez przycinania */
  .mcols-masonry { columns: 2; column-gap: 6px; }
  .mcols-masonry .img-row { display: contents; }
  .mcols-masonry .img-cell { display: block; width: 100%; margin: 0 0 6px; break-inside: avoid; }
  .mcols-center .img-row { justify-content: center; }   /* mobileCenter: true = niepełny rząd na telefonie wyśrodkowany (16.11, rekiny) */
  /* kadry z podpisami: na telefonie jeden pod drugim (cols-4 = po 2 w rzędzie) */
  .frame-row { flex-wrap: wrap; gap: 20px 10px; }
  .frame, .frames[class*="cols-"] .frame { flex: 0 0 100% !important; }
  .frames.cols-4 .frame, .frames.fm-2 .frame { flex: 0 0 calc((100% - 10px) / 2) !important; }
  .frame-row + .frame-row { margin-top: 0; }
  .frames.fm-2 .frame-row { justify-content: flex-start; }
  .frames.fm-3 .frame-row { gap: 12px 6px; justify-content: flex-start; }
  .frames.fm-3 .frame { flex: 0 0 calc((100% - 12px) / 3) !important; }
  .frames.fm-3 figcaption { padding: 0 4px; font-size: .68rem; }
  .frame figcaption { padding: 0 12px; }
}

/* ---------- Strona CONTACT ---------- */
.contact { width: min(500px, 100% - 48px); margin: 0 auto; }
.contact-intro { margin: -24px 0 48px; text-align: center; color: var(--text-muted); font-size: 1rem; }
.contact-intro a { color: var(--link); text-underline-offset: 3px; }
.contact-intro a:hover { color: var(--text); }

.field { margin: 0 0 22px; }
.field label { display: block; margin: 0 0 6px; font-size: .85rem; font-weight: 400; color: var(--icon-muted); }
.field label .req { color: var(--dot); }
.field input,
.field textarea {
  display: block; width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--field-border);
  border-radius: var(--radius);
  background: var(--field-bg);
  color: var(--field-text);
  font: 400 1rem/1.4 var(--font);
  transition: box-shadow .15s, border-color .15s;
}
.field textarea { min-height: 150px; resize: vertical; }
.field input::placeholder,
.field textarea::placeholder { color: #9a9a9a; }
.field input:focus,
.field textarea:focus { outline: none; border-color: var(--link); box-shadow: 0 0 0 3px rgba(45, 181, 240, .45); }
.field.is-invalid input,
.field.is-invalid textarea { border-color: #ff6b6b; box-shadow: 0 0 0 3px rgba(255, 107, 107, .35); }
.field .err { display: none; margin: 6px 0 0; font-size: .85rem; color: #ff8a8a; }
.field.is-invalid .err { display: block; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }  /* pułapka na boty */

.btn {
  display: inline-block;
  padding: 11px 32px;
  border: 1px solid #5a5a5a;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  font: 400 1rem/1.4 var(--font);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.btn:hover { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn:disabled { opacity: .5; cursor: wait; }

.form-status { margin: 20px 0 0; font-size: .95rem; min-height: 1.5em; }
.form-status.ok  { color: var(--accent); }
.form-status.bad { color: #ff8a8a; }
.form-status a { color: inherit; }

/* ---------- Strona ABOUT ---------- */
.about-photo {
  width: 260px; height: 260px;
  margin: -16px auto 64px;
  border-radius: 50%;
  object-fit: cover;
}
.about { font-size: var(--fs-body); line-height: 1.55; }
.about p { margin: 0 0 22px; }
.about strong { font-weight: 500; }
.about .name { color: var(--link); font-weight: 500; }
.about .em { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.about a { color: var(--link); text-underline-offset: 3px; text-decoration: none; }
.about a:hover { color: var(--text); text-decoration: underline; }
.about .sep { margin: 44px 0; color: var(--text-muted); }
.about h2 { margin: 0 0 24px; font-size: 1.1rem; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: .02em; }
.about .facts { list-style: none; margin: 0 0 22px; padding: 0; }
.about .facts li { margin: 0 0 22px; }   /* bez kropek - zdania zaczynają się od emoji (16.10) */
.about .mail, .about .mail a { color: var(--text-muted); }
.about .mail a:hover { color: var(--text); }

@media (max-width: 860px) {
  .about-photo { width: 200px; height: 200px; margin: -8px auto 44px; }
  .contact-intro { margin-top: -12px; }
}

/* ---------- Stopka ---------- */
.site-footer { padding: 120px 24px 48px; }
.site-footer .social { justify-content: center; gap: 26px; }
.site-footer .social a { color: var(--icon-muted); }
.site-footer .social a:hover { color: var(--text); }
.site-footer .copy { margin: 24px 0 0; text-align: center; font-size: .8rem; color: #666; }

/* ---------- Przycisk "wróć na górę" ---------- */
.to-top {
  position: fixed;
  right: 40px;
  bottom: 40px;
  z-index: 40;
  width: 60px;
  height: 60px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  color: rgba(255, 255, 255, .7);
  cursor: pointer;
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s, visibility .25s, background .15s;
}
.to-top.is-visible { opacity: 1; visibility: visible; }
.to-top:hover { background: rgba(255, 255, 255, .22); color: #fff; }
.to-top svg { width: 22px; height: 22px; }

/* ---------- Responsywność ---------- */
@media (max-width: 1100px) {
  :root { --gutter: 32px; --grid-cols: 3; }
  .site-nav ul { gap: 18px; }
  .social { gap: 16px; }
}

@media (max-width: 860px) {
  :root { --gutter: 24px; --header-h: 60px; --logo-size: 36px; --fs-h1: 2rem; --grid-cols: 2; }
  /* nagłówek: [pusto] logo [hamburger] */
  .site-header { box-shadow: none; }
  .site-nav ul,
  .site-header .social { display: none; }        /* puste kolumny, logo zostaje na środku */
  .nav-toggle { display: block; }
  .page-title { margin: 40px 0 44px; }
  .container { width: 100%; }                     /* wideo od krawędzi do krawędzi */
  .prose { width: calc(100% - 2 * 40px); }
  .reel-list { margin-top: 60px; }
  .reel-list li { margin-bottom: 34px; }
}
@media (min-width: 861px) {
  .mobile-menu { display: none; }
}

@media (max-width: 520px) {
  :root { --fs-body: 1rem; --grid-cols: 1; }
  .prose { width: calc(100% - 2 * 24px); }
  .reel-list { margin-top: 44px; }
  .reel-list li { margin-bottom: 26px; }
  .site-footer { padding-top: 80px; }
  .site-footer .social { gap: 22px; }
  .to-top { right: 16px; bottom: 16px; width: 48px; height: 48px; }
}

/* ---------- Blok "matrix": sceny w kolumnach, etapy w wierszach (od 27.10, Whiteboard) ---------- */
.matrix { display: grid; grid-template-columns: 110px repeat(var(--n), minmax(0, 1fr)); gap: 8px; align-items: center; }
.matrix .mx-col { display: contents; }
.matrix .mx-hd { grid-column: var(--c); grid-row: 1; text-align: center; font-weight: 600; font-size: .9rem; padding-bottom: 2px; }
.matrix .mx-lab { grid-column: 1; grid-row: var(--r); text-align: right; padding-right: 6px; color: var(--text-muted); font-size: .8rem; line-height: 1.3; }
.matrix .mx-lab strong, .matrix .mx-cap strong { color: var(--accent, #36E3A0); }
.matrix .mx-cell { grid-column: var(--c); grid-row: var(--r); margin: 0; }
.matrix .mx-cell .img-cell { width: 100%; }
.matrix .mx-cap { display: none; }
@media (max-width: 860px) {
  .matrix { display: block; }
  .matrix .mx-lab { display: none; }
  .matrix .mx-col { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 8px; margin: 0 12px 28px; }
  .matrix .mx-hd { grid-column: 1 / -1; grid-row: auto; text-align: left; }
  .matrix .mx-cell { grid-column: auto; grid-row: auto; }
  .matrix .mx-cap { display: block; margin-top: 4px; color: var(--text-muted); font-size: .72rem; }
}

/* ---------- Przełącznik języka EN | PL (od 13.11, wariant "D.1 + animacja") ----------
   Jasny suwak przesuwa się do klikniętego języka; w tym samym czasie i z tą samą krzywą
   napis płynnie zmienia kolor i grubość (Jost w wersji zmiennej - JostVar).
   Przyciski mają STAŁĄ szerokość, więc pigułka nie zmienia rozmiaru. */
@font-face { font-family: "JostVar"; font-weight: 100 900; font-display: swap;
  src: url("../assets/fonts/jost-var-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "JostVar"; font-weight: 100 900; font-display: swap;
  src: url("../assets/fonts/jost-var-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
:root { --lang-ease: .28s cubic-bezier(.4, 0, .2, 1); }
.lang-switch {
  position: relative; display: flex; align-items: center; margin-right: 28px;
  border: 1px solid #555; border-radius: 999px; padding: 2px; font-size: .85rem;
}
.lang-switch::before {               /* jasny suwak pod aktywnym językiem */
  content: ""; position: absolute; top: 2px; left: 2px; width: 2.9em; height: calc(100% - 4px);
  border-radius: 999px; background: #e8e8e8; transition: transform var(--lang-ease);
}
.lang-switch.is-pl::before { transform: translateX(100%); }
.lang-switch button {
  position: relative; z-index: 1;
  width: 2.9em; padding: 3px 0; text-align: center; border-radius: 999px;
  background: none; border: 0; cursor: pointer;
  font-family: "JostVar", "Jost", system-ui, sans-serif; font-size: 1em; font-weight: 300; letter-spacing: .02em;
  color: var(--icon-muted); transition: color var(--lang-ease), font-weight var(--lang-ease);
}
.lang-switch button:hover { color: var(--text); }
.lang-switch button[aria-current="true"] { color: #222; font-weight: 600; cursor: default; }
.mobile-lang { padding: 0 24px 32px; display: flex; justify-content: center; }
.mobile-lang .lang-switch { margin: 0; font-size: 1.05rem; }
.mobile-lang .lang-switch button { padding: 6px 0; }

/* zmiana języka bez przeładowania: menu i treść na chwilę przygasają i wracają w nowym języku */
#site-header .site-nav ul, .mobile-nav ul, main, .site-footer { transition: opacity .15s ease; }
html.lang-fading #site-header .site-nav ul, html.lang-fading .mobile-nav ul,
html.lang-fading main { opacity: 0; }

/* nazwy w menu nigdy nie łamią się na dwie linijki (13.11) */
.site-nav a { white-space: nowrap; }

/* ---------- Animacja menu (wariant A1, 16.11) ----------
   Napis płynnie zmienia grubość i kolor (JostVar, ten sam czas i krzywa co EN | PL).
   Każda pozycja ma STAŁĄ szerokość - taką, jak po pogrubieniu (niewidoczny ::after z data-label; NIE data-t - tego używa contact.html),
   więc podczas animacji nic się nie przesuwa (decyzja Juliana: A1).
   Kliknięcie obsługuje js/site.js (opóźnienie 0,28 s przed przejściem na nową podstronę). */
.site-nav a, .mobile-nav a {
  display: inline-grid; justify-items: center;
  font-family: "JostVar", "Jost", system-ui, sans-serif;
  transition: color var(--lang-ease), font-weight var(--lang-ease);
}
.site-nav a > span, .mobile-nav a > span { grid-area: 1 / 1; }
.site-nav a::after, .mobile-nav a::after {
  content: attr(data-label); grid-area: 1 / 1; font-weight: 700;
  visibility: hidden; height: 0; overflow: hidden; pointer-events: none;
}
/* węższe okna (1281-1440 px): mniejsze odstępy, żeby polskie menu nie dotykało logo */
@media (max-width: 1440px) { .site-nav ul { gap: 14px; } }
@media (max-width: 1340px) { .site-nav ul { gap: 10px; } }
@media (prefers-reduced-motion: reduce) {
  .site-nav a, .mobile-nav a { transition: none; }
}


/* poniżej 1280 px pasek przechodzi na hamburger (13.11) - menu, przełącznik i ikony są w menu
   na cały ekran; dzięki temu menu nigdy nie dochodzi do logo. Na Full HD nic się nie zmienia. */
@media (max-width: 1280px) {
  .site-nav ul,
  .site-header .social,
  .site-header .lang-switch { display: none; }
  .nav-toggle { display: block; }
}

/* treść tylko w jednym języku: class="t-pl" / class="t-en" */
html[lang="pl"] .t-en,
html:not([lang="pl"]) .t-pl { display: none !important; }
.block-thanks .thanks-one { margin-bottom: 40px; }

/* ---------- About: logo klientów (13.11) - białe pliki PNG/SVG przyciemnione do szarości ikon,
   po najechaniu białe, jak ikony w pasku ---------- */
.worked-with h2 { margin-bottom: 20px; }
/* każde logo w jednakowej "komórce"; wysokość (--h) dobrana tak, żeby wszystkie wyglądały
   na podobnie duże: płaskie napisy niższe, okrągłe/kwadratowe znaki wyższe */
.logo-wall { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px 32px; margin: 0 0 48px; }
.logo-wall img {
  display: block; height: var(--h, 32px); width: auto; max-width: 100%; margin: auto;
  filter: brightness(.6); transition: filter .15s;
}
.logo-wall img:hover { filter: brightness(1); }
.logo-wall > * { place-self: center; }
.logo-wall { grid-auto-rows: 104px; align-items: center; justify-items: center; }
@media (max-width: 860px) {
  .logo-wall { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 96px; column-gap: 24px; }
  .logo-wall img { height: calc(var(--h, 32px) * .9); }
  .logo-wall img:last-child:nth-child(odd) { grid-column: 1 / -1; }   /* ostatnie, samotne logo na środku */
  .worked-with h2 { text-align: center; }
}

/* ---------- About (13.11, wariant B1): na dole strony trzy kolumny - Czym się zajmuję / Wybrani klienci /
   Wybrane agencje i studia - oddzielone pionowymi liniami. Na komputerze tekst About jest szerszy (1040 px)
   i trochę większy, żeby jego krawędzie pokrywały się z kolumnami. Na telefonie kolumny jedna pod drugą. ---------- */
@media (min-width: 861px) { .about.prose { width: min(1040px, 100% - 96px); font-size: 1.12rem; } }
.worked-with { display: grid; grid-template-columns: 1.35fr 1fr 1fr; margin: 56px 0 24px; padding-top: 44px; border-top: 1px solid rgba(255, 255, 255, .14); }   /* linia oddziela kolumny od maila */
.ww-row { padding: 4px 24px; border-left: 1px solid rgba(255, 255, 255, .14); }
.ww-row:first-child { border-left: 0; padding-left: 0; }
.about .ww-label { margin: 0 0 14px; font-size: .85rem; font-weight: 700; color: var(--text); text-transform: uppercase; letter-spacing: .04em; line-height: 1.5; }
.ww-list span { display: block; position: relative; padding-left: 16px; margin-bottom: 6px; line-height: 1.45; color: #9c9c9c; }
.ww-list span::before { content: ""; position: absolute; left: 2px; top: .68em; width: 4px; height: 4px; border-radius: 50%; background: #6e6e6e; }
@media (max-width: 860px) {
  .worked-with { grid-template-columns: 1fr; margin-top: 48px; padding-top: 0; border-top: 0; }
  .ww-row { border-left: 0; padding: 18px 0; border-top: 1px solid rgba(255, 255, 255, .12); }
  .ww-row:last-child { border-bottom: 1px solid rgba(255, 255, 255, .12); }
}

/* ===== Płynne przejścia między podstronami (16.11) =====
   View Transitions API: stara strona płynnie przenika się z nową (Chrome/Edge, Safari 18.2+).
   Górny pasek ma własną nazwę, więc stoi w miejscu – przenika się tylko treść.
   Przeglądarki bez obsługi (np. Firefox) i plik otwarty z dysku: treść łagodnie się pojawia (fade-in, klasa page-fade).
   "Ogranicz ruch" w systemie = bez animacji. */
html { background: var(--bg); }   /* tło od pierwszej klatki – bez błysku */
@view-transition { navigation: auto; }
.site-header { view-transition-name: site-header; }
::view-transition-old(root),
::view-transition-new(root) { animation-duration: .4s; animation-timing-function: cubic-bezier(.4, 0, .2, 1); }
::view-transition-group(site-header) { animation-duration: .4s; }

html.page-fade main { animation: page-fade-in .4s cubic-bezier(.4, 0, .2, 1) both; }   /* klasę dodaje js/site.js */
@keyframes page-fade-in { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  html.page-fade main { animation: none; }
}

/* Podpis pod rzędem obrazków (rowCaptions, 16.11 - rekiny): mały, szary, wyśrodkowany pod parą,
   bliżej swojej ilustracji niż następnej (zasada bliskości) */
.img-row-cap { margin: 10px 0 44px; text-align: center; font-size: .9rem; line-height: 1.4; color: #9c9c9c; letter-spacing: .01em; }
.img-row-cap:last-child { margin-bottom: 0; }
.img-row-cap b { color: var(--text); font-weight: 500; }
@media (max-width: 520px) { .img-row-cap { margin: 8px 0 32px; } }

/* Siatka równych kafelków (blok images z grid: N, od 16.11 - Paleoart, wariant C):
   każdy obrazek ma tę samą szerokość, niepełny rząd wyśrodkowany; --s = węższy kafelek (scale) */
.img-grid { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; }
.img-grid .img-cell { flex: 0 0 calc((100% - (var(--n) - 1) * 8px) / var(--n) * var(--s, 1)) !important; }
@media (max-width: 520px) {
  .img-grid .img-cell { flex-basis: calc((100% - (var(--mn) - 1) * 8px) / var(--mn) * var(--s, 1)) !important; }
}

/* Własne tło paska (pole headerBg w data/projects.js, 18.11): pasek i menu mobilne zostają czarne
   z oryginalnymi kolorami menu, nawet gdy projekt ma kolorowe tło i własne kolory (pole colors) */
html.has-header-bg .site-header, html.has-header-bg .mobile-menu {
  --icon-muted: #8a8a8a; --text-muted: #a8a8a8; --link: #2db5f0; --link-pink: #e040e8;
}

/* Mozaika "duży + 4 małe" (blok images z mosaic: "left" | "center", od 18.11 - Smoki):
   siatka 4 × 2 kwadratów, pierwszy obrazek zajmuje 2 × 2; na telefonie duży na całą szerokość, małe po 2 */
.img-mosaic { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.img-mosaic .img-cell { aspect-ratio: 1 !important; }
.img-mosaic .img-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mosaic-left .img-cell:first-child { grid-column: 1 / 3; grid-row: 1 / 3; }
.mosaic-center .img-cell:first-child { grid-column: 2 / 4; grid-row: 1 / 3; }
@media (max-width: 520px) {
  .img-mosaic { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .img-mosaic .img-cell:first-child { grid-column: 1 / 3; grid-row: auto; }
}

/* mobileLead: true (od 18.11, Hell Creek) = razem z mobileCols + mobileKeepRatio: na telefonie pierwszy obrazek (np. paleta) sam,
   wyśrodkowany (46% szerokości), pozostałe jeden pod drugim na całą szerokość (wariant B1) */
@media (max-width: 520px) {
  .mcols-lead { justify-content: center; }
  .mcols-lead .img-cell { flex: 0 0 100% !important; max-width: 100%; }
  .mcols-lead .img-row:first-child .img-cell:first-child { flex: 0 0 46% !important; max-width: 46%; }
}

/* only: "desktop" | "mobile" w bloku (od 18.11, "Nie wiem, ale się dowiem!") = blok tylko na komputerze albo tylko na telefonie;
   np. plansza z paletą na komputerze, a na telefonie te same miniatury osobno po 2 w rzędzie */
@media (min-width: 521px) { [data-only="mobile"] { display: none !important; } }
@media (max-width: 520px) { [data-only="desktop"] { display: none !important; } }
