/* Choose. One or more (index.html), from 1200px wide: the card under the pointer unfolds to the right
   and a screen beside its text shows the solution at work. The other cards and the summary fold to a
   strip with their name on its side. assets/screens.js measures, opens and closes; this file is how
   it looks. While the cards move, their text keeps its width (--cw, --tw for the switch, --sw), so
   nothing rewraps or slides under the screen. */

.sb-spine,
.sb-screen {
  display: none;
}

@media (min-width: 1200px) {
  .sb-pgrid.is-live .sb-plan {
    grid-template-columns: minmax(0, var(--cw, 1fr)) var(--tw, auto);
    justify-content: start;
  }

  .sb-pgrid.is-live .sb-summary__in {
    width: var(--sw, auto);
  }

  .sb-summary__in {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
  }

  .sb-pgrid.is-live .sb-summary {
    position: relative;
    overflow: hidden;
  }

  /* a folded card: its text goes, its name stands on its side */
  .sb-plan .sb-plan__name,
  .sb-plan .sb-plan__price,
  .sb-plan .sb-plan__what,
  .sb-plan .sb-toggle,
  .sb-summary__in {
    transition: opacity 0.35s ease 0.2s, visibility 0s linear 0s;
  }

  .sb-plan.is-folded .sb-plan__name,
  .sb-plan.is-folded .sb-plan__price,
  .sb-plan.is-folded .sb-plan__what,
  .sb-plan.is-folded .sb-toggle,
  .sb-summary.is-folded .sb-summary__in {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.12s ease, visibility 0s linear 0.12s;
  }

  .sb-spine {
    display: block;
    position: absolute;
    z-index: 1;
    left: 50%;
    bottom: 30px;
    margin: 0;
    writing-mode: vertical-rl;
    transform: translateX(-50%) rotate(180deg);
    font-size: clamp(28px, 2.3vw, 60px);
    font-weight: 500;
    line-height: 1;
    letter-spacing: -0.035em;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
  }

  .is-folded > .sb-spine {
    opacity: 1;
    transition: opacity 0.45s ease 0.3s;
  }

  .sb-summary > .sb-spine {
    color: #252324;
  }

  /* the screen: from where the card ended at rest to 16px from where it ends open */
  .sb-screen {
    display: block;
    position: absolute;
    z-index: 2;
    top: 16px;
    bottom: 16px;
    left: calc(var(--rw, 0px) - 12px);
    width: calc(var(--xw, 0px) - var(--rw, 0px) - 4px);
    overflow: hidden;
    border-radius: 24px;
    background: #141414;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-36px);
    transition: opacity 0.3s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), visibility 0s linear 0.3s;
  }

  .sb-plan.is-open > .sb-screen {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity 0.5s ease 0.12s, transform 1s cubic-bezier(0.16, 1, 0.3, 1) 0.08s, visibility 0s linear 0s;
  }

  .sb-plan--presence > .sb-screen,
  .sb-plan--partner > .sb-screen {
    box-shadow: 0 0 0 1px rgba(255, 252, 225, 0.14);
  }

  .sb-plan--growth > .sb-screen {
    box-shadow: 0 30px 60px -28px rgba(37, 35, 36, 0.55), 0 0 0 1px rgba(37, 35, 36, 0.16);
  }

  .sb-screen__view {
    position: absolute;
    inset: 0;
    overflow: hidden;
  }

  .sb-screen__still,
  .sb-screen__frame {
    position: absolute;
    left: 0;
    top: 0;
    border: 0;
  }

  .sb-screen__still {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 0;
  }

  .sb-screen__frame {
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
  }

  .sb-screen__frame.is-ready {
    opacity: 1;
  }

  /* a website: in a browser, drawn at desktop size and scaled down to the screen (screens.js) */
  .sb-screen--site {
    background: #ffffff;
  }

  .sb-screen--site .sb-screen__view {
    top: 44px;
  }

  .sb-screen--site .sb-screen__frame {
    transform-origin: 0 0;
  }

  .sb-screen__bar {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 44px;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 16px;
    box-sizing: border-box;
    background: #f1efe2;
    border-bottom: 1px solid rgba(37, 35, 36, 0.1);
  }

  .sb-screen__bar > i {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: rgba(37, 35, 36, 0.2);
  }

  .sb-screen__url {
    position: absolute;
    left: 50%;
    top: 50%;
    display: flex;
    align-items: center;
    gap: 7px;
    height: 28px;
    padding: 0 16px;
    border-radius: 999px;
    background: #ffffff;
    color: rgba(37, 35, 36, 0.78);
    font-size: 14px;
    font-weight: 450;
    letter-spacing: -0.01em;
    white-space: nowrap;
    transform: translate(-50%, -50%);
  }

  .sb-screen__url svg {
    flex: none;
    width: 11px;
    height: 13px;
  }

  .sb-screen--app {
    background: #1e1e1e;
  }

  .sb-screen--film {
    background: #101011;
  }
}

@media (min-width: 1200px) and (prefers-reduced-motion: reduce) {
  .sb-screen,
  .sb-plan.is-open > .sb-screen {
    transform: none;
  }
}
