/* Global styles */
:root {
  --bg-color: #e9e9e9;
  --content-bg: #ffffff;
  --text-color: #111111;
  --link-color: #666666;
  --max-width: 80%;
  --gutter: 24px;
  --font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --sidebar-width: 112px;
}

/* === Navigation (base) === */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
nav .logo {
  position: fixed;
  right: 10px;
  bottom: 5px;
  transform: rotate(270deg) translateY(0%) translateX(100%);
  transform-origin: right center;
  font-weight: 600;
  font-size: 16.5px;
  letter-spacing: 0.2px;
  color: #111;
}
nav .logo {
  display: none !important;
}
nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 10px;
}
nav a {
  text-decoration: none;
  color: #8a8a8a; /* subtle gray */
  font-size: 12.5px;
  line-height: 1.2;
  letter-spacing: 0.2px;
  opacity: 1;
  transition: color .2s ease, opacity .2s ease;
}
nav .menu-toggle {
  display: none;
}

/* === Desktop: fixed right nav menu === */
@media (min-width: 768px) {
  nav {
    position: fixed;
    top: 20px;
    right: 30px;
    left: auto;
    width: auto;
    height: auto;
    background: transparent;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-end;
    padding: 0;
    margin: 0;
    z-index: 200;
    gap: 10px;
  }

  nav .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.55);
    background: rgba(255,255,255,0.18);
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    box-shadow: 0 10px 30px rgba(0,0,0,.10), inset 0 1px 0 rgba(255,255,255,.35);
    font-size: 13.2px;
    letter-spacing: .3px;
    cursor: pointer;
    transition: transform .25s ease, background .25s ease, border-color .25s ease, box-shadow .25s ease;
    isolation: isolate;
    background: rgba(255,255,255,0.18);
  }

  nav .menu-toggle:active{
    background: #11111112;
    border-color: rgba(255,255,255,0.65);
  }

  nav .menu-toggle:hover{
    background: #11111112;
    border-color: rgba(255,255,255,0.7);
  }


  nav ul {
    position: absolute;
    top: 0;
    right: 0;
    width: 68px;
    height: 68px;
    flex-direction: column;
    background: transparent;
    padding: 0;
    display: none;
    gap: 10px;
    align-items: center;
    text-align: center;
    transform-origin: top right;
  }

  nav ul li{
    position:absolute;
    top:15px;
    right:50%;
    transform:translate(50%,0);
    opacity:0;
    transition:transform .35s cubic-bezier(.2,.7,.2,1), opacity .25s ease;
  }

  nav ul.open li{
    opacity:1;
  }

  nav ul.open li:nth-child(1){ transform:translate(50%,63px); }
  nav ul.open li:nth-child(2){ transform:translate(50%,130.9px); }
  nav ul.open li:nth-child(3){ transform:translate(50%,198.8px); }
  nav ul.open li:nth-child(4){ transform:translate(50%,266.7px); }
  nav ul.open li:nth-child(5){ transform:translate(50%,334.6px); }

  nav ul.open{
    display: flex;
    animation: menuFadeIn .35s ease forwards;
    top: 0;
    right: 0;
  }


  nav a {
    font-size: 14.3px;
    white-space: nowrap;
  }

  nav ul a{
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:50%;
    text-decoration:none;
    color:#111;
    background:rgba(255,255,255,0.18);
    backdrop-filter:blur(18px) saturate(180%);
    -webkit-backdrop-filter:blur(18px) saturate(180%);
    border:1px solid rgba(255,255,255,0.55);
    box-shadow:0 6px 18px rgba(0,0,0,.08), inset 0 1px 0 rgba(255,255,255,.35);
    font-size:12.1px;
    letter-spacing:.2px;
    padding:0;
    transition:all .25s ease;
    cursor: pointer;
  }

  nav ul a:hover {
    background: #11111112;
    border-color: #22111112;
    color: #111;
  }

  nav ul li a{
    width:57.88px;
    height:57.88px;
    font-size:11.81px;
  }
}

/* === Mobile: top bar with collapsible list === */
@media (max-width: 767px) {
  nav {
    position: fixed;
    top: 90px;
    right: 10px;
    width: auto;
    height: auto;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-end;
    padding: 0;
    margin: 0;
    z-index: 1200;
    opacity: 1;
    transition: opacity 3.95s;
  }

  body.nav-scrolled nav{
    animation: navJump .75s ease forwards;
  }

  main,
  .content,
  .project-content {
    max-width: 96%;
    min-width: 96%;
    margin: 0 auto;
    padding: 0;
  }
  nav ul {
    display: none;
    position: absolute;
    top: 50px;
    right: 0;
    left: auto;
    transform: none;
    flex-direction: column;
    gap: 10px;
    background: transparent;
    padding: 16px var(--gutter) 24px;
    border-top: 0px solid #ddd;
    align-items: center;
    text-align: center;
  }
  /* 🔘 Mobile dropdown items styled like the back button */
  nav ul a {
    display: inline-block;
    padding: 10px 18px;
    border: 1px solid #ccc;
    border-radius: 9999px;
    text-decoration: none;
    color: #111;
    background: rgba(255,255,255,0.22);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    box-shadow: 0 6px 18px rgba(0,0,0,.08), inset 0 1px 0 rgba(255,255,255,.35);
    font-size: 13px;
    letter-spacing: 0.3px;
    transition: all 0.25s ease;
    font-weight: 500;
  }
  nav ul a:hover {
    background: #111;
    color: #fff;
    border-color: #111;
  }
  nav ul a[aria-current="page"] {
    background: rgba(255,255,255,0.55);
    border-color: #999;
    font-weight: 600;
  }
  nav ul.open {
    display: flex;
    animation: menuFadeIn .6s ease forwards;
  }

  /* === Mobile menu blur (stable overlay below menu) === */
  nav ul { z-index: 1201; }

  body:has(nav ul.open)::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.35);
    -webkit-backdrop-filter: blur(4px) saturate(110%);
    backdrop-filter: blur(4px) saturate(110%);
    z-index: 1100;       /* Zawsze pod menu, ponad treścią */
    pointer-events: none;
  }

  nav .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.55);
    background: rgba(255,255,255,0.22);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    box-shadow: 0 10px 30px rgba(0,0,0,.10), inset 0 1px 0 rgba(255,255,255,.35);
    font-size: 13px;
    color: #111;
    transition: transform .25s ease, background .25s ease, border-color .25s ease;
    background-color: rgba(255,255,255,0.35) !important;
    backdrop-filter: blur(4px) saturate(110%) !important;
    -webkit-backdrop-filter: blur(4px) saturate(110%) !important;
    isolation: isolate;
  }

  @media (hover: hover) {
    nav .menu-toggle:hover {
      transform: scale(1.06);
      background: rgba(255,255,255,0.55);
      border-color: rgba(255,255,255,0.7);
      color: #111;
    }
  }

  nav .menu-toggle:active{
    transform: scale(0.96);
    background: rgba(255,255,255,0.45) !important;
    border-color: rgba(255,255,255,0.7);
  }

  /* 🔧 Wrapper width on mobile */
  .wrapper {
    max-width: 96%;
    margin-right: auto;
    margin-left: auto;
  }
  .wrapper {
    padding-top: 110px !important;
  }
  /* === Mobile menu: blur background when open === */
  /* Upewnij się, że menu jest nad rozmyciem */
  

  /* Warstwa rozmycia za menu (bez blokowania klików) */
  

  /* Alternatywnie dodatkowe rozmycie samej treści (bez overlay) */
  body:has(nav ul.open) main,
  body:has(nav ul.open) footer {
    transition: filter .2s ease;
  }

  /* === Mobile: split brand heading into two lines === */
  h1.brand {
    text-align: center;
    margin: 0 auto 12px;
    /* całkowicie ukryj oryginalny tekst, nie pseudo-elementy */
    color: transparent !important;
    font-size: 0 !important;
    line-height: 0 !important;
  }
  h1.brand::before {
    content: "The Totu Studio";
    display: block;
    font-size: clamp(20px, 7vw, 28px);
    font-weight: 600;
    color: var(--text-color);
    letter-spacing: 0.2px;
  }
  h1.brand::after {
    content: "Pracownia Architektury Wnętrz w Warszawie";
    display: block;
    font-size: clamp(14px, 4.5vw, 18px);
    font-weight: 400;
    color: var(--text-color);
    letter-spacing: 0.2px;
    margin-top: 2px;
  }

}

nav .menu-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(0,0,0,0.15);
}

* {
  box-sizing: border-box;
}

/* 🔧 UA reset: usuń domyślne 40px marginesów figure we wszystkich przeglądarkach */
figure {
  margin: 0;              /* skrót wystarczy, ale dla pewności: */
  margin-block: 0;
  margin-inline: 0;
}
figcaption { margin: 0; } /* opcjonalnie zeruje domyślne odstępy */

/* === Global body === */
body {
  margin: 0;
  padding: 0;
  color: var(--text-color);
  font-family: var(--font-family);
  line-height: 1.6;
  /* GLOBAL BACKGROUND ANIMATION */
  background: linear-gradient(25deg, #e4dfd621 0%, #e4dfd629 50%, #e4dfd621 100%);
  background-size: 200% 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header, main, footer {
  width: 100%;
}

/* === Brand heading: two-line layout (global) === */
h1.brand {
  text-align: center;
  margin: 0 auto 12px;
  color: transparent !important; /* ukrywa oryginalny tekst */
  font-size: 0 !important;
  line-height: 0 !important;
}
h1.brand::before {
  content: "The Totu Studio";
  display: block;
  font-size: clamp(16px, 2vw, 20px);
  font-weight: 600;
  color: var(--text-color);
  letter-spacing: 0.2px;
  line-height: 1.2;
}
h1.brand::after {
  content: "Pracownia Architektury Wnętrz w Warszawie";
  display: block;
  font-size: clamp(16px, 2vw, 20px);
  font-weight: 600;
  color: var(--text-color);
  letter-spacing: 0.2px;
  line-height: 1.2;
  opacity: 0.85;
  margin-top: 4px;
}

.wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 135px 0 0;
  background: transparent;
  display: flex;
  flex: 1;
  flex-direction: column;
}

.top-logo {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 260px;
  max-width: 70vw;
  height: auto;
  z-index: 10;
}

.hero {
  width: 100%;
  min-height: 60vh;
  overflow: visible;
}

.hero img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

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

.teasers {
  display: grid;
  gap: 30px;
  margin-top: 40px;
}
@media (min-width: 768px) {
  .teasers {
    grid-template-columns: 1fr;
  }
}
.teasers img {
  width: 100%;
  height: auto;
  display: block;
}

.project-card {
  margin-top: 25px;
  margin-bottom: 60px;
}
.project-card figure {
  margin: 0;
}
.project-card img {
  width: 100%;
  height: auto;
  display: block;
}
.project-card figcaption {
  font-size: 14px;
  margin-top: 10px;
  opacity: 0.7;
}

#footer {
  padding: 8px 20px 6px;
  font-size: 12px;
  color: #555;
  text-align: center;
  margin-top: auto;
  margin-bottom: 20px;
}

@media (min-width: 1200px) {
  :root { --gutter: 32px; }
}

.project-card figcaption {
  font-size: 12px;
  text-align: center;
  color: #6b6b6b;
  margin-top: 12px;
}

/* === Links and nav states === */
nav a:hover,
nav a:focus {
  opacity: 0.7;
  outline: none;
}
nav a[aria-current="page"],
nav a.active {
  color: #000;
  font-weight: 600;
  letter-spacing: 0.2px;
  opacity: 1;
  transition: color 0.25s ease;
}
nav a:hover:not([aria-current="page"]) {
  color: #333;
}
@media (hover:hover) {
  nav a:hover { color: #111; }
}

/* === Sticky footer fix === */

/* === iOS/Safari safe-area & background fix === */
html, body {
  background: linear-gradient(90deg, #f8f8f8 0%, #ffffff 50%, #cfcfcf 100%);
  background-size: 200% 100%;
  background-repeat: no-repeat;
  background-position: center center;
  /* height: auto; */ 
  overflow-x: hidden;
}

@supports (padding: max(0px)) {
  html {
    background-clip: content-box;
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
}
.project-card {
  margin-top: 0;
  margin-bottom: 60px;
}

@media (max-width: 767px) {
  body.page-projects .project-card {
    margin-top: 0px;
    margin-bottom: 0px;
    aspect-ratio: 1 / 1;
    overflow: visible; /* ← było hidden */
  }

  body.page-projects .project-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}
@media (max-width: 768px) {
.project-card img {
  width: 100%;
  height: auto;
  display: block;
  margin-top: 20px;
}
}

@media (min-width: 768px) {
  .project-card {
    margin-top: 0;
  }

}

.back-to-projects{
  text-align:center;
  margin:40px 0 10px;
}

.back-to-projects a{
  display:inline-block;
  padding:12px 22px;
  border-radius:9999px;
  text-decoration:none;
  font-size:13px;
  letter-spacing:.3px;
  color:#111;
  border:1px solid rgba(255,255,255,0.55);
  background:rgba(255,255,255,0.22);
  backdrop-filter:blur(14px) saturate(160%);
  -webkit-backdrop-filter:blur(14px) saturate(160%);
  box-shadow:0 6px 18px rgba(0,0,0,.08), inset 0 1px 0 rgba(255,255,255,.35);
  transition:all .25s ease;
}

.back-to-projects a:hover{
  background:#111;
  color:#fff;
  border-color:#111;
}
  @keyframes navJump{
    0%{
      top:90px;
      opacity:1;
    }
    45%{
      top:90px;
      opacity:0;
    }
    55%{
      top:10px;
      opacity:0;
    }
    100%{
      top:10px;
      opacity:1;
    }
  }

@keyframes menuFadeIn{
  from{
    opacity:0;
    transform:scale(.96);
  }
  to{
    opacity:1;
    transform:scale(1);
  }
}m