/* Pilch Architekci — 2026 refresh. Ten sam motyw: biel, czerń, Work Sans, dużo powietrza. */

@font-face { font-family: "Work Sans"; font-weight: 300; font-display: swap; src: url(fonts/worksans-light.woff2) format("woff2"); }
@font-face { font-family: "Work Sans"; font-weight: 400; font-display: swap; src: url(fonts/worksans-regular.woff2) format("woff2"); }
@font-face { font-family: "Work Sans"; font-weight: 500; font-display: swap; src: url(fonts/worksans-medium.woff2) format("woff2"); }
@font-face { font-family: "Work Sans"; font-weight: 600; font-display: swap; src: url(fonts/worksans-semibold.woff2) format("woff2"); }

:root {
  --bg: #ffffff;
  --ink: #1a1a1a;
  --ink-soft: #555555;
  --ink-muted: #8a8a8a;
  --line: #e4e4e4;
  --surface: #f4f4f4;
  --max: 1440px;
  --gutter: clamp(16px, 5vw, 80px);
  --gap: clamp(10px, 1.5vw, 24px);
  --track: 0.18em;
  --ease: cubic-bezier(.22,.61,.36,1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Work Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 300;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  animation: fadein .6s var(--ease);
}
@keyframes fadein { from { opacity: 0 } to { opacity: 1 } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
sup { font-size: .7em; line-height: 0; }

.wrap { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- Header ---------- */
.site-header { padding-block: clamp(22px, 4vw, 48px) clamp(18px, 3vw, 36px); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.logo img { width: clamp(150px, 16vw, 220px); }

.nav { display: flex; align-items: center; gap: clamp(18px, 2.4vw, 36px); margin: 0; padding: 0; list-style: none; }
.nav a, .nav button {
  font: inherit; font-weight: 400; font-size: 12px; letter-spacing: var(--track); text-transform: uppercase;
  color: var(--ink); background: none; border: 0; padding: 6px 0; cursor: pointer;
  position: relative; display: inline-block;
}
.nav a::after, .nav .dd-toggle::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--ink);
  transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease);
}
.nav a:hover::after, .nav .dd-toggle:hover::after, .nav a[aria-current]::after, .nav .is-active > .dd-toggle::after { transform: scaleX(1); }
.nav a[aria-current], .nav .is-active > .dd-toggle { font-weight: 600; }

.dd { position: relative; }
.dd-menu {
  list-style: none; margin: 0; padding: 18px 22px 20px; position: absolute; right: -22px; top: calc(100% + 6px); min-width: 240px;
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px; border: 1px solid var(--line); box-shadow: 0 12px 32px rgba(0,0,0,.06);
  opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity .25s var(--ease), transform .25s var(--ease), visibility .25s;
  background: var(--bg); z-index: 20;
}
.dd-menu a { font-size: 11px; font-weight: 300; white-space: nowrap; }
.dd-menu a[aria-current] { font-weight: 600; }
.dd.open > .dd-menu, .dd:focus-within > .dd-menu { opacity: 1; visibility: visible; transform: none; }
@media (hover: hover) { .dd:hover > .dd-menu { opacity: 1; visibility: visible; transform: none; } }

.menu-btn { display: none; font: inherit; background: none; border: 0; padding: 8px; cursor: pointer; }
.menu-btn span { display: block; width: 24px; height: 1.5px; background: var(--ink); margin: 5px 0; transition: transform .3s var(--ease), opacity .3s; }

@media (max-width: 760px) {
  .menu-btn { display: block; }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--bg); z-index: 30;
    flex-direction: column; align-items: flex-start; gap: 4px; padding: 8px var(--gutter) 28px; border-bottom: 1px solid var(--line);
  }
  .site-header { position: relative; }
  .site-header.menu-open .nav { display: flex; }
  .site-header.menu-open .menu-btn span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
  .site-header.menu-open .menu-btn span:nth-child(2) { opacity: 0; }
  .site-header.menu-open .menu-btn span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
  .nav a, .nav button { font-size: 13px; padding: 10px 0; }
  .dd-menu {
    position: static; transform: none; align-items: flex-start; gap: 0;
    padding: 0 0 6px 18px; min-width: 0; border: 0; box-shadow: none;
    display: none; opacity: 1; visibility: visible;
  }
  .dd.open > .dd-menu { display: flex; }
  .dd:focus-within > .dd-menu { display: none; }
  .dd.open:focus-within > .dd-menu { display: flex; }
  .dd-menu a { font-size: 12px; padding: 8px 0; }
  .nav .dd-toggle { padding-right: 24px; }
  .dd-toggle::after { display: none; }
  .dd-toggle::before {
    content: ""; position: absolute; right: 4px; top: 50%; width: 7px; height: 7px;
    border-right: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink);
    transform: translateY(-70%) rotate(45deg); transition: transform .25s var(--ease);
  }
  .dd.open > .dd-toggle::before { transform: translateY(-30%) rotate(225deg); }
}

/* ---------- Common ---------- */
main { flex: 1; padding-block: clamp(8px, 2vw, 24px) clamp(48px, 8vw, 120px); }
.eyebrow {
  font-size: 11px; letter-spacing: var(--track); text-transform: uppercase; color: var(--ink-muted); font-weight: 400;
  margin: 0 0 clamp(16px, 2.5vw, 32px);
}
.eyebrow a { color: var(--ink-muted); }
.eyebrow a:hover { color: var(--ink); }
.eyebrow strong { color: var(--ink); font-weight: 500; }
h1, h2 { font-weight: 500; letter-spacing: .12em; text-transform: uppercase; line-height: 1.25; margin: 0 0 .8em; }
h1 { font-size: clamp(16px, 1.6vw, 20px); }
h2 { font-size: 13px; letter-spacing: var(--track); color: var(--ink-soft); }
p { margin: 0 0 1em; }

/* ---------- Gallery grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: var(--gap); list-style: none; margin: 0; padding: 0; }
.card { position: relative; overflow: hidden; background: var(--surface); margin: 0; }
.card img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; transition: transform 1.2s var(--ease), filter .9s var(--ease); }
.card figcaption {
  position: absolute; inset: auto 0 0 0; padding: 14px 16px; background: rgba(255,255,255,.88);
  font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; line-height: 1.45;
  transform: translateY(100%); transition: transform .45s var(--ease);
}
.card figcaption small { display: block; font-weight: 300; letter-spacing: .14em; color: var(--ink-soft); }
.card:hover img, .card:focus-within img { transform: scale(1.04); filter: saturate(1.6); }
.card:hover figcaption, .card:focus-within figcaption { transform: none; }
@media (hover: none) {
  .card figcaption { position: static; transform: none; background: none; padding: 10px 2px 2px; }
}
.empty { color: var(--ink-muted); font-size: 13px; letter-spacing: .06em; }

/* ---------- Project page ---------- */
.project { display: flex; gap: clamp(28px, 5vw, 80px); align-items: flex-start; }
/* galeria zajmuje tyle, ile potrzebuje jej liczba zdjęć (--n z generatora); opis staje zaraz obok */
.project-gallery {
  flex: 1 1 auto; min-width: 0;
  max-width: calc(var(--n, 6) * 400px + (var(--n, 6) - 1) * var(--gap));
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: var(--gap); margin: 0; padding: 0; list-style: none;
}
.project-gallery li { margin: 0; background: var(--surface); }
.project-gallery a { display: block; position: relative; }
.project-gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: var(--surface); transition: filter .6s var(--ease); }
.project-gallery a:hover img { filter: saturate(1.5); }
.project-gallery .portrait img { object-fit: contain; }
.project-meta { position: sticky; top: 24px; flex: 0 1 340px; min-width: 260px; }
.project-meta h1 { margin-bottom: 4px; }
.project-meta .city { font-size: 12px; letter-spacing: var(--track); text-transform: uppercase; color: var(--ink-muted); margin: 0 0 28px; }
.meta { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 10px 20px; font-size: 13px; }
.meta dt { color: var(--ink-muted); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; padding-top: 2px; }
.meta dd { margin: 0; }
.project-nav { display: flex; justify-content: space-between; gap: 16px; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 11px; letter-spacing: var(--track); text-transform: uppercase; }
.project-nav a:hover { color: var(--ink-muted); }
@media (max-width: 900px) {
  .project { flex-direction: column; }
  .project-gallery { max-width: none; width: 100%; }
  .project-meta { position: static; order: -1; flex: none; width: 100%; }
  .project-meta .city { margin-bottom: 18px; }
}

/* ---------- Lightbox ---------- */
.lb { position: fixed; inset: 0; background: rgba(255,255,255,.96); z-index: 100; display: none; align-items: center; justify-content: center; padding: 48px; }
.lb.open { display: flex; }
.lb img { max-width: min(100%, 1000px); max-height: 100%; width: auto; height: auto; object-fit: contain; box-shadow: 0 20px 60px rgba(0,0,0,.08); }
.lb button { position: absolute; background: none; border: 0; cursor: pointer; padding: 16px; color: var(--ink); font-size: 12px; letter-spacing: var(--track); text-transform: uppercase; font-family: inherit; }
.lb .lb-close { top: 16px; right: 16px; }
.lb .lb-prev { left: 8px; top: 50%; transform: translateY(-50%); }
.lb .lb-next { right: 8px; top: 50%; transform: translateY(-50%); }
.lb .lb-count { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); font-size: 11px; letter-spacing: var(--track); color: var(--ink-muted); }
body.lb-locked { overflow: hidden; }
@media (max-width: 600px) { .lb { padding: 56px 8px 48px; } .lb .lb-prev, .lb .lb-next { top: auto; bottom: 8px; transform: none; } }

/* ---------- Text pages ---------- */
.prose { max-width: 68ch; font-size: 15.5px; line-height: 1.75; }
.prose p { margin-bottom: 1.3em; }
.prose ul { padding-left: 1.2em; margin: 0 0 1.3em; }
.prose li { margin-bottom: .35em; }
.prose a { border-bottom: 1px solid var(--ink); }
.prose a:hover { color: var(--ink-muted); border-color: var(--ink-muted); }
.lead { font-weight: 400; }

/* ---------- Contact ---------- */
.contact { display: grid; grid-template-columns: minmax(280px, 420px) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.address { font-size: 14px; line-height: 1.8; }
.address .company { font-weight: 600; letter-spacing: var(--track); text-transform: uppercase; font-size: 13px; margin-bottom: 20px; }
.address dl { margin: 0 0 36px; }
.address dt { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-muted); margin-top: 14px; }
.address dd { margin: 0; }
.address a { border-bottom: 1px solid var(--line); }
.address a:hover { border-color: var(--ink); }
.map { position: relative; display: block; background: var(--surface); overflow: hidden; }
.map img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; filter: grayscale(1) contrast(1.05); transition: filter .6s var(--ease); }
.map:hover img { filter: grayscale(.3); }
.map span { position: absolute; left: 16px; bottom: 14px; background: #fff; padding: 8px 12px; font-size: 11px; letter-spacing: var(--track); text-transform: uppercase; }

.form { display: grid; gap: 18px; margin-top: 12px; }
.form label { display: block; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-muted); margin-bottom: 6px; }
.form input, .form textarea {
  width: 100%; font: inherit; font-size: 14px; color: var(--ink); background: transparent;
  border: 0; border-bottom: 1px solid #cfcfcf; padding: 8px 0; border-radius: 0; transition: border-color .3s;
}
.form input:focus, .form textarea:focus { outline: none; border-color: var(--ink); }
.form textarea { min-height: 120px; resize: vertical; }
.form .hp { position: absolute; left: -9999px; }
.btn {
  display: inline-block; font: inherit; font-size: 11px; font-weight: 500; letter-spacing: var(--track); text-transform: uppercase;
  background: var(--ink); color: #fff; border: 1px solid var(--ink); padding: 14px 32px; cursor: pointer; justify-self: start; transition: background .3s, color .3s;
}
.btn:hover { background: #fff; color: var(--ink); }
.form-note { font-size: 12px; color: var(--ink-muted); }
@media (max-width: 820px) { .contact { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: 22px 28px; font-size: 10.5px; letter-spacing: .1em; color: var(--ink-muted); line-height: 1.8; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; }
.site-footer p { margin: 0; }
.site-footer a:hover { color: var(--ink); }
@media (max-width: 600px) { .site-footer .wrap { flex-direction: column; } }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 600px) { .grid { grid-template-columns: repeat(2, 1fr); } }

.obf[data-k="tel"] { unicode-bidi: bidi-override; direction: rtl; display: inline-block; }
