.imbarcadero-film {
  --film-ink: #091c2c;
  --film-gold: #dab981;
  --film-ivory: #fff3da;
  --film-runtime: 4.9s;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: var(--film-ink);
  color: var(--film-ivory);
}

.imbarcadero-film::backdrop {
  background: #091c2c;
}

html:has(.imbarcadero-film[open]) {
  overflow: hidden;
}

.film-images,
.film-scene,
.film-crop,
.film-crop::after {
  position: absolute;
  inset: 0;
}

.film-images {
  isolation: isolate;
  pointer-events: none;
}

.film-scene {
  overflow: hidden;
  opacity: 0;
  background: var(--film-ink);
}

.film-crop {
  overflow: hidden;
  background: #1b3544;
}

.film-crop::after {
  content: '';
}

.film-crop img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.film-scene > p {
  position: absolute;
  z-index: 1;
  margin: 0;
  font: normal clamp(3rem, 9.5vw, 9rem)/.87 var(--display, Georgia, serif);
  letter-spacing: -.035em;
}

.film-lake .film-crop {
  inset: 12% 0;
}

.film-lake img {
  object-position: center 54%;
}

.film-lake .film-crop::after {
  background: linear-gradient(0deg, #041827bc, transparent 65%), #11395030;
}

.film-lake > p {
  left: 7vw;
  bottom: 17%;
}

.film-terrace {
  background: #eee5d3;
  color: #142a3b;
}

.film-terrace .film-crop {
  inset: 8% 30% 8% 4%;
}

.film-terrace img {
  object-position: center 55%;
}

.film-terrace .film-crop::after {
  background: #3a241022;
}

.film-terrace > p {
  top: 42%;
  right: 6%;
  max-width: 4.6ch;
  font-style: italic;
  font-size: clamp(3.2rem, 7.7vw, 8rem);
}

.film-table .film-crop {
  inset: 0;
}

.film-table img {
  object-position: 54% 54%;
}

.film-table .film-crop::after {
  background: linear-gradient(90deg, #121b22c7, transparent 78%), #522f171f;
}

.film-table > p {
  left: 8%;
  top: 46%;
}

.film-title {
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at 50% 62%, #173548 0%, #091c2c 68%);
}

.film-title::before {
  content: '';
  position: absolute;
  inset: clamp(1rem, 4vw, 3.75rem);
  border: 1px solid #dab98155;
  pointer-events: none;
}

.film-title-inner {
  position: relative;
  display: grid;
  justify-items: center;
  gap: clamp(.55rem, 1.65vw, 1.25rem);
  text-align: center;
}

.film-title-inner span {
  font: normal clamp(3.4rem, 12vw, 11rem)/.86 var(--display, Georgia, serif);
  letter-spacing: -.045em;
}

.film-title-inner small {
  color: var(--film-gold);
  font-size: .79rem;
  letter-spacing: .24em;
  text-transform: uppercase;
}

.film-ripples,
.film-ripples::before,
.film-ripples::after {
  width: clamp(1.7rem, 3.8vw, 3.3rem);
  height: .42rem;
  border-top: 1px solid var(--film-gold);
  border-radius: 50%;
}

.film-ripples {
  position: relative;
  transform: rotate(-12deg);
  margin-bottom: .6rem;
}

.film-ripples::before,
.film-ripples::after {
  content: '';
  position: absolute;
  left: 12%;
  top: 35%;
}

.film-ripples::after {
  left: 25%;
  top: 85%;
}

.film-controls {
  position: absolute;
  inset: auto clamp(1.35rem, 5vw, 5rem) max(1.4rem, env(safe-area-inset-bottom)) clamp(1.35rem, 5vw, 5rem);
  display: flex;
  align-items: center;
  gap: 1.1rem;
}

.film-progress {
  flex: 1;
  height: 2px;
  background: #1025338c;
}

.film-progress::before {
  content: '';
  display: block;
  height: 100%;
  background: var(--film-gold);
  transform-origin: left center;
  transform: scaleX(0);
}

.film-skip {
  min-height: 44px;
  padding: .3rem .9rem;
  border: 1px solid #dab981a8;
  border-radius: 0;
  background: #091c2c;
  color: var(--film-ivory);
  font: inherit;
  font-size: .875rem;
  cursor: pointer;
}

.film-skip:hover {
  background: #263e4d;
}

.film-skip:focus-visible {
  outline: 2px solid var(--film-gold);
  outline-offset: 3px;
}

.film-running,
.film-running::backdrop {
  animation: film-dissolve .36s ease 4.5s both;
}

.film-running .film-lake {
  animation: film-lake-cut 1.75s both;
}

.film-running .film-lake .film-crop {
  animation: film-aperture 1.3s cubic-bezier(.16,.78,.26,1) both;
}

.film-running .film-lake img {
  animation: film-lake-drift 1.8s ease-out both;
}

.film-running .film-terrace {
  animation: film-terrace-cut 1.55s cubic-bezier(.22,.75,.22,1) 1.22s both;
}

.film-running .film-terrace img {
  animation: film-terrace-drift 1.5s cubic-bezier(.15,.55,.3,1) 1.22s both;
}

.film-running .film-table {
  animation: film-table-cut 1.27s ease 2.37s both;
}

.film-running .film-table img {
  animation: film-closeup 1.27s ease-out 2.37s both;
}

.film-running .film-title {
  animation: film-title-cut .53s cubic-bezier(.18,.8,.22,1) 3.35s both;
}

.film-running .film-title-inner {
  animation: film-type-in .68s cubic-bezier(.18,.8,.22,1) 3.47s both;
}

.film-running .film-progress::before {
  animation: film-progress var(--film-runtime) linear forwards;
}

@keyframes film-aperture {
  from { clip-path: inset(48.5% 0); }
  38%, to { clip-path: inset(0); }
}

@keyframes film-lake-cut {
  from { opacity: 0; }
  10%, 83% { opacity: 1; }
  to { opacity: 0; }
}

@keyframes film-lake-drift {
  from { transform: scale(1.16) translateX(2.4%); }
  to { transform: scale(1.05) translateX(0); }
}

@keyframes film-terrace-cut {
  from { opacity: 1; clip-path: inset(0 100% 0 0); }
  24%, 82% { opacity: 1; clip-path: inset(0); }
  to { opacity: 0; clip-path: inset(0); }
}

@keyframes film-terrace-drift {
  from { transform: scale(1.17) translateX(-3.2%); }
  to { transform: scale(1.07) translateX(0); }
}

@keyframes film-table-cut {
  from { opacity: 0; }
  12%, 84% { opacity: 1; }
  to { opacity: 0; }
}

@keyframes film-closeup {
  from { transform: scale(1.02); }
  to { transform: scale(1.14); }
}

@keyframes film-title-cut {
  from { opacity: 0; clip-path: inset(50% 0); }
  23% { opacity: 1; }
  to { opacity: 1; clip-path: inset(0); }
}

@keyframes film-type-in {
  from { opacity: 0; transform: translateY(10%); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes film-progress {
  to { transform: scaleX(1); }
}

@keyframes film-dissolve {
  to { opacity: 0; }
}

@media (max-width: 600px) {
  .film-lake .film-crop { inset: 10% 0 15%; }
  .film-lake > p { bottom: 20%; }
  .film-terrace .film-crop { inset: 9% 9% 28%; }
  .film-terrace > p { top: auto; right: 10%; bottom: 15%; max-width: none; }
  .film-table img { object-position: 58% center; }
  .film-table > p { top: auto; bottom: 18%; }
  .film-title-inner small { font-size: .74rem; }
}

@media (prefers-reduced-motion: reduce) {
  .film-running, .film-running::backdrop, .film-running *, .film-running *::before { animation: none; }
  .film-running .film-title { opacity: 1; }
}
