/* =========================================================
   Portfolio — minimalistyczny, jasny motyw
   Czysty CSS, bez zależności zewnętrznych (font self-hosted)
   ========================================================= */

/* Libre Caslon Text — self-hosted (licencja OFL), z polskimi znakami */
@font-face {
  font-family: "Libre Caslon Text";
  font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/LibreCaslonText-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+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Libre Caslon Text";
  font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/LibreCaslonText-latinext.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-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #ffffff;
  --bg-soft: #f7f6f4;
  --text: #1a1a1a;
  --muted: #8a8a8a;
  --line: #e7e4df;
  --accent: #1a1a1a;
  --max: 1280px;
  --gap: 18px;
  --radius: 2px;
  --font-serif: "Libre Caslon Text", "Big Caslon", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }

figure { margin: 0; }

a { color: inherit; text-decoration: none; }

/* ---------- Layout container ---------- */
.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}

/* Grafitowa tekstura z odręcznych szkiców — tylko w górnym pasku */
.site-header::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../images/header-texture.jpg") center / cover no-repeat;
  opacity: 0.40;
  pointer-events: none;
}

.site-header .container {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding-top: 20px;
  padding-bottom: 20px;
}

.brand {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
}
.brand small {
  display: block;
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 6px;
  font-weight: 400;
}

.nav {
  display: flex;
  gap: 26px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.nav a {
  color: var(--muted);
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.nav a:hover { color: var(--text); }
.nav a.active { color: var(--text); border-bottom-color: var(--text); }

/* ---------- Page intro ---------- */
.page-head {
  text-align: center;
  padding: 64px 0 28px;
}
.page-head h1 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(34px, 6vw, 58px);
  line-height: 1.05;
  margin: 0 0 10px;
}
.page-head p {
  max-width: 620px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 16px;
}

/* ---------- Filters ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 6px;
  padding: 8px 0 40px;
}
.filter-btn {
  font-family: var(--font-sans);
  font-size: 12.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 9px 18px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.filter-btn:hover { color: var(--text); border-color: var(--muted); }
.filter-btn.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

/* ---------- Category intro (temat przewodni / opis) ---------- */
.category-intro {
  max-width: 720px;
  margin: 0 auto 48px;
  text-align: center;
  animation: fade 0.5s ease;
}
.category-intro .eyebrow {
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}
.category-intro h2 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(26px, 4vw, 38px);
  margin: 0 0 18px;
  line-height: 1.1;
}
.category-intro p {
  color: #4a4a4a;
  font-size: 16.5px;
  line-height: 1.75;
  margin: 0 auto;
}
.category-intro p + p { margin-top: 14px; }

/* ---------- Gallery: masonry (Pinterest) ---------- */
.gallery.masonry {
  column-count: 4;
  column-gap: var(--gap);
}
@media (max-width: 1080px) { .gallery.masonry { column-count: 3; } }
@media (max-width: 720px)  { .gallery.masonry { column-count: 2; } }
@media (max-width: 440px)  { .gallery.masonry { column-count: 1; } }

.gallery.masonry .work {
  break-inside: avoid;
  margin-bottom: var(--gap);
}

/* ---------- Gallery: sequence (prace po sobie) ---------- */
.gallery.sequence {
  max-width: 860px;
  margin: 0 auto;
}
.gallery.sequence .work {
  margin-bottom: 56px;
}
.gallery.sequence .work-title {
  opacity: 1;
  position: static;
  background: none;
  color: var(--text);
  padding: 14px 2px 0;
  font-family: var(--font-serif);
  font-size: 20px;
}

/* ---------- Gallery: grid (grupa) ---------- */
.gallery.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
}
.gallery.grid .work.wide { grid-column: 1 / -1; }
@media (max-width: 600px) { .gallery.grid { grid-template-columns: 1fr; } }

/* ---------- Work item ---------- */
.work {
  position: relative;
  cursor: zoom-in;
  background: var(--bg-soft);
  border-radius: var(--radius);
  overflow: hidden;
  animation: fade 0.5s ease both;
}
.work img {
  width: 100%;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.4s ease;
}
.work:hover img { transform: scale(1.03); }

.work-title {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 30px 16px 14px;
  font-size: 14px;
  letter-spacing: 0.02em;
  color: #fff;
  background: linear-gradient(to top, rgba(0,0,0,0.55), rgba(0,0,0,0));
  opacity: 0;
  transition: opacity 0.25s ease;
}
.masonry .work:hover .work-title { opacity: 1; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(16, 15, 14, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}
.lightbox.open { opacity: 1; pointer-events: auto; }

.lightbox img {
  max-width: 90vw;
  max-height: 82vh;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
  border-radius: var(--radius);
}
.lb-caption {
  position: absolute;
  bottom: 26px; left: 0; right: 0;
  text-align: center;
  color: rgba(255,255,255,0.8);
  font-size: 14px;
  letter-spacing: 0.03em;
}
.lb-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.05);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s ease;
}
.lb-btn:hover { background: rgba(255,255,255,0.16); }
.lb-prev { left: 24px; }
.lb-next { right: 24px; }
.lb-close {
  position: absolute;
  top: 22px; right: 24px;
  width: 44px; height: 44px;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 30px;
  cursor: pointer;
  line-height: 1;
}
@media (max-width: 640px) {
  .lb-prev { left: 8px; }
  .lb-next { right: 8px; }
  .lb-btn { width: 42px; height: 42px; font-size: 18px; }
}

/* ---------- About page ---------- */
.about {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 56px;
  align-items: start;
  padding: 20px 0 80px;
}
.about .portrait {
  background: var(--bg-soft);
  border-radius: var(--radius);
  overflow: hidden;
}
.about-body h2 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 30px;
  margin: 0 0 18px;
}
.about-body p { color: #3d3d3d; margin: 0 0 16px; }
@media (max-width: 760px) {
  .about { grid-template-columns: 1fr; gap: 32px; }
}

/* ---------- Contact page ---------- */
.contact {
  max-width: 620px;
  margin: 0 auto;
  padding: 24px 0 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.contact-row {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  color: var(--text);
}
.contact-row .icon {
  width: 22px; height: 22px; flex: none;
  color: var(--muted);
  transition: color 0.2s ease;
}
.contact-row:hover .icon { color: var(--text); }
.contact-row span {
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: border-color 0.2s ease;
}
.contact-row:hover span { border-color: var(--text); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 34px 0;
  margin-top: 40px;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
  letter-spacing: 0.05em;
}
.site-footer a:hover { color: var(--text); }

/* ---------- Utilities ---------- */
@keyframes fade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.is-hidden { display: none !important; }
