/* Home page: five acts on the liquid. The default rules are the still page (reduced motion and
   no JavaScript): normal sections over a still image. html.motion pins the acts, and acts.js
   drives them from the scroll position. */

.home main {
  background: var(--liquid-base);
  color: var(--liquid-ink);
  color-scheme: dark;
}

.act {
  position: relative;
  z-index: 1;
  padding: var(--sp-10) var(--page-inset);
}

.home footer {
  position: relative;
  z-index: 1;
  background: var(--page);
}

.act h2 {
  margin: 0;
  font-size: var(--fs-h2);
  line-height: 1;
  letter-spacing: -0.032em;
}

.act .lede {
  margin: 0;
  color: var(--liquid-ink-2);
}

/* ---- Act 1: the surface and the K ---------------------------------------- */

.act-surface {
  min-height: 100svh;
  display: grid;
  align-items: center;
}

.surface-copy {
  position: relative;
  z-index: 2;
  display: grid;
  gap: var(--sp-5);
  justify-items: start;
}

.surface-copy > * {
  margin: 0;
}

.surface-copy h1 {
  max-width: 11.5ch;
}

.surface-copy .surface-mark {
  margin-bottom: var(--sp-6);
}

.surface-wordmark {
  display: block;
  height: 28px;
  width: auto;
  color: var(--liquid-ink);
}

.surface-copy .surface-lede {
  max-width: 28ch;
}

.surface-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-5);
}

.kcv,
.kchip-hit {
  display: none;
}

.k-static {
  position: absolute;
  left: 72%;
  top: 50%;
  width: min(56svh, 34vw);
  height: auto;
  aspect-ratio: 1;
  color: var(--liquid-ink);
  transform: translate(-50%, -50%);
}

html.motion .kcv {
  display: block;
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

html.motion .kchip-hit {
  display: block;
  position: absolute;
  left: 0;
  top: 0;
  z-index: 3;
  width: 0;
  height: 0;
  border-radius: 30%;
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

html.motion .kchip-hit.is-held {
  cursor: grabbing;
}

html.motion .act-surface.k-live .k-static {
  display: none;
}

/* ---- Acts 2 and 3: the lift ----------------------------------------------- */

.act-lift {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  align-items: center;
  gap: var(--sp-8);
}

.lift-pin {
  display: contents;
}

.lift-copy {
  max-width: 30rem;
}

.lift-copy h2 {
  margin-bottom: var(--sp-5);
}

.lift-swap {
  display: grid;
}

.lift-swap > * {
  grid-area: 1 / 1;
}

.lift-intro p {
  margin: 0 0 var(--sp-4);
}

.inside-steps,
.inside-progress,
.lift-screen:not([data-i="-1"]),
.lift-tile {
  display: none;
}

.inside-steps {
  margin: 0;
  padding: 0;
  list-style: none;
}

.inside-step {
  grid-area: 1 / 1;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}

.inside-step.is-on {
  opacity: 1;
  transform: none;
}

.inside-step h3 {
  margin: 0 0 var(--sp-3);
  font-size: var(--fs-h3);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.inside-step p {
  margin: 0;
  color: var(--liquid-ink-2);
}

.inside-progress {
  margin-top: var(--sp-6);
}

.inside-progress span {
  width: 24px;
  height: 2px;
  margin-right: 6px;
  background: var(--liquid-line);
}

.inside-progress span.is-on {
  background: var(--liquid-ink);
}

.lift-stage {
  display: grid;
  place-items: center;
}

.lift-phone {
  position: relative;
  height: min(640px, 74svh);
  aspect-ratio: 1080 / 2400;
}

.lift-phone .app-phone {
  height: 100%;
}

.lift-screen {
  position: absolute;
  inset: 8px;
}

.lift-screen img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lift-tile {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: 132px;
  height: 132px;
  margin: -66px 0 0 -66px;
  border-radius: 30px;
  overflow: hidden;
}

.lift-tile img {
  display: block;
  width: 100%;
  height: 100%;
}

html.motion .act-lift {
  display: block;
  height: 500vh;
  padding: 0;
}

html.motion .lift-pin {
  display: block;
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
}

html.motion .lift-copy {
  position: absolute;
  left: var(--page-inset);
  top: 50%;
  width: min(30rem, 34vw);
  transform: translateY(-50%);
}

html.motion .lift-stage {
  position: absolute;
  right: var(--page-inset);
  top: 0;
  bottom: 0;
  width: 46vw;
}

html.motion .lift-phone {
  height: min(700px, 74svh);
}

html.motion .inside-steps {
  display: grid;
}

html.motion .inside-progress {
  display: flex;
}

html.motion .lift-screen {
  display: block;
  opacity: 0;
  transition: opacity 220ms var(--ease-out);
}

html.motion .lift-screen.is-on {
  opacity: 1;
}

html.motion .lift-tile {
  display: block;
}

/* ---- Inside: the screens as a list --------------------------------------- */

.act-inside .inside-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-8) var(--sp-7);
}

.act-inside .screen-fig {
  align-items: center;
}

.act-inside .app-phone {
  height: min(560px, 62svh);
  aspect-ratio: 1080 / 2400;
}

.act-inside .app-phone picture,
.act-inside .app-phone img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.act-inside .screen-text {
  color: var(--liquid-ink-2);
}

@media (min-width: 900px) {
  html.motion .act-inside {
    display: none;
  }
}

/* ---- Act 4: settle -------------------------------------------------------- */

.act-settle > * {
  width: 100%;
  max-width: 40rem;
  margin-inline: auto;
}

.act-settle h2 {
  margin-bottom: var(--sp-6);
}

html.motion .act-settle {
  min-height: 120svh;
  display: grid;
  align-content: center;
}

.home .group {
  background: var(--liquid-panel);
  border: 1px solid var(--liquid-line);
  border-radius: 20px;
}

.home .group-row,
.home .group-row-title {
  color: var(--liquid-ink);
}

.home .row-glyph {
  background: var(--liquid-panel);
  color: var(--liquid-ink-2);
}

.home .group-row::after {
  border-color: var(--liquid-ink-2);
}

.home .group-item + .group-item::before {
  background: var(--liquid-line);
}

/* ---- The hollows ---------------------------------------------------------- */

.act-hollows {
  padding-bottom: var(--sp-11);
  text-align: center;
}

.act-hollows h2 {
  max-width: 18ch;
  margin: 0 auto var(--sp-8);
}

html.motion .act-hollows {
  min-height: 100svh;
  display: grid;
  align-content: center;
}

.hollows {
  --hollow: 132px;
  --hollow-gap: 28px;
  display: grid;
  grid-template-columns: repeat(3, var(--hollow));
  gap: var(--hollow-gap);
  justify-content: center;
}

.hollow {
  display: grid;
  place-items: center;
  width: var(--hollow);
  aspect-ratio: 1;
  border-radius: calc(var(--hollow) * 0.229);
  background: var(--hollow-fill);
  box-shadow: var(--hollow-shadow);
}

html.liquid-on .hollow {
  background: transparent;
  box-shadow: none;
}

.hollow-icon {
  display: block;
  width: 84%;
  height: 84%;
  border-radius: calc(var(--hollow) * 0.229 * 0.84);
  overflow: hidden;
  view-transition-name: app-tile;
}

.hollow-icon img {
  display: block;
  width: 100%;
  height: 100%;
}

.hollow-k {
  width: 56%;
  height: 56%;
  color: var(--liquid-ink);
}

.hollow-app:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
}

/* ---- Phone ---------------------------------------------------------------- */

@media (max-width: 899px) {
  .act {
    padding: var(--sp-9) var(--page-inset);
  }

  .act-surface {
    align-items: start;
    padding-top: max(15svh, 88px);
  }

  .surface-copy h1 {
    max-width: none;
  }

  .k-static {
    left: 50%;
    top: auto;
    bottom: 120px;
    width: min(62vw, 300px);
    transform: translate(-50%, 0);
  }

  .act-lift {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
  }

  .lift-phone {
    height: min(520px, 64svh);
  }

  html.motion .act-lift {
    height: 170vh;
    padding: 0;
    justify-items: normal; /* or the pinned layer shrinks to zero width */
  }

  html.motion .lift-copy {
    left: var(--page-inset);
    right: var(--page-inset);
    top: max(10svh, 64px);
    width: auto;
    transform: none;
  }

  html.motion .lift-stage {
    left: 0;
    right: 0;
    top: 34svh;
    width: auto;
  }

  html.motion .lift-phone {
    height: min(52svh, 440px);
  }

  html.motion .inside-steps,
  html.motion .inside-progress,
  html.motion .lift-screen:not([data-i="-1"]) {
    display: none;
  }

  .act-inside .inside-strip {
    display: flex;
    gap: var(--sp-5);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin-inline: calc(-1 * var(--page-inset));
    padding-inline: var(--page-inset);
  }

  .act-inside .screen {
    flex: 0 0 78vw;
    scroll-snap-align: center;
  }

  .act-inside .app-phone {
    height: min(460px, 58svh);
  }

  .hollows {
    --hollow: 88px;
    --hollow-gap: 18px;
  }

  .lift-tile {
    width: 104px;
    height: 104px;
    margin: -52px 0 0 -52px;
    border-radius: 24px;
  }
}
