/* style.css - Main Stylesheet */
:root {
  --bg-color: #f5f5f5;
  /* Light grey base from design */
  --header-bg: #c8e6c9;
  /* Light green base */
  --text-main: #333333;
  --text-light: #ffffff;
  --font-family: 'Nunito', sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-main);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Base utility for smooth hidden scrollbar while keeping functionality */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.4);
}

#app {
  width: 100%;
}

/* Typography & General */
h1,
h2,
h3 {
  text-transform: uppercase;
  font-weight: 900;
}

/* Hero Section */
.hero {
  position: relative;
  background-color: var(--header-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
  padding: 12vh 2rem 2rem;
}

.hero-statement {
  position: relative;
  z-index: 60;
  /* Above the eyes */
  text-align: center;
  max-width: 1200px;
  margin: 0 auto;
}

.hero-statement-text {
  font-size: clamp(2rem, 5vw, 4rem);
  color: #1b5e20;
  /* Dark green as requested */
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 900;
  text-transform: uppercase;
  text-shadow: 2px 2px 0px rgba(255, 255, 255, 0.3);
}

/* Interactive Eyes */
.eyes-wrapper {
  position: fixed;
  /* Place eyes lower in the screen */
  top: 70%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 20px;
  z-index: 50;
  /* Above grid, below product view */
  pointer-events: none;
  /* Let clicks pass through to grid */
  /* We will handle the scroll positioning entirely via GSAP now since they start centered */
  filter: drop-shadow(0px 10px 15px rgba(0, 0, 0, 0.4));
}

.eyes-container {
  display: flex;
  gap: 20px;
  /* Kept tight relative to massive size */
}

.eye {
  width: 500px;
  /* 10x original 50px */
  height: 500px;
  background-color: #fff;
  border-radius: 50%;
  position: relative;
  border: 3px solid #000;
  /* Keeping thin contour as requested */
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 10px 10px 0px rgba(0, 0, 0, 0.15);
}

.pupil {
  width: 200px;
  /* 10x original 20px */
  height: 200px;
  background-color: #000;
  border-radius: 50%;
  position: absolute;
}

/* Portfolio Grid - Mobile First Base */
.portfolio-grid {
  display: grid;
  grid-template-columns: 1fr;
  grid-auto-rows: 100vw; /* Keep them roughly square on mobile */
  grid-auto-flow: dense;
  gap: 20px;
  padding: 20px;
  max-width: 1600px;
  margin: 0 auto;
  background: var(--bg-color);
}

.grid-item {
  position: relative;
  border-radius: 0;
  overflow: hidden;
  cursor: pointer;
  background: #eaeaea;
}

/* Responsive Grid Overrides */
@media (min-width: 768px) {
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 50vw; /* Keeps standard cells somewhat square on tablet */
  }
  
  /* Selectively spanning items on Tablet to keep it interesting */
  .grid-item:nth-child(1) { grid-column: span 2; grid-row: span 2; }
  .grid-item:nth-child(5) { grid-column: span 2; grid-row: span 1; }
  .grid-item:nth-child(6) { grid-column: span 2; grid-row: span 2; }
  .grid-item:nth-child(9) { grid-column: span 2; }
}

@media (min-width: 1024px) {
  .portfolio-grid {
    grid-template-columns: repeat(4, 1fr);
    /* Adjust row height so a span 2 is roughly a square or landscape 
       depending on the cell width (which is ~25vw) */
    grid-auto-rows: calc((100vw - 100px) / 4);
    max-height: none;
  }
  /* Limit max row height so it doesn't get ridiculously large on ultra-wide */
  @media (min-width: 1600px) {
     .portfolio-grid { grid-auto-rows: 375px; }
  }

  /* Exact Desktop Layout replicating the provided design image */
  .grid-item:nth-child(1) { grid-column: span 2; grid-row: span 2; } /* Stacheln */
  .grid-item:nth-child(2) { grid-column: span 1; grid-row: span 2; } /* Bottles */
  .grid-item:nth-child(3) { grid-column: span 1; grid-row: span 1; } /* Blue boxes */
  .grid-item:nth-child(4) { grid-column: span 1; grid-row: span 1; } /* SAUZIPF */
  .grid-item:nth-child(5) { grid-column: span 2; grid-row: span 1; } /* Frischling */
  .grid-item:nth-child(6) { grid-column: span 2; grid-row: span 2; } /* Löffel */
  .grid-item:nth-child(7) { grid-column: span 1; grid-row: span 1; } /* STOAK */
  .grid-item:nth-child(8) { grid-column: span 1; grid-row: span 1; } /* Eye */
  .grid-item:nth-child(9) { grid-column: span 2; grid-row: span 1; } /* Alice */
  .grid-item:nth-child(10) { grid-column: span 1; grid-row: span 1; } /* BUNT WELT */
  .grid-item:nth-child(11) { grid-column: span 1; grid-row: span 1; } /* LEHNER */
}

.grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), filter 0.6s ease;
  filter: grayscale(80%);
}

.grid-item:hover img {
  transform: scale(1.05);
  filter: grayscale(0%);
}

.grid-item-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.4s ease;
  display: flex;
  align-items: flex-end;
  padding: 2rem;
}

.grid-item:hover .grid-item-overlay {
  opacity: 1;
}

.grid-item-text {
  color: white;
  font-size: 1.2rem;
  font-weight: 900;
  transform: translateY(20px);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.grid-item:hover .grid-item-text {
  transform: translateY(0);
}

/* Product View */
.product-view {
  position: fixed;
  inset: 0;
  background-color: var(--bg-color);
  z-index: 100;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  /* Handled by GSAP */
  display: flex;
  flex-direction: column;
}

.product-view.active {
  pointer-events: all;
  opacity: 1;
}

.product-view-header {
  padding: 2rem;
  position: sticky;
  top: 0;
  z-index: 101;
  background: linear-gradient(to bottom, var(--bg-color) 70%, transparent);
}

.back-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-main);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.back-btn:hover {
  opacity: 0.6;
  transform: translateX(-5px);
}

.product-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0 2rem 6rem;
  max-width: 1400px;
  margin: 0 auto;
  gap: 4rem;
}

@media(min-width: 900px) {
  .product-content {
    flex-direction: row;
    align-items: flex-start;
  }

  .product-info-sticky {
    position: sticky;
    top: 100px;
    /* Keep it in view as gallery scrolls only on desktop */
  }
}

.product-info-sticky {
  flex: 1;
  padding-top: 2rem;
  /* position: relative by default, scrolls naturally on mobile/tablet */
}

.product-title {
  font-size: 3.5rem;
  /* Make it a bit larger */
  margin-bottom: 1.5rem;
  color: var(--text-main);
}

.product-desc {
  font-size: 1.2rem;
  line-height: 1.6;
  color: #555;
}

.product-image-gallery {
  flex: 2;
  /* Give gallery more space */
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.product-image-wrapper {
  border-radius: 0;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.product-image-wrapper img,
.product-image-wrapper video {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--header-bg);
  color: white;
  border: none;
  box-shadow: 0 10px 20px rgba(200, 230, 201, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 102;
  opacity: 0;
  pointer-events: none;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: all;
}

.back-to-top:hover {
  transform: translateY(-8px) scale(1.1);
}

/* Footer Section */
.site-footer {
  background-color: #c8e6c9;
  color: #000000;
  padding: 4rem 2rem;
  margin-top: 4rem;
  border-radius: 0;
  /* Remove rounded tops */
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  text-align: center;
}

.footer-content p {
  font-size: 1rem;
  color: #000000;
}

.footer-links {
  display: flex;
  gap: 2rem;
}

.footer-links a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
}

.footer-links a:hover {
  color: var(--header-bg);
}

@media(min-width: 768px) {
  .footer-content {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

/* Responsive Overrides */
@media (max-width: 768px) {
  .hero-statement-text {
    font-size: 2.5rem;
  }

  .portfolio-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    grid-auto-rows: 200px;
  }

  .eye {
    width: 250px;
    height: 250px;
  }

  .pupil {
    width: 100px;
    height: 100px;
  }
}

/* Navigation & Hamburger Menu */
.main-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
  pointer-events: none;
  /* Let clicks pass through empty space */
  transition: padding 0.4s ease, background-color 0.4s ease, box-shadow 0.4s ease;
}

.main-nav.nav-scrolled {
  background-color: var(--header-bg);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  padding: 1.5rem 2rem; /* Etwas schmaler beim Scrollen */
}

.nav-logo {
  font-size: 1.8rem;
  font-weight: 900;
  pointer-events: auto;
  color: var(--text-main);
  text-decoration: none;
  letter-spacing: -0.05em;
  transition: opacity 0.3s ease;
}

.nav-logo:hover {
  opacity: 0.7;
}

.menu-toggle {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: auto;
  z-index: 1001;
  padding: 10px;
}

.hamburger-line {
  display: block;
  width: 30px;
  height: 3px;
  background-color: var(--text-main);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease, background-color 0.4s ease;
}

/* Toggle active state */
.menu-toggle.active .hamburger-line:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
  background-color: var(--text-light);
}

.menu-toggle.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active .hamburger-line:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
  background-color: var(--text-light);
}

/* Side Menu Panel */
.side-menu {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  height: 100vh;
  background-color: var(--text-main);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateX(100%);
  transition: transform 0.6s cubic-bezier(0.77, 0, 0.175, 1);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5);
}

.side-menu.menu-open {
  transform: translateX(0);
}

.menu-links {
  display: flex;
  flex-direction: column;
  text-align: center;
  gap: 2rem;
}

.menu-links a {
  color: var(--text-light);
  text-decoration: none;
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 900;
  text-transform: uppercase;
  transition: color 0.3s ease, transform 0.3s ease;
  position: relative;
  display: inline-block;
}

.menu-links a:hover {
  color: var(--header-bg);
  transform: scale(1.05);
}

/* Desktop Sidebar Width */
@media(min-width: 768px) {
  .side-menu {
    width: 450px;
  }
}