/* Hero na zdjęciu lotniczym z przełącznikiem perspektyw. Ładowany po fly-high.css. */
:root {
  --header-h: 100px;
  --hero-night: #002036;
  --viewer-step: 4s;
}
@media (max-width: 1150px) {
  :root {
    --header-h: 86px;
  }
}
@media (max-width: 700px) {
  :root {
    --header-h: 78px;
  }
}

/* Nagłówek nad hero: przezroczysty, biały; po zjechaniu wraca do białego tła */
.header {
  transition:
    background-color 0.25s,
    border-color 0.25s;
}
.header.is-over-hero {
  background: transparent;
  border-bottom-color: rgba(255, 255, 255, 0.16);
}
.header.is-over-hero.is-scrolled {
  background: #012136;
}
.header.is-over-hero .brand img {
  filter: brightness(0) invert(1);
}
.header.is-over-hero nav > a:not(.button),
.header.is-over-hero .lang-switch button[aria-pressed="true"] {
  color: #fff;
}
.header.is-over-hero nav > a:not(.button):hover::after {
  background: #fff;
}
.header.is-over-hero .lang-switch {
  border-left-color: rgba(255, 255, 255, 0.25);
}
.header.is-over-hero .lang-switch button {
  color: rgba(255, 255, 255, 0.7);
}
.header.is-over-hero .menu-toggle {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}
.header.is-over-hero :focus-visible {
  outline-color: #fff;
}

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: min(100svh, 1000px);
  margin-top: calc(-1 * var(--header-h));
  padding-top: var(--header-h);
  background: var(--hero-night);
  color: #fff;
}
.hero-backdrop {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  max-width: none;
  height: 100%;
  object-fit: cover;
  object-position: 60% 50%;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(0, 32, 54, 0.7) 0%, rgba(0, 32, 54, 0) 24%),
    linear-gradient(0deg, rgba(0, 32, 54, 0.8) 0%, rgba(0, 32, 54, 0) 34%),
    linear-gradient(
      90deg,
      rgba(0, 32, 54, 0.95) 0%,
      rgba(0, 42, 69, 0.84) 40%,
      rgba(0, 42, 69, 0.5) 100%
    );
}
.hero-grid {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  align-items: center;
  gap: 72px;
  padding: 56px 0 40px;
}
.hero h1 {
  margin-bottom: 28px;
  color: #fff;
  font-size: clamp(48px, 5.6vw, 84px);
  line-height: 1.02;
  letter-spacing: -0.05em;
}
.hero .lead {
  max-width: 30em;
  color: rgba(255, 255, 255, 0.86);
  font-size: 19px;
  line-height: 1.6;
}
.hero .actions {
  flex-wrap: wrap;
  gap: 28px;
  margin-top: 40px;
}
.hero .button,
.hero .button:hover {
  background: #fff;
  color: var(--blue-dark);
}
.hero .button:hover {
  background: #e3f3ff;
  filter: none;
}
.hero .text-link {
  color: #fff;
}
.hero .text-link:hover {
  color: #fff;
  border-bottom-color: #fff;
}
.hero :focus-visible,
.hero .button:focus-visible {
  outline-color: #fff;
}
.hero-credit {
  margin-top: 0;
  margin-bottom: 0;
  padding: 18px 0 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
}

/* Okno perspektyw: to samo osiedle w pięciu ujęciach */
.viewer {
  min-width: 0;
}
.viewer-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: rgba(0, 32, 54, 0.6);
  overflow: hidden;
}
.viewer-tab {
  position: relative;
  padding: 13px 6px 14px;
  border: 0;
  background: none;
  color: rgba(255, 255, 255, 0.68);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.viewer-tab + .viewer-tab {
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}
.viewer-tab:hover {
  color: #fff;
}
.viewer-tab[aria-selected="true"] {
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
}
.viewer-tab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: #fff;
  transform: scaleX(0);
  transform-origin: left;
}
.viewer-tab[aria-selected="true"]::after {
  transform: scaleX(1);
}
.viewer.is-cycling .viewer-tab[aria-selected="true"]::after {
  animation: viewer-progress var(--viewer-step) linear both;
}
.viewer.is-cycling.is-paused .viewer-tab[aria-selected="true"]::after {
  animation-play-state: paused;
}
.viewer-tab:focus-visible {
  outline-offset: -3px;
}
@keyframes viewer-progress {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}
.viewer-stage {
  position: relative;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 0 0 8px 8px;
  background: #0b2233;
  box-shadow: 0 30px 80px rgba(0, 16, 30, 0.45);
}
.viewer-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.viewer-layer.is-active {
  opacity: 1;
}
.viewer-caption {
  min-height: 3em;
  margin: 16px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 15px;
  line-height: 1.5;
}
.viewer-caption strong {
  color: #fff;
  font-weight: 600;
}

/* Jedno wejście przy załadowaniu strony */
@media (prefers-reduced-motion: no-preference) {
  .hero-copy > *,
  .viewer {
    animation: hero-in 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }
  .hero-copy > :nth-child(2) {
    animation-delay: 0.1s;
  }
  .hero-copy > :nth-child(3) {
    animation-delay: 0.2s;
  }
  .viewer {
    animation-delay: 0.3s;
  }
}
@keyframes hero-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

@media (max-width: 1150px) {
  .hero-grid {
    gap: 44px;
  }
}
@media (max-width: 950px) {
  .hero {
    min-height: 0;
  }
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 44px;
    padding: 48px 0 36px;
  }
  .hero h1 {
    font-size: clamp(44px, 8vw, 64px);
  }
  .hero .lead {
    font-size: 18px;
  }
  .hero .actions {
    flex-direction: row;
    align-items: center;
  }
  .viewer {
    max-width: 640px;
  }
}
@media (max-width: 700px) {
  .hero-grid {
    gap: 36px;
    padding: 36px 0 28px;
  }
  .hero h1 {
    font-size: clamp(40px, 11vw, 56px);
    margin-bottom: 20px;
  }
  .hero .lead {
    font-size: 17px;
  }
  /* Na telefonie przycisk Krosna ląduje pod oknem perspektyw */
  .hero-grid {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .hero-copy,
  .hero .actions {
    display: contents;
  }
  .hero .lead {
    order: 2;
    margin-bottom: 0;
  }
  .hero h1 {
    order: 1;
  }
  .hero .text-link {
    order: 3;
    align-self: flex-start;
    margin-top: 24px;
  }
  .viewer {
    order: 4;
    margin-top: 32px;
  }
  .hero .button {
    order: 5;
    margin-top: 28px;
  }
  .viewer-tab {
    padding: 12px 2px 13px;
    font-size: 13px;
  }
  .viewer-caption {
    font-size: 14px;
  }
  .hero::before {
    background:
      linear-gradient(180deg, rgba(0, 32, 54, 0.7) 0%, rgba(0, 32, 54, 0) 24%),
      linear-gradient(90deg, rgba(0, 32, 54, 0.9), rgba(0, 42, 69, 0.78));
  }
}
