/* =========================================================================
   Layout & Sections
   ========================================================================= */

/* Hero Section */
.hero {
  position: relative;
  height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #fff;
  z-index: 1; /* tworzy nowy stacking context */
}

.hero video.bg-video {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  z-index: -2;
  transform: translateX(-50%) translateY(-50%);
  object-fit: cover;
}

.hero::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.2) 60%, var(--on-surface) 100%);
  z-index: -1;
}

.hero-content {
  text-align: center;
  z-index: 10;
  padding: 0 24px;
}

.hero-content .display-lg {
  margin-bottom: 24px;
}

/* Nav */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 48px;
  z-index: 100;
  transition: background-color 0.3s;
}
nav.scrolled {
  background: rgba(28, 27, 27, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  z-index: 101; /* Above mobile menu */
}

/* Snap Scroll System exclusively for index.html */
@media (min-width: 1024px) {
  html.snap-scroll-enabled {
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
  }
  html.snap-scroll-enabled body {
    /* usunięto height 100vh i overflow, aby GSAP miał dostęp do naturalnego scrolla okna */
  }
  html.snap-scroll-enabled .snap-section {
    scroll-snap-align: start;
    scroll-snap-stop: always;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  html.snap-scroll-enabled section.standard-section {
      padding-top: 0;
      padding-bottom: 0;
  }
}
nav .logo img {
  height: 40px;
}
.nav-links {
  display: flex;
  gap: 32px;
  align-items: center;
}

.nav-item {
  position: relative;
  height: 100%;
}

.nav-link-main {
  color: #fff;
  text-decoration: none;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  transition: color 0.2s;
  padding: 8px 12px;
}

.nav-link-main:hover {
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
}

/* Mega Menu Hover System */
.mega-menu {
  position: fixed;
  top: 72px; /* right below nav */
  left: 0;
  width: 100vw;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0,0,0,0.05);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
  z-index: 90;
}

.nav-item:hover .mega-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* When exactly mega menu is active, make nav bg white and text black */
nav:has(.nav-item:hover) {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
}
nav:has(.nav-item:hover) .nav-link-main {
  color: #1a1a1a;
}
nav:has(.nav-item:hover) .nav-link-main:hover {
  background: rgba(0,0,0,0.05);
}
nav:has(.nav-item:hover) .logo img {
  filter: brightness(0); /* Make logo black */
}

.mega-container {
  display: flex;
  justify-content: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px;
  gap: 64px;
}

.mega-products {
  display: flex;
  gap: 48px;
}

.mega-product-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.mega-product-card img {
  height: 120px;
  object-fit: contain;
  margin-bottom: 16px;
  transition: transform 0.3s;
}

.mega-product-card:hover img {
  transform: scale(1.05);
}

.mega-product-card span {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  color: #1a1a1a;
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.muted-link {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  color: #666;
  text-decoration: underline;
  transition: color 0.2s;
}
.muted-link:hover {
  color: var(--primary);
}

.mega-utilities {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  border-left: 1px solid rgba(0,0,0,0.1);
  padding-left: 64px;
}

.mega-utilities a {
  font-family: 'Space Grotesk', sans-serif;
  color: #1a1a1a;
  text-decoration: none;
  font-weight: 500;
  font-size: 1.1rem;
  transition: color 0.2s;
}

.mega-utilities a:hover {
  color: var(--primary);
}

/* Sections - General Padding Rule (Extreme padding per specs) */
section.standard-section {
  padding: var(--spacing-128) 24px;
  position: relative;
  background-color: var(--surface);
}

.container {
  max-width: 1440px;
  margin: 0 auto;
}

/* Asymmetric Image/Text Overlaps */
.split-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}
.split-content.reverse {
  direction: rtl;
}
.split-content.reverse > * {
  direction: ltr; /* Reset inner text direction */
}
.text-content-wrapper {
  padding: 32px;
}

/* Image wrappers for heavy industrial photography */
.img-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 8px; /* Slight hardware rounding */
}
.img-wrapper img {
  width: 100%;
  height: auto;
  display: block;
}

/* Products Section */
.products-section {
  background-color: var(--surface-container-low);
}

.product-card {
  background-color: var(--surface-container);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.product-image {
  background-color: #fff; /* To make product pop */
  padding: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.product-image img {
  max-width: 100%;
  height: 380px;
  object-fit: contain;
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.product-card:hover .product-image img {
  transform: scale(1.05);
}

.product-info {
  padding: 40px;
}

.product-info h3 {
  color: var(--primary);
  margin-bottom: 8px;
}

/* Technical Details Grid */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 32px;
  padding-top: 32px;
  /* Instead of line, change background layer */
}

.tech-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tech-item-value {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 1.5rem;
  color: var(--on-surface);
}

/* Footer */
footer {
  background-color: #1a1a1a;
  color: #fff;
  padding: 64px 24px 24px;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 48px;
  max-width: 1440px;
  margin: 0 auto;
}
.footer-column h4 {
  color: var(--primary);
  margin-bottom: 24px;
  font-family: 'Space Grotesk', sans-serif;
}
.footer-column a, .footer-column p {
  color: #a0a0a0;
  text-decoration: none;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  display: block;
  margin-bottom: 12px;
}
.footer-column a:hover {
  color: #fff;
}
.footer-bottom {
  margin-top: 64px;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 24px;
  text-align: center;
  font-size: 0.8rem;
  color: #666;
}

/* Utility to ensure Apple-like scroll reveals works smoothly */
.reveal {
  opacity: 0;
  transform: translateY(40px);
}

/* =========================================================================
   Responsive Design
   ========================================================================= */
@media (max-width: 992px) {
  .display-lg {
    font-size: clamp(2rem, 4vw, 3rem);
  }
  
  .split-content,
  .product-card {
    grid-template-columns: 1fr;
  }
  
  .split-content {
    gap: 32px;
  }
  
  .product-card {
    flex-direction: column;
  }
}

@media (max-width: 768px) {
  nav {
    padding: 16px 24px;
  }
  
  .mobile-menu-btn {
    display: block;
  }

  .nav-links {
    position: fixed;
    top: 72px; 
    left: 0; 
    right: 0;
    height: calc(100vh - 72px);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 32px 24px;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  .nav-links.active {
    transform: translateX(0);
  }
  
  .nav-link-main {
    color: #1a1a1a;
    font-size: 1.5rem;
    padding: 16px 0;
    width: 100%;
    border-bottom: 1px solid rgba(0,0,0,0.1);
  }

  /* Make hover dropdowns block for mobile */
  .mega-menu {
    position: relative;
    top: 0;
    transform: none;
    background: transparent;
    border: none;
    box-shadow: none;
    display: none;
    opacity: 1;
    visibility: visible;
  }
  
  /* On mobile, if a trigger has class "expanded", show its mega-menu */
  .nav-item.expanded .mega-menu {
    display: block;
    height: auto;
  }
  
  .mega-container {
    flex-direction: column;
    gap: 32px;
    padding: 16px 0;
  }
  .mega-products {
    flex-direction: column;
    gap: 24px;
  }
  .mega-utilities {
    border-left: none;
    border-top: 1px solid rgba(0,0,0,0.1);
    padding-left: 0;
    padding-top: 24px;
  }
  .mega-product-card img {
      height: 80px;
  }
  
  .hero-content {
    padding: 0 16px;
  }
  
  .tech-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .product-card[style*="display: grid"] {
    display: flex !important;
    flex-direction: column-reverse;
  }
}
