/* Previous/Next Project Section */
.project-prevnext {
  width: 50vw;
  display: flex;
  flex-direction: column;
      justify-content: center;
}
.project-prevnext-inner {
  display: flex;
  flex-direction: column;
}
.project-prevnext-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
    width: 50vw;
    transition: scale 0.3s ease;
    justify-content: center;
}
.project-prevnext-block:hover {
  scale: 0.95;
}
.project-prevnext-block a{
  color: white;
  text-decoration: none;
}
.project-prevnext-img {
    width: 30vw;
    object-fit: cover;
    display: block;
    aspect-ratio: 16 / 9;
    margin: 5vw 5vw 0 5vw;
}
.project-prevnext-title {
  font-size: 1.5vw;
  font-weight: normal;
  padding-top: 1vw;

  margin-left: 5vw;
}
.project-prevnext-title a {
  color: var(--color-text);
  text-decoration: none;
  font-style: italic;
  transition: opacity 0.3s;
}
.project-prevnext-title a:hover {
  opacity: 0.6;
}
/* Model Viewer Exit Animation (wie Slider) */
.splash-screen model-viewer.modelviewer-exit {
  opacity: 0;
  transform: scale(0) translateY(30vh);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.4,0,0.2,1);
  pointer-events: none;
}
/* Vimeo Video in Galerie */
.project-vimeo {
  height: 100vh;
  width: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  pointer-events: none;
}

.project-vimeo iframe {
  height: 100vh;
  width: auto;
  aspect-ratio: 16/9;
  border: none;
  background: #000;
}
/* Font Face Declarations */
@font-face {
  font-family: 'EKRoumald';
  src: url('../fonts/EKRoumald-Roman.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'EKRoumald';
  src: url('../fonts/EKRoumald-Italic.otf') format('opentype');
  font-weight: normal;
  font-style: italic;
}

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Root Variables */
:root {
  --color-bg: black;
  --color-text: #FFFFFF;
  --color-overlay: #D9D9D9;
  --font-main: 'EKRoumald', serif;
}

/* Base Styles */
html {
  font-size: 1vw;
}

body {
  font-family: var(--font-main);
  background-color: var(--color-bg);
  color: var(--color-text);
  overflow: hidden;
}

/* Page Transitions */
body .main {
  opacity: 1;
  transition: opacity 0.1s ease;
  overflow-y: hidden;
}

.main {
  transition: opacity 0.1s ease;
}

body.page-transitioning-out .main {
  opacity: 0;
}

body.page-transitioning-in .main {
  opacity: 0;
  animation: fadeIn 0.1s ease forwards;
  background: var(--color-bg);
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

/* Crossfade Transition Overlay */
.page-transition-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 999;
  background-color: var(--color-bg);
  transition: opacity 0s ease;
  overflow: hidden;
}

/* Splash Screen / Startseite Animation */
.splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  cursor: pointer;
  transition: opacity 0.3s ease-out;
  mix-blend-mode: hard-light;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.splash-screen.fade-out {
  opacity: 0;
  pointer-events: none;
}

.splash-screen model-viewer {
  width: 100%;
  height: 120%;
  filter: contrast(0.9);
  --poster-color: transparent;
}

/* Header & Navigation */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  padding: 2vw 3vw;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
  background-color: transparent;
  mix-blend-mode: difference;
}
.rabbit-hole{
  mix-blend-mode: difference;
}
.header .logo {
  width: 10vw;
  min-width: 120px;
}

.header .logo img,
.header .logo svg {
  width: 100%;
  height: auto;
  display: block;
}
.main-nav{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  width: 100%;
}
.main-nav ul {
  list-style: none;
  display: flex;
  gap: 3vw;
  align-items: center;
}

.main-nav ul li:last-child {
  margin-left: 3vw;
}

.main-nav ul li {
  /* Fix: reserviere Platz für die breiteste Variante */
  flex: 0 0 auto;
  text-align: center;
  min-width: 4vw; /* Passe ggf. an die längsten Linktexte an */
}

.main-nav ul li a {
  font-size: 1.5vw;
  color: var(--color-text);
  text-decoration: none;
  transition: opacity 0.3s ease;
  /* Fix: reserviere Platz für italic */
  display: inline-block;
  min-width: 1em;
  position: relative;
}

.main-nav ul li a::after {
  content: attr(data-text);
  font-style: italic;
  visibility: hidden;
  position: absolute;
  left: 0;
  top: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

.main-nav ul li a:hover,
.main-nav ul li a[aria-current="page"] {
    font-style: italic;

}

/* Main Content */
.main {
  height: 100vh;
}

/* Home Page */
.home {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  width: 100vw;
  position: relative;
}

.home .intro {
  text-align: center;
  height: 100vh;
  width: 100vw;
}

.rabbit-hole {
  position: fixed;
  bottom: 3vw;
  right: 3vw;
  font-size: 1.5vw;
  font-style: italic;
  color: var(--color-text);
  text-decoration: none;
  transition: opacity 0.3s ease;
  z-index: 1000; /* erhöht, damit immer sichtbar */
  pointer-events: auto;
  opacity: 1 !important;
}
.rabbit-hole.exit {
  left: 3vw;
  right: unset;
}

.rabbit-hole .hover-text {
  display: none;
}

.rabbit-hole:hover .default-text {
  display: none;
}

.rabbit-hole:hover .hover-text {
  display: inline;
}

.rabbit-hole:hover {
  opacity: 0.6;
}

.rabbit-hole::after {
  content: ' →';
}
.rabbit-hole.exit::before {
  content: ' ←';
}
.rabbit-hole.exit::after {
  content: '';
}

/* Center Image on Home */
.home .center-image {
  background-color: var(--color-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
    height: 100vh;
  width: 100vw;
}

.home .center-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home .center-image h1 {
  font-size: 3vw;
  font-weight: normal;
  text-align: center;
}

/* Category & Project Grid */
.projects-grid-wrapper,
.index-grid-wrapper {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.projects-grid,
.index-grid {
  display: flex;
  width: max-content;
  height: 100vh;
  margin: 0;
  padding: 0;
  transition: transform 0.6s ease;
}

.project-card,
.index-item {
  position: relative;
  width: 25vw;
  min-width: 25vw;
  height: 100vh;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: width 0.5s ease, min-width 0.5s ease;
}

.projects-grid:has(.project-card:hover) .project-card:not(:hover),
.index-grid:has(.index-item:hover) .index-item:not(:hover) {
  width: calc((100vw - 30vw) / 3);
  min-width: calc((100vw - 30vw) / 3);
}

.project-card:hover,
.index-item:hover {
  width: 30vw;
  min-width: 30vw;
}

/* Shrink other cards when one is expanding */
.projects-grid:has(.project-card.expanding) .project-card:not(.expanding),
.index-grid:has(.index-item.expanding) .index-item:not(.expanding) {
  width: calc((100vw - 100vw) / 3);
  min-width: calc((100vw - 100vw) / 3);
  opacity: 0;
}

/* Expansion Animation for Project Cards */
.project-card.expanding,
.index-item.expanding {
  position: fixed;
  top: 0;
  left: var(--expand-left);
  width: var(--expand-width);
  min-width: var(--expand-width);
  height: 100vh;
  max-height: 100vh;
  z-index: 998;
  overflow: hidden;
}

.project-card.expanding {
  animation: expandAndSlide 0.3s cubic-bezier(0.4, 0.0, 0.2, 1) forwards;
}

.index-item.expanding {
  animation: expandAndSlide 0.3s cubic-bezier(0.4, 0.0, 0.2, 1) forwards;
}

@keyframes expandAndSlide {
  0% {
    left: var(--expand-left);
    width: var(--expand-width);
  }
  100% {
    left: 0;
    width: 100vw;
  }
}

.project-card.expanding::before,
.index-item.expanding::before {
  opacity: 1;
  height: 100vh;
  max-height: 100vh;
}

.project-card.expanding h3,
.project-card.expanding .subheadline,
.index-item.expanding h3,
.index-item.expanding .subheadline,
.index-item.expanding .category {
  opacity: 0;
  transition: opacity 0.4s ease;
}

/* Grid Navigation Arrows */
.grid-nav-arrow {
  position: fixed;
  bottom: 3vw;
  right: 3vw;
  font-size: 1.5vw;
  font-style: italic;
  color: var(--color-text);
  text-decoration: none;
  z-index: 1001;
  cursor: pointer;
  transition: opacity 0.3s ease;
  mix-blend-mode: difference;
}

.grid-nav-arrow:hover {
  opacity: 0.6;
}

.grid-nav-arrow.hidden {
  display: none;
}

/* Project Card Link Styling */
.project-card,
.index-item {
  text-decoration: none;
  color: inherit;
}


.project-card h3,
.index-item h3 {
  margin-top: calc(50vh - 4vw);
  width: 23vw;
}

.project-card::before,
.index-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: var(--cover-image);
  background-size: cover;
  background-position: center;
  z-index: 1;
}

.project-card::after,
.index-item::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--color-overlay);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 2;
}

.project-card h3,
.index-item h3 {
  position: relative;
  z-index: 3;
    font-size: 1.85vw;  
    font-weight: normal;
  text-transform: uppercase;
  line-height: 1;
  margin: 0;
  padding: 0 1vw 1vw 1vw;
  text-align: left;
}

.project-card .subheadline,
.index-item .subheadline {
  position: relative;
  z-index: 3;
  font-size: 1vw;
  font-weight: normal;
  line-height: 1.4;
  text-align: left;
  padding: 0 1vw 1vw 1vw;
  width: 23vw;
}

.index-item .category {
  position: relative;
  z-index: 3;
  font-size: 1.2vw;
  font-style: italic;
  margin-top: 1vw;
}

/* Navigation Arrows */
.project-navigation {
  position: fixed;
  bottom: 3vw;
  width: calc(100vw - 6vw);
  left: 3vw;
  display: flex;
  justify-content: space-between;
  font-size: 1.5vw;
  font-style: italic;
  z-index: 100;
  mix-blend-mode: difference;
}

.project-navigation a {
  color: var(--color-text);
  text-decoration: none;
  transition: opacity 0.3s ease;
  mix-blend-mode: difference;
}

.project-navigation a:hover {
  opacity: 0.6;
}

.project-navigation .prev::before {
  content: '← ';
  mix-blend-mode: difference;
}

.project-navigation .next::after {
  content: ' →';
  mix-blend-mode: difference;
}

/* Project Detail Page */
.project {
  padding: 0;
  position: relative;
  height: 100vh;
  overflow: hidden;
}

/* Fixed Info Text on Left Side */
.project-info-fixed {
  position: fixed;
  left: 3vw;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  max-width: 25vw;
  color: var(--color-text);
  mix-blend-mode: difference;
}

.project-info-fixed h1 {
  font-size: 1.85vw;
  font-weight: normal;
  text-transform: uppercase;
  margin-bottom: 1vw;
  line-height: 1;
}

.project-info-fixed .project-subline {
  font-size: 1vw;
  line-height: 1.4;
  margin-bottom: 2vw;
}

.project-info-fixed .project-info-text {
  font-size: 1vw;
  line-height: 1.4;
}

.project-info-fixed .project-info-text p {
  margin-bottom: 1vw;
}

/* Horizontal Scrolling Gallery */
.project-gallery-horizontal {
  display: flex;
  height: 100vh;
  overflow-x: scroll;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  transition: all 1s ease;
}

.project-gallery-horizontal::-webkit-scrollbar {
  display: none;
}

/* First image as full-width cover */
.project-first-image {
  width: 100vw;
  height: 100vh;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.project-gallery-horizontal > img {
  height: 100vh;
  width: auto;
  flex-shrink: 0;
  display: block;
}

/* About Page */
.about header,
.about .text {
  padding: 0 3vw;
  max-width: 60vw;
}

.about h1 {
  font-size: 3vw;
  font-weight: normal;
  margin-bottom: 2vw;
}

.about .text {
  font-size: 1.2vw;
  line-height: 1.6;
  margin-bottom: 3vw;
}

.about-images {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(30vw, 1fr));
  gap: 2vw;
  padding: 0 3vw;
}

.about-images img {
  width: 100%;
  height: auto;
  display: block;
}

/* Footer */
.footer {
  padding: 3vw;
  margin-top: 6vw;
  display: none;
}

.footer ul {
  list-style: none;
  display: flex;
  gap: 3vw;
  justify-content: center;
}

.footer ul li a {
  font-size: 1.2vw;
  color: var(--color-text);
  text-decoration: none;
  font-style: italic;
  transition: opacity 0.3s ease;
}

.footer ul li a:hover {
  opacity: 0.6;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .header .logo {
    width: 20vw;
    min-width: 80px;
  }
  
  .main-nav ul {
    gap: 4vw;
  }
  
  .main-nav ul li a {
    font-size: 3vw;
  }
  
  .projects-grid,
  .index-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .project-card h3,
  .index-item h3 {
    font-size: 4vw;
  }
  
  .project h1 {
    font-size: 6vw;
  }
  
  .project .text,
  .about .text {
    font-size: 3vw;
    max-width: 90vw;
  }
  
  .splash-screen img {
    width: 60vw;
    
  }
}

/* Home Page Slider */
.slider {
  position: fixed;
  inset: 0;
  background: var(--color-bg);
  overflow: hidden;
  touch-action: manipulation;
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 1;
}

.slider.loaded {
  opacity: 1;
}

.slide {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 0;
  will-change: transform;
  transition: transform 0.5s ease-in-out;
  transform-origin: 50% 50%;
  opacity: 0;
}

.slide img {
  max-width: 100vw;
  max-height: 100vh;
  width: auto;
  height: auto;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.slide.landscape {
  width: 100vw;
  height: 100vh;
}

.slide.landscape img {
  width: 100%;
  height: 100%;
  object-fit: cover !important;
}

.slide.active { 
  z-index: 2;
  opacity: 1;
}

.slide.next { 
  z-index: 1;
  opacity: 1;
}

.slide.nextnext { 
  z-index: 0;
  opacity: 1;
}

.slide.out {
  transform: scale(0);
  opacity: 1;
}
