/* ── Gallery Grid ── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.gallery-grid.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.gallery-grid .full-width {
  grid-column: 1 / -1;
}

.gallery-item {
  cursor: pointer;
  overflow: hidden;
  position: relative;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.2s;
}


/* Caption under gallery items (when visible below image) */
.gallery-item-caption {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--color-text-muted);
  padding: 0.4rem 0 0;
  text-align: center;
}

/* ── Section title in gallery ── */
.gallery-section-title {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin: 2rem 0 1rem;
  text-align: center;
}

.gallery-section-title:first-child {
  margin-top: 0;
}

/* ── Lightbox ── */
#lightbox {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(250, 249, 247, 0.97);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-lightbox);
}

#lightbox.open {
  opacity: 1;
  pointer-events: all;
}

#lb-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 90vw;
  max-height: 90dvh;
  transform: scale(0.94);
  transition: transform var(--transition-lightbox);
}

#lightbox.open #lb-figure {
  transform: scale(1);
}

#lb-img {
  max-width: 90vw;
  max-height: 80dvh;
  object-fit: contain;
  display: block;
}

#lb-video {
  max-width: 90vw;
  max-height: 80dvh;
  display: block;
}

.video-grid-item {
  cursor: pointer;
}

.video-grid-item video {
  pointer-events: none;
}

#lb-caption {
  margin-top: 0.75rem;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--color-text-muted);
  text-align: center;
  max-width: 60ch;
}

#lb-close {
  position: fixed;
  top: 1rem;
  right: 1.25rem;
  font-size: 2rem;
  line-height: 1;
  color: var(--color-text);
  z-index: 520;
  padding: 0.25rem 0.5rem;
  opacity: 0.6;
  transition: opacity 0.15s;
}

#lb-close:hover { opacity: 1; }

#lb-prev,
#lb-next {
  position: fixed;
  /* top is set dynamically by JS to center on the image */
  top: 50%;
  width: 18%;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 510;
  opacity: 0;
  transition: opacity 0.2s;
  background: transparent;
}

#lb-prev { left: 0; justify-content: flex-start; padding-left: 1rem; }
#lb-next { right: 0; justify-content: flex-end; padding-right: 1rem; }

#lightbox:hover #lb-prev,
#lightbox:hover #lb-next,
#lb-prev:focus,
#lb-next:focus {
  opacity: 1;
}

.arrow-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(250, 249, 247, 0.7);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  font-size: 1.5rem;
  color: var(--color-text);
  backdrop-filter: blur(4px);
}

#lb-prev:disabled .arrow-icon,
#lb-next:disabled .arrow-icon {
  opacity: 0.3;
}

/* ── Fine Art special layouts ── */
.fine-art-section {
  margin-bottom: 3rem;
}

.fine-art-section .screen-height-row {
  height: 80dvh;
}

.fine-art-title {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
  text-align: center;
}

/* Painting sketches: each image screen-height tall, 2 per row, pairs centered */
.painting-sketches .gallery-section-title {
  margin: 2rem 0 0.75rem;
  text-align: center;
}

.painting-sketches .gallery-section-title:first-child {
  margin-top: 0;
}

.painting-sketches .gallery-grid {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 0.75rem;
  height: calc((100dvh - var(--header-height)) * 0.8);
}

.painting-sketches .gallery-item {
  flex: 0 0 auto;
  height: 100%;
  display: flex;
  justify-content: center;
}

.painting-sketches .gallery-item img {
  height: 100%;
  width: auto;
  object-fit: unset;
  display: block;
}

@media (max-width: 768px) {
  .painting-sketches .gallery-grid {
    flex-direction: column;
    height: auto;
    align-items: center;
  }
  .painting-sketches .gallery-item {
    height: auto;
    width: 100%;
  }
  .painting-sketches .gallery-item img {
    height: auto;
    width: 100%;
  }
}

.screen-height-row {
  display: flex;
  gap: 0.75rem;
  height: calc(100dvh - var(--header-height) - 4rem);
  justify-content: center;
}

.screen-height-row .gallery-item {
  flex: 0 0 auto;
  height: 100%;
  min-width: 0;
  display: flex;
  justify-content: center;
}

.screen-height-row .gallery-item img {
  height: 100%;
  width: auto;
  display: block;
  object-fit: unset;
}

/* ── Full-height single image row (full width, height ≤ screen) ── */
.full-height-row {
  width: 100%;
}

.full-height-row .gallery-item {
  width: 100%;
}

.full-height-row .gallery-item img {
  width: 100%;
  max-height: 100dvh;
  object-fit: contain;
}

/* ── One-third width image, left-aligned ── */
.one-third-row {
  width: 100%;
  display: flex;
  justify-content: center;
}

.one-third-row .gallery-item {
  width: 33.333%;
}

.one-third-row .gallery-item img {
  width: 100%;
  display: block;
  object-fit: contain;
}

/* ── Centered single image row ── */
.centered-single-row {
  display: flex;
  justify-content: center;
}

.centered-single-row .gallery-item {
  max-width: 60%;
}

.centered-single-row .gallery-item img {
  width: 100%;
  max-height: calc(100dvh - var(--header-height) - 2rem);
  object-fit: contain;
}

/* ── Project list (Interactive, Character Design/Animation) ── */
.project-list-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100dvh - var(--header-height) - 4rem);
  width: 100%;
}

.project-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

/* Always stay in one row on landscape/wide screens */
.project-list.single-row {
  grid-template-columns: repeat(2, 1fr);
}

@media (orientation: portrait) {
  .project-list.single-row {
    grid-template-columns: 1fr;
  }
}

.project-card {
  cursor: pointer;
  text-decoration: none;
  display: block;
}

.project-card img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
  transition: opacity 0.2s;
}

.project-card-multi-thumb {
  display: flex;
  aspect-ratio: 16/9;
  overflow: hidden;
  gap: 0;
}

.project-card-multi-thumb img {
  flex: 1;
  width: 0;
  height: 100%;
  aspect-ratio: unset;
  object-fit: cover;
  transition: opacity 0.2s;
}


.project-card-name {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text);
  margin-top: 0.5rem;
}

/* ── Home page videos ── */
.home-videos {
  display: flex;
  gap: 0.75rem;
  height: calc(100dvh - var(--header-height) - 1rem);
  justify-content: center;
  align-items: stretch;
}

.home-video-link {
  display: block;
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
}

/* captain (first/left) gets ~35%, The Dusk (second/right) gets ~65% */
.home-video-link:first-child { flex: 7 1 0; }
.home-video-link:last-child  { flex: 13 1 0; }

.home-video-link video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

/* ── Project detail ── */
.project-detail-title {
  font-family: var(--font-ui);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 1.5rem;
  color: var(--color-text);
  text-align: center;
}

/* ── About page ── */
.about-wrapper {
  min-height: calc(100dvh - var(--header-height) - 8rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.about-content {
  max-width: min(52ch, 100%);
  margin: 0 auto;
}

.about-content p {
  margin-bottom: 1rem;
}

.about-content ul {
  margin: 0 0 1rem 1.25rem;
  padding: 0;
}

.about-content ul li {
  margin-bottom: 0.6rem;
  line-height: 1.65;
}

.about-links {
  margin: 2.5rem 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.about-links a {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--color-text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.about-social {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.about-social a {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--color-text-muted);
  text-decoration: none;
}

.about-social a:hover { color: var(--color-text); }

.about-social svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* ── Vimeo embed ── */
.vimeo-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100dvh - var(--header-height) - 4rem);
}

.vimeo-wrapper {
  height: 80dvh;
  aspect-ratio: 16 / 9;
  max-width: 100%;
}

.vimeo-wrapper iframe {
  width: 100%;
  height: 100%;
  border: none;
}

@media (max-width: 768px) {
  .vimeo-wrapper {
    height: auto;
    width: 98%;
    aspect-ratio: 16 / 9;
  }
}

/* ── Monochrolarmes layout ── */
/* Force 3 columns even on mobile */
.force-3col {
  grid-template-columns: repeat(3, 1fr) !important;
}

.mono-play-row {
  display: flex;
  justify-content: center;
  margin: 1.5rem 0;
}

.mono-play-btn {
  font-family: var(--font-ui);
  font-size: 1rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--color-text);
  border: 1.5px solid var(--color-text);
  padding: 0.75rem 2.75rem;
  display: inline-block;
  transition: background 0.18s, color 0.18s;
}

.mono-play-btn:hover {
  background: var(--color-text);
  color: var(--color-bg);
}

.mono-photo-row {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  justify-content: center;
  margin-top: 3rem;
}

.mono-photo {
  width: 40%;
  max-width: 380px;
  flex-shrink: 0;
  cursor: pointer;
  transition: opacity 0.2s;
}


.mono-description {
  max-width: 40ch;
  color: var(--color-text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
  padding-top: 0.25rem;
}

@media (max-width: 768px) {
  .mono-photo-row { flex-direction: column; align-items: center; }
  .mono-photo { width: 100%; max-width: 100%; }
}

/* ── The Dusk layout ── */
.the-dusk-description {
  max-width: 65ch;
  margin: 1rem auto 2rem;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.the-dusk-description.centered {
  text-align: center;
}

.the-dusk-main-video {
  width: 100%;
  margin-bottom: 0.5rem;
  position: relative;
}

.the-dusk-main-video video {
  width: 100%;
  max-height: 80dvh;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.the-dusk-play {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 2rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-top: 1.5rem;
  margin-bottom: 2rem;
}

.video-grid video {
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none;
}

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

/* ── Responsive ── */
@media (max-width: 768px) {
  .gallery-grid { grid-template-columns: 1fr; }
  .gallery-grid.cols-3 { grid-template-columns: 1fr; }
  .gallery-grid .full-width { grid-column: 1; }
  .project-list { grid-template-columns: 1fr; }
  .force-3col { gap: 0.35rem; }
  .home-videos { flex-direction: column; height: auto; gap: 0.5rem; }
  .home-video-link,
  .home-video-link:first-child,
  .home-video-link:last-child { flex: 0 0 auto; width: 100%; }
  .home-video-link video { width: 100%; height: auto; }

  /* Paired images stack vertically on mobile */
  .screen-height-row { flex-direction: column; height: auto; }
  .screen-height-row .gallery-item { height: auto; width: 100%; }
  .screen-height-row .gallery-item img { height: auto; max-height: 80vw; }

  /* One-third expands to full width on mobile */
  .one-third-row .gallery-item { width: 100%; }

  /* Centered single fills more width on mobile */
  .centered-single-row .gallery-item { max-width: 100%; }
}
