/* =========================
   Base Reset
   ========================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

button:focus,
button:focus-visible,
.project-card:focus,
.project-card:focus-visible,
a:focus,
a:focus-visible {
  outline: none;
}

body {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-weight: 400;
  letter-spacing: 0.2px;
  font-style: normal;
  font-display: swap;
  background: black;
  color: white;
  overflow-x: hidden;
}

button {
  font-family: inherit;
}

[data-text-key] {
  white-space: pre-wrap;
  word-break: break-word;
}

/* =========================
   Background Video Layer (Future-Proof)
   ========================= */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;               /* Always bottom */
  overflow: hidden;
  pointer-events: none;      /* Never block UI */
}

.background-video {
  position: absolute;       /* Inside bg-layer */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* About page video correction */
.about-page .background-video {
  filter:
    saturate(0.35)
    brightness(0.55)
    contrast(1.05);
}


body > *:not(.bg-layer) {
  position: relative;
  z-index: 1;
}

.page-content {
  position: relative;
  z-index: 1;
}

:root {
  --blur-x: -40px;
  --blur-y: 30px;
  --project-thumb-width: clamp(150px, 18vw, 240px);
  --project-gap: 24px;
  --transition-fast: 0.2s;
  --transition-medium: 0.4s;
  --transition-page: 0.8s;
}

/* =========================
   DVD Page Menu
   ========================= */
.menu-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  gap: clamp(30px, 3vh, 42px);

}

.menu-button {
  font-family: "Garamond", "Palatino Linotype", Palatino, serif;
  background: none;
  border: none;
  color: white;
  font-size: clamp(20px, 2.5vw, 48px);
  font-style: italic;
  text-transform: lowercase;
  cursor: pointer;
  transition: transform var(--transition-fast) ease;
  text-shadow: 0 0 2px rgba(255,255,255,0.2);
  text-decoration: none;
}

.menu-button:hover {
  transform: scale(1.06);
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
}

.menu-button.active,
.project-card.active {
  transform: scale(1.08);
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
}

.menu-spacer {
  height: 40px;
}

.page-content {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.title-block {
  height: 40vh;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
}

.title-stack {
  position: relative;
  display: inline-block;
}

/* Base title styling */
.title-name {
  font-family: "IM Fell DW Pica", serif;
  font-size: clamp(36px, 6vw, 84px);
  letter-spacing: 0.03em;
  white-space: nowrap;
  max-width: 100vw;
}

/* Blur layer */
.title-name.blur {
  position: absolute;
  top: 0;
  left: 0;

  transform: translate(var(--blur-x), var(--blur-y));

  filter: blur(8px);
  opacity: 0.6;

  z-index: 0;
}

/* Name staggering */
.first-name {
  display: inline-block;
  transform: translateY(-4%);
}

.last-name {
  display: inline-block;
  margin-left: 0em;
  transform: translateY(4%);
  position: relative;
}

/* "Editor" label */
.title-sub {
  position: absolute;
  right: 0;
  bottom: -0.3em;

  font-family: "IM Fell DW Pica", serif;
  font-size: clamp(12px, 1.5vw, 22px);
  letter-spacing: 0.11em;
  white-space: nowrap;

  opacity: 0.85;
}

.page-content,
.about-container,
.menu-container,
.title-block {
  transition: opacity var(--transition-page) ease;
}

body.is-transitioning .page-content,
body.is-transitioning .about-container,
body.is-transitioning .menu-container,
body.is-transitioning .content-layer,
body.is-transitioning .carousel {
  opacity: 0;
}

/* =========================
   Carousel & Videos
   ========================= */
.carousel {
  height: 100vh;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scroll-padding-top: 0;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: none;
}

.carousel-section {
  height: 100vh;
  width: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.video-container {
  width: 100%;
  max-width: 900px;
  aspect-ratio: 16 / 9;
  background: black;
  display: flex;
  justify-content: center;
  align-items: center;
}

.video-frame {
  width: 100%;
  height: 100%;
  border: none;
  display: block;

  opacity: 1;
  visibility: visible;
  transition: opacity 0.4s ease;
}

.video-meta {
  width: 100%;
  max-width: 900px;
  padding: 16px 8px 0 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.video-title {
  font-size: 18px;
  letter-spacing: 0.5px;
}

.video-category {
  font-size: 11px;
  opacity: 0.5;
  letter-spacing: 0.6px;
}

.video-description {
  font-size: 14px;
  opacity: 0.7;
  line-height: 1.4;
  white-space: pre-wrap;
}

/* =========================
   Project Layout
   ========================= */

.project-list {
  padding: 80px 60px;
  display: flex;
  flex-direction: column;
  gap: var(--project-gap);
}

.project-card {
  display: flex;
  gap: var(--project-gap);
  align-items: flex-start;
  cursor: pointer;
  transition:
    transform var(--transition-fast) ease,
    opacity var(--transition-fast) ease;
  width: 100%;
  max-width: 100%;
}

.project-card:hover {
  transform: scale(1.015);
}

.project-card:active {
  transform: scale(1.03);
}

.project-thumbnail {
  flex: 0 0 var(--project-thumb-width);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: hidden;
}

.project-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-info {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  white-space: normal; /* wrap titles & descriptions */
}

.project-title {
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
  margin-bottom: 4px;
}

.project-title span {
  display: inline-block;
}

.project-title.scrolling span {
  animation: title-scroll 4s ease-in-out infinite alternate;
}

@keyframes title-scroll {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(calc(-1 * var(--overflow)));
  }
}

.project-description {
  font-size: 0.6rem;
  line-height: 1.3;
  opacity: 0.7;
  margin-bottom: 6px;
  font-style: italic;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-runtime {
  font-size: 0.75rem;
  opacity: 0.5;
}

/* =========================
   About Page
   ========================= */

/* Fullscreen centered menu pages */
.language-page .menu-container,
.special-page .menu-container {
  min-height: 100vh;
}

.about-container {
  max-width: 700px;
  margin: 0 auto;
  padding: 120px 20px 80px 20px;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.about-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

.about-text {
  font-size: 14px;
}
/* About text: preserve line breaks from translations */
.about-text p,
.about-text span,
.about-text div {
  line-height: 1.4;       /* optional, improves readability */
}

.about-image {
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.about-image img {
  width: 100%;
  max-width: 320px;
  height: auto;
  object-fit: contain;
}

.about-links {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 20px;
}

/* =========================
   Collage / BTS
   ========================= */
.bts-page {
  background: black;
  overflow-x: hidden;
}

.collage-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.content-layer {
  position: relative;
  z-index: 1;
}

.collage-item {
  position: absolute;
  width: 180px;
  height: auto;
  opacity: 0.9;
  image-rendering: auto;
}

.collage-item:nth-child(1) {
  top: 10%;
  left: 5%;
}

.collage-item:nth-child(2) {
  top: 40%;
  right: 10%;
  transform: rotate(-4deg);
}

.collage-item:nth-child(3) {
  bottom: 15%;
  left: 30%;
}

/* =========================
   Other / Utility
   ========================= */
@media (max-width: 768px) {
  .chapter-nav {
    display: none;
  }
}

@keyframes spin {
  to { transform: rotate(360deg); }
} 

@media (max-width: 768px) {
  .about-top {
    grid-template-columns: 1fr;
  }

  .about-image img {
    max-width: 70vw;
  }

@media (max-width: 768px) {

  .project-list {
    padding: 24px 12px;
  }

  .project-card {
    gap: 12px;
  }

  :root {
    --project-thumb-width: 110px;
  }

  .project-title {
    font-size: 0.85rem;
  }

  .project-description {
    font-size: 0.55rem;
  }

  .project-runtime {
    font-size: 0.65rem;
  }
}

}