/* KONK! home on a phone held upright (Safari with its bars leaves about 393 × 660).
   The whole home column fits on one screen above the music strip: a smaller logo,
   tighter play rows and the five utility links in two rows. Every control keeps a 44px touch target. If the text
   is enlarged or the browser chrome is taller, the column still scrolls, inside itself only, and never under the
   music strip. The strip shows the song, the people behind it and the playing bars again. */
@media (max-width: 700px) and (orientation: portrait) {
  html body .screen-title.is-active {
    gap: 6px;
    /* Room for the music strip under the last row: its height, its edge gap, the home indicator, and a breath. */
    padding-bottom: calc(var(--control-size) + max(var(--now-playing-edge, 14px), env(safe-area-inset-bottom)) + 14px);
    overscroll-behavior: contain; /* scrolling the menu never drags the whole page */
    -webkit-overflow-scrolling: touch;
  }

  /* Hero: the logo gives up height first; edition and location sit tight beneath it. */
  html body .screen-title .home-logo { width: min(250px, 64vw); margin: 0 0 0 -4px; }
  html body .screen-title .home-edition { margin: 2px 0 0; }
  html body .screen-title .home-location { margin: 0 0 2px; }

  html body .screen-title .menu-stack { gap: 6px; }
  /* Still a compact column with the table showing beside it: the desktop 300px on phones that have the room,
     so the three utility links read as three words, not one. */
  @media (min-width: 375px) { html body .screen-title .menu-stack { width: min(300px, 100%); } }
  html body .screen-title .home-play { min-height: 50px; padding-block: 8px; }
  html body .screen-title .btn.home-mayhem { min-height: 48px; padding-block: 6px; }
  html body .screen-title .home-more-trigger { min-height: 44px; }

  /* The five utility links: full width, three across, then Credits and KONK! home. */
  html body .screen-title .home-more-utilities.cap-workshop-utilities {
    grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 10px;
    width: 100%; margin-top: 4px; padding: 2px 12px 0;
  }
  html body .screen-title .home-more-utilities.cap-workshop-utilities :is(button, a) { min-height: 44px; padding: 6px 0; font-size: 13.5px; }
  html body .screen-title .home-more-utilities.cap-workshop-utilities .home-trailer-link {
    grid-column: span 2; margin-top: 0; border-top: 0; color: var(--paper);
  }

  /* Stars and the tap-in hint share one quiet line under the menu instead of floating over it. */
  html body .screen-title .title-stars { margin: 2px 0 0; }
  html body .screen-title .home-tap-hint {
    position: static; align-self: stretch; margin: 0; text-align: center; font-size: 16px;
  }

  /* Music strip: song title, who made it and the bars, on a surface solid enough to read over the table. */
  html body .now-playing { background: rgb(var(--ink-rgb) / .9); }
  html body .now-playing-text { display: grid; }
  html body .now-playing-bars { display: flex; margin-right: 2px; }
  html body .now-playing-main { flex: 1; padding-right: 10px; }
  html body .now-playing-bars { margin-left: auto; } /* the bars sit at the right end, beside Next song */
  html body .now-playing[data-status="playing"] .now-playing-cover { box-shadow: none; }
  html body .now-playing-title { font-size: 13px; }
  html body .now-playing-credit { font-size: 11px; }
}

/* A first visit adds "Just play" under Learn with Kwame; the star line (nothing earned yet) gives way for it. */
@media (max-width: 700px) and (orientation: portrait) {
  html body .screen-title:has(.home-learn:not([hidden])) .title-stars { display: none; }
}
/* Short phones (iPhone SE, Safari bars showing): a smaller logo, and the tap-in hint steps aside. */
@media (max-width: 700px) and (orientation: portrait) and (max-height: 620px) {
  html body .screen-title .home-logo { width: min(200px, 54vw); }
  html body .screen-title .home-tap-hint { display: none; }
}

/* The smallest phones (iPhone SE, 320–360 wide): two utility columns so the words never squeeze. */
@media (max-width: 360px) and (orientation: portrait) {
  html body .screen-title .home-more-utilities.cap-workshop-utilities { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html body .screen-title .home-more-utilities.cap-workshop-utilities .home-trailer-link { grid-column: 1 / -1; }
}
