/* The supplied film owns the scene; its final frame is the static fallback. */
.cinema { padding-top: 0; background: #02060e; }
.cinema-stage { position: relative; height: max(700px, 100svh); max-height: 1000px; overflow: hidden; isolation: isolate; background: #02060e; }
.cinema-media { position: absolute; inset: 0; }
.cinema-media img, .cinema-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.cinema-media video { opacity: 0; }
.cinema.video-visible video { opacity: 1; }
.cinema-vignette { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, #02060eed 0%, #02060ea6 25%, #02060e0a 58%), linear-gradient(0deg, #02060e 0%, transparent 40%); transition: opacity .7s; }
.cinema.is-playing .cinema-vignette { opacity: .12; }
.cinema-topline { position: absolute; top: 76px; left: 5%; right: 5%; display: flex; justify-content: space-between; font: 8px var(--mono); color: #c3d3e9; letter-spacing: 1.8px; }
.cinema-copy {
  position: absolute;
  left: max(5%, calc((100% - 1320px) / 2));
  bottom: clamp(140px, 22vh, 220px);
  width: fit-content;
  max-width: min(440px, calc(100% - 10%));
  padding: 26px 28px 22px;
  background: rgba(4, 15, 34, .9);
  border: 1px solid rgba(109, 172, 255, .2);
  border-radius: 10px;
  backdrop-filter: blur(12px) saturate(100%);
  -webkit-backdrop-filter: blur(12px) saturate(100%);
  box-shadow: 0 16px 40px -16px rgba(0, 0, 0, .5);
  z-index: 2;
}
.cinema-copy, .cinema-topline { transition: opacity .8s cubic-bezier(0.16, 1, 0.3, 1), transform .8s cubic-bezier(0.16, 1, 0.3, 1); }
.cinema.is-playing .cinema-copy, .cinema.is-playing .cinema-topline { opacity: 0; visibility: hidden; transform: translateY(16px); }
.portfolio-home .cinema-copy .availability { margin-bottom: 12px; font-size: 10px; }
.portfolio-home .cinema-role { font: 9px/1.8 var(--mono); letter-spacing: 1px; color: #a9c4e6; margin-top: 0; margin-bottom: 12px; }
.cinema-role span { color: #7894b8; padding: 0 5px; }
.portfolio-home .cinema-description { font: 13.5px/1.75 var(--sans); color: #e4efff; margin-top: 0; margin-bottom: 24px; }
.cinema-copy .intro-actions { margin-top: 0; margin-bottom: 18px; }
.cinema-copy .intro-socials {
  margin-top: 0;
  padding-top: 16px;
  border-top: 1px solid rgba(109, 172, 255, .16);
  display: flex;
  gap: 20px;
}
.cinema-bottom { position: absolute; bottom: 24px; left: 5%; right: max(96px, 5%); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.cinema-scroll { display: flex; align-items: center; gap: 13px; font: 8px var(--mono); letter-spacing: 1px; color: #c3d3e9; }
.cinema-scroll span { border: 1px solid #00d9ff55; border-radius: 50%; width: 28px; height: 28px; display: grid; place-items: center; font-size: 14px; }
.cinema a:focus-visible { outline: 2px solid var(--fluorescent-blue); outline-offset: 5px; }

/* Ambient living background & moving objects (active after intro video finishes) */
.cinema-ambient-world {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  visibility: hidden;
  transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 1.2s;
  overflow: hidden;
}
.cinema.ambient-active:not(.video-visible) .cinema-ambient-world {
  opacity: 1;
  visibility: visible;
}
.cinema.is-playing .cinema-ambient-world, .cinema.video-visible .cinema-ambient-world {
  opacity: 0;
  visibility: hidden;
  transition: none;
}
.cinema-ambient-world * { animation-play-state: paused !important; }
.cinema.ambient-active:not(.video-visible) .cinema-ambient-world * { animation-play-state: running !important; }
/* No coloured haze over the portrait. Retain the subtle hair and eye motion. */
.ambient-nebula { display: none; }
.ambient-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(125, 184, 255, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125, 184, 255, .025) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at 65% 45%, black 25%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 65% 45%, black 25%, transparent 75%);
  opacity: 0.6;
}
.ambient-orbit {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  border: 1px dashed rgba(0, 217, 255, .12);
}
.orbit-primary {
  width: 720px;
  height: 310px;
  right: -60px;
  top: 18%;
  transform: rotate(-14deg);
  box-shadow: none;
  animation: orbit-float-primary 24s ease-in-out infinite alternate;
}
.orbit-secondary {
  width: 940px;
  height: 400px;
  right: -150px;
  top: 10%;
  transform: rotate(20deg);
  border: 1px solid rgba(37, 99, 255, .14);
  box-shadow: none;
  animation: orbit-float-secondary 30s ease-in-out infinite alternate;
}
@keyframes orbit-float-primary {
  0% { transform: rotate(-14deg) translateY(0) scale(1); }
  50% { transform: rotate(-11deg) translateY(-8px) scale(1.02); }
  100% { transform: rotate(-17deg) translateY(6px) scale(0.98); }
}
@keyframes orbit-float-secondary {
  0% { transform: rotate(20deg) translateY(0) scale(1); }
  50% { transform: rotate(23deg) translateY(10px) scale(1.02); }
  100% { transform: rotate(17deg) translateY(-8px) scale(0.98); }
}
.ambient-glyph {
  position: absolute;
  font: 9px/1 var(--mono);
  color: #b9d5fa;
  background: rgba(6, 19, 41, .8);
  border: 1px solid rgba(109, 172, 255, .18);
  border-radius: 4px;
  padding: 6px 10px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 4px 18px rgba(5, 8, 17, 0.45);
  pointer-events: none;
  letter-spacing: 0.8px;
  opacity: 0.85;
}
.glyph-sys {
  top: 15%;
  right: 14%;
  animation: glyph-float-1 9s ease-in-out infinite alternate;
}
.glyph-tcp {
  top: 48%;
  right: 32%;
  animation: glyph-float-2 11s ease-in-out infinite alternate;
}
.glyph-ai {
  top: 66%;
  right: 16%;
  animation: glyph-float-3 10.5s ease-in-out infinite alternate;
}
.glyph-code {
  top: 28%;
  right: 40%;
  animation: glyph-float-4 13s ease-in-out infinite alternate;
}
.glyph-star {
  top: 36%;
  right: 9%;
  color: var(--fluorescent-blue);
  font-size: 13px;
  padding: 4px 8px;
  animation: glyph-float-5 8s ease-in-out infinite alternate;
}
@keyframes glyph-float-1 {
  0% { transform: translateY(0) rotate(0deg); }
  100% { transform: translateY(-14px) rotate(1.5deg); }
}
@keyframes glyph-float-2 {
  0% { transform: translateY(0) rotate(0deg); }
  100% { transform: translateY(12px) rotate(-1.5deg); }
}
@keyframes glyph-float-3 {
  0% { transform: translateY(0) rotate(0deg); }
  100% { transform: translateY(-10px) rotate(-2deg); }
}
@keyframes glyph-float-4 {
  0% { transform: translateY(0) rotate(0deg); }
  100% { transform: translateY(14px) rotate(1.2deg); }
}
@keyframes glyph-float-5 {
  0% { transform: translateY(0) scale(1); }
  100% { transform: translateY(-8px) scale(1.15); }
}
.cinema-ambient-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

@media (max-width: 900px) {
  .orbit-primary { width: 560px; height: 250px; right: -40px; }
  .orbit-secondary { width: 700px; height: 320px; right: -80px; }
  .glyph-code, .glyph-tcp { display: none; }
  .cinema { padding-top: 0; }
  .cinema-stage { height: 820px; max-height: none; }
  .cinema-media { height: 560px; }
  .cinema-vignette { background: linear-gradient(0deg, #02060e 27%, #02060ed9 39%, transparent 68%); }
  .cinema-topline { top: 82px; }
  .cinema-copy {
    bottom: 140px;
    left: 5%;
    width: fit-content;
    max-width: calc(100% - 10%);
    padding: 24px 24px 20px;
  }
}
@media (max-width: 640px) {
  .cinema { padding-top: 0; }
  .cinema-stage { height: max(820px, 100svh); }
  .cinema-media { height: 470px; }
  .cinema-media img, .cinema-media video { object-position: 45% center; }
  .cinema-topline { top: 80px; font-size: 6px; letter-spacing: 1px; }
  .cinema-copy {
    bottom: 155px;
    left: 5%;
    width: fit-content;
    max-width: calc(100% - 10%);
    padding: 20px 18px 18px;
    border-radius: 10px;
  }
  .portfolio-home .cinema-copy .availability { font-size: 8.5px; margin-bottom: 10px; }
  .portfolio-home .cinema-role { font-size: 7.5px; margin-top: 0; margin-bottom: 10px; letter-spacing: .6px; }
  .portfolio-home .cinema-description { font-size: 12px; margin-top: 0; margin-bottom: 18px; }
  .cinema-copy .intro-actions { margin-top: 0; margin-bottom: 14px; gap: 18px; }
  .cinema-copy .intro-socials { margin-top: 0; padding-top: 12px; gap: 16px; }
  .cinema-vignette { background: linear-gradient(0deg, #02060e 38%, #02060eed 45%, transparent 67%); }
  .cinema-bottom { bottom: 27px; left: 7%; right: 86px; flex-direction: column; align-items: flex-start; }
  .cinema-scroll { font-size: 7px; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .cinema-copy, .cinema-topline, .cinema-vignette { transition: none; }
  .cinema-media video { display: none; }
  .cinema-ambient-world, .ambient-orbit, .ambient-glyph, .cinema-ambient-canvas { display: none !important; }
}
