/* Frameless: the film sits directly on the portfolio's paper-coloured canvas. */
#project {
  position: fixed;
  inset: 0;
  margin: 0;
  width: 100%;
  height: 100svh;
  max-width: none;
  max-height: none;
  padding: 0 6.5vw 36px;
  border: 0;
  border-radius: 0;
  background: #dfdcd4;
  overflow: auto;
}
#project[open] {
  display: flex;
  flex-direction: column;
}
#project::backdrop {
  background: #dfdcd4;
  backdrop-filter: none;
}
.project-header {
  flex: none;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.project-brand {
  font-size: clamp(20px, 2vw, 31px);
  letter-spacing: -1.25px;
}
.project-brand sup {
  font-size: 9px;
  vertical-align: top;
  margin-left: 2px;
}
#project .close {
  position: static;
  width: 44px;
  height: 44px;
  margin-right: -12px;
  display: grid;
  place-items: center;
  letter-spacing: 0;
}
#project svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#project .close svg {
  width: 24px;
  height: 24px;
}
#project button {
  transition: opacity var(--motion-p2s);
}
#project button:hover {
  opacity: 0.6;
}
.project-content {
  width: min(100%, var(--film-width, 110svh));
  margin: auto;
  flex: none;
}
#project #detail-art {
  width: 100%;
  border-radius: 0;
  max-height: none;
  overflow: hidden;
}
#project .full-video :is(iframe, video) {
  pointer-events: none;
}
.player-stage {
  position: relative;
  outline: none;
}
.player-controls {
  position: relative;
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 56px;
  transition: opacity var(--motion-micro) var(--motion-ease);
}
.player-stage[data-controls-idle] .player-controls:not(:focus-within) {
  opacity: 0;
  pointer-events: none;
}
.player-controls button {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 44px;
  padding: 7px;
}
.player-controls [data-action="play"] {
  margin-left: -7px;
}
.player-controls [data-action="fullscreen"] {
  margin-right: -7px;
}
.player-controls button:disabled {
  opacity: 0.3;
  cursor: wait;
}
.player-time {
  font-size: 10px;
  letter-spacing: 0.6px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.player-seek-wrap {
  position: relative;
  min-width: 36px;
  flex: 1;
  --seek-track: #aaa79f;
  --seek-fill: #252323;
}
.player-seek-track {
  position: absolute;
  inset: 50% 0 auto;
  height: 1px;
  transform: translateY(-50%);
  background: var(--seek-track);
  pointer-events: none;
}
.player-seek-fill {
  display: block;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  background: var(--seek-fill);
}
.player-seek {
  touch-action: none;
  position: relative;
  display: block;
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 30px;
  margin: 0;
  cursor: pointer;
  background: transparent;
  color: #252323;
}
.player-seek::-webkit-slider-runnable-track {
  height: 1px;
  background: transparent;
  border: 0;
}
.player-seek::-moz-range-track {
  height: 1px;
  background: transparent;
  border: 0;
}
.player-seek::-moz-range-progress {
  height: 1px;
  background: transparent;
}
.player-seek::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 6px;
  height: 6px;
  border: 0;
  border-radius: 50%;
  margin-top: -2.5px;
  background: #252323;
}
.player-seek::-moz-range-thumb {
  width: 6px;
  height: 6px;
  border: 0;
  border-radius: 50%;
  background: #252323;
}
.player-seek:focus-visible {
  outline: 1px solid #777;
  outline-offset: 3px;
}
.player-seek-bubble {
  position: absolute;
  left: 0;
  bottom: 100%;
  z-index: 1;
  padding: 4px 6px;
  border-radius: 2px;
  background: #292821;
  color: #fff;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.player-loading {
  display: none;
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  overflow: hidden;
  background: rgb(125 122 108 / .25);
  pointer-events: none;
}
.player-stage[data-loading] .player-loading { display: block; }
.player-loading::after {
  display: block;
  width: 25%;
  height: 100%;
  background: #686556;
  content: "";
}
.player-stage[data-loading-motion] .player-loading::after {
  animation: player-load-sweep var(--motion-loadingSweep) var(--motion-move) infinite;
}
@keyframes player-load-sweep {
  from { transform: translateX(-100%); }
  to { transform: translateX(400%); }
}
html.motion-lite .player-controls { transition: none; }
html.motion-lite .player-stage[data-loading-motion] .player-loading::after { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .player-controls { transition: none; }
  .player-stage[data-loading-motion] .player-loading::after { animation: none; }
}
.player-status {
  font-size: 11px;
  line-height: 1.4;
  margin: 0 0 8px;
  color: #6f6c65;
}
.player-status:empty {
  display: none;
}
.player-status a {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.project-meta {
  border-top: 1px solid #c4c1b9;
  padding-top: 18px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 30px;
}
#project .detail-caption {
  display: block;
  margin: 0;
  min-width: 0;
}
#project h1 {
  font-size: clamp(18px, 2vw, 28px);
  line-height: 1.2;
  letter-spacing: 0.035em;
  font-weight: 400;
}
#project-number {
  display: block;
  margin-top: 10px;
  font-size: 9px;
  letter-spacing: 0.7px;
  color: #89867f;
}
#project .detail-note {
  margin: 0;
  flex-shrink: 0;
  font-size: 9px;
  letter-spacing: 0.075em;
  color: #252323;
  line-height: 1.6;
}
#project .credit-line:last-of-type {
  margin: 0;
}
.credit-role {
  color: #706d66;
}
#project .player-morph {
  border-radius: 0;
}
.player-stage:fullscreen {
  background: #dfdcd4;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 16px 3vw;
}
.player-stage:fullscreen #detail-art {
  flex: 1;
  min-height: 0;
  aspect-ratio: auto !important;
  background: #080808;
}
.player-stage:fullscreen .player-controls {
  flex: none;
}
@media (max-width: 680px) {
  #project {
    padding: 0 22px 28px;
  }
  .project-header {
    height: 88px;
  }
  .project-content {
    width: 100%;
    margin: auto;
  }
  .project-meta {
    gap: 20px;
    flex-direction: column;
    padding-top: 16px;
  }
  #project .detail-note {
    font-size: 10px;
  }
  .player-controls {
    gap: 8px;
    min-height: 52px;
  }
  .player-time {
    font-size: 9px;
    letter-spacing: 0;
  }
  .player-controls button {
    width: 30px;
  }
}
@media (max-height: 540px) and (min-width: 681px) {
  .project-header {
    height: 58px;
  }
  #project {
    padding-bottom: 18px;
  }
  .project-content {
    --film-width: 100svh !important;
  }
  .project-meta {
    padding-top: 12px;
  }
  .player-controls {
    min-height: 44px;
  }
  #project h1 {
    font-size: 18px;
  }
}
@media (prefers-reduced-motion: reduce) {
  #project button {
    transition: none;
  }
}

/* Editorial film browser: credits left, selected film right. */
#project {
  height: 100dvh;
  overflow: hidden;
  padding: 0 4vw;
}
.project-header {
  position: relative;
  z-index: 5;
  height: 90px;
}
#project .project-content {
  position: static;
  width: 100%;
  margin: 0;
  display: contents;
}
#project .player-stage {
  position: absolute;
  z-index: 3;
  left: 45%;
  right: 4vw;
  top: 50%;
  transform: translateY(-50%);
}
#project #detail-art {
  max-height: 65dvh;
  aspect-ratio: auto !important;
  height: min(57dvh, 34vw);
}
#project #detail-art :is(iframe, video) {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
}
#project .project-meta {
  position: absolute;
  left: 6.5vw;
  top: 50%;
  width: 30%;
  transform: translateY(-50%);
  z-index: 3;
}
#project .detail-caption {
  display: block;
  margin: 0 0 26px;
}
#project h1 {
  font-size: clamp(20px, 2.1vw, 34px);
  line-height: 1.3;
  letter-spacing: 0.02em;
}
#project-number {
  display: block;
  margin-top: 18px;
}
#project .film-neighbour {
  position: absolute;
  left: 50%;
  right: 4vw;
  height: 30dvh;
  background-position: center;
  background-size: cover;
  opacity: 0.2;
  filter: grayscale(1);
  padding: 0;
  z-index: 1;
}
#project .film-neighbour[hidden] {
  display: none;
}
#project .film-previous {
  bottom: calc(50% + min(28.5dvh, 17vw) + 40px);
}
#project .film-next {
  top: calc(50% + min(28.5dvh, 17vw) + 64px);
}
@media (max-width: 680px) {
  #project .player-stage {
    left: 6vw;
    right: 6vw;
    top: 48%;
  }
  #project #detail-art {
    height: 45dvh;
  }
  #project .project-meta {
    top: auto;
    bottom: 7dvh;
    left: 6vw;
    width: 88%;
    transform: none;
  }
  #project h1 {
    font-size: 19px;
  }
  #project .detail-caption {
    margin-bottom: 12px;
  }
  #project-number {
    margin-top: 8px;
  }
  #project .film-neighbour {
    left: 12vw;
    right: 6vw;
    height: 20dvh;
  }
  #project .film-previous {
    bottom: calc(52% + 22.5dvh + 24px);
  }
  #project .film-next {
    top: calc(48% + 22.5dvh + 60px);
    opacity: 0.08;
    pointer-events: none;
  }
}

#project .project-meta {
  display: block;
  border-top: 0;
  padding-top: 0;
}
#project .player-stage:fullscreen {
  position: fixed;
  inset: 0;
  transform: none;
  width: 100vw;
  height: 100dvh;
}
#project .player-stage:fullscreen #detail-art {
  height: auto;
  max-height: none;
}
@media (max-width: 680px) {
  #project .project-meta {
    bottom: 4dvh;
  }
  #project .player-stage {
    top: 43%;
  }
  #project #detail-art {
    height: 38dvh;
  }
}

@media (max-width: 680px) {
  #project .film-next {
    display: none;
  }
  #project #detail-art {
    touch-action: pan-x pinch-zoom;
  }
  #project .film-previous {
    opacity: 0.12;
  }
}

/* Keep the close button above the player and incoming/outgoing film strips. */
#project .project-header { z-index: 10; pointer-events: none; }
#project .project-header .close { pointer-events: auto; touch-action: manipulation; }
/* Keep the close glyph and its full hit area. */
#project .close {
  width: 42px;
  height: 42px;
  margin: 0;
  color: #49483d;
  outline: none;
}
#project .close svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.25;
  transition: transform var(--motion-p5s) cubic-bezier(0.16, 1, 0.3, 1);
}
#project .close:hover {
  opacity: 1;
}
#project .close:hover svg {
  transform: rotate(90deg);
}
@media (prefers-reduced-motion: reduce) {
  #project .close,
  #project .close svg {
    transition: none;
  }
}

/* Loading/error copy must not change the vertically centred film geometry. */
#project .player-status { position:absolute; top:100%; left:0; right:0; margin:0; }

/* Fullscreen is a separate black viewing surface, with transport over the film. */
#project .player-stage:is(:fullscreen, :-webkit-full-screen) {
  position:fixed !important;
  inset:0 !important;
  width:100vw !important;
  height:100dvh !important;
  padding:0 !important;
  margin:0 !important;
  border:0 !important;
  border-radius:0 !important;
  transform:none !important;
  background:#000 !important;
  overflow:hidden;
}
#project .player-stage:fullscreen::backdrop { background:#000; }
#project .player-stage:is(:fullscreen, :-webkit-full-screen) #detail-art {
  position:absolute !important;
  inset:0 !important;
  width:100% !important;
  height:100% !important;
  max-height:none !important;
  margin:0 !important;
  aspect-ratio:auto !important;
  background:#000 !important;
}
#project .player-stage:is(:fullscreen, :-webkit-full-screen) .player-controls {
  position:absolute;
  z-index:5;
  inset:auto 0 0;
  padding:18px max(20px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  background:linear-gradient(transparent, rgb(0 0 0 / .8));
  color:#fff !important;
}
#project .player-stage:is(:fullscreen, :-webkit-full-screen) :is(.player-controls button,.player-time,.player-status) {
  color:#fff !important;
  text-shadow:none !important;
  filter:none !important;
}
#project .player-stage:is(:fullscreen, :-webkit-full-screen) .player-status {
  top:auto;
  bottom:75px;
  left:20px;
}
#project .player-stage:is(:fullscreen, :-webkit-full-screen) .player-seek-wrap {
  --seek-track: rgb(255 255 255 / .35);
  --seek-fill: #fff;
}
#project .player-stage:is(:fullscreen, :-webkit-full-screen)[data-controls-idle] { cursor: none; }
#project .player-stage:is(:fullscreen, :-webkit-full-screen) .player-loading::after { background: #fff; }
.player-cursor { display: none; }
@media (hover:hover) and (prefers-reduced-motion:no-preference) {
  .player-stage:is(:fullscreen, :-webkit-full-screen)[data-custom-pointer],
  .player-stage:is(:fullscreen, :-webkit-full-screen)[data-custom-pointer] * { cursor: none !important; }
  .player-stage:is(:fullscreen, :-webkit-full-screen)[data-custom-pointer] .player-cursor {
    display: block;
    position: absolute;
    inset: 0 auto auto 0;
    z-index: 6;
    opacity: 1;
    pointer-events: none;
    transition: opacity var(--motion-micro) var(--motion-ease);
  }
  .player-stage:is(:fullscreen, :-webkit-full-screen)[data-controls-idle] .player-cursor { opacity: 0; }
  #project .player-cursor svg {
    display: block;
    width: 20px;
    height: 24px;
    fill: #fff;
    stroke: #151515;
  }
}
#project .player-stage:is(:fullscreen, :-webkit-full-screen) .player-seek::-webkit-slider-thumb { background:#fff; }
#project .player-stage:is(:fullscreen, :-webkit-full-screen) .player-seek::-moz-range-thumb { background:#fff; }

/* Built only when a film finishes; the media, not the FLIP surface, dims. */
#project .player-end {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  color: #eeece5;
  text-align: center;
}
#project .player-end[hidden] { display: none; }
#project .player-end button {
  max-width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 10px 14px;
  color: inherit;
  font: inherit;
  font-size: 11px;
  line-height: 1.6;
  letter-spacing: .08em;
  text-wrap: balance;
  cursor: pointer;
}
#project .player-end button[hidden] { display: none; }
#project .player-end button:disabled { opacity: .5; cursor: wait; }
#project .player-end button:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }
