/* DP DESIGN – wspólne style */
html {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: #0A0A0A;
  color: #FFFFFF;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, .font-display {
  font-family: 'Plus Jakarta Sans', sans-serif;
}

/* =====================================================================
   PRELOADER – PEŁNOEKRANOWE OTWARCIE Z LOGOTYPEM DP DESIGN
===================================================================== */
#dp-preloader {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: radial-gradient(circle at 50% 48%, #141414 0%, #070707 72%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.85s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.85s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity;
}

#dp-preloader.is-hiding {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.dp-preloader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(460px, 82vw);
  opacity: 0;
  transform: translateY(16px) scale(0.96);
  transition: opacity 0.85s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.95s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

#dp-preloader.is-entered .dp-preloader-inner {
  opacity: 1;
  transform: translateY(0) scale(1);
}

#dp-preloader.is-hiding .dp-preloader-inner {
  opacity: 0;
  transform: translateY(-10px) scale(1.03);
  transition: opacity 0.55s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.65s cubic-bezier(0.4, 0, 0.2, 1);
}

.dp-preloader-logo {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 18px 45px rgba(0, 0, 0, 0.75));
}

.dp-preloader-bar {
  width: 140px;
  height: 1.5px;
  background: rgba(255, 255, 255, 0.12);
  margin-top: 28px;
  overflow: hidden;
  position: relative;
}

.dp-preloader-bar-fill {
  position: absolute;
  inset: 0;
  background: #E31E24;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 1.25s cubic-bezier(0.22, 1, 0.36, 1);
}

#dp-preloader.is-entered .dp-preloader-bar-fill {
  transform: scaleX(1);
}

/* Kolory wektora logo-dpdesign.svg */
.dp-fil-red-nz { fill: #E31E24; fill-rule: nonzero; }
.dp-fil-red { fill: #E31E24; }
.dp-fil-white { fill: #FEFEFE; }
.dp-fil-white-nz { fill: #FEFEFE; fill-rule: nonzero; }

/* Animacje ujawniania sekcji podczas przewijania */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

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

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* Niestandardowy pasek przewijania */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #0A0A0A;
}
::-webkit-scrollbar-thumb {
  background: #2A2A2A;
}
::-webkit-scrollbar-thumb:hover {
  background: #D9231B;
}

/* Strzałka dla pola select na ciemnym tle */
select.custom-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23A3A3A3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1rem;
}

/* Wyróżnienie formularza po wyborze kategorii z oferty */
.form-highlight {
  box-shadow: 0 0 0 1px #D9231B, 0 25px 60px -15px rgba(217, 35, 27, 0.22);
  transition: box-shadow 0.5s ease;
}

/* =====================================================================
   LIGHTBOX GALERII (2 KOLUMNY DESKTOP + FULLSCREEN BLUR MOBILE)
===================================================================== */
#portfolio-lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: #070707;
  color: #FFFFFF;
  overflow: hidden;
}

#portfolio-lightbox.hidden {
  display: none !important;
}

#lightbox-ambient-bg {
  position: absolute;
  inset: -40px;
  background-size: cover;
  background-position: center;
  filter: blur(40px) brightness(0.22) saturate(1.05);
  transform: scale(1.08);
  z-index: 0;
  pointer-events: none;
}

#lightbox-ambient-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(7, 7, 7, 0.35) 0%, rgba(7, 7, 7, 0.92) 100%);
}

#lightbox-close {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 40;
  width: 44px;
  height: 44px;
  border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(10, 10, 10, 0.84);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

#lightbox-close:hover {
  background: #D9231B;
  border-color: #D9231B;
}

.dp-lb-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 30;
  width: 44px;
  height: 44px;
  border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(10, 10, 10, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.dp-lb-arrow:hover {
  background: #D9231B;
  border-color: #D9231B;
}

.dp-lb-arrow.hidden {
  display: none !important;
}

#lightbox-prev { left: 14px; }
#lightbox-next { right: 14px; }

#lightbox-desc {
  white-space: pre-line;
  color: #E5E5E5;
}

#lightbox-more-btn {
  display: none;
  margin-top: 8px;
  padding: 4px 0;
  background: none;
  border: none;
  color: #F87171;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  align-items: center;
  gap: 4px;
}

#lightbox-more-btn:hover {
  color: #FCA5A5;
  text-decoration: underline;
}

#lightbox-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

@media (min-width: 769px) {
  #lightbox-layout {
    position: relative;
    z-index: 10;
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(360px, 460px);
    gap: 32px;
    align-items: center;
    max-width: 1440px;
    width: 100%;
    height: 100vh;
    margin: 0 auto;
    padding: 32px 76px 32px 48px;
    box-sizing: border-box;
  }

  #lightbox-media {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
  }

  #lightbox-image {
    max-width: 100%;
    max-height: 82vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 2px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.78);
    transition: opacity 0.25s ease;
  }

  #lightbox-dots {
    margin-top: 14px;
  }

  #lightbox-info-panel {
    background: rgba(12, 12, 14, 0.92);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 2px;
    padding: 32px;
    display: flex;
    flex-direction: column;
    max-height: 86vh;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
  }

  #lightbox-desc-wrap {
    overflow-y: auto;
    padding-right: 6px;
    margin-top: 12px;
  }

  #lightbox-info-panel:not(.is-expanded) #lightbox-desc.is-clamped {
    display: -webkit-box;
    -webkit-line-clamp: 7;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  #lightbox-inquire {
    width: 100%;
    margin-top: 22px;
  }
}

@media (max-width: 768px) {
  #lightbox-layout {
    position: relative;
    z-index: 10;
    width: 100vw;
    height: 100dvh;
    overflow: hidden;
  }

  #lightbox-media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
  }

  #lightbox-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 35%;
    display: block;
    transition: opacity 0.25s ease;
  }

  #lightbox-meta-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 25;
    padding: 16px 66px 42px 16px;
    background: linear-gradient(
      to bottom,
      rgba(7, 7, 7, 0.9) 0%,
      rgba(7, 7, 7, 0.5) 58%,
      transparent 100%
    );
  }

  #lightbox-close {
    top: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
  }

  .dp-lb-arrow {
    top: 38%;
    width: 38px;
    height: 38px;
  }

  #lightbox-prev { left: 10px; }
  #lightbox-next { right: 10px; }

  #lightbox-dots {
    position: absolute;
    top: 62px;
    left: 16px;
    z-index: 25;
  }

  #lightbox-info-panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 25;
    padding: 58px 18px calc(18px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
  }

  #lightbox-info-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -2;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    mask-image: linear-gradient(to top, #000 74%, transparent 100%);
    -webkit-mask-image: linear-gradient(to top, #000 74%, transparent 100%);
    pointer-events: none;
  }

  #lightbox-info-panel::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(
      to top,
      rgba(7, 7, 7, 0.98) 0%,
      rgba(7, 7, 7, 0.92) 64%,
      rgba(7, 7, 7, 0.55) 86%,
      transparent 100%
    );
    pointer-events: none;
  }

  #lightbox-info-panel.is-expanded::after {
    background: linear-gradient(
      to top,
      rgba(7, 7, 7, 0.99) 0%,
      rgba(7, 7, 7, 0.95) 82%,
      rgba(7, 7, 7, 0.65) 95%,
      transparent 100%
    );
  }

  #lightbox-title {
    font-size: 1.15rem;
    line-height: 1.3;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.75);
  }

  #lightbox-desc-wrap {
    margin-top: 8px;
  }

  #lightbox-info-panel:not(.is-expanded) #lightbox-desc.is-clamped {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  #lightbox-info-panel.is-expanded #lightbox-desc-wrap {
    max-height: 40dvh;
    overflow-y: auto;
    padding-right: 4px;
  }

  #lightbox-desc {
    font-size: 0.86rem;
    line-height: 1.52;
  }

  #lightbox-inquire {
    width: 100%;
    margin-top: 14px;
    padding: 13px 16px;
    font-size: 0.88rem;
  }
}
