/* Phone/tablet compositions retain the relationships in the approved desktop
   exhibits. This file deliberately does not change desktop layouts. */
@media (max-width: 820px) {
  /* Work remains a picture + editorial summary, rather than four posters. */
  body[data-page="home"] .work-row {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: clamp(.85rem, 3vw, 1.5rem);
    align-items: start;
    min-height: 0;
    padding-block: 2.25rem;
  }
  body[data-page="home"] .work-media {
    grid-column: 1;
    margin: 0;
    align-self: start;
  }
  body[data-page="home"] .work-media img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 8 / 5;
    object-fit: contain;
    filter: none;
  }
  body[data-page="home"] .work-copy { grid-column: 2; min-width: 0; }
  body[data-page="home"] .work-copy h3 {
    font-size: clamp(1.2rem, 4.5vw, 2rem);
    line-height: 1.08;
    letter-spacing: -.035em;
  }
  body[data-page="home"] .work-copy > .work-category {
    margin: 0 0 .7rem;
    font-size: var(--type-label, .6rem) !important;
    line-height: 1.5;
    letter-spacing: .04em;
  }
  body[data-page="home"] .work-copy > p:not(.work-category) {
    margin: .8rem 0 1.1rem;
    font-size: .78rem;
    line-height: 1.55;
  }
  body[data-page="home"] .work-copy dl { gap: .5rem; margin-top: 0; }
  body[data-page="home"] .work-copy dl div {
    grid-template-columns: 1fr;
    gap: .2rem;
    padding-top: .45rem;
  }
  body[data-page="home"] .work-copy dt { font-size: .6rem; }
  body[data-page="home"] .work-copy dd { font-size: .72rem; line-height: 1.5; }
  body[data-page="home"] .work-arrow {
    width: 1.8rem;
    right: .4rem;
    bottom: .4rem;
    font-size: .9rem;
  }

  /* Portrait and introductory text share a compact opening composition.
     Career entries remain full width so the actual biography stays readable. */
  body[data-page="about"] .about-story {
    display: grid;
    grid-template-columns: minmax(5.5rem, .42fr) minmax(0, 1fr);
    align-items: start;
    gap: 0 clamp(1rem, 4vw, 2rem);
    padding-block: 7rem 4rem;
  }
  body[data-page="about"] .about-headshot {
    position: static;
    grid-column: 1;
    grid-row: 1 / span 3;
    width: 100%;
    margin: 0;
  }
  body[data-page="about"] .about-headshot img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: auto;
    object-fit: contain;
  }
  body[data-page="about"] .about-narrative { display: contents; }
  body[data-page="about"] .about-narrative > :is(.eyebrow, h1, p) { grid-column: 2; }
  body[data-page="about"] .about-narrative > .eyebrow { margin: 0; font-size: .63rem; letter-spacing: .06em; }
  body[data-page="about"] .about-narrative h1 {
    margin: .75rem 0 0;
    font-size: clamp(1.6rem, 5.4vw, 2.5rem);
    line-height: 1.08;
    letter-spacing: -.035em;
  }
  body[data-page="about"] .about-narrative > p:not(.eyebrow) {
    margin: 1rem 0 0;
    font-size: .9rem;
    line-height: 1.65;
  }
  body[data-page="about"] .career-list { grid-column: 1 / -1; margin-top: 3rem; }

  /* Two- and three-image evidence groups stay together at every phone width. */
  .source-case :is(.source-two-media, .source-phone-pair),
  .wallet-keynote .wallet-k-media--phones-2,
  .wallet-keynote .wallet-k-logo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .65rem;
  }
  .source-case .source-two-media--uneven { grid-template-columns: minmax(0, .72fr) minmax(0, 1.28fr); }
  :is(.source-case, .wallet-keynote) .wallet-k-media--phones-3,
  .source-case .source-three-stage {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .6rem;
    padding: .7rem;
  }
  :is(.source-case, .wallet-keynote) .wallet-k-media--phones-2 { padding: .7rem; column-gap: 1rem; }
  :is(.source-case, .wallet-keynote) .wallet-k-media--phones-3 :is(figure, .image-frame),
  :is(.source-case, .wallet-keynote) .wallet-k-media--phones-2 :is(figure, .image-frame) {
    width: 100%;
    min-width: 0;
    min-height: 0;
    padding: 0;
  }
  :is(.source-case, .wallet-keynote) :is(.wallet-k-media--phones-3, .wallet-k-media--phones-2) :is(img, video) {
    display: block;
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain;
  }
  :is(.source-case, .wallet-keynote) .wallet-k-media--labeled figcaption {
    min-height: 2.4em;
    margin-bottom: .65rem;
    font-size: .6rem;
    line-height: 1.3;
    letter-spacing: .02em;
  }
  body.wallet-keynote #personalization .wallet-k-media--mixed-3 { padding: .7rem; }
  body.wallet-keynote #personalization .wallet-k-media__inner {
    width: 100%;
    grid-template-columns: minmax(0, .805fr) minmax(0, 1fr);
    grid-template-rows: auto auto;
    gap: .7rem;
    padding: 0;
  }
  body.wallet-keynote #personalization .wallet-k-media__inner figure:first-child { grid-column: 1; grid-row: 1 / span 2; }
  body.wallet-keynote #personalization .wallet-k-media__inner figure:nth-child(2),
  body.wallet-keynote #personalization .wallet-k-media__inner figure:nth-child(3) { grid-column: 2; grid-row: auto; }
  body.wallet-keynote #personalization .wallet-k-media__inner figure:first-child .image-frame { width: 100%; }
  .source-case .source-phone-pair figure { padding: .5rem; }
  .source-case .source-three-stage .image-frame { min-height: 0; padding: .3rem; }
  .source-case .source-three-stage figcaption { padding: .5rem .2rem; font-size: .65rem; }

  /* Music: original discovery evidence, player comparisons and final screens. */
  .source-case--music .music-context-layout { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
  .source-case--music .music-context-layout .source-media-card--phone {
    height: auto;
    min-height: 0;
    padding: 0;
    background: #fff;
  }
  .source-case--music .music-context-layout .source-media-card--phone .image-frame { height: auto; }
  .source-case--music .music-context-layout .source-media-card--phone img {
    display: block;
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain;
  }
  .source-case--music .music-context-points { grid-column: 1 / -1; }
  .source-case--music .music-phone-gallery--final,
  .source-case--music .music-sustain-media--three,
  .source-case--music .music-sustain-media--six { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .55rem; }
  .source-case--music .music-phone-gallery--validation { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .4rem; }
  .source-case--music .music-research-comparison { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
  .source-case--music .music-research-v1 .image-frame,
  .source-case--music .music-research-v2 .image-frame { height: auto; min-height: 0; }
  .source-case--music .music-research-comparison img { width: 100%; height: auto; object-fit: contain; }
  .source-case--music .music-system-pair { grid-template-columns: minmax(0, .9fr) minmax(0, 2.35fr); gap: .65rem; }
  .source-case--music .music-system-pair .image-frame { height: auto; min-height: 0; }
  .source-case--music .music-system-pair img { width: 100%; height: auto; object-fit: contain; }
  .source-case--music .music-system-pair figcaption { font-size: .65rem; }

  /* The latest Music editorial art remains a joined composition on phones. */
  .music-editorial .ms-behavior-stage { grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 1.5rem 1rem; }
  .music-editorial .ms-player { width: 100%; }
  .music-editorial .ms-evidence-label { display: block; padding-bottom: .7rem; }
  .music-editorial .ms-evidence-label h3 { margin-bottom: .35rem; font-size: .95rem; }
  .music-editorial .ms-evidence-label > span { font-size: .65rem; }
  .music-editorial .ms-counts th { font-size: .78rem; }
  .music-editorial .ms-counts td { font-size: clamp(1.05rem, 4.1vw, 1.75rem); }
  .music-editorial .ms-counts :is(th, td) { padding-block: .7rem; }
  .music-editorial .ms-source-note { font-size: .65rem; }
  .music-editorial .ms-decisions { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
  .music-editorial .ms-decisions h3 { font-size: 1.05rem; line-height: 1.25; }
  .music-editorial .ms-decisions article p { font-size: .8rem; line-height: 1.6; }
  .music-editorial .me-direction-scene { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0 .7rem; }
  .music-editorial .me-structure { grid-column: 1 / 9; grid-row: 1; font-size: clamp(1.2rem, 5.2vw, 2rem); margin-bottom: 1.2rem; }
  .music-editorial .me-kinfolk { grid-column: 1 / 8; grid-row: 2 / 4; }
  .music-editorial .me-pantone { grid-column: 9 / 13; grid-row: 1 / 3; padding-top: 2rem; }
  .music-editorial .me-character { grid-column: 8 / 13; grid-row: 3; margin-top: 1rem; font-size: clamp(1.1rem, 4.5vw, 1.75rem); }
  .music-editorial .me-direction-keywords { grid-row: 4; margin-top: 1.5rem; }
  .music-editorial .me-reference-name { gap: .3rem; font-size: .55rem; }
  .music-editorial .me-direction-scene figcaption p { font-size: .7rem; }

  /* FITURE's three distinct views still read as one product experience. */
  .fiture-page .fiture-story-grid.fiture-journey {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .75rem;
    padding: 0;
    background: transparent;
  }
  .fiture-page .fiture-story-grid .fiture-journey__card { grid-template-rows: minmax(9rem, auto) auto; gap: .8rem; }
  .fiture-page .fiture-story-grid .fiture-journey__copy { display: block; min-width: 0; min-height: 0; }
  .fiture-page .fiture-story-grid .fiture-journey__copy h3 { font-size: clamp(.82rem, 2.8vw, 1.15rem); line-height: 1.3; letter-spacing: -.015em; }
  .fiture-page .fiture-story-grid .fiture-journey__copy p { font-size: .7rem; line-height: 1.5; margin-top: .6rem; }
  .fiture-page .fiture-story-grid .fiture-journey__label { font-size: .58rem; }
  .fiture-page .fiture-story-grid .fiture-ui-stage { width: 100%; height: auto; padding: 0; }
  .fiture-page .fiture-story-grid .fiture-ui-stage::before { display: none; }
  .fiture-page .fiture-story-grid .fiture-ui-stage img { display: block; width: 100%; height: auto; max-height: none; object-fit: contain; }
  .fiture-page .fiture-story-grid--card-gallery .fiture-story-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; }
  .fiture-page .fiture-story-grid--card-gallery .fiture-journey__card { grid-template-rows: auto; }

  /* Narōm: keep related boards adjacent, while prose stays at reading size. */
  .narom-keynote .narom-workflow-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem .7rem; padding: .7rem; }
  .narom-keynote .narom-system-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; padding: .7rem; }
  .narom-keynote .narom-system-grid figure { grid-template-columns: 1fr; grid-template-rows: auto auto; gap: 0; }
  .narom-keynote .narom-system-grid .image-frame { aspect-ratio: 1.38; }
  .narom-keynote .narom-system-grid figcaption { font-size: .65rem; line-height: 1.45; }
  .narom-keynote .narom-workflow-grid figcaption span { font-size: .62rem; }
  .narom-keynote .narom-workflow-grid figcaption strong { font-size: .78rem; }
}
@media (max-width: 820px) {
  .source-case--music :is(#problem, #restructure) .music-wallet-media {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: .65rem;
    gap: .5rem;
    margin-top: 2rem;
  }
  .source-case--music :is(#problem, #restructure) .music-wallet-media .image-frame { width: 100%; }
  .source-case--music :is(#problem, #restructure) .music-wallet-media img { border-radius: .45rem; }
  .source-case--music #research .music-research-comparison { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
}
