:root {
  --bg: #f5f5f7;
  --bg-soft: #fbfbfd;
  --text: #1d1d1f;
  --text-muted: #6e6e73;
  --accent: #2a2a2c;
  --accent-hover: #1c1c1e;
  --link: #3a3a3c;
  --link-hover: #0a0a0b;
  --border: rgba(0, 0, 0, 0.08);
  --radius: 22px;
  --radius-sm: 14px;
  --space: clamp(1rem, 4vw, 2rem);
  --max: 72rem;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

.liquid-glass {
  background: linear-gradient(
    150deg,
    rgba(255, 255, 255, 0.75) 0%,
    rgba(255, 255, 255, 0.45) 50%,
    rgba(255, 255, 255, 0.62) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow:
    0 8px 30px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
  transition:
    box-shadow 0.45s var(--ease-soft),
    transform 0.45s var(--ease-soft);
}

.liquid-glass-dark {
  background: linear-gradient(
    150deg,
    rgba(22, 22, 25, 0.42) 0%,
    rgba(18, 18, 22, 0.62) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  box-shadow:
    0 12px 36px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition:
    box-shadow 0.45s var(--ease-soft),
    transform 0.45s var(--ease-soft);
}

.site-top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  /* Above main content compositing (hero, cards) so the bar never sits under the hero image. */
  z-index: 100;
  /* Pełna szerokość viewportu — pasek szerszy niż treść (--max). */
  max-width: none;
  width: 100%;
  margin: 0;
  padding-left: max(0px, env(safe-area-inset-left));
  padding-right: max(0px, env(safe-area-inset-right));
  padding-top: env(safe-area-inset-top);
}

/* Glass layer only — nav stays outside backdrop-filter so fixed mobile panel works. */
.site-top__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  border-radius: 0;
}

/* PNG z kanałem alfa: bez koloru pod spodem — przezroczyste piksele pokazują treść pod paskiem. */
.site-top__bg.liquid-glass {
  background: transparent;
  background-image: url("assets/site-header-bg.png?v=202604152");
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  /* box-shadow = prostokąt; drop-shadow respektuje alfę PNG */
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.4));
}

.site-top.is-scrolled .site-top__bg.liquid-glass {
  background-color: transparent;
  background-image: url("assets/site-header-bg.png?v=202604152");
  filter: drop-shadow(0 12px 26px rgba(0, 0, 0, 0.45));
}

.site-top.is-scrolled .site-top__bg:not(.liquid-glass) {
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.site-header {
  position: relative;
  z-index: 2;
  max-width: none;
  margin: 0;
  /* Więcej miejsca pod spodem — PNG ma ząbkowany dół, treść nie może na niego wchodzić */
  padding: 1.35rem var(--space) 2.05rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  background: transparent;
  border: none;
  box-shadow: none;
}

.logo {
  font-size: clamp(0.68rem, 1.45vw, 0.8rem);
  font-weight: 700;
  letter-spacing: 0.035em;
  line-height: 1.15;
  color: #f5f5f7;
  max-width: min(56vw, 18rem);
  white-space: nowrap;
  margin-left: 5.25rem;
}

.logo:hover {
  text-decoration: none;
  color: rgba(255, 255, 255, 0.82);
}

.nav {
  display: none;
  gap: clamp(0.55rem, 1.35vw, 1.15rem);
}

.nav a {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.74rem;
  font-weight: 400;
  transition:
    color 0.3s var(--ease-soft),
    opacity 0.3s var(--ease-soft);
}

.nav a:hover {
  color: #fff;
  opacity: 0.88;
  text-decoration: none;
}

.lang-switch {
  display: inline-flex;
  gap: 0.32rem;
}

.lang-btn {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.95);
  border-radius: 999px;
  padding: 0.34rem 0.72rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition:
    background 0.35s var(--ease-soft),
    border-color 0.35s var(--ease-soft),
    color 0.35s var(--ease-soft),
    transform 0.25s var(--ease-soft);
}

.lang-btn:hover:not(.active) {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.16);
}

.lang-btn.active {
  background: #d8d8e0;
  border-color: rgba(0, 0, 0, 0.08);
  color: #0a0a0c;
}

.site-header__trailing {
  display: flex;
  align-items: center;
  gap: 0.32rem;
  flex-shrink: 0;
  margin-right: 6.25rem;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 2.28rem;
  height: 2.28rem;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  color: #f5f5f7;
  cursor: pointer;
  transition: background 0.25s var(--ease-soft);
}

.nav-toggle:hover {
  background: rgba(255, 255, 255, 0.18);
}

.nav-toggle__bar {
  display: block;
  width: 0.95rem;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  transition:
    transform 0.32s var(--ease-soft),
    opacity 0.25s var(--ease-soft);
}

body.nav-open .nav-toggle__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

body.nav-open .nav-toggle__bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

body.nav-open .nav-toggle__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 45;
  margin: 0;
  padding: 0;
  border: none;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  cursor: pointer;
}

.nav-backdrop[hidden] {
  display: none !important;
}

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: clamp(6.15rem, 13.5vh, 7.85rem) var(--space) clamp(2rem, 7vh, 3rem);
  overflow: hidden;
  background: #0a0a0c;
}

.hero-bg {
  position: absolute;
  z-index: 0;
  /* Bleed past edges to avoid 1px bright gaps on subpixel layouts. */
  inset: -3px;
  overflow: hidden;
}

.hero-bg__drift {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-image: url("assets/hero-bg.jpg?v=202604122");
  background-size: cover;
  background-position: 50% 48%;
  background-repeat: no-repeat;
}

@media (min-width: 900px) and (orientation: landscape) and (min-aspect-ratio: 2/1) {
  .hero-bg__drift {
    background-position: 50% 52%;
  }
}

@media (min-width: 900px) and (orientation: landscape) and (min-aspect-ratio: 3/1) {
  .hero-bg__drift {
    background-position: 50% 55%;
  }
}

@media (min-width: 900px) and (orientation: portrait) {
  .hero-bg__drift {
    background-position: 50% 38%;
  }
}

@media (min-width: 900px) and (orientation: portrait) and (max-width: 380px) {
  .hero-bg__drift {
    background-position: 50% 32%;
  }
}

@media (max-width: 899px) {
  .hero-bg__drift {
    background-image: url("assets/hero-bg-mobile.jpg?v=202604122");
    background-size: cover;
    background-position: 50% 50%;
    background-repeat: no-repeat;
  }
}

.hero-overlay {
  position: absolute;
  z-index: 1;
  inset: -3px;
  pointer-events: none;
  background: transparent;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 30rem;
  width: 100%;
  border-radius: var(--radius);
  padding: clamp(1.2rem, 4vw, 2rem);
}

/* Główna: baner hero — płynne znikanie przy scrollu (sterowane z JS) */
main#home .hero .hero-content {
  backface-visibility: hidden;
  transform-origin: 50% 50%;
}

.hero-enter {
  animation: hero-enter-up 2s var(--ease-out) both;
}

@keyframes hero-enter-up {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero h1 {
  margin: 0 0 0.75rem;
  color: #fff;
  font-size: clamp(1.65rem, 5vw, 2.85rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.hero-lead {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.05rem;
}

.hero-actions {
  display: flex;
  gap: 0.7rem;
  margin-top: 1.2rem;
  flex-wrap: wrap;
}

.hero-actions .btn {
  min-height: 3.55rem;
  padding: calc(0.8rem - 3px) clamp(2rem, 5vw, 3.15rem) calc(0.8rem + 3px);
  font-size: 0.93rem;
  flex: 1 1 auto;
  min-width: min(100%, 14.25rem);
}

.hero-actions .btn-primary {
  min-height: 4.4rem;
  padding: calc(1.12rem - 3px) clamp(2.35rem, 5.8vw, 3.85rem) calc(1.12rem + 3px);
  font-size: 1.08rem;
  min-width: min(100%, 17rem);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 0;
  isolation: isolate;
  border: none;
  border-radius: 0;
  min-height: 3.2rem;
  padding: calc(0.68rem - 3px) clamp(1.55rem, 3.8vw, 2.45rem) calc(0.68rem + 3px);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  background-color: transparent;
  background-image: none;
  text-align: center;
  transition:
    color 0.35s var(--ease-soft),
    transform 0.3s var(--ease-soft),
    text-shadow 0.35s var(--ease-soft);
  box-shadow: none;
  -webkit-tap-highlight-color: transparent;
}

.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-repeat: no-repeat;
  background-position: center;
  /* Zachowuje proporcje sylwetki — bez rozciągania jak przy 100% 100% */
  background-size: contain;
  pointer-events: none;
  /* drop-shadow tylko na tle — filter+transform na .btn znika tekst w WebKit/Blink */
  transition: filter 0.35s var(--ease-soft);
  backface-visibility: hidden;
  transform: translateZ(0);
}

.btn:hover {
  text-decoration: none;
}

@media (hover: hover) {
  .btn:hover {
    transform: translateY(-2px) scale(1.05);
  }

  .btn:hover::before {
    filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.14));
  }
}

.btn:active {
  transform: translateY(0) scale(1);
  transition-duration: 0.12s;
}

.btn:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

/* Jedna stała sylwetka na przycisk — bez podmiany grafiki przy hover */
.btn-primary::before {
  background-image: url("assets/btn-primary.png?v=202604140");
}

.btn-primary {
  color: #f5f5f7;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
  min-height: 4.15rem;
  padding: calc(0.98rem - 3px) clamp(1.85rem, 4.2vw, 3.05rem) calc(0.98rem + 3px);
  font-size: 1.04rem;
}

.btn-secondary::before {
  background-image: url("assets/btn-secondary.png?v=202604138");
}

.btn-secondary {
  color: #f5f5f7;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Wyższa specyficzność niż globalne a:hover — tekst nie zmienia się na --link-hover */
a.btn-primary:hover,
a.btn-primary:focus-visible {
  color: #f5f5f7;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}

a.btn-secondary:hover,
a.btn-secondary:focus-visible {
  color: #f5f5f7;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(2.8rem, 8vw, 4.5rem) var(--space);
  scroll-margin-top: 5.5rem;
}

.section-head {
  max-width: 42rem;
}

.section-eyebrow {
  margin: 0 0 0.35rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

h2 {
  margin: 0 0 0.6rem;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  letter-spacing: -0.03em;
}

.section p {
  margin: 0;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.about-text {
  white-space: pre-line;
  max-width: 42rem;
}

.section-grid {
  display: grid;
  gap: 1rem;
}

.card {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  padding: 1.2rem;
}

@media (hover: hover) {
  .section-grid .card:hover {
    transform: translateY(-3px);
  }
}

.card h3 {
  margin: 0 0 0.45rem;
  font-size: 1.2rem;
}

.card p {
  margin: 0;
}

.style-section__grid {
  display: grid;
  gap: clamp(1.5rem, 4vw, 2.25rem);
  max-width: 58rem;
  margin-inline: auto;
}

@media (min-width: 880px) {
  .style-section__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
    align-items: start;
    gap: clamp(2rem, 4.5vw, 3rem);
  }
}

.style-section__intro {
  max-width: 38rem;
}

.style-section__intro h2 {
  margin-bottom: 0.75rem;
}

.style-section__lead {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.65;
  color: var(--text-muted);
}

.style-section__panel {
  border-radius: var(--radius);
  padding: clamp(1.35rem, 3.5vw, 1.85rem) clamp(1.25rem, 3vw, 1.75rem);
}

@media (hover: hover) {
  .style-section__panel:hover {
    box-shadow:
      0 14px 40px rgba(0, 0, 0, 0.1),
      inset 0 1px 0 rgba(255, 255, 255, 0.85);
  }
}

.style-section__why {
  margin: 0 0 1.1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
  font-size: clamp(1rem, 2vw, 1.15rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.35;
  color: var(--text);
}

.style-section__benefits {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.style-benefit {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.style-benefit:first-of-type {
  padding-top: 0.15rem;
}

.style-benefit:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.style-benefit__badge {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 1.5px solid rgba(0, 0, 0, 0.14);
  background: rgba(0, 0, 0, 0.05);
  font-size: 0.8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  color: var(--text);
  transition:
    border-color 0.35s var(--ease-soft),
    background 0.35s var(--ease-soft),
    transform 0.35s var(--ease-soft);
}

.style-benefit__body {
  min-width: 0;
  padding-top: 0.12rem;
}

.style-benefit__title {
  margin: 0 0 0.35rem;
  font-size: 1.02rem;
  line-height: 1.35;
}

.style-benefit__title strong {
  font-weight: 600;
  color: var(--text);
}

.style-benefit__text {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--text-muted);
}

@media (hover: hover) {
  .style-benefit:hover .style-benefit__badge {
    border-color: rgba(0, 0, 0, 0.28);
    background: rgba(0, 0, 0, 0.09);
    transform: scale(1.04);
  }
}

.location-card,
.contact-card {
  max-width: 42rem;
}

.contact-card ul {
  list-style: none;
  margin: 0.8rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.contact-card li {
  color: var(--text-muted);
}

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  text-align: center;
  padding: 1.25rem var(--space);
  font-size: 0.85rem;
  background: var(--bg-soft);
}

/* Galeria prac */
.gallery-section .section-head {
  margin-bottom: 1.25rem;
}

.gallery-intro {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.gallery-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

.gallery-noscript {
  margin: 1rem 0 0;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Projekty (preview na głównej + strona projects.html) */
.projects-section .section-head {
  margin-bottom: 1.25rem;
}

.projects-intro {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.projects-preview-grid,
.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

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

  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .projects-preview-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .projects-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.projects-cta-wrap {
  margin-top: 1.5rem;
  text-align: center;
}

.projects-cta-wrap .btn {
  display: inline-flex;
  min-width: min(100%, 23.5rem);
  min-height: 4.35rem;
  padding: calc(1.1rem - 3px) clamp(2.65rem, 6.2vw, 4.5rem) calc(1.1rem + 3px);
  font-size: 1.07rem;
  max-width: 100%;
}

.project-card {
  margin: 0;
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition:
    box-shadow 0.5s var(--ease-soft),
    transform 0.5s var(--ease-soft);
}

@media (hover: hover) {
  .project-card:hover {
    transform: translateY(-3px);
    box-shadow:
      0 16px 40px rgba(0, 0, 0, 0.12),
      inset 0 1px 0 rgba(255, 255, 255, 0.85);
  }
}

.project-card__open {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  cursor: zoom-in;
  background: #121214;
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.project-card__open:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

.project-card__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition:
    transform 0.65s var(--ease-out),
    filter 0.45s var(--ease-soft);
}

@media (hover: hover) {
  .project-card__open:hover .project-card__img {
    transform: scale(1.04);
    filter: brightness(1.05);
  }
}

.projects-page-main .section-head,
.about-page__text.section-head {
  margin-bottom: 1.35rem;
}

.projects-page-main .section-head h1,
.about-page-main .section-head h1 {
  margin: 0 0 0.6rem;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  letter-spacing: -0.03em;
}

/* Strona O mnie — ilustracyjne tło (ptaki / gałęzie) */
.about-subpage .about-page-main {
  position: relative;
  background-color: #fafafa;
  background-image: url("assets/about-bg.jpg?v=202604120");
  background-repeat: no-repeat;
  background-position: center top;
  background-size: cover;
}

.about-subpage .about-page {
  background: transparent;
}

.about-subpage .about-page__layout {
  display: grid;
  gap: clamp(1.5rem, 4vw, 2.5rem);
  align-items: start;
  max-width: 56rem;
  margin-inline: auto;
  position: relative;
  z-index: 1;
}

.about-subpage .about-page__text {
  padding: clamp(1.1rem, 2.5vw, 1.45rem) clamp(1.15rem, 2.8vw, 1.6rem);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow:
    0 10px 36px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
}

.about-subpage .about-page__text .section-eyebrow,
.about-subpage .about-page__text h1,
.about-subpage .about-page__text .about-text {
  position: relative;
  z-index: 1;
}

.about-subpage .projects-back {
  position: relative;
  z-index: 1;
}

.about-subpage .projects-back a {
  text-shadow: 0 1px 12px rgba(255, 255, 255, 0.9);
}

@media (min-width: 800px) {
  .about-subpage .about-page__layout {
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.15fr);
  }
}

.about-page__figure {
  margin: 0;
  padding: 0;
  border-radius: var(--radius);
  overflow: hidden;
  line-height: 0;
}

.about-page__figure.liquid-glass {
  box-shadow:
    0 10px 36px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.about-page__img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center 18%;
}

.about-page__text.section-head {
  max-width: none;
}

@media (min-width: 800px) {
  .about-page__text .about-text {
    max-width: 40rem;
  }
}

.projects-back {
  margin: 2rem 0 0;
  font-size: 0.95rem;
}

.gallery-item {
  margin: 0;
  padding: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  transition:
    box-shadow 0.5s var(--ease-soft),
    transform 0.5s var(--ease-soft);
}

@media (hover: hover) {
  .gallery-item:hover {
    transform: translateY(-3px);
    box-shadow:
      0 16px 40px rgba(0, 0, 0, 0.14),
      inset 0 1px 0 rgba(255, 255, 255, 0.85);
  }
}

.gallery-open {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  cursor: zoom-in;
  background: #121214;
  border-radius: inherit;
  overflow: hidden;
  position: relative;
  aspect-ratio: 1;
  -webkit-tap-highlight-color: transparent;
}

.gallery-open:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

.gallery-item img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition:
    transform 0.7s var(--ease-out),
    filter 0.5s var(--ease-soft);
}

@media (hover: hover) {
  .gallery-open:hover img {
    transform: scale(1.045);
    filter: brightness(1.05);
  }
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 0.75s var(--ease-out),
    transform 0.75s var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(1rem, env(safe-area-inset-top))
    max(1rem, env(safe-area-inset-right))
    max(1rem, env(safe-area-inset-bottom))
    max(1rem, env(safe-area-inset-left));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.4s var(--ease-out),
    visibility 0.4s;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.lightbox-scrim {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  background: rgba(8, 8, 10, 0.82);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
}

.lightbox-panel {
  position: relative;
  z-index: 1;
  max-width: min(96vw, 1200px);
  max-height: min(92vh, 92dvh);
  transform: scale(0.96) translateY(12px);
  opacity: 0;
  transition:
    transform 0.45s var(--ease-out),
    opacity 0.45s var(--ease-out);
}

.lightbox.is-open .lightbox-panel {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.lightbox-img {
  display: block;
  max-width: min(96vw, 1200px);
  max-height: min(88vh, 88dvh);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.08);
}

.lightbox-close {
  position: absolute;
  top: -2.75rem;
  right: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(20, 20, 24, 0.75);
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.3s var(--ease-soft),
    transform 0.25s var(--ease-soft);
}

.lightbox-close:hover {
  background: rgba(40, 40, 48, 0.95);
  transform: scale(1.06);
}

@media (max-width: 600px) {
  .lightbox-close {
    top: auto;
    bottom: calc(100% + 0.5rem);
    right: 0;
  }
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero-enter {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .gallery-item,
  .gallery-item img,
  .btn,
  .btn::before,
  .lang-btn,
  .site-header,
  .site-top__bg,
  .nav,
  .nav-toggle,
  .nav-toggle__bar,
  .lightbox,
  .lightbox-panel {
    transition: none !important;
    animation: none !important;
  }

  .gallery-item:hover,
  .gallery-open:hover img,
  .project-card:hover,
  .project-card__open:hover .project-card__img {
    transform: none;
    filter: none;
  }

  @media (hover: hover) {
    .btn:hover {
      transform: none;
    }
  }
}

/* Desktop */
@media (min-width: 900px) {
  .nav-toggle {
    display: none;
  }

  .nav-backdrop {
    display: none !important;
  }

  .site-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: clamp(0.65rem, 2vw, 1.55rem);
    padding: 1.45rem var(--space) 2.2rem;
  }

  .site-header .logo {
    justify-self: start;
    max-width: none;
  }

  .site-header .nav {
    justify-self: center;
  }

  .site-header .site-header__trailing {
    justify-self: end;
  }

  /* Lekko w górę — spójnie z wierszem (logo, nav, język) */
  .site-header .logo,
  .site-header .site-header__trailing {
    transform: translateY(-0.42rem);
  }

  .nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    position: static;
    width: auto;
    height: auto;
    max-width: none;
    padding: 0;
    margin: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    transform: translateY(-0.42rem) !important;
    overflow: visible;
    pointer-events: auto;
  }

  .nav a {
    padding: 0;
    border: none;
    font-size: 0.74rem;
    font-weight: 400;
  }

  .section-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }
}

/* iPad / wąski desktop (900–1366): cała grupa (logo + nav + język) przy centrum */
@media (min-width: 900px) and (max-width: 1366px) {
  .site-header {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
    gap: clamp(0.4rem, 1.25vw, 0.9rem);
  }

  .site-header .logo {
    margin-left: 0;
    margin-right: 0;
    flex-shrink: 0;
  }

  .site-header .site-header__trailing {
    margin-right: 0;
    margin-left: 0;
    flex-shrink: 0;
  }

  .nav {
    gap: clamp(0.22rem, 0.65vw, 0.45rem);
    flex-shrink: 1;
    min-width: 0;
  }
}

/* Mobile optimization */
@media (max-width: 899px) {
  .nav-toggle {
    display: inline-flex;
  }

  .nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(19.5rem, 88vw);
    margin: 0;
    padding: calc(0.85rem + env(safe-area-inset-top)) 1.15rem
      max(1.25rem, env(safe-area-inset-bottom));
    background: linear-gradient(180deg, #14141a 0%, #0c0c10 100%);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    transform: translateX(105%);
    transition: transform 0.38s var(--ease-soft);
    z-index: 60;
    overflow-y: auto;
    pointer-events: none;
    -webkit-overflow-scrolling: touch;
  }

  body.nav-open .nav {
    transform: translateX(0);
    pointer-events: auto;
  }

  /* Header + drawer above dim layer (backdrop must stay below interactive bar). */
  body.nav-open .site-header {
    z-index: 70;
  }

  .site-top__bg {
    border-radius: 0;
  }

  .nav a {
    padding: 0.95rem 0.15rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 1rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.92);
  }

  .nav a:hover {
    color: #fff;
    opacity: 1;
  }

  .nav a:last-of-type {
    border-bottom: none;
  }

  .site-header {
    border-radius: 0 0 14px 14px;
    /* Ta sama wysokość paska co na desktopie (padding jak w bazie); tylko treść przesunięta w górę */
    padding: 1.35rem max(var(--space), env(safe-area-inset-left)) 2.05rem
      max(var(--space), env(safe-area-inset-right));
  }

  .site-header .logo,
  .site-header .site-header__trailing {
    transform: translateY(-1.2rem);
  }

  .hero {
    min-height: min(88svh, 88dvh);
    padding-top: 5.95rem;
  }

  .hero-content {
    max-width: 100%;
    border-radius: 16px;
    padding: 1.1rem 1rem;
  }

  .hero-lead {
    font-size: 1rem;
  }

  .hero-actions .btn {
    flex: 1 1 100%;
  }

  .btn {
    width: 100%;
  }

  .section,
  .site-footer {
    padding-left: max(var(--space), env(safe-area-inset-left));
    padding-right: max(var(--space), env(safe-area-inset-right));
  }

  .liquid-glass {
    backdrop-filter: blur(16px) saturate(150%);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
  }

  .site-top__bg.liquid-glass {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .cookie-consent__inner {
    flex-direction: column;
    align-items: stretch;
  }

  .cookie-consent__actions {
    flex-direction: column;
    justify-content: stretch;
    width: 100%;
  }

  .cookie-consent__ok {
    width: 100%;
    justify-content: center;
  }
}

/* iPad w pionie (768–899): logo + PL/menu jako jedna grupka na środku */
@media (min-width: 768px) and (max-width: 899px) {
  .site-header {
    justify-content: center;
    gap: clamp(0.5rem, 2.2vw, 1rem);
  }

  .logo {
    margin-left: 0;
    margin-right: 0;
  }

  .site-header__trailing {
    margin-right: 0;
    margin-left: 0;
    gap: 0.22rem;
  }

  .lang-switch {
    gap: 0.22rem;
  }
}

/* Podstrona (np. polityka, projekty) */
.subpage .privacy-page-main,
.subpage .projects-page-main,
.subpage .about-page-main {
  padding-top: clamp(5.85rem, 13vh, 7.35rem);
}

/* Polityka prywatności */
.privacy-section .privacy-card {
  max-width: 48rem;
}

.privacy-card h1,
.privacy-card h2 {
  margin-top: 0;
  letter-spacing: -0.02em;
  color: var(--text);
}

.privacy-card h1 {
  margin-bottom: 0.35rem;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
}

.privacy-back {
  margin: 1.75rem 0 0;
  font-size: 0.95rem;
}

.privacy-body {
  margin-top: 1rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.privacy-body h2 {
  margin: 1.35rem 0 0.5rem;
  font-size: 1.05rem;
  color: var(--text);
  font-weight: 600;
}

.privacy-body h2:first-of-type {
  margin-top: 0.75rem;
}

.privacy-body p {
  margin: 0 0 0.65rem;
}

.privacy-body ul {
  margin: 0 0 0.65rem;
  padding-left: 1.25rem;
}

.privacy-body li {
  margin-bottom: 0.35rem;
}

.privacy-lang-en {
  display: none;
}

html[lang="en"] .privacy-lang-pl {
  display: none;
}

html[lang="en"] .privacy-lang-en {
  display: block;
}

/* Baner zgody (cookies / polityka) */
.cookie-consent {
  position: fixed;
  z-index: 170;
  left: 0;
  right: 0;
  bottom: 0;
  padding: max(0.75rem, env(safe-area-inset-bottom))
    max(var(--space), env(safe-area-inset-right))
    max(0.75rem, env(safe-area-inset-bottom))
    max(var(--space), env(safe-area-inset-left));
  pointer-events: none;
}

.cookie-consent[hidden] {
  display: none !important;
}

.cookie-consent__inner {
  pointer-events: auto;
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  animation: cookie-slide-up 0.55s var(--ease-out) both;
}

@keyframes cookie-slide-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cookie-consent__text {
  margin: 0;
  flex: 1 1 16rem;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text);
}

.cookie-consent__text a {
  font-weight: 600;
}

.cookie-consent__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.65rem;
  justify-content: flex-end;
  align-items: center;
  flex-shrink: 0;
}

.cookie-consent__ok {
  flex-shrink: 0;
  cursor: pointer;
  min-height: 48px;
}

.cookie-consent__ok:active {
  transform: scale(0.98);
}

body.has-cookie-banner {
  padding-bottom: 6.25rem;
}

@media (prefers-reduced-motion: reduce) {
  .cookie-consent__inner {
    animation: none;
  }

  .cookie-consent__ok:active {
    transform: none;
  }
}
