/* ========================================
   CSS VARIABLES
   ======================================== */
:root {
  --edge-padding: 40px;
  --header-offset: 70px;
  --header-height: 40px;
  --header-height-mobile: 60px;
  
  /* Typography */
  --font-serif: "Orpheus Pro", "Playfair Display", "Times New Roman", serif;
  --font-sans: "Bahnschrift", "Segoe UI", "Inter", "Arial", sans-serif;
  
  /* Colors */
  --color-text: #000000;
  --color-bg: #ffffff;
  
  /* Z-index layers */
  --z-slideshow: 1;
  --z-main-content: 1;
  --z-page-content: 800;
  --z-prev-next: 800;
  --z-footer: 850;
  --z-nav-menu: 900;
  --z-logo-bg: 999;
  --z-header: 1000;
  --z-logo: 1001;
}

/* ========================================
   RESET & BASE STYLES
   ======================================== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  font-family: var(--font-sans);
  font-size: 14px;
  text-transform: uppercase;
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.15);
  z-index: 0;
  pointer-events: none;
}

/* ========================================
   TYPOGRAPHY
   ======================================== */
.brand-name,
.page-header,
.logo {
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: 1px;
}

/* ========================================
   HEADER
   ======================================== */
.header {
  position: fixed;
  top: var(--header-offset);
  height: var(--header-height);
  display: flex;
  align-items: center; /* żeby logo było idealnie wycentrowane w headerze */
  left: 0;
  width: 100%;
  height: var(--header-height);
  padding: 0 var(--edge-padding);
  display: flex;
  align-items: center;
  z-index: var(--z-header);
}

.header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
  height: var(--header-height);
}

.header-center {
  justify-self: center;
}

.header-right {
  justify-self: end;
}

/* ========================================
   LOGO
   ======================================== */
.logo-container {
  position: absolute;
  left: var(--edge-padding);
  top: 0;
  display: inline-block;
}

.logo,
#goHome {
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: normal;
  letter-spacing: 0.5px;
  line-height: 1;
  color: inherit;
  text-decoration: none;
  padding: 8px 0;
  white-space: nowrap;
  cursor: pointer;
  display: inline-block;
  position: relative;
  z-index: var(--z-logo);
}

/* Logo on works page */
.works-page .logo,
.logo-works {
  color: var(--color-text);
}

/* White stripe behind logo on works page */
.logo-works-bg {
  position: fixed;
  left: 0;
  top: var(--header-offset);
  height: var(--header-height);
  width: 0;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: var(--z-logo-bg);
}

.logo-works-bg.active {
  opacity: 1;
}

/* ========================================
   NAVIGATION MENU
   ======================================== */
.nav-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding-top: calc(var(--header-offset) * 1.5);
  padding-left: var(--edge-padding);
  padding-right: var(--edge-padding);
  padding-bottom: 40px;
  background: transparent;
  pointer-events: auto;
  z-index: var(--z-nav-menu);
  margin-top: var(--header-offset);
}

.nav-wrapper {
  width: 100%;
  height: 100%;
  background: transparent;
}

.nav-wrapper-interior {
  display: flex;
  width: 100%;
  height: 100%;
}

.main-nav {
  flex: 1;
}

.utility-nav {
  width: 200px;
  text-align: right;
}

/* Navigation lists */
.nav-main,
.nav-utility {
  list-style: none;
}

.nav-main > .menu-item,
.nav-utility > .menu-item {
  margin-bottom: 1px;
}

.nav-main a,
.nav-utility a {
  color: inherit;
  text-decoration: none;
  display: block;
  position: relative;
  font-weight: 300;
  letter-spacing: 1.2px;
}

/* Sub-menu styling */
.sub-menu {
  list-style: none;
  max-height: 0;
  overflow: hidden;
  margin-left: 20px;
  transition: max-height 0.3s cubic-bezier(0.65, 0.05, 0.36, 1);
}

.menu-item-has-children.clicked > .sub-menu {
  max-height: 1000px;
}

.menu-item-has-children.clicked > a {
  font-weight: 500;
}

/* Sub-menu animation */
.sub-menu .menu-item {
  opacity: 0;
  transform: translateY(10px);
  animation: slideInMenu 0.5s cubic-bezier(0.65, 0.05, 0.36, 1) forwards;
}

.sub-menu .menu-item:nth-child(1) { animation-delay: 50ms; }
.sub-menu .menu-item:nth-child(2) { animation-delay: 100ms; }
.sub-menu .menu-item:nth-child(3) { animation-delay: 150ms; }
.sub-menu .menu-item:nth-child(4) { animation-delay: 200ms; }
.sub-menu .menu-item:nth-child(5) { animation-delay: 250ms; }
.sub-menu .menu-item:nth-child(6) { animation-delay: 300ms; }
.sub-menu .menu-item:nth-child(7) { animation-delay: 350ms; }
.sub-menu .menu-item:nth-child(8) { animation-delay: 400ms; }
.sub-menu .menu-item:nth-child(9) { animation-delay: 450ms; }

/* Nested sub-menus */
.sub-menu .sub-menu {
  padding-left: 20px;
  margin-top: 10px;
}

@keyframes slideInMenu {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========================================
   MAIN CONTENT
   ======================================== */
.main-content {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 var(--edge-padding);
  pointer-events: none;
  z-index: var(--z-main-content);
}

.brand-name {
  font-size: clamp(48px, 3vw, 120px);
  letter-spacing: 2px;
  line-height: 1;
  margin-bottom: 24px;
  text-transform: uppercase;
}

.tagline {
  font-size: 12px;
  letter-spacing: 1.5px;
  font-weight: 300;
}

/* ========================================
   PAGE CONTENT
   ======================================== */
.page-content {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 140px 40px 40px;
  background: var(--color-bg);
  overflow-y: auto;
  display: none;
  z-index: var(--z-page-content);
}

.page-content.active {
  display: block;
}

.page-header {
  font-size: 36px;
  letter-spacing: 1.5px;
  margin-top: 60px;
  margin-bottom: 60px;
  text-transform: uppercase;
}

.page-text {
  font-size: 14px;
  line-height: 1.6;
  max-width: 600px;
  margin-bottom: 40px;
  font-weight: 300;
  letter-spacing: 0.5px;
  text-transform: none;
}

.back-link {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 1.5px;
  padding-bottom: 2px;
  margin-top: 20px;
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--color-text);
  font-weight: 300;
  cursor: pointer;
}

/* ========================================
   FOOTER
   ======================================== */
.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: var(--edge-padding);
  background: transparent;
  z-index: var(--z-footer);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-contact {
  font-size: 11px;
  letter-spacing: 0.8px;
  font-weight: 300;
}

/* ========================================
   SLIDESHOW
   ======================================== */
.slideshow {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  z-index: var(--z-slideshow);
}

.slide {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s ease-in-out;
}

.slide.active {
  opacity: 1;
}

.slide img {
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Slideshow controls */
.prev,
.next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2rem;
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(6px);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: var(--z-prev-next);
}

.prev:hover,
.next:hover {
  background: rgba(255, 255, 255, 0.6);
  transform: translateY(-50%) scale(1.1);
}

.prev {
  left: 20px;
}

.next {
  right: 20px;
}

/* Slideshow fallback background */
.slideshow::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #000;
  opacity: 0;
  z-index: -1;
}

.slideshow.loading .slide img {
  filter: blur(5px);
}

/* ========================================
   RESPONSIVE - TABLET (≤1024px)
   ======================================== */
@media (max-width: 1024px) {
  :root {
    --edge-padding: 30px;
    --header-offset: 60px;
  }

  .logo,
  #goHome {
    font-size: 16px;
  }

  .nav-menu {
    padding-top: calc(var(--header-offset) * 1.3);
    padding-bottom: 30px;
  }

  .prev,
  .next {
    font-size: 1.8rem;
    padding: 8px 16px;
  }
}

/* ========================================
   RESPONSIVE - TABLET PORTRAIT (≤768px)
   ======================================== */
@media (max-width: 768px) {
  :root {
    --edge-padding: 24px;
    --header-offset: 50px;
  }

  .nav-wrapper-interior {
    flex-direction: column;
    gap: 30px;
  }

  .utility-nav {
    width: 100%;
    text-align: left;
  }

  .brand-name {
    font-size: clamp(28px, 8vw, 56px);
    margin-bottom: 16px;
  }

  .tagline {
    font-size: 11px;
    letter-spacing: 1.2px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .page-content {
    padding: 120px var(--edge-padding) var(--edge-padding);
  }

  .page-header {
    font-size: 28px;
    margin-top: 40px;
    margin-bottom: 40px;
  }

  .slide img {
    transform: scale(1.05);
    transition: transform 0.3s ease;
  }

  .prev,
  .next {
    font-size: 1.6rem;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.4);
  }
}

/* Very tall photos on mobile */
@media (max-width: 768px) and (max-height: 700px) {
  .slide img {
    object-position: center 30%;
  }
}

/* ========================================
   RESPONSIVE - MOBILE (≤480px)
   ======================================== */
@media (max-width: 480px) {
  :root {
    --edge-padding: 20px;
    --header-offset: 40px;
  }

  html,
  body {
    overflow-y: auto;
  }

  .logo,
  #goHome {
    font-size: 15px;
  }

  .nav-menu {
    position: relative;
    height: auto;
    min-height: calc(100vh - var(--header-offset));
    padding-top: calc(var(--header-offset) * 1.8);
    z-index: var(--z-main-content);
  }

  .main-content {
    position: relative;
    min-height: 100vh;
    padding: calc(var(--header-offset) * 2) var(--edge-padding) 80px;
    pointer-events: auto;
  }

  .brand-name {
    font-size: clamp(32px, 12vw, 48px);
    margin-bottom: 12px;
  }

  .tagline {
    font-size: 10px;
    letter-spacing: 1px;
  }

  .footer {
    position: relative;
  }

  .page-content {
    position: relative;
    min-height: 100vh;
    padding: calc(var(--header-offset) * 2) var(--edge-padding) 80px;
  }

  .page-header {
    font-size: 24px;
    margin-top: 30px;
    margin-bottom: 30px;
  }

  .page-text {
    font-size: 13px;
  }

  .prev,
  .next {
    font-size: 1.4rem;
    padding: 6px 12px;
    min-width: 44px;
    min-height: 44px;
    background: rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .prev {
    left: 10px;
  }

  .next {
    right: 10px;
  }
}

/* Portrait orientation */
@media (max-width: 480px) and (max-aspect-ratio: 3/4) {
  .slide img {
    object-position: center top;
  }
}

/* Landscape orientation */
@media (max-width: 480px) and (min-aspect-ratio: 4/3) {
  .slide img {
    object-position: center center;
  }
}

/* ========================================
   RESPONSIVE - EXTRA SMALL (≤320px)
   ======================================== */
@media (max-width: 320px) {
  :root {
    --edge-padding: 15px;
    --header-offset: 35px;
  }

  .logo,
  #goHome {
    font-size: 14px;
  }

  .slide img {
    transform: scale(1.1);
  }

  .prev,
  .next {
    font-size: 1.2rem;
    padding: 5px 10px;
    min-width: 40px;
    min-height: 40px;
  }

  .utility-nav {
    display: none;
  }
}

/* ========================================
   RESPONSIVE - WIDE SCREENS
   ======================================== */
/* Standard wide (16:9) */
@media (min-aspect-ratio: 16/9) {
  .slide img {
    object-position: center center;
  }
}

/* Ultra-wide (21:9) */
@media (min-aspect-ratio: 21/9) {
  .slide img {
    object-position: center center;
    transform: scale(1.1);
  }
}