* { box-sizing: border-box; }

:root { color-scheme: dark; }

html,
body { width: 100%; height: 100%; }

body {
  margin: 0;
  overflow: hidden;
  background: #0d0d0f;
  color: #fff;
  font-family: var(--font-display, "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
  -webkit-font-smoothing: antialiased;
}

button,
select,
input { font: inherit; }

button,
select { color: inherit; }

button:focus-visible,
select:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid var(--color-primary-on-dark, #2997ff);
  outline-offset: 3px;
}

.film,
.stage,
.stage canvas,
.reference { position: absolute; inset: 0; width: 100%; height: 100%; }

.film { isolation: isolate; background: #0d0d0f; }

.stage { z-index: 0; }

.stage canvas { display: block; }

.reference {
  z-index: 1;
  display: none;
  object-fit: cover;
  background: #000;
}

.film.is-comparing .stage { inset-inline-end: 50%; width: 50%; }
.film.is-comparing .reference { display: block; inset-inline-start: 50%; width: 50%; }

.film::before,
.film::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset-inline: 0;
  pointer-events: none;
}

.film::before {
  top: 0;
  height: 26%;
  background: linear-gradient(to bottom, rgba(0, 0, 0, .55), transparent);
}

.film::after {
  bottom: 0;
  height: 30%;
  background: linear-gradient(to top, rgba(0, 0, 0, .62), transparent);
}

.topbar {
  position: absolute;
  z-index: 4;
  top: 0;
  right: 0;
  left: 0;
  min-height: 74px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: max(18px, env(safe-area-inset-top)) clamp(18px, 4vw, 58px) 12px;
}

.brand {
  width: max-content;
  color: inherit;
  text-decoration: none;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -.02em;
}

.topbar p {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  color: rgba(255,255,255,.72);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .16em;
}

.topbar i { width: 3px; height: 3px; border-radius: 50%; background: #59f0cf; }

.topbar > button { justify-self: end; }

.intro {
  position: absolute;
  z-index: 3;
  top: 17%;
  left: clamp(20px, 6vw, 92px);
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 16px;
  color: #73f6d8;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .2em;
}

.intro h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(54px, 7vw, 112px);
  font-weight: 650;
  line-height: .92;
  letter-spacing: -.07em;
  text-shadow: 0 2px 32px rgba(0,0,0,.35);
}

.intro > p:last-child {
  margin: 24px 0 0;
  color: rgba(255,255,255,.7);
  font-family: var(--font-text, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
  font-size: clamp(13px, 1.1vw, 16px);
  line-height: 1.6;
  letter-spacing: -.01em;
}

.transport {
  position: absolute;
  z-index: 5;
  right: clamp(16px, 4vw, 58px);
  bottom: max(18px, env(safe-area-inset-bottom));
  left: clamp(16px, 4vw, 58px);
  display: grid;
  grid-template-columns: 48px minmax(140px, 1fr) auto 68px 42px 42px;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 18px;
  background: rgba(24,24,26,.65);
  box-shadow: 0 14px 50px rgba(0,0,0,.24);
  -webkit-backdrop-filter: blur(22px) saturate(1.35);
  backdrop-filter: blur(22px) saturate(1.35);
}

.play,
.utility,
select {
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.1);
  cursor: pointer;
}

.play {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #111;
  font-size: 13px;
}

.utility,
select { min-height: 38px; border-radius: 999px; font-size: 12px; }

.utility { padding: 0 14px; }
.icon-button { width: 40px; padding: 0; font-size: 16px; }
.utility[aria-pressed="true"] { background: #fff; color: #111; }

.speed-label { color: rgba(255,255,255,.55); font-size: 11px; }

select { appearance: none; padding: 0 14px; text-align: center; }

.timeline { min-width: 0; }

input[type="range"] {
  width: 100%;
  height: 16px;
  margin: 0;
  accent-color: #65efd4;
  cursor: pointer;
}

.time {
  display: grid;
  grid-template-columns: 56px 1fr 56px;
  margin-top: 1px;
  color: rgba(255,255,255,.55);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .12em;
}

.time span:nth-child(2) { color: rgba(255,255,255,.78); text-align: center; }
.time span:last-child { text-align: right; }

.disclosure {
  position: absolute;
  z-index: 4;
  right: clamp(18px, 4vw, 58px);
  top: 88px;
  width: min(310px, 42vw);
  text-align: right;
}

.disclosure span { color: #73f6d8; font-size: 9px; font-weight: 700; letter-spacing: .18em; }
.disclosure p { margin: 7px 0 0; color: rgba(255,255,255,.52); font-size: 10px; line-height: 1.45; }

.fallback {
  position: absolute;
  z-index: 8;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 30px;
  background: #111;
  color: rgba(255,255,255,.7);
  text-align: center;
}

.fallback[hidden] { display: none; }

@media (max-width: 720px) {
  .topbar { min-height: 62px; grid-template-columns: 1fr auto; padding-inline: 18px; }
  .topbar p { display: none; }
  .intro { display: none; }
  .intro > p:last-child { display: none; }
  .disclosure { top: auto; right: 20px; bottom: 132px; width: 230px; }
  .disclosure p { display: none; }
  .transport {
    right: 12px;
    bottom: max(10px, env(safe-area-inset-bottom));
    left: 12px;
    grid-template-columns: 44px minmax(0, 1fr) 60px 38px 38px;
    gap: 7px;
    padding: 9px;
    border-radius: 16px;
  }
  .speed-label { display: none; }
  .time { grid-template-columns: 44px 1fr 44px; letter-spacing: .06em; }
  .time span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .utility { padding-inline: 10px; }
  .film.is-comparing .stage { inset: 0 0 50%; width: 100%; height: 50%; }
  .film.is-comparing .reference { inset: 50% 0 0; width: 100%; height: 50%; }
}
