/* iPhone 18 Pro chassis and display. See Apple's published specifications:
   71.9 × 150.0 mm body, 1206 × 2622 pixel display at 460 ppi. */
.tour-phone {
  position: relative;
  width: min(100%, 338px);
  aspect-ratio: 71.9 / 150;
  margin: auto;
  border-radius: 15.5% / 7.43%;
  background: linear-gradient(110deg, #a29687, #382f29 18%, #1b1714 67%, #8f8174 98%);
  box-shadow: inset 0 0 0 1px #ebd8c5a1, inset 0 0 0 3px #3c352f,
    inset 0 0 0 5px #141211, 0 18px 44px #2513093d;
}
.tour-display {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: 92.62%;
  aspect-ratio: 1206 / 2622;
  overflow: hidden;
  border-radius: 13.3% / 6.12%;
  background: #060403;
  box-shadow: 0 0 0 2px #0c0a09;
  container-type: inline-size;
}
/* The Dynamic Island sits above everything on the display. */
.tour-display::after {
  content: "";
  position: absolute;
  z-index: 4;
  pointer-events: none;
  width: 21%;
  height: 2.5%;
  left: 39.5%;
  top: 1%;
  border-radius: 999px;
  background: #020202;
}

/* The feed on the display. It is the app's Scroll tab drawn in HTML over the
   official demo clips, so every size below is a share of the display's width. */
.feed > * { --u: 2.9px; }
@supports (width: 1cqw) {
  .feed > * { --u: 1cqw; }
}
.feed { color: #fff9ee; }
/* A 720 × 1288 clip fills the width and sits between the status area and the dock.
   Two slides share the track: the one on screen and the next one waiting below it. */
.feed-track {
  position: absolute;
  inset: 9.7% 0 auto;
  aspect-ratio: 720 / 1288;
}
.feed-slide {
  position: absolute;
  inset: 0;
  background: #060403 center / cover no-repeat;
  will-change: transform;
}
.feed-slide.is-next { transform: translateY(100%); }
.feed-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Darken the clip under its caption. */
.feed-slide::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 36%;
  pointer-events: none;
  background: linear-gradient(transparent, rgb(6 4 3 / 80%));
}

.feed-ui { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
/* Blend the clip into the status area above it. */
.feed-ui::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 22%;
  background: linear-gradient(#060403 44%, transparent);
}
.feed-brand {
  position: absolute;
  z-index: 1;
  top: 5.6%;
  left: calc(var(--u) * 5);
  display: flex;
  align-items: center;
  gap: .4em;
  font-size: calc(var(--u) * 4.5);
  font-weight: 750;
  letter-spacing: -.075em;
  line-height: 1;
}
.feed-brand .brand-mark { width: 1.3em; }
/* Like, share and save, each reel's own, with its counts as in the app. */
.feed-rail {
  position: absolute;
  z-index: 1;
  right: calc(var(--u) * 3.2);
  bottom: calc(var(--u) * 5.2);
  width: calc(var(--u) * 13);
  display: grid;
  justify-items: center;
  gap: calc(var(--u) * 4.4);
}
.feed-rail span { display: grid; justify-items: center; gap: calc(var(--u) * .9); }
.feed-rail b {
  font-size: calc(var(--u) * 3.1);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.feed-rail .icon, .feed-dock .icon { width: calc(var(--u) * 7.2); height: calc(var(--u) * 7.2); stroke-width: 1.8; }
.is-liked .feed-rail span:first-child .icon {
  fill: #ff8a3d;
  stroke: #ff8a3d;
  animation: feed-like .42s cubic-bezier(.3, 1.7, .5, 1);
}
@keyframes feed-like { from { transform: scale(.55); } }
.feed-caption {
  position: absolute;
  z-index: 1;
  left: calc(var(--u) * 5);
  right: calc(var(--u) * 19);
  bottom: calc(var(--u) * 5);
}
/* The move's name in capitals on one line, as in the app. */
.feed-title {
  font-size: calc(var(--u) * 4.6);
  font-weight: 800;
  letter-spacing: .02em;
  line-height: 1.15;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgb(0 0 0 / 65%);
}
/* The pill under the name that opens the exercise guide in the app. */
.feed-details {
  display: inline-flex;
  align-items: center;
  gap: .45em;
  margin-top: calc(var(--u) * 2.2);
  padding: calc(var(--u) * 1.9) calc(var(--u) * 2.6) calc(var(--u) * 1.9) calc(var(--u) * 3.2);
  border: 1px solid rgb(255 240 220 / 28%);
  border-radius: 999px;
  background: rgb(11 9 8 / 76%);
  font-size: calc(var(--u) * 3.2);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  color: #fff9ee;
}
/* Its chevron, drawn with two borders. */
.feed-details i {
  width: .42em;
  height: .42em;
  border: solid currentColor;
  border-width: .1em .1em 0 0;
  transform: rotate(45deg);
  opacity: .85;
}
.feed-dock {
  position: absolute;
  z-index: 1;
  inset: auto 0 0;
  height: 8%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  justify-items: center;
  padding-top: calc(var(--u) * 3.1);
  background: #0a0706;
}
.feed-dock .icon { width: calc(var(--u) * 6.6); height: calc(var(--u) * 6.6); opacity: .58; }
.feed-dock .icon:first-of-type { opacity: 1; }
/* Playback position of the current clip, on the dock's top edge as in the app. */
.feed-progress { position: absolute; inset: 0 0 auto; height: max(1px, calc(var(--u) * .5)); background: rgb(255 249 238 / 16%); }
.feed-progress i { display: block; height: 100%; background: #fff9ee; transform: scaleX(0); transform-origin: left; }
.feed-dock::after {
  content: "";
  position: absolute;
  left: 32.5%;
  bottom: calc(var(--u) * 2);
  width: 35%;
  height: calc(var(--u) * 1.25);
  border-radius: 999px;
  background: rgb(255 249 238 / 88%);
}

/* The whole display pauses and resumes the demo. */
.feed-toggle {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 100%;
  border-radius: inherit;
}
.feed-toggle[hidden] { display: none; }
.feed-toggle:focus-visible { outline-offset: -5px; outline-color: #ffe1b4; }
.feed-toggle span {
  display: grid;
  place-items: center;
  width: calc(var(--u) * 19);
  height: calc(var(--u) * 19);
  border-radius: 50%;
  background: rgb(8 6 5 / 62%);
  box-shadow: inset 0 0 0 1px rgb(255 240 220 / 24%);
  opacity: 0;
  transition: opacity .18s ease;
}
.feed-toggle .icon { width: 42%; height: 42%; margin-left: 6%; fill: currentColor; stroke-width: 1.2; }
.is-paused .feed-toggle span { opacity: 1; }

@media (max-width: 690px) {
  .tour-phone { width: min(86%, 314px); }
}

@media (prefers-reduced-motion: reduce) {
  .is-liked .feed-rail span:first-child .icon { animation: none; }
}
