/* The stage of screens (stage.js) and the store buttons, shared by the landing page and the page
   behind a sent link. A page sets --accent to the wallpaper's color and --snow, --dim, --line,
   --ember on :root. */

/* ---------- backdrop ---------- */
/* The wallpaper's colors thrown against the page behind everything. Two layers so a page that
   changes wallpapers can fade the new colors in over the old. */
.glow {
  position: fixed;
  inset: -20%;
  z-index: -1;
  opacity: .38;
  filter: blur(40px);
  pointer-events: none;
  transition: opacity 1.6s ease;
}
.glow.out { opacity: 0; }

/* ---------- stage ---------- */
.stage-frame {
  position: relative;
  width: 100%;
  container-type: inline-size;
}
.stage-overlay {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  aspect-ratio: 16 / 9;
  z-index: 30;
  pointer-events: none;
}
.stage-overlay > * { pointer-events: auto; }
.stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
}
.stage .screen {
  position: absolute;
  left: var(--l);
  top: var(--t);
  width: var(--w);
  aspect-ratio: var(--ar);
  overflow: hidden;
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(244, 244, 245, .07), rgba(244, 244, 245, .02));
  /* Each screen stands in front of the one behind it and throws its shadow back onto it. They are
     stacked flat rather than given depth of their own: a shadow on a 3D layer of its own stays on
     that layer and never falls on its neighbours. */
  z-index: var(--depth);
  box-shadow:
    0 0 0 1px var(--line),
    56px 36px 80px 8px rgba(0, 0, 0, .9),
    24px 16px 30px 2px rgba(0, 0, 0, .85),
    7px 5px 10px 0 rgba(0, 0, 0, .75);
  /* The rise keeps its pace while the screen itself comes in quickly. */
  animation: slide-up .9s cubic-bezier(.2, .8, .2, 1) both, fade-in .3s ease both;
  animation-delay: calc(var(--depth) * 120ms);
}
/* A screen waits, unseen, until its picture is in: an empty screen is all shadow. */
.stage .screen:not(.loaded) { animation-play-state: paused; }
.stage .screen.phone { border-radius: 8% / 3.8%; }
.stage .screen.tablet { border-radius: 5% / 3.5%; }
.stage .shot {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  transition: opacity .7s ease;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(24px); }
}
@keyframes slide-up {
  from { transform: translateY(24px); }
}
@keyframes fade-in {
  from { opacity: 0; }
}
/* A phone's width: the same desk composed tall, so the screens are not tiny. A media query rather
   than a container one, so it switches at the same width as the words below the stage. */
@media (max-width: 700px) {
  .stage { aspect-ratio: var(--narrow-aspect); }
  .stage .screen, .stage .stage-logo { left: var(--ln); top: var(--tn); width: var(--wn); }
}
.stage-info {
  position: absolute;
  left: var(--l);
  top: var(--t);
  width: var(--w);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2.2cqi;
  text-align: left;
  animation: rise .9s cubic-bezier(.2, .8, .2, 1) .5s both;
}
.stage-info.align-bottom { translate: 0 -100%; }
.stage-info h1 { font-size: 3.6cqi; text-shadow: 0 2px 18px rgba(0, 0, 0, .7); }
.stage-info p { margin-top: .9cqi; font-size: 1.35cqi; color: var(--dim); text-shadow: 0 1px 12px rgba(0, 0, 0, .7); }
.stage-info .badges { justify-content: flex-start; gap: .9cqi; margin-top: 0; }
.stage-info .badge { padding: .95cqi 1.7cqi; border-radius: 1.3cqi; gap: .8cqi; }
.stage-info .badge svg { width: 1.7cqi; height: 1.7cqi; }
.stage-info .badge small { font-size: .72cqi; }
.stage-info .badge b { font-size: 1.15cqi; }
.stage-logo {
  position: absolute;
  left: var(--l);
  top: var(--t);
  width: var(--w);
  z-index: 20;
  color: var(--snow);
  animation: rise .9s cubic-bezier(.2, .8, .2, 1) .6s both;
}
.stage-logo svg {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 0 10px rgba(0, 0, 0, .8)) drop-shadow(0 8px 24px rgba(0, 0, 0, .6));
}
/* On the wide stage the wordmark sits a touch higher than its place. */
@media (min-width: 701px) {
  .stage-logo { translate: 0 -1.5cqi; }
}
/* Below the stage, the words it cannot hold on a narrow page. */
.flow-info { display: none; flex-direction: column; align-items: center; gap: clamp(1.5rem, 3.5vh, 2.25rem); }
@media (prefers-reduced-motion: reduce) {
  .stage .screen, .stage-info, .stage-logo { animation: none; }
}
/* The narrow stage leaves its words to the page below it. */
@media (max-width: 700px) {
  .stage-info { display: none; }
  .flow-info { display: flex; }
}

/* ---------- store buttons ---------- */
.badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .8rem;
}
.badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .8rem;
  padding: .95rem 1.7rem;
  border-radius: 18px;
  /* Frosted glass: they sit over the screens, so the art behind is blurred to a wash of its
     colours rather than showing through, with a dark accent tint for contrast. */
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .03)),
    color-mix(in srgb, color-mix(in srgb, var(--accent), #000 75%) 55%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  backdrop-filter: blur(18px) saturate(1.6);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .25),
    0 8px 24px -10px rgba(0, 0, 0, .7);
  color: var(--snow);
  text-decoration: none;
  text-shadow: none;
}
/* The hover brightening is its own layer so it can fade: gradients don't transition. */
.badge::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .05));
  opacity: 0;
  transition: opacity .35s ease;
  pointer-events: none;
}
.badge:hover::before { opacity: 1; }
.badge > * { position: relative; }
.badge svg { width: 24px; height: 24px; fill: currentColor; flex: none; }
.badge small {
  display: block;
  margin: 0;
  font-size: .65rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--dim);
}
.badge b {
  display: block;
  font-size: .975rem;
  font-weight: 600;
  letter-spacing: .01em;
  margin-top: .1rem;
}
/* Keep both store buttons on one row down to ~360px instead of stacking one of them. */
@media (max-width: 430px) {
  .badges { gap: .5rem; }
  .badge { padding: .8rem 1.05rem; gap: .55rem; border-radius: 16px; }
  .badge svg { width: 20px; height: 20px; }
  .badge small { font-size: .55rem; }
  .badge b { font-size: .84rem; }
}
