/* Swarpeti — smaller screens and reduced motion. Last, so it can override the rest. */

/* ------------------------------------------------------------------ *
 * Responsive + motion
 * ------------------------------------------------------------------ */

/* On wide screens the page makes room for the drawer, so you can keep playing
   the keys while you pick colours. */
@media (min-width: 1100px) {
  body {
    transition: padding-right 0.25s ease;
  }

  html.drawer-open body {
    padding-right: 390px;
  }

  /* With less width the panel wraps taller; the first-use tip under the
     instrument is the one thing to give up, so the page still fits 1280x800. */
  html.drawer-open .app > .footnote {
    display: none;
  }

  .scrim {
    display: none;
  }
}

/* Narrower (an iPad, a laptop with the drawer open): the same four columns, closer together. */
@container instrument (max-width: 1040px) {
  .panel {
    gap: 12px 14px;
    padding-inline: 16px;
  }

  .reeds,
  .drone-tuning,
  .drone-stops {
    gap: 4px;
  }
}

/* Below about 880px the four groups go two by two: Air and Reeds, then Drone and Pitch. */
@container instrument (max-width: 880px) {
  .panel,
  .panel:has(> .group-drone[hidden]) {
    grid-template-columns: auto auto;
    justify-content: space-around;
    gap: 18px 24px;
  }
}

/* Too narrow even for that: one column. */
@container instrument (max-width: 600px) {
  .panel,
  .panel:has(> .group-drone[hidden]) {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 14px 14px 10px;
  }
}

@media (max-width: 560px) {
  .app {
    padding: 12px 12px 24px;
  }

  .instrument {
    padding: 10px;
  }

  .btn span {
    display: none;
  }

  .reeds {
    gap: 8px;
  }

}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
