/* ==========================================================================
   Fullscreen Menu
   ========================================================================== */

/* Menu Container - Fixed Fullscreen */
.menu {
  position: fixed;
  inset: 0;
  z-index: 99;
  pointer-events: none;
  visibility: hidden;
  display: flex;
  flex-direction: column;
}

.menu.is-open {
  pointer-events: auto;
  visibility: visible;
}

/* Backdrop - Blur + 50% Schwarz - animiert BEIDES gleichzeitig */
.menu__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  transition: background 0.4s ease, backdrop-filter 0.4s ease, -webkit-backdrop-filter 0.4s ease;
}

.menu.is-open .menu__backdrop {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* Scrollable Content */
.menu__content {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 1;
  overflow-y: scroll;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding: var(--space-4xl) var(--space-2xl);
  padding-bottom: var(--space-5xl);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xl);
  opacity: 0;
  transition: opacity 0.4s ease;
  /* Firefox Scrollbar */
  scrollbar-width: thin;
  scrollbar-color: var(--color-gold) transparent;
  /* 3D Perspective für Tilt-Effekt */
  perspective: 1000px;
}

.menu.is-open .menu__content {
  opacity: 1;
}

/* Scrollbar wie auf Hauptseite - 6px Gold */
.menu__content::-webkit-scrollbar {
  width: 6px;
}
.menu__content::-webkit-scrollbar-track {
  background: transparent;
}
.menu__content::-webkit-scrollbar-thumb {
  background: var(--color-gold);
  border-radius: 3px;
}

/* ==========================================================================
   Header - Logo + Name
   ========================================================================== */

.menu__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

.menu__logo {
  width: clamp(60px, 5vw, 80px);
  height: auto;
}

.menu__name {
  width: clamp(280px, 45vw, 700px);
  height: auto;
}

/* Slogan - wie im Hero */
.menu__slogan {
  font-family: var(--font-body);
  font-size: var(--fs-md);
  color: var(--color-gold);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* ==========================================================================
   Navigation Grid 2x3
   ========================================================================== */

.menu__nav {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  width: 100%;
  max-width: 700px;
}

/* Last link centered when alone in row (odd count) */
.menu__nav .menu__link:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  width: calc(50% - var(--space-md) / 2);
  justify-self: center;
}

/* Links - wie Contact-Buttons */
.menu__link {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: clamp(1.2rem, 2vw, 1.6rem);  /* Contact-Button Match */
  color: var(--color-gold);
  text-decoration: none;
  border: 2px solid var(--color-gold);
  padding: var(--space-sm) var(--space-lg);  /* Contact-Button Match */
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: background 0.3s ease, color 0.3s ease;
}

.menu__link:hover {
  background: var(--color-gold);
  color: var(--color-black);
}

.menu__link--disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* ==========================================================================
   Section Title - "WORK"
   ========================================================================== */

.menu__section-title {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  color: var(--color-gold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: var(--space-xl);
}

/* ==========================================================================
   Project Grid - Desktop: 3 Spalten
   ========================================================================== */

.menu__projects {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  width: 100%;
  max-width: 1200px;
  isolation: isolate;  /* Für z-index beim Hover */
}

/* Project Card - große Ecken, Hover mit Scale + Shadow + 3D Tilt */
.menu__project {
  position: relative;
  aspect-ratio: 9 / 16;
  border-radius: 64px;
  overflow: hidden;
  text-decoration: none;
  transition: box-shadow 0.2s ease, z-index 0s;
  will-change: transform;
  transform-style: preserve-3d;
}

.menu__project:hover {
  /* Scale wird via GSAP gemacht (wegen Parallax-Konflikt) */
  z-index: 10;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
}

.menu__project video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Gradient-Overlay - Schatten nach oben */
.menu__project-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.85) 0%,
    rgba(0, 0, 0, 0.5) 40%,
    rgba(0, 0, 0, 0.1) 70%,
    rgba(0, 0, 0, 0) 100%
  );
  transition: background 0.3s ease;
}

.menu__project:hover .menu__project-overlay {
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.7) 0%,
    rgba(0, 0, 0, 0.3) 40%,
    rgba(0, 0, 0, 0) 70%,
    rgba(0, 0, 0, 0) 100%
  );
}

/* Content - unten linksbündig */
.menu__project-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  text-align: left;
  padding: var(--space-lg);
  padding-bottom: var(--space-xl);
  gap: var(--space-2xs);
}

/* Kompakt: Number, Client, Skills versteckt */
.menu__project-number,
.menu__project-client,
.menu__project-skills {
  display: none;
}

/* Title - GOLD, groß, prominent */
.menu__project-title {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.5vw, 1.8rem);
  color: var(--color-gold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.1;
}

/* Year - GOLD, groß und prominent */
.menu__project-year {
  font-family: var(--font-body);
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  color: var(--color-gold);
  letter-spacing: 0.1em;
  opacity: 0.9;
}

/* ==========================================================================
   Icon Row (wie Hero)
   ========================================================================== */

.menu__icons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-xl) 0;
  margin-bottom: var(--space-2xl);
}

.menu__icons img {
  height: clamp(30px, 3vw, 45px);
  width: auto;
}

/* Rating Box ist breiter - wie im Hero */
.menu__icons img:last-child {
  height: clamp(25px, 2.5vw, 35px);
}

/* ==========================================================================
   Responsive - Tablet (max 1200px)
   ========================================================================== */

@media (max-width: 1200px) {
  .menu__project {
    border-radius: 48px;
  }
}

/* ==========================================================================
   Responsive - Mobile (max 1024px): 2 Spalten mit Anschnitt
   ========================================================================== */

@media (max-width: 1024px) {
  .menu__content {
    padding: var(--space-3xl) var(--space-md);
    align-items: center;
  }

  .menu__header,
  .menu__slogan,
  .menu__nav,
  .menu__section-title,
  .menu__icons {
    align-self: center;
  }

  /* Projekte: 2 Spalten, schmaler als Buttons */
  .menu__projects {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    width: calc(100% - var(--space-3xl));
    max-width: calc(100% - var(--space-3xl));
  }

  .menu__project {
    border-radius: 32px;
  }

  /* Mobile: Mehr Padding für Alignment mit Buttons */
  .menu__project-content {
    padding: var(--space-lg) var(--space-md);
  }

  .menu__nav {
    max-width: 100%;
  }
}

/* ==========================================================================
   Responsive - Small Mobile (max 768px)
   ========================================================================== */

@media (max-width: 768px) {
  .menu__content {
    padding: var(--space-2xl) var(--space-sm);
    gap: var(--space-lg);
  }

  .menu__projects {
    width: calc(100% - var(--space-2xl));
    max-width: calc(100% - var(--space-2xl));
  }

  .menu__logo {
    width: 50px;
  }

  .menu__name {
    width: clamp(220px, 70vw, 350px);
  }

  .menu__slogan {
    font-size: var(--fs-base);
    letter-spacing: 0.1em;
  }

  .menu__nav {
    gap: var(--space-sm);
  }

  .menu__link {
    font-size: var(--fs-base);
    padding: var(--space-sm) var(--space-md);
  }

  .menu__project {
    border-radius: 24px;
  }

  .menu__icons {
    gap: var(--space-md);
  }

  .menu__icons img {
    height: 28px;
  }

  .menu__icons img:last-child {
    height: 22px;
  }
}

/* ==========================================================================
   Responsive - Very Small Mobile (max 480px)
   ========================================================================== */

@media (max-width: 480px) {
  .menu__content {
    padding: var(--space-xl) var(--space-xs);
  }

  .menu__projects {
    width: calc(100% - var(--space-xl));
    max-width: calc(100% - var(--space-xl));
  }

  .menu__name {
    width: 85vw;
    max-width: 300px;
  }

  .menu__slogan {
    font-size: var(--fs-sm);
    letter-spacing: 0.05em;
  }

  .menu__nav {
    grid-template-columns: 1fr;
    width: 90%;
  }

  /* Reset last link width on mobile (1 column) */
  .menu__nav .menu__link:last-child:nth-child(odd) {
    width: 100%;
  }

  .menu__link {
    font-size: var(--fs-base);
  }

  .menu__project {
    border-radius: 20px;
  }

  .menu__project-title {
    font-size: clamp(0.75rem, 3vw, 0.9rem);
  }

  .menu__project-year {
    font-size: clamp(1rem, 4vw, 1.2rem);
  }

  .menu__icons img {
    height: 24px;
  }

  .menu__icons img:last-child {
    height: 18px;
  }
}

/* ==========================================================================
   Animation Initial States (for GSAP)
   ========================================================================== */

/* Elemente starten unsichtbar - GSAP animiert sie ein */
.menu__header,
.menu__slogan,
.menu__nav,
.menu__projects,
.menu__icons {
  opacity: 0;
  transform: translateY(30px);
}

/* Header braucht perspective für 3D Tilt */
.menu__header {
  transform-style: preserve-3d;
}
