/* Phone layout: compact app-like header, 16:9 hero, one-line categories. */
@media (max-width: 800px) {
  /* Solid bar: the translucent overlay over the hero reads as noise on a phone. */
  #site-header,
  body.page-home #site-header {
    height: auto;
    background: #0f0f0f;
  }

  body.page-home #main {
    padding-top: var(--site-header-height, 84px);
  }

  .has-site-search .header-inner {
    height: auto !important;
    padding: 0 12px !important;
    gap: 0 8px !important;
  }

  .has-site-search .header-inner > .brand {
    min-height: 46px !important;
  }

  #site-header .brand-logo {
    width: auto;
    height: 20px;
  }

  /* Colors and glass states stay in site-search.css; this block only sizes
     the control for the phone header. */
  #site-header .site-search {
    height: 30px;
    padding: 0 4px 0 10px;
    border-radius: 999px;
  }

  #site-header .site-search input {
    height: 30px;
    font-size: 13px;
  }

  #site-header .site-search > .icon {
    width: 15px;
    height: 15px;
  }

  #site-header .search-clear {
    flex-basis: 24px;
    height: 24px;
  }

  .has-site-search .search-submit {
    display: none;
  }

  #site-header .picker-header {
    height: 30px;
  }

  #site-header .picker-start {
    padding: 0 10px;
    font-size: 12px;
  }

  #site-header .picker-menu > summary {
    width: 28px;
  }
  #site-header .studio-link {
    height: 30px;
    padding: 4px 8px;
    font-size: 12px;
    gap: 4px;
  }

  #site-header .studio-link .icon {
    width: 12px;
    height: 12px;
  }

  #site-header .main-nav {
    height: 38px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }

  #site-header .main-nav > a {
    height: 38px;
    font-size: 14px;
  }

  #site-header .main-nav a.active::after {
    bottom: 3px !important;
    width: 16px;
    height: 2px;
    border-radius: 2px;
    background: var(--accent-strong);
  }

  /* 16:9 banner: the 2.65 crop cut the poster's own lettering off. */
  body.page-home .hero {
    height: auto;
    aspect-ratio: 16 / 9;
    min-height: 0;
    max-height: none;
  }

  body.page-home .hero-topline,
  body.page-home .hero-center-play,
  body.page-home .hero-next {
    display: none;
  }

  body.page-home .hero-copy > span,
  body.page-home .hero-copy p {
    display: none;
  }

  body.page-home .hero-bottom {
    left: 12px;
    right: 12px;
    bottom: 8px;
    gap: 10px;
  }

  body.page-home .hero-copy h2 {
    display: block;
    font-size: 15px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body.page-home .hero-copy h2 .icon {
    display: none;
  }

  body.page-home .hero-carousel {
    display: flex;
    align-items: flex-end;
  }

  body.page-home .hero-number {
    display: block;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.9);
  }

  body.page-home .hero-dots {
    display: none;
  }

  /* Categories: one scrollable row instead of three wrapped rows. */
  body.page-home .mobile-filter-slot {
    margin: 0;
    padding: 0;
  }

  body.page-home .filter-row {
    padding: 0 12px;
    border-bottom: 0;
  }

  body.page-home .category-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 6px;
    height: 44px;
    align-items: center;
    scrollbar-width: none;
  }

  body.page-home .category-tabs::-webkit-scrollbar {
    display: none;
  }

  body.page-home .category-tab {
    flex: 0 0 auto;
    min-height: 0;
    padding: 5px 12px;
    font-size: 13px;
    border-radius: 999px;
  }

  body.page-home .collection-toolbar {
    display: none;
  }

  body.page-home .works-section {
    padding-top: 8px;
  }

  /* Two tight columns so a phone shows the banner plus four cards. */
  body.page-home {
    padding: 0 10px;
  }

  body.page-home .work-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  body.page-home .card-image {
    border-radius: 6px;
  }

  body.page-home .card-info {
    padding: 8px;
  }

  body.page-home .card-title {
    font-size: 13px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  body.page-home .card-sub,
  body.page-home .card-meta {
    font-size: 11px;
  }

  body.page-home .card-play {
    display: none;
  }
}

@media (max-width: 800px) {
  #site-header .header-left,
  #site-header .header-right {
    display: contents;
  }

  #site-header .header-inner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: 46px 38px;
    align-items: center;
    gap: 0 8px;
    height: auto !important;
    padding: 0 12px !important;
  }

  #site-header .brand {
    grid-column: 1;
    grid-row: 1;
    min-height: 0 !important;
    justify-self: start;
  }

  #site-header .site-search {
    grid-column: 2;
    grid-row: 1;
    width: 100%;
    min-width: 0;
    max-width: none;
    margin: 0;
    height: 30px;
  }

  #site-header .header-actions {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
  }

  #site-header .main-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    height: 38px;
    margin: 0;
    justify-content: space-between;
    gap: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }
}