/* Mobile uses flowing content inside a stable header and navigation shell. */
@media (max-width: 760px) {
  .home-media-controls .media-control,
  #panel .panel-head-actions .media-control {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 4px;
    min-width: 0;
    min-height: 72px;
    padding: 6px 2px;
    font-size: .875rem;
    line-height: 1.25;
  }
  .home-media-controls .media-control-label,
  #panel .panel-head-actions .media-control-label { display: none; }
  .home-media-controls .media-control::after,
  #panel .panel-head-actions .media-control::after {
    content: attr(data-mobile-label);
    white-space: pre-line;
    text-align: center;
    font: inherit;
    letter-spacing: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
  }
  .home-media-controls .media-control[hidden],
  #panel .panel-head-actions .media-control[hidden] { display: none; }

  .home {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 100svh;
    padding: 0;
  }
  .home > .home-media-controls {
    position: relative;
    inset: auto;
    order: 0;
    width: 100%;
    max-width: none;
    padding: max(8px, env(safe-area-inset-top)) 16px 0;
    align-items: start;
  }
  .home > .masthead {
    position: relative;
    inset: auto;
    order: 1;
    flex: none;
    margin: 16px 0 12px;
  }
  .home > .scene {
    position: relative;
    inset: auto;
    order: 2;
    flex: none;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    z-index: 0;
    mask-image: linear-gradient(transparent, #000 10%, #000 80%, transparent);
    -webkit-mask-image: linear-gradient(transparent, #000 10%, #000 80%, transparent);
  }
  .home > .scene img,
  .home > .scene video { inset: 0; width: 100%; height: 100%; object-fit: cover; }
  .body-panel-open .home > .scene {
    position: fixed;
    inset: 0;
    height: 100svh;
    height: 100dvh;
    aspect-ratio: auto;
    mask-image: none;
    -webkit-mask-image: none;
  }
  .body-panel-open .home::before {
    content: '';
    order: 2;
    flex: none;
    aspect-ratio: 16 / 9;
  }
  .home > .featured {
    position: relative;
    inset: auto;
    order: 3;
    flex: none;
    margin: 4px 20px 0;
  }
  .home > .featured h2.has-featured-title-art {
    width: min(100%, 24rem);
    margin-bottom: 8px;
  }
  .home > .featured .work-actions { gap: 12px 20px; min-height: 56px; }
  .home .featured .listen-action { font-size: 1.125rem; min-height: 48px; gap: 10px; }
  .home .featured .film-action { font-size: .875rem; letter-spacing: .04em; }
  .home .play-medallion.delenda-control { width: 44px; height: 44px; }
  .home > .coast-bottom {
    position: relative;
    inset: auto;
    order: 4;
    flex: none;
    padding: 32px 22px max(18px, env(safe-area-inset-bottom));
  }
  .home .coast-bottom .navigation { gap: 24px 28px; margin-bottom: 32px; }
  .home .nav-poem { font-size: clamp(1.5rem, 5.5vw, 1.875rem); line-height: 1.12; }
  .home .nav-caption { margin-top: 12px; }

  #panel {
    height: 100svh;
    height: 100dvh;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
  }
  #panel[open] { display: grid; }
  #panel .panel-head {
    position: relative;
    inset: auto;
    grid-row: 1;
    height: auto;
    min-width: 0;
    padding: max(10px, env(safe-area-inset-top)) 16px 6px;
    background: linear-gradient(#071013d9, #07101370);
  }
  #panel .panel-wordmark {
    display: block;
    width: min(58vw, 12rem);
    max-width: calc(100% - 60px);
    margin: 9px 0 15px;
  }
  #panel .panel-head-actions {
    position: static;
    inset: auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
    gap: 4px;
  }
  #panel .panel-head-actions .close-button {
    position: absolute;
    top: max(4px, env(safe-area-inset-top));
    right: 12px;
    width: 44px;
    height: 44px;
  }
  #panel #panel-content {
    position: relative;
    inset: auto;
    grid-row: 2;
    min-width: 0;
    min-height: 0;
    margin: 0 12px;
    padding: 8px 4px 16px;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior-y: contain;
    scrollbar-width: thin;
    scrollbar-color: #a4b7bc40 transparent;
    scroll-padding-block: 12px;
  }
  #panel .panel-footer {
    position: relative;
    inset: auto;
    grid-row: 3;
    display: flex;
    flex-direction: column;
    gap: 0;
    min-height: 0;
    padding: 4px 12px max(6px, env(safe-area-inset-bottom));
    background: linear-gradient(#040a0dda, #03090cf5);
  }
  #panel .panel-navigation {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    width: 100%;
    max-width: none;
    gap: 0;
  }
  #panel .panel-navigation a {
    width: 100%;
    min-width: 0;
    height: auto;
    min-height: 44px;
    margin: 0;
    padding: 6px 2px;
    font-size: .875rem;
    line-height: 1.2;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  #panel .back-link {
    position: static;
    min-height: 44px;
    margin: 0;
    padding: 6px 12px;
    font-size: .875rem;
  }

  /* One scroll surface: headings no longer occupy a fixed part of the story. */
  #panel .project-view {
    display: block;
    height: auto;
    max-height: none;
    min-height: 0;
    margin: 0;
    padding: 16px;
    overflow: visible;
  }
  .project-view .project-opening { margin-bottom: 22px; }
  #panel-title.project-title { font-size: 2.5rem; margin: 0; }
  .project-title-art-image { max-height: 112px; }
  .project-view .project-body {
    display: flex;
    flex-direction: column;
    height: auto;
    gap: 24px;
    padding: 0;
    overflow: visible;
    scrollbar-gutter: auto;
  }
  .project-view .project-story { height: auto; overflow: visible; padding: 0; }
  .project-view .project-text p { font-size: 1rem; line-height: 1.65; }
  .project-view .project-artwork { height: auto; width: min(100%, 260px); }
  .project-view .project-figure { height: auto; }
  .project-view .project-image-stage { flex: none; aspect-ratio: 4 / 5; }

  /* The animated figure belongs to the artwork stage; the title has its own row. */
  #panel .music-view {
    height: auto;
    max-height: none;
    min-height: 0;
    grid-template-rows: auto auto auto auto;
    padding: 0 0 8px;
  }
  .music-view .song-scene {
    --mobile-cover: clamp(120px, 40cqw, 180px);
    container-type: inline-size;
    height: auto;
    min-height: 0;
    overflow: visible;
  }
  .music-view .song-display {
    --cover-width: var(--mobile-cover);
    --card-step: calc(var(--cover-width) * .65);
    height: auto;
    padding: 4px 0 0;
  }
  .music-view .song-display > .eyebrow { padding: 0 8px; margin: 0 0 12px; }
  .music-view .song-cover-stage { height: calc(var(--cover-width) + 100px); }
  .music-view .song-choice,
  .music-view .song-cover { left: 50%; }
  .music-view .song-choice {
    padding: 5px 5px 12px;
    border-radius: 10px;
    opacity: calc(1 - var(--distance) * .2);
    filter: brightness(calc(1 - var(--distance) * .25));
  }
  .music-view .song-choice-title,
  .music-view .song-choice-meta,
  .music-view .song-artwork-hint { display: none; }
  .music-view .song-figure {
    top: calc(1.225rem + 24px);
    bottom: auto;
    right: auto;
    left: var(--figure-mobile-left, 66%);
    height: calc(var(--mobile-cover) + 76px);
    width: auto;
  }
  .music-view .song-heading,
  .music-view.has-title-art .song-heading {
    position: relative;
    inset: auto;
    width: 100%;
    max-width: none;
    margin: 12px 0 0;
    padding: 0 8px;
  }
  .music-view #panel-title { font-size: 2rem; line-height: 1.15; }
  .music-view .song-title-art { width: min(calc(100% * var(--title-art-scale, 1)), calc(48px * var(--title-ink-ratio, var(--title-art-ratio, 2.5)) * var(--title-art-scale, 1))); }
  .music-view .song-title-art-image {
    width: 100%;
    height: auto;
    object-fit: contain;
    object-position: left center;
  }
  .music-view.has-title-art[data-title-style=signature] #panel-title { margin-bottom: 4px; }
  .music-view .song-edition { padding-right: 76px; line-height: 1.5; }
  .music-view .song-browse button { top: calc(1.225rem + 16px + var(--cover-width) * .48); }
  .music-view .music-frame { inset: 28px 0 0; }
  .music-view .song-player { margin: 12px 8px 0; gap: 4px 12px; padding-top: 12px; }
  .music-view .song-waveform { height: 44px; }
  .music-view .song-volume-control { min-height: 44px; }
  .music-view .song-mute,
  .music-view .song-volume-control input { min-height: 44px; }
  .music-view .song-links { margin: 8px; gap: 0 20px; }
  .music-view .song-links .inline-link { flex-basis: 100%; width: fit-content; }
  .music-view .song-information {
    display: none;
    height: auto;
    min-height: 0;
    margin: 0 0 8px;
    padding: 14px 16px;
  }
  .music-view.is-reading .song-information { display: grid; grid-template-rows: auto auto; }
  .music-view.is-reading .song-scene { display: none; }
  .music-view .song-info-body { container-type: normal; overflow: visible; padding: 4px 0 0; }
  .music-view.is-reading .song-info-toggle { display: none; }

  #panel .film-view { width: 100%; padding: 14px; margin: 0; }
  .film-view .film-heading { margin-bottom: 14px; }
  .film-view .film-title-art-image { max-height: 90px; object-fit: contain; object-position: left center; }
  .film-view .film-stage { min-height: 0; }
  .film-view .film-stage:has(.film-youtube:not([hidden])),
  .film-view .film-youtube iframe { min-height: 200px; }
  .film-view .film-play-symbol.delenda-control { width: 56px; height: 56px; }
  .film-view .film-start { gap: 6px; }
  .film-view .film-below { column-gap: 16px; }
  .film-view .film-below a { overflow-wrap: anywhere; }
  #panel .gallery-view,
  #panel .copy-view { margin: 0; padding: 16px; }
  #panel .gallery-view #panel-title,
  #panel .copy-view #panel-title { font-size: 2.25rem; margin-bottom: 22px; }
  .gallery-controls { gap: 12px; }
  .gallery-arrow.delenda-control { min-width: 44px; min-height: 44px; }
}
