.cinema {
  height: 490svh;
  position: relative;
  background: #18231e;
  color: #f7f3e9;
  isolation: isolate;
}
.cinema-stage {
  height: 100svh;
  position: sticky;
  top: 0;
  overflow: hidden;
  background: #26392f;
}
.cinema-poster,
.cinema-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
/* Campus fills the desktop stage. Portrait phones retain the whole wide shot. */
@media (min-width: 761px) {
  .cinema[data-sequence="assets/cinema/campus-tal"] .cinema-poster,
  .cinema[data-sequence="assets/cinema/campus-tal"] .cinema-canvas {
    object-fit: cover;
  }
}
.cinema-canvas {
  opacity: 0;
  transition: opacity 0.4s;
}
.cinema-ready .cinema-canvas {
  opacity: 1;
}
.cinema-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(0deg, #111b1ba6, transparent 40%, #13231a33),
    linear-gradient(90deg, #18241c33, transparent 70%);
  pointer-events: none;
}
.cinema-topline {
  position: absolute;
  top: 37px;
  left: var(--gutter);
  right: var(--gutter);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 25px;
  z-index: 2;
  font-size: 14px;
  letter-spacing: 1.8px;
}
.cinema-topline .cinema-marker {
  display: flex;
  gap: 10px;
  align-items: center;
}
.cinema-marker:before {
  content: "";
  width: 6px;
  height: 6px;
  background: #e47b54;
  border-radius: 50%;
}
.cinema-kind {
  font-size: 14px;
  letter-spacing: 1.2px;
  background: #16231e55;
  padding: 10px 13px;
  backdrop-filter: blur(8px);
  border: 1px solid #ffffff38;
}
.cinema-chapters {
  position: absolute;
  inset: 0;
}
.cinema-chapter {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 90px var(--gutter) 130px;
  will-change: transform, opacity;
}
.cinema-chapter:not(:first-child) {
  opacity: 0;
  visibility: hidden;
}
.cinema-chapter h1,
.cinema-chapter h2 {
  font-size: clamp(64px, 8vw, 128px);
  font-weight: 450;
  line-height: 0.96;
  letter-spacing: -0.075em;
  text-shadow: 0 2px 28px #16231c22;
  max-width: 1200px;
  margin: 0;
}
.cinema-chapter em {
  color: #f0dbc0;
}
.cinema-chapter > p {
  font-size: 14px;
  line-height: 1.8;
  letter-spacing: 0.2px;
  margin-top: 28px;
  max-width: 470px;
}
.cinema-chapter .cinema-cta {
  font-size: 14px;
  border: 1px solid #fff8;
  padding: 14px 22px;
  margin-top: 26px;
  background: #19271e33;
  backdrop-filter: blur(8px);
  transition: background 0.3s;
}
.cinema-chapter .cinema-cta:hover {
  background: var(--accent);
}
.cinema-cta span {
  margin-left: 30px;
}
.cinema-footer {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  bottom: 30px;
  z-index: 3;
}
.cinema-directions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  font-size: 14px;
  letter-spacing: 1px;
}
.cinema-scroll-hint {
  display: flex;
  align-items: center;
  gap: 15px;
}
.cinema-scroll-hint span {
  display: grid;
  place-items: center;
  border: 1px solid #fff6;
  width: 30px;
  height: 42px;
  border-radius: 16px;
  font-size: 16px;
}
.cinema-links {
  display: flex;
  gap: 25px;
}
.cinema-links a {
  font-size: 14px;
  letter-spacing: 0.2px;
  border-bottom: 1px solid #fff5;
  padding-bottom: 6px;
}
.cinema-track {
  height: 1px;
  background: #ffffff40;
  position: relative;
}
.cinema-track i {
  position: absolute;
  inset: 0;
  transform-origin: left;
  transform: scaleX(var(--cinema-progress, 0));
  background: #f4e2c4;
  height: 2px;
}
.cinema-steps {
  display: flex;
  justify-content: space-between;
  gap: 25px;
  margin-top: 18px;
}
.cinema-step {
  font-size: 14px;
  letter-spacing: 1.4px;
  color: #ffffff70;
  transition: color 0.3s;
}
.cinema-step.active {
  color: #f2dcc0;
}
.cinema-immersive .header {
  transform: translateY(-110%);
  pointer-events: none;
}
.cinema-immersive .project-subnav {
  visibility: hidden;
  pointer-events: none;
}
.header {
  transition:
    transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1),
    box-shadow 0.3s,
    height 0.3s;
}
.header:focus-within {
  transform: none !important;
  pointer-events: auto;
}
.cinema-immersive .reading-progress {
  opacity: 0;
}
.cinema-static {
  height: auto;
}
.cinema-static .cinema-stage {
  position: relative;
  min-height: 700px;
  height: 90svh;
}
.cinema-static .cinema-canvas {
  display: none;
}
.cinema-static .cinema-chapter {
  transform: none !important;
}
.cinema-static .cinema-chapter:first-child {
  opacity: 1 !important;
  visibility: visible !important;
}
.cinema-static .cinema-chapter:not(:first-child) {
  display: none;
}
.cinema-static .cinema-scroll-hint {
  visibility: hidden;
}
.cinema-static .cinema-track {
  display: none;
}
.cinema-static .cinema-skip {
  display: none;
}
.cinema-static .cinema-poster {
  opacity: 1;
}
@media (min-width: 1800px) {
  .cinema-chapter h1,
  .cinema-chapter h2 {
    font-size: 140px;
  }
}
@media (max-width: 760px) {
  .cinema {
    height: 420svh;
  }
  .cinema-topline {
    top: 24px;
    align-items: flex-start;
    gap: 15px;
    flex-direction: column;
  }
  .cinema-marker {
    font-size: 14px;
    letter-spacing: 1px;
  }
  .cinema-kind {
    font-size: 14px;
    letter-spacing: 0.7px;
    padding: 8px 10px;
  }
  .cinema-chapter {
    padding: 120px 20px 180px;
  }
  .cinema-chapter h1,
  .cinema-chapter h2 {
    font-size: clamp(52px, 13vw, 90px);
    letter-spacing: -0.075em;
    line-height: 1.02;
  }
  .cinema-chapter > p {
    font-size: 14px;
    max-width: 290px;
    margin-top: 22px;
  }
  .cinema-chapter .cinema-cta {
    font-size: 14px;
    margin-top: 22px;
  }
  .cinema-footer {
    bottom: 25px;
  }
  .cinema-directions {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 18px;
    font-size: 14px;
  }
  .cinema-scroll-hint {
    font-size: 14px;
    letter-spacing: 0.5px;
  }
  .cinema-scroll-hint span {
    height: 30px;
    width: 23px;
    font-size: 14px;
  }
  .cinema-links {
    justify-content: space-between;
    width: 100%;
    gap: 16px;
  }
  .cinema-links a {
    font-size: 14px;
  }
  .cinema-step {
    font-size: 14px;
    letter-spacing: 0.7px;
  }
  .cinema-steps {
    gap: 14px;
    margin-top: 15px;
  }
  .cinema-static {
    height: auto;
  }
  .cinema-static .cinema-stage {
    min-height: 650px;
    height: 90svh;
  }
}
@media (prefers-reduced-motion: reduce) {
  .cinema {
    height: auto;
  }
  .cinema-stage {
    position: relative;
    min-height: 650px;
    height: 90svh;
  }
  .cinema-canvas {
    display: none;
  }
  .cinema-chapter:first-child {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
  }
  .cinema-chapter:not(:first-child) {
    display: none;
  }
  .cinema-immersive .header {
    transform: none;
  }
  .cinema-track {
    display: none;
  }
}
body:has(#start.cinema) .header {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
}
#start.cinema .cinema-topline {
  top: calc(var(--site-header-height, 100px) + 30px);
  transition: none;
}
.cinema-immersive #start.cinema .cinema-topline {
  top: calc(var(--site-header-height, 100px) + 30px);
}
@media (max-width: 760px) {
  #start.cinema .cinema-topline {
    top: calc(var(--site-header-height, 76px) + 20px);
  }
  .cinema-immersive #start.cinema .cinema-topline {
    top: calc(var(--site-header-height, 76px) + 20px);
  }
}

.project-subnav {
  transition:
    opacity 0.3s,
    visibility 0.3s;
}
.cinema-immersive .project-subnav {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Portrait phones keep the complete widescreen film above the chapter text. */
@media (max-width: 760px) {
  .cinema-stage, .cinema-static .cinema-stage {
    min-height: 0; height: 100svh;
  }
  .cinema-poster, .cinema-canvas {
    inset: 120px 0 auto; width: 100%; height: 56.25vw; object-fit: contain;
  }
  .cinema-shade { background: none; }
  .cinema .cinema-chapter {
    justify-content: flex-start; align-items: flex-start; text-align: left;
    padding: calc(56.25vw + 136px) var(--gutter) 90px;
  }
  .cinema .cinema-chapter h1, .cinema .cinema-chapter h2 { font-size: clamp(32px, 8.5vw, 44px); }
  .cinema-chapter > p { margin-top: 10px; line-height: 1.5; }
  .cinema-chapter .cinema-cta { margin-top: 10px; padding: 10px 16px; min-height: 44px; }
  .cinema-topline { top: 24px; }
  .cinema-footer { bottom: max(14px, env(safe-area-inset-bottom)); background: #26392f; }
  .cinema-links { gap: 16px; flex-wrap: wrap; }
  .cinema-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 4px 0; }
}

.cinema-end { scroll-margin-top: 50px; }
/* The vertical drone view has no horizon: turn the complete shot on portrait
   phones. Both the canvas and its static poster use the same geometry. */
@media (max-width: 760px) and (orientation: portrait) {
  .cinema[data-sequence="assets/cinema/axdorf-drone-31"] .cinema-poster,
  .cinema[data-sequence="assets/cinema/axdorf-drone-31"] .cinema-canvas {
    inset: auto; left: 50%; top: 50%;
    width: min(100svh, 177.7778vw); height: min(100vw, 56.25svh);
    transform: translate(-50%, -50%) rotate(90deg);
    object-fit: contain;
  }
  .cinema[data-sequence="assets/cinema/axdorf-drone-31"] .cinema-shade {
    background: linear-gradient(180deg, #13231ad9, transparent 25%, transparent 42%, #13231ae6 92%);
  }
  .cinema[data-sequence="assets/cinema/axdorf-drone-31"] .cinema-chapter {
    justify-content: flex-end;
    padding: 120px var(--gutter) calc(110px + env(safe-area-inset-bottom));
    text-shadow: 0 2px 18px #10231a99;
  }
  .cinema[data-sequence="assets/cinema/axdorf-drone-31"] .cinema-footer {
    background: transparent;
  }
}
@media (max-width: 760px) {
  .cinema-steps { display: none; }
  .cinema-scroll-hint { display: none; }
  .cinema-directions { margin-bottom: 8px; }
}

/* Short viewports keep controls reachable; the complete image stays contained. */
@media (max-width: 760px) and (max-height: 640px) {
  .cinema-poster, .cinema-canvas { top: 110px; height: min(56.25vw, 32svh); }
  .cinema .cinema-chapter { padding-top: calc(122px + min(56.25vw, 32svh)); }
  .cinema .cinema-chapter h1, .cinema .cinema-chapter h2 { font-size: 30px; }
  .cinema-chapter > p { margin-top: 7px; }
}

/* Turning the phone back restores the wide aerial without crowding controls. */
@media (max-height: 500px) and (orientation: landscape) {
  .cinema[data-sequence="assets/cinema/axdorf-drone-31"] .cinema-poster,
  .cinema[data-sequence="assets/cinema/axdorf-drone-31"] .cinema-canvas {
    inset: 0; width: 100%; height: 100%; transform: none;
  }
  .cinema[data-sequence="assets/cinema/axdorf-drone-31"] .cinema-topline {
    top: 12px; flex-direction: row; align-items: center; gap: 10px;
  }
  .cinema[data-sequence="assets/cinema/axdorf-drone-31"] .cinema-kind { font-size: 12px; padding: 4px 8px; }
  .cinema[data-sequence="assets/cinema/axdorf-drone-31"] .cinema-chapter {
    padding: 65px var(--gutter) 95px; justify-content: center;
    align-items: flex-start; text-align: left;
  }
  .cinema[data-sequence="assets/cinema/axdorf-drone-31"] .cinema-chapter h2 { font-size: 32px; }
  .cinema[data-sequence="assets/cinema/axdorf-drone-31"] .cinema-chapter > p { margin-top: 8px; font-size: 14px; max-width: none; }
  .cinema[data-sequence="assets/cinema/axdorf-drone-31"] .cinema-cta { margin-top: 8px; padding: 8px 14px; min-height: 44px; font-size: 14px; }
  .cinema[data-sequence="assets/cinema/axdorf-drone-31"] .cinema-footer { bottom: 12px; background: transparent; }
  .cinema[data-sequence="assets/cinema/axdorf-drone-31"] .cinema-scroll-hint,
  .cinema[data-sequence="assets/cinema/axdorf-drone-31"] .cinema-steps { display: none; }
  .cinema[data-sequence="assets/cinema/axdorf-drone-31"] .cinema-directions { margin-bottom: 8px; }
  .cinema[data-sequence="assets/cinema/axdorf-drone-31"] .cinema-links { width: 100%; justify-content: space-between; }
  .cinema[data-sequence="assets/cinema/axdorf-drone-31"] .cinema-links a { display: inline-flex; align-items: center; min-height: 44px; }
}
