/* Download: a photograph of our doorway of light with the devices standing in its light, every screen green
   when it was taken; the app's own screens are cut to each screen (media/<wide|tall>-<device>-<variant>) and
   laid on the photograph in percent of it, so they stay in their frames at any size. The scene covers the
   hero; a phone or a portrait screen gets the tall photograph. A moment after the page opens every screen
   connects at once. The photograph is a picture with physical places in it: it is never mirrored. */
@layer widgets {
  .studio-hero {
    --connect-at: 1.6s;

    container-type: size;
  }
  .studio-hero .scene {
    position: absolute;
    z-index: var(--z-media);
    direction: ltr;
    left: 50%;
    top: 50%;
    width: max(100cqw, 100cqh * 2400 / 1344);
    aspect-ratio: 2400 / 1344;
    translate: -50% -50%;
  }
  .studio-hero .scene.tall {
    display: none;
    width: max(100cqw, 100cqh * 1200 / 1600);
    aspect-ratio: 1200 / 1600;
  }
  .studio-hero .backdrop {
    width: 100%;
    height: 100%;
  }
  .studio-hero.hero .copy {
    justify-content: flex-start;
    padding-top: var(--space-32);
  }
  .scene .frames {
    position: absolute;
    inset-inline-start: var(--l);
    top: var(--t);
    width: var(--w);
  }
  .scene .frames img {
    display: block;
    width: 100%;
  }
  .wide [data-frame="tv"] {
    --l: 55.625%;
    --t: 34.226%;
    --w: 22.250%;
  }
  .wide [data-frame="laptop"] {
    --l: 44.000%;
    --t: 50.521%;
    --w: 14.375%;
  }
  .wide [data-frame="tablet"] {
    --l: 78.458%;
    --t: 52.307%;
    --w: 7.792%;
  }
  .wide [data-frame="phone"] {
    --l: 71.750%;
    --t: 62.426%;
    --w: 4.667%;
  }
  .tall [data-frame="tv"] {
    --l: 28.667%;
    --t: 36.188%;
    --w: 42.750%;
  }
  .tall [data-frame="laptop"] {
    --l: 16.333%;
    --t: 55.250%;
    --w: 22.833%;
  }
  .tall [data-frame="tablet"] {
    --l: 62.167%;
    --t: 55.125%;
    --w: 16.000%;
  }
  .tall [data-frame="phone"] {
    --l: 48.417%;
    --t: 66.062%;
    --w: 8.583%;
  }
  .frames {
    position: relative;
    display: block;
  }
  .frames > .on {
    position: absolute;
    inset: 0;
    height: 100%;
    opacity: 0;
    animation: connect var(--duration-slower) var(--ease) var(--connect-at) forwards;
  }
  @keyframes connect {
    to {
      opacity: 1;
    }
  }

  @media (max-aspect-ratio: 1/1) {
    .studio-hero .scene.wide {
      display: none;
    }
    /* On a portrait screen the tall photograph stands above the words, so they never cover the doorway or
       the devices. */
    .studio-hero.hero {
      height: auto;
      min-height: 0;
      padding-bottom: var(--space-16);
      container-type: normal;
    }
    .studio-hero .scene.tall {
      display: block;
      position: relative;
      inset: auto;
      width: 100%;
      translate: none;
      mask-image: var(--mask-fade-bottom);
    }
    .studio-hero.hero .copy {
      height: auto;
      margin-top: calc(var(--space-4) * -1);
      padding: 0;
    }
  }

  @media (prefers-reduced-motion: reduce) {
    .frames > .on {
      opacity: 1;
    }
  }
}/* One tab per system with its mark: the visitor's own system comes first and is open. The stage shows the
   device of that system with the app's own screen inside, the text beside it says what to install. Without
   scripts every system shows and the tabs do not. */
@layer widgets {
  .system-tabs {
    display: flex;
    gap: var(--space-1);
    width: fit-content;
    max-width: 100%;
    margin: var(--space-12) auto 0;
    padding: var(--space-1);
    overflow-x: auto;
    border-radius: var(--radius-pill);
    background: var(--color-light-glass);
    box-shadow: var(--shadow-edge);
    scrollbar-width: none;
  }
  .system-tabs button {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: var(--space-2);
    min-height: 46px;
    padding: 0 var(--space-5);
    border: 0;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--color-light-muted);
    font-size: var(--text-md);
    white-space: nowrap;
    transition:
      background var(--duration-fast) var(--ease),
      color var(--duration-fast) var(--ease);
  }
  .system-tabs button:hover {
    color: var(--color-light);
  }
  .system-tabs button[aria-selected="true"] {
    background: var(--color-light);
    color: var(--color-dark);
  }
  .system-tabs .os {
    width: 17px;
    height: 17px;
  }
  .systems {
    overflow-x: clip;
  }
  .system {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    align-items: center;
    gap: var(--space-18);
    margin-top: var(--space-18);
    scroll-margin-top: 140px;
  }
  .stage {
    position: relative;
    isolation: isolate;
    display: grid;
    place-items: center;
    min-height: 480px;
  }
  .stage::before {
    content: "";
    position: absolute;
    z-index: var(--z-media);
    inset: 0 -10%;
    background: var(--glow-stage);
  }
  .about .os.big {
    width: 40px;
    height: 40px;
  }
  .about h3 {
    margin-top: var(--space-5);
    font-size: var(--heading-lg);
    line-height: var(--leading-snug);
    letter-spacing: var(--tracking-heading);
  }
  .about > p {
    max-width: 34ch;
    margin-top: var(--space-4);
    font-size: var(--text-lg);
  }
  .about .pill {
    margin-top: var(--space-7);
  }
  /* Until a system's app is out, the place of its button says so, in words. */
  .about .soon {
    max-width: 34ch;
    margin-top: var(--space-7);
    font-size: var(--text-lg);
    color: var(--color-text);
  }
  .about .command {
    margin-top: var(--space-4);
  }
  .about .text-link {
    display: flex;
    width: fit-content;
    margin-top: var(--space-4);
  }
  .about .specs {
    margin-top: var(--space-9);
  }
  .about .specs > div {
    grid-template-columns: 6.5rem minmax(0, 1fr);
    gap: var(--space-4);
    padding: var(--space-4) 0;
  }
  .about .specs :is(dt, dd) {
    font-size: var(--text-md);
  }
  /* The devices around the app's own screens; their bezels and the laptop's base in percent of the device. */
  .laptop {
    --bezel: 2.4% 2.4% 3.2%;
    --overhang: -7%;

    width: min(100%, 640px);
  }
  .laptop .screen,
  .tv .screen,
  .tablet {
    background: var(--color-deep);
    box-shadow: var(--shadow-screen);
  }
  .laptop .screen,
  .tv .screen {
    padding: var(--bezel);
  }
  .laptop .screen {
    border-radius: var(--radius-xl) var(--radius-xl) var(--radius-xs) var(--radius-xs);
  }
  .laptop .screen img {
    width: 100%;
    border-radius: var(--radius-xs);
  }
  .laptop::after {
    content: "";
    display: block;
    height: 13px;
    margin: 0 var(--overhang);
    border-radius: var(--radius-xs) var(--radius-xs) var(--radius-lg) var(--radius-lg);
    background: var(--gradient-laptop-base);
  }
  .tv {
    --bezel: 1.1%;

    width: min(100%, 660px);
  }
  .tv .screen {
    border-radius: var(--radius-sm);
  }
  .tv .screen img {
    width: 100%;
  }
  .tv::after {
    content: "";
    display: block;
    width: 26%;
    height: 12px;
    margin: 0 auto;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    background: var(--gradient-tv-stand);
  }
  .pair {
    display: flex;
    align-items: flex-end;
  }
  .tablet {
    width: min(62vw, 330px);
    padding: var(--space-3);
    border-radius: var(--radius-2xl);
  }
  .tablet img {
    width: 100%;
    border-radius: var(--radius-xl);
  }
  .pair .phone {
    --w: min(30vw, 168px);

    margin-inline-start: calc(var(--space-16) * -1);
  }
  .stage > .phone {
    --w: 250px;
  }

  @media (max-width: 760px) {
    .system-tabs {
      width: auto;
      padding: 0;
      border-radius: 0;
      background: none;
      box-shadow: none;
    }
    .system-tabs button {
      background: var(--color-light-glass);
    }
    .system {
      grid-template-columns: minmax(0, 1fr);
      gap: var(--space-10);
      margin-top: var(--space-10);
    }
    .stage {
      min-height: 0;
    }
    .stage > .phone {
      --w: 220px;
    }
  }

  @media (scripting: none) {
    .system-tabs {
      display: none;
    }
  }
}

/* [hidden] is final in the base layer; only a rule of that layer can show the hidden systems without scripts. */
@layer base {
  @media (scripting: none) {
    .system[hidden] {
      display: grid !important;
    }
  }
}