/* fonts:start */
/* Archivo latin-ext */
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 600;
  font-stretch: 125%;
  font-display: swap;
  src: url("../fonts/archivo-expanded-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Archivo latin */
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 600;
  font-stretch: 125%;
  font-display: swap;
  src: url("../fonts/archivo-expanded-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Instrument Serif latin-ext */
@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/instrument-serif-italic-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Instrument Serif latin */
@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/instrument-serif-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Schibsted Grotesk latin-ext */
@font-face {
  font-family: "Schibsted Grotesk";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/schibsted-grotesk-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Schibsted Grotesk latin */
@font-face {
  font-family: "Schibsted Grotesk";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/schibsted-grotesk-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* fonts:end */

/* ============ tokeny ============ */
:root {
  --bg: #f6f6f5;
  --bg-top: #ffffff;
  --bg-end: #e7e7e5;
  /* biel u góry przechodzi w jasną szarość u dołu; przypięty do okna */
  --paper: linear-gradient(180deg, var(--bg-top), var(--bg) 45%, var(--bg-end));
  --ink: #141413;
  --muted: #8b877e;
  --line: rgba(20, 20, 19, .08);
  --gap: 6px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --sans: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --wide: "Archivo", var(--sans); /* menu: Archivo 600, szerokość 125% */
  --side: clamp(260px, 27vw, 380px);
  --pad: clamp(32px, 6vw, 96px);
  --bar: 56px;
  color-scheme: light;
}

/* ============ baza ============ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; font-synthesis: none; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
/* gradient na osobnej warstwie fixed, nie background-attachment: fixed (repaint przy przewijaniu) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--paper);
  pointer-events: none;
}
h1, h2, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
b { font-weight: 600; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
::selection { background: var(--ink); color: var(--bg); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ============ układ (desktop) ============ */
body { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); }
main { grid-column: 2; grid-row: 1; min-width: 0; }
.topbar { display: none; }

/* ============ pasek boczny ============ */
.side {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 36px 30px 28px;
  border-right: 1px solid var(--line);
  view-transition-name: chrome;
}
.logo { display: block; width: fit-content; }
.side .logo-svg { width: 150px; height: auto; }
.name {
  margin-top: 14px;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: .24em;
  text-transform: uppercase;
}

/* menu: numer + szerokie wersaliki (Archivo Expanded); po najechaniu wysuwa się linia */
.nav { margin-top: 54px; display: flex; flex-direction: column; gap: 6px; }
.nav a { display: flex; align-items: baseline; gap: 14px; width: fit-content; padding: 7px 12px 7px 0; }
.num { width: 20px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; transition: color .4s var(--ease); }
.label {
  position: relative;
  font-family: var(--wide);
  font-size: 16px;
  font-weight: 600;
  font-stretch: 125%;
  line-height: 24px;
  letter-spacing: .12em;
  text-transform: uppercase;
  white-space: nowrap;
}
.label::after {
  content: "";
  position: absolute;
  left: 0;
  right: .12em; /* bez światła po ostatniej literze */
  bottom: -3px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .6s var(--ease);
}
@media (width > 900px) {
  .nav a:hover .label::after,
  .nav a:focus-visible .label::after,
  .nav a[aria-current="page"] .label::after { transform: scaleX(1); }
  .nav a:hover .num,
  .nav a:focus-visible .num,
  .nav a[aria-current="page"] .num { color: var(--ink); }
}

.foot {
  margin-top: auto;
  padding-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
}
.foot a { width: fit-content; color: var(--ink); font-weight: 500; }
.foot .ig { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.ig-icon { width: 19px; height: 19px; }
.m-only { display: none; }

/* ============ pasek postępu (main.js) ============ */
/* tor w pasku bocznym, 17 px od krawędzi (na samej krawędzi zlewałby się z brzegiem zdjęć) */
.progress {
  position: fixed;
  z-index: 30;
  top: 36px;
  bottom: 28px;
  left: calc(var(--side) - 20px);
  width: 2px;
  background: var(--line);
  pointer-events: none;
}
.progress i { position: absolute; inset: 0; background: var(--ink); transform-origin: 50% 0; transform: scaleY(var(--p, 0)); will-change: transform; }
@media (width <= 900px) {
  /* telefon: linia na dolnej krawędzi topbaru */
  .progress { z-index: 51; top: calc(var(--bar) - 2px); bottom: auto; left: 0; width: 100%; height: 2px; background: none; transition: opacity .45s var(--ease); }
  .progress i { transform-origin: 0 50%; transform: scaleX(var(--p, 0)); }
  html.menu-open .progress { opacity: 0; }
}

/* ============ telefon i tablet (<= 900 px) ============ */
@media (width <= 900px) {
  body { display: block; }
  .topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--bar);
    padding: 0 calc(var(--pad) - 12px) 0 var(--pad);
    background: var(--bg-top); /* = górna krawędź gradientu */
    border-bottom: 1px solid var(--line);
    view-transition-name: chrome;
  }
  .topbar .logo-svg { width: 110px; height: auto; }
  .menu-btn {
    position: relative;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
  }
  .menu-btn span {
    position: absolute;
    left: 12px;
    right: 12px;
    top: calc(50% - .75px);
    height: 1.5px;
    background: currentColor;
    transition: transform .45s var(--ease);
  }
  .menu-btn span:first-child { transform: translateY(-3.5px); }
  .menu-btn span:last-child { transform: translateY(3.5px); }
  html.menu-open .menu-btn span:first-child { transform: rotate(45deg); }
  html.menu-open .menu-btn span:last-child { transform: rotate(-45deg); }

  /* pasek boczny staje się pełnoekranową nakładką z menu */
  .side {
    position: fixed;
    inset: 0;
    z-index: 40;
    align-self: auto; /* „start” z desktopu zwęziłby nakładkę fixed do wysokości treści */
    height: auto;
    padding: calc(var(--bar) + 40px) var(--pad) 32px;
    border-right: 0;
    background: var(--paper); /* ta sama geometria co body::before */
    overscroll-behavior: contain;
    view-transition-name: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity .45s var(--ease), visibility 0s linear .45s;
  }
  .side > * { transform: translateY(12px); transition: transform .45s var(--ease); }
  html.menu-open { overflow: hidden; }
  html.menu-open .side { opacity: 1; visibility: visible; transition: opacity .45s var(--ease); }
  html.menu-open .side > * { transform: none; }
  .brand { display: none; }
  .nav { margin-top: 0; gap: 0; }
  .nav a { gap: 16px; padding: 5px 12px 5px 0; }
  .label { font-size: clamp(22px, 7vw, 30px); line-height: 1.5; letter-spacing: .06em; }
  .label::after { content: none; }
  .nav a[aria-current="page"] .num { color: var(--ink); }
  .foot { gap: 10px; font-size: 14px; }
  .foot .m-only { display: block; }
}

/* ============ strony tekstowe ============ */
.page { padding: var(--pad); }
.eyebrow {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--muted);
}
.display {
  margin-top: 18px;
  font: italic 400 clamp(44px, 6vw, 88px)/1 var(--serif);
  letter-spacing: -.01em;
  text-wrap: balance;
}

/* jeden krój: wstęp tym samym groteskiem, tylko większy i grubszy */
.about { box-sizing: content-box; max-width: 62ch; font-size: 17px; line-height: 1.75; }
.about .lead {
  margin: 22px 0 32px;
  font: 500 clamp(21px, 1.9vw, 26px)/1.45 var(--sans);
  letter-spacing: -.012em;
  color: var(--ink);
  text-wrap: balance;
}
.about p { color: #3b3a37; text-wrap: pretty; }
.about p + p { margin-top: 1.1em; }

/* O mnie, „Przykładowe materiały z wykorzystaniem moich zdjęć”: ramki postów z IG i grafiki w układzie „murowanym”
   (kolumny CSS: każda kolumna wypełniona bez dziur, równe odstępy); pod każdą poświata z jej kolorów (rozmyta kopia,
   .glow). Kolejność w site.json dobrana tak, żeby kolumny wychodziły symetrycznie (4: 2-3-3-2, 3: 3-4-3, 2: 5-5)
   i grafika nie stała pod grafiką. Szeroki kolaż 4 kolumny, węziej 3, telefon 2. */
.works { padding-top: 0; container-type: inline-size; }
.works-title { font: 500 clamp(21px, 1.9vw, 26px)/1.3 var(--sans); letter-spacing: -.012em; }
.works-list {
  --wgap: clamp(24px, 3vw, 56px);
  columns: 3;
  column-gap: var(--wgap);
  max-width: 1040px; /* na średnim ekranie nie rozciągać na całą szerokość */
  margin-top: clamp(28px, 4vw, 56px);
}
.works-list > .work { break-inside: avoid; margin-bottom: var(--wgap); }
/* od 1250 px kolażu 4 kolumny bez limitu szerokości: ramki większe (węziej byłyby mniejsze niż w 3) */
@container (width >= 1250px) {
  .works-list { columns: 4; max-width: none; }
}
.work-link { position: relative; display: block; isolation: isolate; }
.work-link img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 0 0 1px rgba(20, 20, 19, .05), 0 2px 6px rgba(20, 20, 19, .08);
}
.glow {
  position: absolute;
  inset: 6% -7% -9%;
  z-index: -1;
  background: center / cover no-repeat;
  filter: blur(36px) saturate(1.7);
  opacity: .72;
  pointer-events: none;
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .work-link img, .glow { transition: transform .9s var(--ease), opacity .9s var(--ease); }
  .work-link:hover img { transform: translateY(-6px); }
  .work-link:hover .glow { opacity: .95; transform: scale(1.05); }
}
@media (width <= 900px) {
  .works-list { columns: 2; } /* telefon */
}

.big-link {
  position: relative;
  display: inline-block;
  max-width: 100%;
  font-size: clamp(20px, calc(4.6vw + 6px), 34px);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -.015em;
  overflow-wrap: anywhere;
}
.big-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transition: transform .6s var(--ease);
}
.big-link:hover::after, .big-link:focus-visible::after { transform: scaleX(1); }
.big-link.tel { white-space: nowrap; }

.channels { margin-top: clamp(40px, 6vw, 72px); max-width: 680px; border-top: 1px solid var(--line); }
.channels li {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  align-items: baseline;
  gap: 8px 24px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}
.where { margin-top: 32px; font: italic 400 clamp(26px, 2.6vw, 34px)/1.2 var(--serif); color: var(--muted); }
.notfound .big-link { margin-top: clamp(32px, 5vw, 56px); }
@media (width <= 600px) {
  .channels li { grid-template-columns: minmax(0, 1fr); padding: 20px 0; }
}

/* ============ zdjęcia: hero i wiersze bez przycinania ============ */
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ph { position: relative; display: block; overflow: hidden; background: var(--c); }
.ph img { width: 100%; height: 100%; }
.hero img { object-fit: cover; }
.rows { display: flex; flex-direction: column; gap: var(--gap); padding-top: var(--gap); }
/* --r = w/h: szerokość rośnie z proporcją, więc zdjęcia w wierszu mają równą wysokość */
.row { display: flex; gap: var(--gap); }
.row > .ph { flex: var(--r) 1 0; aspect-ratio: var(--r); }
/* strona główna jak stara: niski pas u góry, wąsko w rzędzie, szeroko między rzędami */
.hero.strip { aspect-ratio: 4 / 1; }
.rows.spaced { gap: clamp(20px, 2.4vw, 56px); }

/* strona główna: linki do galerii pod wyborem kadrów */
.more {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  padding: clamp(48px, 7vw, 96px) var(--pad) var(--pad);
}
.more a { display: flex; flex-direction: column; gap: 10px; padding-top: 20px; border-top: 1px solid var(--line); }
.more-label { font: italic 400 32px/1.1 var(--serif); letter-spacing: -.005em; }
.more-label i { display: inline-block; font-style: inherit; transition: transform .6s var(--ease); }
.more a:hover .more-label i, .more a:focus-visible .more-label i { transform: translateX(6px); }
.more-count { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

@media (width <= 900px) {
  /* pas też 5/4: nie niższy niż zdjęcia pod nim, więc zostaje elementem LCP */
  .hero, .hero.strip { aspect-ratio: 5 / 4; }
  .row { flex-direction: column; }
  .row > .ph { flex: none; width: 100%; }
  /* rząd z 4 zdjęć: 2 × 2 w równych kafelkach 4:5 (pion 3:4 traci kilka % wysokości) */
  .row.quad { display: grid; grid-template-columns: 1fr 1fr; }
  .row.quad > .ph { aspect-ratio: 4 / 5; }
  .row.quad img { object-fit: cover; }
}

/* powolne powiększenie po najechaniu, bez cieni i poświaty */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  a.ph img { transition: transform 1.1s var(--ease); }
  a.ph:hover img { transform: scale(1.035); }
}

/* reveal: ukrywa tylko z klasą js (main.js), więc bez JS treść jest widoczna */
@media screen and (prefers-reduced-motion: no-preference) {
  html.js [data-reveal] {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .9s var(--ease) var(--d, 0s), transform .9s var(--ease) var(--d, 0s);
  }
  html.js [data-reveal].in { opacity: 1; transform: none; }
}

/* ============ przejścia między stronami ============ */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .25s var(--ease) both; }
::view-transition-new(root) { animation: vt-in .5s var(--ease) both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }

/* ============ ograniczony ruch ============ */
@media (prefers-reduced-motion: reduce) {
  .label::after, .num, .side, html.menu-open .side, .side > *, .menu-btn span, .big-link::after, .more-label i, .progress { transition: none; }
  .side > * { transform: none; }
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) { animation: none !important; }
}

/* ============ lightbox (assets/js/lightbox.js) ============ */
dialog.lb {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  overscroll-behavior: contain;
  background: rgba(246, 246, 245, .97); /* = --bg */
  color: var(--ink);
}
dialog.lb::backdrop { background: transparent; }
dialog.lb:focus { outline: none; }
.lb-stage { position: absolute; inset: 0; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
.lb-img {
  position: absolute;
  max-width: none;
  transform-origin: 50% 50%;
  opacity: 0;
  transition: opacity .35s var(--ease);
  -webkit-user-drag: none;
}
.lb-img.cur { opacity: 1; }
.lb-img.anim { transition: opacity .35s var(--ease), transform .35s var(--ease); }
.lb-count {
  position: absolute;
  top: 18px;
  left: 24px;
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.lb-btn {
  position: absolute;
  z-index: 1;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  font-size: 18px;
  line-height: 44px;
  cursor: pointer;
}
.lb-close { top: 4px; right: 8px; }
.lb-prev, .lb-next { top: calc(50% - 22px); }
.lb-prev { left: 14px; }
.lb-next { right: 14px; }
@media (width <= 900px) {
  .lb-count { top: 17px; left: 16px; }
  .lb-prev, .lb-next { top: auto; bottom: 4px; }
  .lb-prev { left: 8px; }
  .lb-next { right: 8px; }
}
@media (prefers-reduced-motion: no-preference) {
  dialog.lb[open] { animation: lb-in .35s var(--ease); }
}
@keyframes lb-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .lb-img, .lb-img.anim { transition: none; }
}
