/* Desktop or phone picture per card, and the switch that sets them all (view-switch.js). A phone already sees both pictures. */
.view-switch,
.card-view,
.phone-name {
  display: none;
}

@media (min-width: 720px) {
  .view-switch:not([hidden]) {
    display: inline-flex;
    gap: 2px;
    min-height: 44px;
    padding: 3px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #fff;
  }

  .view-switch button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    font-family: "DM Mono", monospace;
    font-size: 11px;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    cursor: pointer;
  }

  .view-switch svg,
  .card-view svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .card {
    position: relative;
  }

  .card-view {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255, 255, 255, .95);
    box-shadow: 0 2px 8px rgba(16, 32, 16, .12);
  }

  .card-view button {
    display: grid;
    place-items: center;
    width: 32px;
    height: 26px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
  }

  .view-switch button[aria-pressed="true"],
  .card-view button[aria-pressed="true"] {
    background: var(--forest);
    color: #fff;
  }

  .view-switch button:focus-visible,
  .card-view button:focus-visible {
    outline: 2px solid var(--green);
    outline-offset: 2px;
  }

  /* In the desktop grid the phone stands in the same 16:10 space the desktop picture takes. */
  .card.as-phone .shot {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 16 / 10;
    padding: 14px 0;
    background: var(--green-soft);
  }

  .card.as-phone .shot .frame-monitor {
    display: none;
  }

  .card.as-phone .shot .frame-phone {
    display: block;
    width: auto;
    height: 100%;
    aspect-ratio: 400 / 854;
    margin: 0;
    padding: 5px;
    border-radius: 20px;
  }

  .card.as-phone .shot .frame-phone img {
    width: 100%;
    height: 100%;
    border-radius: 15px;
  }

  .card.as-phone .phone-name {
    display: block;
    position: absolute;
    left: 16px;
    bottom: 16px;
    color: var(--forest);
    font-size: 16px;
    font-weight: 600;
  }

  /* The phone grid: narrow columns of full-height phones, the toggle above each phone. */
  .rail.phones {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }

  .rail.phones .card.as-phone .shot {
    display: block;
    aspect-ratio: auto;
    padding: 48px 16px 0;
  }

  .rail.phones .card.as-phone .shot .frame-phone {
    width: 100%;
    height: auto;
  }

  .rail.phones .card.as-phone .phone-name {
    position: static;
    padding: 12px 0 2px;
    font-size: 15px;
    text-align: center;
  }

  .rail.phones .card.as-phone .card-foot {
    background: var(--green-soft);
  }

  .rail.phones .card.as-phone .cta:not(.cta-live) {
    background: #fff;
  }

  .rail.phones .works {
    display: none;
  }
}
