:root {
  --font-primary: "BDO Grotesk", sans-serif;
  --color-bg: #ffffff;
  --color-text: #0f0e0f;
  --container-max-width: 100%;
  --grid-gap: 0;
  --nav-font-weight-normal: 400;
  --nav-font-weight-active: 900;
  --nav-height: 0rem;
  --icon-stroke-width: 2px;
  --icon-size-standard: 28px;
  --icon-size-small: 24px;
  --section-min-height: 100vh;
  --pill-shape-padding: 0.25rem 1rem 0.25rem 1rem;
}

/* Custom font loading */
@font-face {
  font-family: "BDO Grotesk";
  src: url("/public/fonts/BDOGrotesk-VF.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Base Styles */
html {
  scroll-behavior: smooth;
  height: 100%;
  scroll-padding-top: var(--nav-height);
  overflow-x: hidden;
  width: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

body {
  font-family: var(--font-primary);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.2;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100%;
  height: 100%;
  overflow-x: hidden;
  position: relative;
  width: 100%;
  max-width: 100vw;
}

.section.blur {
  filter: blur(5px);
  transition: filter 0.3s ease;
  pointer-events: none;
}

/* Main content scroll container */
.scroll-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  max-width: 100vw;
}

/* Project Grid */
.project-page {
  background-color: var(--color-bg);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--grid-gap);
  width: 100%;
  margin-top: 0;
  padding-top: 0;
}

.project-card {
  position: relative;
  aspect-ratio: 1/1.1;
  overflow: hidden;
  background: transparent;
  cursor: pointer;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.project-card.hidden {
  opacity: 0;
  visibility: hidden;
  position: absolute;
  pointer-events: none;
}

.project-card img,
.project-card video.cover-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.2s ease-in-out;
}

.project-card:hover img,
.project-card:hover video.cover-video {
  filter: grayscale(0%);
}

.project-link {
  display: block;
  width: 100%;
  height: 100%;
}

/* Project Hover Title - Completely revised */
.project-hover-title {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  font-family: var(--font-primary);
  font-weight: 500;
  font-size: 1.1rem;
  padding: var(--pill-shape-padding);
  color: white;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 999px;
  opacity: 0;
  visibility: hidden;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
  transform: translate(15px, -15px);
  will-change: transform, opacity;
  transition: opacity 0.18s ease, visibility 0.18s ease;
  top: 0;
  left: 0;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.project-hover-title.visible {
  opacity: 1;
  visibility: visible;
}

/* Sections */
.section {
  position: relative;
  width: 100%;
  min-height: var(--section-min-height);
}

.section-container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  height: 100%;
  width: 100%;
}

.section-content {
  width: 100%;
}

/* About Section */
#about {
  background-color: var(--color-bg);
}

.about-content {
  display: flex;
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  overflow: hidden;
}

.about-text {
  width: 50%;
  padding: 6rem 4rem;
  font-family: var(--font-primary);
  font-weight: 350;
  font-size: clamp(1rem, 3vw, 2rem);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.about-text p + p {
  margin-top: 2rem;
}

.about-image {
  position: relative;
  width: 50%;
  max-height: 100vh;
  padding: 0;
  margin: 0;
  overflow: hidden;
}

.about-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: filter 0.3s ease;
}

/* Contact Section */
.contact-link {
  font-family: var(--font-primary);
  color: var(--color-text);
  transition: all 0.3s ease;
  text-decoration: underline;
  text-underline-offset: 0.1em;
  text-decoration-thickness: 0.05em;
  display: inline-block;
  width: fit-content;
  margin: 1rem auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.contact-link:hover {
  font-weight: 900;
}

/* Loading States */
.loading {
  position: relative;
  background: #f0f0f0;
}

.loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* OJS Logo Container styles */
.ojs-logo-container {
  position: absolute;
  top: auto;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: 90vh;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 5;
  pointer-events: auto;
  cursor: pointer;
  will-change: transform, bottom, left;
  transition: bottom 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.ojs-logo {
  font-family: var(--font-primary);
  font-weight: 900;
  color: var(--color-bg);
  transition: font-size 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: font-size;
  text-align: center;
  user-select: none;
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
}

.distortion-text {
  display: inline-block;
  white-space: nowrap;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(2.5);
  transform-origin: center center;
  z-index: 10;
  will-change: transform, filter;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
}

/* Video styling */
.cover-video {
  object-fit: cover;
  width: 100%;
  height: 100%;
  display: block;
}

.grid-video-item video {
  object-fit: cover;
  width: 100%;
  height: 100%;
  display: block;
}

.video-item video {
  object-fit: cover;
  width: 100%;
  height: 100%;
  display: block;
}

/* Gallery items with videos */
.gallery-item.video-item {
  grid-column: 1 / -1; /* Full span by default */
}

.gallery-item.video-item.center-last {
  grid-column: 1 / -1;
  width: 50%;
  justify-self: center;
}

/* Imprint footer styling */

.imprint-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  margin: auto;
  margin-top: 3rem;
  margin-bottom: 2rem;
  font-size: 0.9rem;
  text-align: center;
  font-family: var(--font-primary);
  color: var(--color-bg);
}

.imprint-footer a {
  color: var(--color-text) !important;
  text-decoration: none;
  border-bottom: none;
  transition: opacity 0.3s ease;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .nav-list {
    gap: 1rem;
  }
}

@media (max-width: 768px) {
  :root {
    --icon-size-standard: 24px;
    --icon-size-small: 20px;
  }

  .nav {
    padding: 0 1rem;
    margin-top: 0.5rem;
  }

  .nav-list {
    gap: 1.5rem;
    padding: 0.5rem 0.5rem;
  }

  .nav-link {
    font-size: 2rem;
    padding: 0.4rem 0rem;
  }

  .nav-link-container {
    padding: 0.3rem;
  }

  .section-header {
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 0.5rem 1rem;
    gap: 2rem;
  }

  .filter-buttons {
    gap: 1rem;
  }

  .filter-btn {
    font-size: 0.6rem;
    border: 1px solid var(--color-bg);
  }

  .project-grid {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .project-card {
    aspect-ratio: 2/2.5;
    width: 100%;
    margin-bottom: 1rem;
  }

  .project-card img,
  .project-card video.cover-video {
    width: 100%;
    filter: grayscale(0%);
  }

  .about-content {
    flex-direction: column;
  }

  .about-text {
    width: 100%;
    padding: 6rem 2rem 5rem;
    font-size: 1.25rem;
  }

  .about-image {
    width: 100%;
    height: auto;
  }

  .ojs-logo-container {
    height: 80vh;
    bottom: 0;
  }

  .distortion-text {
    top: 65%;
    transform: translate(-50%, -50%) scale(3);
  }

  .ojs-logo-container.fixed {
    top: 8px;
    left: 8px;
  }

  .ojs-logo-container.fixed .ojs-logo {
    font-size: 24px;
  }

  /* Mobile video styling */
  .gallery-item.video-item.center-last {
    width: 100%; /* Full width on mobile */
  }

  /* Hide hover title on mobile */
  .project-hover-title {
    display: none;
  }
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #0f0e0f;
    --color-text: #ffffff;
  }
}
