/* Full project / full video pages ----------------------------------------- */
:root { --project-page-height: 100vh; }
@supports (height: 100svh) { :root { --project-page-height: 100svh; } }

html.is-project-page,
html.is-project-page body {
  width: 100%;
  min-height: 100%;
  background: var(--bg);
}

/* Full-video pages remain a locked viewport. */
html.is-project-page.is-full-video-page,
html.is-project-page.is-full-video-page body {
  height: var(--project-page-height);
  min-height: var(--project-page-height);
  overflow: hidden;
  overscroll-behavior: none;
}

html.is-project-page.is-full-video-page body { touch-action: none; }

/* Full-project pages use the browser's normal vertical document scroll. */
html.is-project-page.is-full-project-page {
  height: auto;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}

html.is-project-page.is-full-project-page::-webkit-scrollbar,
html.is-project-page.is-full-project-page body::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

html.is-project-page.is-full-project-page body {
  height: auto;
  min-height: 100%;
  overflow: visible;
  touch-action: auto;
}

.project-page-app,
.project-page-stage {
  position: relative;
  width: 100%;
  background: var(--bg);
}

body[data-project-page-type="fullVideo"] .project-page-app,
body[data-project-page-type="fullVideo"] .project-page-stage {
  height: var(--project-page-height);
  min-height: var(--project-page-height);
  overflow: hidden;
}

body[data-project-page-type="fullProject"] .project-page-app,
body[data-project-page-type="fullProject"] .project-page-stage {
  height: auto;
  min-height: var(--project-page-height);
  overflow: visible;
}

.project-page-stage {
  opacity: 1;
  transition: none;
}

/* Project-page descriptions blur the media only on desktop. */
@media (min-width: 701px) {
  .project-page-stage::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 19;
    width: 100vw;
    height: var(--project-page-height);
    background: transparent;
    pointer-events: none;
    backdrop-filter: blur(0);
    -webkit-backdrop-filter: blur(0);
    transition:
      backdrop-filter var(--overlay-filter-duration) var(--overlay-transition-easing),
      -webkit-backdrop-filter var(--overlay-filter-duration) var(--overlay-transition-easing);
  }

  .project-page-app.is-project-details-open .project-page-stage::after {
    backdrop-filter: blur(var(--overlay-blur));
    -webkit-backdrop-filter: blur(var(--overlay-blur));
  }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  @media (min-width: 701px) {
    .project-page-app.is-project-details-open .project-page-stage::after {
      background: rgba(253, 253, 253, 0.72);
    }
  }
}

/* Shared reveal states ---------------------------------------------------- */
.project-page-info,
.project-page-video-controls,
[data-project-media-reveal] {
  opacity: 0;
  transition: none;
}

body.is-opacity-transitions-enabled .project-page-info,
body.is-opacity-transitions-enabled .project-page-video-controls,
body.is-opacity-transitions-enabled [data-project-media-reveal] {
  transition: opacity 1.28s cubic-bezier(0.365, 0.220, 0.000, 0.995);
}

body.is-page-visible .project-page-info,
body.is-page-visible .project-page-video-controls,
body.is-page-visible [data-project-media-reveal].is-project-media-revealed {
  opacity: 1;
}

/* Info / close ------------------------------------------------------------ */
.project-page-info {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 20;
  display: grid;
  gap: 0;
  width: 350px;
  max-width: 100vw;
  box-sizing: border-box;
  color: var(--text);
  background: transparent;
  font-size: var(--ui-font-size);
  line-height: 1.2;
  font-weight: 550;
  letter-spacing: 0.005em;
  text-align: left;
  pointer-events: auto;
  cursor: pointer;
}

.project-page-info.has-no-project-details { cursor: default; }

.project-page-info-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  width: 100%;
  padding-right: 7px;
  min-width: 0;
  max-width: 100%;
  pointer-events: none;
}

.project-page-title-group {
  display: inline-flex;
  align-items: center;
  flex: 0 1 auto;
  gap: 7px;
  min-width: 0;
  pointer-events: none;
}

.project-page-title {
  display: block;
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

.project-page-close-button {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  box-sizing: border-box;
  height: auto;
  min-height: 0;
  margin: 0;
  padding: 7px;
  border: 0;
  border-radius: 0;
  color: var(--text);
  background: transparent;
  font: inherit;
  line-height: 0;
  text-decoration: none;
  white-space: nowrap;
  pointer-events: auto;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.project-page-close-button [data-button-label] {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 1.5em;
  height: 1.5em;
  min-height: 1.5em;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  line-height: 0;
}

.project-page-details {
  display: flex;
  flex-direction: column;
  gap: 1em;
  width: 100%;
  max-width: 100%;
  margin-top: calc((-7px - 0.25em) + 1em);
  padding: 0 7px 7px;
  pointer-events: auto;
}

.project-page-details[hidden] { display: none !important; }

.project-page-description-text,
.project-page-credits {
  display: block;
  margin: 0;
}

/* Full video page --------------------------------------------------------- */
body[data-project-page-type="fullVideo"] .project-page-stage {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: var(--project-page-height);
  min-height: var(--project-page-height);
  max-height: var(--project-page-height);
  overflow: hidden;
}

.project-page-video-frame {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: var(--project-page-height);
  min-height: var(--project-page-height);
  overflow: hidden;
  line-height: 0;
}

body[data-project-page-type="fullVideo"] .project-page-video-frame {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: var(--project-page-height);
  min-height: var(--project-page-height);
  max-height: var(--project-page-height);
}

.project-page-video {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100vw;
  max-height: 100%;
  object-fit: cover;
  object-position: center center;
  background: transparent;
  color: transparent;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

/* Project-page video controls: top right on desktop, bottom on mobile. */
.project-page-video-controls {
  position: fixed;
  top: 0;
  right: 0;
  bottom: auto;
  left: auto;
  z-index: 30;
  width: 50vw;
  max-width: 50vw;
  box-sizing: border-box;
  padding: 0;
  color: var(--text);
  pointer-events: auto;
  cursor: default;
  touch-action: manipulation;
}

.project-page-video-controls .video-controls-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  width: 100%;
}

.project-page-video-controls .video-controls-timeline {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  width: 100%;
  min-width: 0;
  padding-left: 0;
  padding-right: 7px;
}

.project-page-video-controls .video-control-button {
  padding-top: calc(0.15rem + 7px);
  padding-bottom: calc(0.15rem + 7px);
}

/* Full project: native horizontal media strip, no Swiper. ---------------- */
.project-full-scroll {
  position: relative;
  width: 100%;
  height: var(--project-page-height);
  min-height: var(--project-page-height);
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  cursor: default;
}

.project-full-scroll::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

/* Desktop: keep trackpad momentum inside the horizontal project strip. */
@media (min-width: 701px) {
  .project-full-scroll {
    overscroll-behavior: none;
  }
}

.project-full-track {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  width: max-content;
  min-width: 100%;
  height: var(--project-page-height);
  min-height: var(--project-page-height);
}

.project-full-slide {
  position: relative;
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  flex: 0 0 auto;
  width: auto;
  max-width: 100vw;
  height: var(--project-page-height);
  min-height: var(--project-page-height);
  overflow: hidden;
  line-height: 0;
  cursor: default;
}

.project-full-video-frame {
  width: auto;
  max-width: 100vw;
  height: 100%;
}

.project-full-slide img,
.project-full-slide video {
  display: block;
  width: auto;
  height: 100%;
  max-width: 100vw;
  max-height: 100%;
  object-fit: cover;
  object-position: center center;
  background: transparent;
  color: transparent;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

/* Mobile project pages retain the existing two-column media grid. -------- */
@media (max-width: 700px) {
  .project-page-info,
  .project-page-video-controls {
    width: 100vw;
    max-width: 100vw;
  }

  .project-page-video-controls {
    top: auto;
    right: auto;
    bottom: 0;
    left: 0;
    width: 100vw;
    max-width: 100vw;
  }

  html.is-project-page.is-full-project-page .site-header,
  html.is-project-page.is-full-project-page .site-header * {
    touch-action: pan-y;
  }

  body[data-project-page-type="fullProject"] .project-page-app,
  body[data-project-page-type="fullProject"] .project-page-stage,
  .project-full-scroll {
    height: auto;
    min-height: 100svh;
    overflow: visible;
  }

  .project-full-track {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: auto;
    align-items: start;
    gap: 0;
    width: 100%;
    height: auto;
    min-height: 0;
  }

  .project-full-slide {
    grid-column: span var(--project-mobile-span, 2);
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .project-full-slide[data-project-mobile-span="1"] { grid-column: span 1; }
  .project-full-slide[data-project-mobile-span="2"] { grid-column: span 2; }


  .project-full-video-frame {
    width: 100%;
    height: auto;
    max-width: 100%;
  }

  .project-full-slide img,
  .project-full-slide video {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: none;
    object-fit: contain;
  }

  .project-page-info-row {
    justify-content: flex-start;
    gap: 0;
  }
}


/* Mouse-only sharp hover blink for the expandable project title and pill. */
@media (any-hover: hover) and (any-pointer: fine) {
  .project-page-info.has-project-details[aria-expanded="false"] .project-page-title {
    pointer-events: auto;
  }


  .project-page-info.has-project-details[aria-expanded="false"]:not(.is-details-hover-suppressed):not(:has(.project-page-close-button:hover)):hover .project-page-title,
  .project-page-info.has-project-details[aria-expanded="false"]:not(.is-details-hover-suppressed):not(:has(.project-page-close-button:hover)):hover .details-pill,
  .project-page-close-button:hover {
    animation: ui-sharp-blink 0.3s steps(1, end) infinite;
    transition: none !important;
  }
}
