/* The hero: a film of a real Mac on white, cut off by a curve that holds the one call. As the page moves the
   film rises from behind the curve. Everything inside the film is drawn by macOS; see assets/macos/SOURCES.md. */

.hero-film {
  --arch: 141px;
  position: relative;
  isolation: isolate;
  overflow: clip;
  padding: 110px 24px 0;
  background: #fff;
  color: #1d1d1f;
}
.hero-heading { position: relative; }
.hero-film h1 { max-width: 1100px; margin: 0 auto 40px; font-size: clamp(44px, 6vw, 72px); line-height: 1.1; }

/* As wide as Dia's, narrowing on short windows so what is centred in the film clears the curve. */
.home .demo { position: relative; width: min(1100px, 100%, max(640px, calc((100svh - 441px) * 2.1))); margin: 0 auto; text-align: left; }
.demo-viewport { position: relative; container-type: inline-size; aspect-ratio: 1200 / 788; overflow: hidden; border-radius: calc(16 * min(100vw / 1440, 100svh / 854)); }

.demo-scene { position: absolute; inset: 0; }
.demo-scene img { display: block; }
.demo-desktop { width: 100%; height: 100%; }
.demo-work { position: absolute; left: 29.667%; top: 15.990%; width: 59.333%; height: auto; }
.demo-work[hidden] { display: none; }
.demo-spinner { position: absolute; left: 30.250%; width: 1.667%; height: auto; will-change: transform; }
.demo-menu { position: absolute; left: 64.583%; top: 0; width: 30%; height: auto; opacity: 0; }
.demo-pill { position: absolute; left: 34.333%; top: 2.284%; width: 31.333%; aspect-ratio: 752 / 220; overflow: hidden; opacity: 0; }
.demo-pill img { width: 100%; height: auto; }
.demo-pill svg { position: absolute; inset: 0; width: 100%; height: 100%; }
/* Geometry of the app's own ring in CountdownPill. */
.demo-ring { fill: none; stroke: #307cf8; stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; }

.demo-pointer { position: absolute; inset: 0; pointer-events: none; will-change: transform; }
/* The drawing is 33 by 36 points, and its tip is at 4, 3. */
.demo-pointer img { position: absolute; left: 0; top: 0; width: 2.75%; height: auto; transform: translate(-12.121%, -8.333%); transform-origin: 12.121% 8.333%; }

/* The menu bar while guarding: patches over the desktop, at their places on the screen. */
.demo-shield { position: absolute; left: 78.667%; top: 0.635%; width: 1.833%; height: auto; }
.demo-shield-fill { clip-path: inset(100% 0 0 0); }
.demo-shield-armed { opacity: 0; }
.demo-clock { position: absolute; left: 86.667%; top: 0.381%; width: 13.333%; height: auto; opacity: 0; }

/* The time goes by: the menu bar's own clock steps through every minute, and a stopwatch under it says so, while the work goes
   on and the rest of the screen falls back a little. */
.demo-clock-run { position: absolute; left: 86.667%; top: 0.381%; width: 13.333%; aspect-ratio: 320 / 44; overflow: hidden; opacity: 0; }
.demo-clock-run img { display: block; width: 100%; height: auto; }
.demo-spot { position: absolute; inset: 0; background: radial-gradient(circle at 92% 3%, rgba(40, 24, 0, 0) 14%, rgba(40, 24, 0, 0.22) 56%); opacity: 0; pointer-events: none; }
.demo-stopwatch { position: absolute; right: 1.1%; top: 5.2%; display: flex; align-items: center; gap: 0.5cqw; padding: 0.7cqw 1.5cqw 0.7cqw 1cqw; border-radius: 999px; background: #fff; box-shadow: 0 1.2cqw 3.4cqw rgba(60, 36, 0, 0.26); opacity: 0; }
.demo-watch { width: 3.7cqw; height: 3.7cqw; fill: none; stroke: #1d1d1f; stroke-width: 3; stroke-linecap: round; }
.demo-watch-face { stroke: rgba(0, 0, 0, 0.12); }
.demo-watch-ring { stroke: #ff9500; stroke-dasharray: 100; transform: rotate(-90deg); transform-origin: 20px 23px; }
.demo-watch-hand { transform-origin: 20px 23px; }
.demo-watch-time { width: 15.6cqw; aspect-ratio: 360 / 124; overflow: hidden; }
.demo-watch-time img { display: block; width: 100%; height: auto; }

.demo-lockscreen, .demo-done { opacity: 0; }
.demo-lockscreen > img:first-child, .demo-done > img:first-child { width: 100%; height: 100%; }
.demo-lock-time { position: absolute; left: 31.667%; top: 12.056%; width: 36.667%; height: auto; opacity: 0; }
.demo-typing { position: absolute; left: 37.5%; top: 87.310%; width: 25%; aspect-ratio: 600 / 96; overflow: hidden; }
.demo-lock-floor { position: absolute; left: 0; top: 100%; width: 100%; height: auto; }
.demo-typing img { width: 100%; height: auto; }
.demo-toast { position: absolute; left: 31.667%; top: 2.284%; width: 36.667%; height: auto; opacity: 0; }

/* A hand on the Mac: the one thing in the film that is not on the screen, so it comes into the frame. */
.demo-key { position: absolute; left: 50%; top: 42%; display: flex; flex-direction: column; align-items: center; gap: 1.6cqw; opacity: 0; transform: translateX(-50%); }
.demo-keys { display: flex; gap: 0.35cqw; }
.demo-keys i { position: relative; display: grid; place-items: center; width: 4.6cqw; height: 4.6cqw; border-radius: 0.8cqw; background: linear-gradient(#fff, #f2f2f4); box-shadow: 0 0.14cqw 0 #c4c4ca, 0 0.5cqw 1.8cqw rgba(0, 0, 0, 0.24); color: #6e6e73; font-size: 1.5cqw; font-style: normal; }
.demo-keys .demo-space { width: 24cqw; }
.demo-space b { position: absolute; inset: 0; border: 0.2cqw solid #ff9d24; border-radius: inherit; opacity: 0; }

.demo-touch { display: flex; align-items: center; gap: 0.8cqw; padding: 0.9cqw 1.5cqw; border-radius: 4cqw; background: #ff9d24; color: #2c1900; font-size: 1.35cqw; font-weight: 500; white-space: nowrap; }
.demo-touch .i { width: 1.8cqw; height: 1.8cqw; }

.demo-evidence { opacity: 0; }

/* The last word, a little above the middle so all of it clears the curve. */
.demo-end { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding-bottom: 10.5cqw; background: #f5f5f7; color: #1d1d1f; text-align: center; opacity: 0; }
.demo-end img { width: 5.6cqw; height: 5.6cqw; margin-bottom: 1.8cqw; }
.demo-end p { font: 400 5.4cqw/1.08 "Exposure", Georgia, serif; font-synthesis: none; letter-spacing: -0.04em; }
.demo-end span { margin-top: 1.6cqw; color: rgba(0, 0, 0, 0.55); font-size: 1.7cqw; line-height: 1.35; }
.demo-evidence img { display: block; width: 100%; height: 100%; }

/* Pinned to the bottom of the window until the film has risen clear of it, then it moves off with the page. */
.hero-bottom { position: sticky; bottom: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; height: var(--arch); margin: 24px -24px 0; padding-top: 31px; }
.hero-bottom::before { content: ""; position: absolute; z-index: -1; top: 0; left: -25%; width: 150%; height: 160%; border-radius: 50% 50% 0 0 / 34% 34% 0 0; background: #fff; }
.hero-cta { display: inline-flex; flex: none; align-items: center; justify-content: center; gap: 12px; height: 56px; padding: 0 28px; border-radius: 999px; background: #000; color: #fff; font-size: 18px; }
.hero-cta:hover { background: #2a2a2d; text-decoration: none; }
.hero-cta .i { font-size: 18px; opacity: 0.8; }
.hero-bottom > span { margin-top: 16px; color: rgba(0, 0, 0, 0.5); font-size: 14px; line-height: 16.8px; }

.demo-caption { display: flex; align-items: center; justify-content: center; gap: 2px; margin-top: 16px; }
.demo-caption:not(.demo-ready) { visibility: hidden; }
.demo-chapters { display: flex; align-items: center; gap: 2px; }
.demo-chapters button, .demo-play { border: 0; background: none; color: #6e6e73; font: 500 13px/1 inherit; font-family: inherit; cursor: pointer; }
.demo-chapters button { height: 30px; padding: 0 13px; border-radius: 999px; }
.demo-chapters button:hover, .demo-play:hover { color: #1d1d1f; }
.demo-chapters button[aria-pressed="true"] { background: #f0f0f2; color: #1d1d1f; }
.demo-play { display: grid; place-items: center; width: 30px; height: 30px; padding: 8px; border-radius: 50%; }
.demo-play .i { width: 14px; height: 14px; }
.demo-play-icon, .demo-paused .demo-pause-icon { display: none; }
.demo-paused .demo-play-icon { display: block; }

.journey-heading { padding: 64px 24px 0; text-align: center; }
.journey-heading h2 { font-size: clamp(33px, 5vw, 56px); line-height: 1.1; }

@media (max-width: 799px) {
  .demo-viewport { border-radius: 4px; }
}

/* On a short window the curve covers more of the film. */
@media (min-width: 601px) and (max-height: 760px) {
  .demo-end { padding-bottom: 20cqw; }
}

@media (max-width: 600px) {
  .hero-film { padding: 96px 16px 0; }
  .hero-film h1 { margin-bottom: 26px; font-size: clamp(38px, 10.4vw, 52px); }
  .home .demo { width: 100%; }
  .demo-viewport { aspect-ratio: 760 / 788; }
  /* The right of the screen, from the countdown to the clock, at a size a phone can read. */
  .demo-scene { right: auto; left: -57.895%; width: 157.895%; }
  /* The Lock Screen and what follows it are centred, and only the Mac's own right side is cropped. */
  .demo-lockscreen, .demo-done { left: -28.947%; }
  .demo-end { padding: 0 7cqw; }
  .demo-end img { width: 13cqw; height: 13cqw; margin-bottom: 4cqw; }
  .demo-end p { font-size: 11cqw; }
  .demo-end span { margin-top: 3.4cqw; font-size: 3.8cqw; }
  .demo-stopwatch { gap: 1cqw; padding: 1.4cqw 3cqw 1.4cqw 2cqw; }
  .demo-watch { width: 7.4cqw; height: 7.4cqw; }
  .demo-watch-time { width: 31cqw; }
  .demo-keys { gap: 0.8cqw; }
  .demo-keys i { width: 9.4cqw; height: 9.4cqw; border-radius: 1.8cqw; font-size: 3.2cqw; }
  .demo-keys .demo-space { width: 44cqw; }
  .demo-space b { border-width: 0.45cqw; }
  .demo-key { gap: 3cqw; }
  .demo-touch { gap: 1.6cqw; padding: 2cqw 3.2cqw; font-size: 3.6cqw; }
  .demo-touch .i { width: 4.2cqw; height: 4.2cqw; }
  .hero-bottom { margin: 22px -16px 0; }
  .hero-bottom::before { left: -50%; width: 200%; border-radius: 50% 50% 0 0 / 22% 22% 0 0; }
  .demo-chapters button { height: 36px; padding: 0 12px; }
  .demo-play { width: 36px; height: 36px; padding: 10px; }
  .demo-caption { margin-top: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .demo-play { display: none; }
}

html:not(.js) .demo-evidence { opacity: 1; }
