:root {
  --bg: #f5f3ee;
  --fg: #0d0d0c;
  --muted: #8b8881;
  --line: #dcd9d1;
  --accent: #f9bd9a;
  --gap: 6px;
  --pad: clamp(14px, 2.2vw, 32px);
  --ease: cubic-bezier(.2, .7, .1, 1);
  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Spline Sans", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* delikatne ziarno na całej stronie */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  opacity: .05;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

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

:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 4px;
}

/* ---------- Pasek ---------- */

.bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 8;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 14px var(--pad);
  color: var(--fg);
  background: rgba(245, 243, 238, .84);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  transition: color .35s, background .35s;
  font-size: .82rem;
  font-weight: 500;
  letter-spacing: .01em;
  text-transform: uppercase;
}

.logo {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -.02em;
}

.logo img { height: 22px; width: auto; display: block; }
.logo sup { font-size: .5em; font-weight: 500; margin-left: .15em; }

.menu {
  display: flex;
  gap: clamp(.8rem, 2.4vw, 2rem);
}

.menu a,
.footer a {
  position: relative;
  padding: .2rem 0;
  white-space: nowrap;
}

.menu a::after,
.footer a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .45s var(--ease);
}

.menu a:hover::after,
.menu a:focus-visible::after,
.footer a:hover::after,
.footer a:focus-visible::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* ---------- Hero ---------- */

.hero {
  padding: clamp(84px, 13vh, 150px) var(--pad) clamp(14px, 2vw, 28px);
}

.hero h1 {
  margin: 0;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -.045em;
  line-height: .8;
  overflow: hidden;
}

@keyframes rise {
  from { transform: translateY(105%); }
}

.hero-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: clamp(18px, 2.6vw, 40px);
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: .78rem;
  font-weight: 500;
  text-transform: uppercase;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- Siatka masonry ---------- */

.gallery { padding: 0 var(--gap); }

#portfolio { scroll-margin-top: 56px; }

.grid {
  display: flex;
  align-items: flex-start;
  gap: var(--gap);
}

.grid-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.tile {
  display: block;
  position: relative;
  overflow: hidden;
  background: color-mix(in srgb, var(--accent) 35%, var(--bg));
  cursor: zoom-in;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity .9s var(--ease), transform .9s var(--ease), filter .4s;
}

.tile.in {
  opacity: 1;
  transform: none;
}

.tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity .7s, transform 1.2s var(--ease);
}

.tile img.loaded {
  opacity: 1;
  transform: none;
}

.tile-no {
  position: absolute;
  left: 10px;
  bottom: 8px;
  font-size: .72rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #fff;
  mix-blend-mode: difference;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .3s, transform .4s var(--ease);
}

@media (hover: hover) {
  /* najechane zdjęcie zostaje, reszta przygasa */
  .grid:has(.tile:hover) .tile.in:not(:hover) {
    opacity: .7;
    filter: grayscale(.35);
    transition-duration: .4s;
  }
  .tile:hover img.loaded { transform: scale(1.04); }
  .tile:hover .tile-no { opacity: 1; transform: none; }
}

.empty {
  color: var(--muted);
  padding: 4rem var(--pad);
}

/* ---------- Sekcje tekstowe ---------- */

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 3fr);
  gap: 1.5rem var(--pad);
  padding: clamp(80px, 14vw, 200px) var(--pad) 0;
  scroll-margin-top: 0;
}

.label {
  margin: .5em 0 0;
  font-size: .78rem;
  font-weight: 500;
  text-transform: uppercase;
  color: var(--muted);
}

.label::before {
  content: "";
  display: inline-block;
  width: .5em;
  height: .5em;
  margin-right: .6em;
  border-radius: 50%;
  background: var(--accent);
}

.statement p,
.lead {
  margin: 0;
  max-width: 22em;
  font-size: clamp(1.6rem, 4.2vw, 4rem);
  font-weight: 500;
  letter-spacing: -.035em;
  line-height: 1.02;
  text-wrap: balance;
}

.statement p + p { margin-top: .5em; }
.dim { color: var(--muted); }

.big-link {
  display: inline-flex;
  align-items: baseline;
  gap: .15em;
  max-width: 100%;
  margin-top: .35em;
  font-size: clamp(1.6rem, 4.2vw, 4rem);
  font-weight: 500;
  letter-spacing: -.035em;
  line-height: 1.1;
  overflow-wrap: anywhere;
  padding: 0 .12em;
  background: linear-gradient(var(--accent), var(--accent)) 0 100% / 100% .14em no-repeat;
  transition: background-size .45s var(--ease);
}

.big-link span {
  display: inline-block;
  transition: transform .4s var(--ease);
}

/* po najechaniu brzoskwiniowe podkreślenie wypełnia cały napis */
.big-link:hover,
.big-link:focus-visible { background-size: 100% 100%; }
.big-link:hover span { transform: translate(.12em, -.12em); }

/* ---------- Stopka ---------- */

.footer {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: .75rem 2rem;
  margin-top: clamp(80px, 14vw, 200px);
  padding: 14px var(--pad) 18px;
  border-top: 1px solid var(--line);
  font-size: .78rem;
  font-weight: 500;
  text-transform: uppercase;
  color: var(--muted);
}

.footer a { color: var(--fg); }

.social {
  display: flex;
  gap: 1.75rem;
}

/* ---------- Lightbox ---------- */

.lb {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(245, 243, 238, .88);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  touch-action: pan-y;
  font-size: .78rem;
  font-weight: 500;
  text-transform: uppercase;
  color: #fff;
}

.lb[hidden] { display: none; }

.lb-img {
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  cursor: e-resize;
}

.lb button {
  position: absolute;
  padding: 14px var(--pad);
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-transform: inherit;
  cursor: pointer;
  mix-blend-mode: difference;
  transition: color .2s;
}

.lb button:hover,
.lb button:focus-visible { color: var(--fg); mix-blend-mode: normal; background: var(--accent); }

.lb-close { top: 0; right: 0; }
.lb-prev { left: 0; bottom: 0; }
.lb-next { right: 0; bottom: 0; }

.lb-count {
  position: absolute;
  top: 14px;
  left: var(--pad);
  font-variant-numeric: tabular-nums;
  mix-blend-mode: difference;
  pointer-events: none;
}

/* płynne przejście miniatura → powiększenie */
::view-transition-group(photo) {
  animation-duration: .5s;
  animation-timing-function: cubic-bezier(.2, .7, .1, 1);
}

::view-transition-old(photo),
::view-transition-new(photo) {
  height: 100%;
  object-fit: cover;
}

@media (max-width: 640px) {
  :root { --gap: 4px; }
  .bar { font-size: .7rem; }
  .logo { font-size: .95rem; }
  .split { grid-template-columns: 1fr; }
  .hero-meta span:nth-child(2) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tile, .tile img { transition: none; transform: none; }
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) { animation: none !important; }
}

/* ---------- Logo: zamiana napisów ---------- */

.logo {
  display: grid;
  overflow: hidden;
  line-height: 1.15;
}

.logo-a,
.logo-b {
  grid-area: 1 / 1;
  white-space: nowrap;
  transition: transform .8s var(--ease), opacity .5s;
}

.logo-b,
.logo.alt .logo-a {
  opacity: 0;
  transform: translateY(110%);
}

.logo.alt .logo-a { transform: translateY(-110%); }

.logo.alt .logo-b {
  opacity: 1;
  transform: none;
}

.menu a[aria-current="page"]::after {
  transform: scaleX(1);
}

/* ---------- Filtr nad zdjęciami ---------- */

.hero-meta { align-items: baseline; }

.filter {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem clamp(1rem, 2.4vw, 2rem);
}

.filter button {
  padding: .2rem 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: .95rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  transition: color .25s;
}

.filter button sup {
  margin-left: .25em;
  font-size: .6em;
  font-weight: 500;
}

.filter button::before {
  content: "";
  display: inline-block;
  width: .45em;
  height: .45em;
  margin-right: .45em;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: .12em;
  transform: scale(0);
  transition: transform .35s var(--ease);
}

.filter button:hover,
.filter button[aria-pressed="true"] { color: var(--fg); }

.filter button[aria-pressed="true"]::before { transform: none; }

/* ---------- Podstrona „O mnie" ---------- */

.page-title {
  display: block;
  font-size: clamp(4rem, 15vw, 16rem);
  padding-top: .06em;
  animation: rise 1s var(--ease) both;
}

.about { padding-top: clamp(40px, 7vw, 100px); }

.portrait {
  display: block;
  width: min(100%, 520px);
  height: auto;
  margin-bottom: clamp(24px, 4vw, 56px);
}

@media (max-width: 640px) {
  .bar { align-items: start; }
  .logo { font-size: .85rem; }
  .logo-b { white-space: normal; width: min-content; line-height: 1; }
  .filter button { font-size: .82rem; }
}

@media (prefers-reduced-motion: reduce) {
  .logo-a, .logo-b { transition: opacity .3s; transform: none !important; }
  .page-title { animation: none; }
}

/* ---------- Strona główna bez dużego nagłówka ---------- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.hero-slim { padding-top: clamp(72px, 10vh, 110px); }

.hero-slim .hero-meta {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

/* ---------- Logo: szary napis zamienny ---------- */

.logo-b { color: var(--muted); }

/* ---------- Szerokość strony ---------- */

:root { --page: max(1240px, 70vw); } /* co najmniej 70% szerokości okna */

.hero,
.gallery,
.split,
.contact,
.footer {
  max-width: var(--page);
  margin-left: auto;
  margin-right: auto;
}

.gallery { padding: 0 var(--pad); }

/* ---------- Pasek menu: układ i rozmiar ---------- */

.bar {
  /* tło na całą szerokość, zawartość wyrównana do szerokości strony */
  padding: 16px max(var(--pad), calc((100% - var(--page)) / 2 + var(--pad)));
  color: var(--bg);
  background: var(--fg);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  font-size: .95rem;
}

.logo { font-size: 1.2rem; }
.logo-b { color: #9a9790; }

/* ---------- Filtry na środku ---------- */

.hero-meta { justify-content: center; }
.filter { justify-content: center; }
.filter button { font-size: .82rem; }

@media (max-width: 640px) {
  .gallery { padding: 0 var(--gap); }
  .bar { padding: 14px var(--pad); font-size: .74rem; }
  .menu { gap: .6rem; }
  .logo { font-size: .85rem; }
  .filter button { font-size: .74rem; }
}

/* ---------- Kontakt na stronie głównej: bez tytułu, wyśrodkowany ---------- */

.contact {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(80px, 14vw, 200px) var(--pad) 0;
  text-align: center;
}

/* bio na podstronie „O mnie": ten sam wyśrodkowany układ, mniejszy odstęp od tytułu */
.contact.about { padding-top: clamp(40px, 7vw, 100px); }
.page-title { text-align: center; }

/* ---------- Pasek menu w kolorze akcentu ---------- */

.bar {
  color: var(--fg);
  background: var(--accent);
}

.logo-b { color: rgba(13, 13, 12, .5); }

/* ---------- Telefon ---------- */

@media (max-width: 640px) {
  /* pasek w dwóch wierszach: logo na środku, pod nim menu na całą szerokość */
  .bar {
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px var(--pad) 8px;
    font-size: .8rem;
  }

  .logo {
    justify-items: center;
    font-size: 1.2rem;
  }

  .logo-b {
    width: auto;
    white-space: nowrap;
    line-height: inherit;
  }

  .menu {
    width: 100%;
    max-width: 360px;
    justify-content: space-between;
    gap: 0;
  }

  .menu a { padding: .45rem 0; }

  .hero { padding-top: 124px; }
  .hero-slim { padding-top: 104px; padding-bottom: 14px; }
  #portfolio { scroll-margin-top: 100px; }

  .filter { gap: .25rem 1.5rem; }
  .filter button { padding: .45rem 0; font-size: .8rem; }

  .contact { padding-top: 96px; }
  .contact.about { padding-top: 40px; }
  .lead, .statement p, .big-link { font-size: 1.55rem; }

  .footer {
    flex-direction: column;
    align-items: center;
    gap: 1.1rem;
    margin-top: 96px;
    padding: 24px var(--pad) 28px;
    text-align: center;
  }

  .social { order: -1; font-size: .85rem; }

  /* powiększenie: przyciski wygodne dla kciuka */
  .lb button { padding: 18px var(--pad); }
}

/* ---------- Czcionki: tytuły Unbounded Bold, tekst Spline Sans Regular ---------- */

:root { --display: "Unbounded", "Spline Sans", sans-serif; }

body { font-weight: 400; }

.logo,
.page-title,
.lead {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -.02em;
  text-transform: lowercase; /* usuń tę linijkę, żeby tytuły były pisane normalnie */
}

.logo { font-size: 1.1rem; line-height: 1.2; }
.logo sup { font-family: "Spline Sans", sans-serif; font-weight: 400; }
.page-title { font-size: clamp(3rem, 11vw, 11rem); }
.hero h1 { line-height: 1; }
.lead { font-size: clamp(1.15rem, 2.5vw, 2.3rem); line-height: 1.2; }

.bar,
.hero-meta,
.footer,
.lb,
.label { font-weight: 400; }

.filter button,
.tile-no { font-weight: 500; }

.statement p,
.big-link {
  font-size: clamp(1.35rem, 3.1vw, 3rem);
  font-weight: 400;
  letter-spacing: -.02em;
  line-height: 1.15;
}

@media (max-width: 640px) {
  .logo { font-size: 1.05rem; }
  .statement p, .big-link { font-size: 1.3rem; }
  .lead { font-size: 1.1rem; }
}

/* ---------- Unbounded jako akcent ---------- */
/* Unbounded: logo, tytuły, filtry, wyróżnione nazwy, liczniki. Spline Sans: wszystko do czytania. */

/* filtry jako „pigułki": wybrana na brzoskwiniowym tle */
.filter { gap: .35rem; }

.filter button {
  padding: .6em 1.15em;
  border-radius: 999px;
  font-family: var(--display);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: lowercase;
  transition: color .25s, background .3s;
}

.filter button::before { display: none; }
.filter button[aria-pressed="true"] { background: var(--accent); }

.filter button sup {
  font-family: "Spline Sans", sans-serif;
  font-weight: 400;
}

/* wyróżnione nazwy w tekście: Unbounded + brzoskwiniowy marker */
.hl {
  padding: 0 .12em;
  font-family: var(--display);
  font-size: .8em;
  font-weight: 700;
  letter-spacing: -.02em;
  white-space: nowrap;
  background: linear-gradient(var(--accent), var(--accent)) 0 92% / 100% .42em no-repeat;
}

/* tekst do czytania mniejszy i spokojniejszy, tytuły robią robotę */
.statement p {
  max-width: 30em;
  font-size: clamp(1.2rem, 2.1vw, 1.9rem);
  letter-spacing: -.01em;
  line-height: 1.35;
}

.lead {
  max-width: 18em;
  font-size: clamp(1.3rem, 3vw, 2.8rem);
  line-height: 1.12;
}

.big-link {
  font-size: clamp(1.2rem, 2.1vw, 1.9rem);
  letter-spacing: -.01em;
}

/* drobne liczniki */
.tile-no,
.lb-count {
  font-family: var(--display);
  font-size: .68rem;
  font-weight: 500;
}

@media (max-width: 640px) {
  .filter button { padding: .65em 1.1em; font-size: .7rem; }
  .statement p, .big-link { font-size: 1.15rem; }
  .lead { font-size: 1.35rem; }
  .hl { white-space: normal; }
}
