* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* The watch photo's own background, so the page continues it outside the 16:9 box. */
html {
  background: #d8d8d8;
}

body {
  font-family: "Montserrat", Arial, sans-serif;
  overflow-x: hidden;
  --color: #2e4883;
}

/* Watch and scenes: one 16:9 box, as large as fits, in the bottom right corner, where the watch's shadow runs
   off the photo (its top and left edges are plain grey and meet the page without a seam). `isolation` keeps
   the blend inside the box, so transparent parts of a scene leave the watch as it is instead of lightening it
   with the page grey. */
.stage {
  position: fixed;
  right: 0;
  bottom: 0;
  width: min(100vw, 177.78vh);
  aspect-ratio: 16 / 9;
  isolation: isolate;
}

.stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.scene {
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}

.scene.is-on {
  opacity: 1;
}

.watch {
  mix-blend-mode: lighten;
}

.title,
.scene-text {
  position: fixed;
  left: 10%;
  z-index: 2;
  color: var(--color);
  transition: color 0.5s ease-in-out;
}

.title {
  top: 30%;
  font-size: clamp(22px, 4.2vh, 2rem);
  font-weight: 900;
}

.scene-text {
  top: 40%;
  width: 37.5%;
  transition: color 0.5s ease-in-out, opacity 0.3s ease-in-out;
}

.scene-text.is-out {
  opacity: 0;
}

.tagline {
  margin-bottom: 0.9em;
  font-size: clamp(15px, 3.1vh, 1.5rem);
  font-style: italic;
  text-align: right;
}

.copy {
  font-size: clamp(12px, 2.1vh, 1rem);
  text-align: justify;
  text-justify: inter-word;
}

.track {
  height: 500vh;
}

/* Small embedded frames: title and tagline only. */
@media (min-aspect-ratio: 1/1) and (max-height: 300px) {
  .title {
    top: 18%;
    font-size: clamp(12px, 5vw, 22px);
  }

  .scene-text {
    top: 42%;
  }

  .tagline {
    font-size: clamp(10px, 3.8vw, 15px);
  }

  .copy {
    display: none;
  }
}

/* Portrait: the watch large at the bottom (its centre is at 75 % across the photo), the text above it. */
@media (max-aspect-ratio: 1/1) {
  .stage {
    right: auto;
    left: -106vw;
    width: 208vw;
  }

  .title,
  .scene-text {
    left: 6vw;
    width: 88vw;
  }

  .title {
    top: 4vh;
    font-size: clamp(22px, 7vw, 2rem);
  }

  .scene-text {
    top: calc(4vh + 3em);
  }

  .tagline {
    font-size: clamp(16px, 5vw, 1.5rem);
  }

  .copy {
    font-size: clamp(12px, 3.5vw, 1rem);
    hyphens: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scene,
  .title,
  .scene-text {
    transition: none;
  }
}
