/* Picture keeps the photograph and its overlaid labels in one coordinate system. */
.hero::before { content: none; }
.hero__picture { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.hero__picture img { width: 100%; height: 100%; object-fit: cover; object-position: center bottom; filter: brightness(1.28) saturate(.95); }
.hero__gallery a { min-height: 44px; }
@media (max-width: 999px) {
  .header__inner { gap: 10px; }
  .header__actions { margin-left: 0; }
  .header__nav { order: 4; }
  .header__links a { display: block; padding: 10px 0; }
}
@media (max-width: 767px) {
  .hero { aspect-ratio: 941 / 1672; }
  .hero__picture img { object-fit: contain; filter: brightness(1.16); }
  .hero__title { left: 8%; top: 8%; font-size: clamp(30px, 8vw, 60px); max-width: 85%; line-height: 1.08; }
  /* Five evenly spaced signs recede toward the upper-left vanishing point. */
  .hero__gallery {
    left: var(--sign-left); top: var(--sign-top); width: var(--sign-width);
    font-size: clamp(13px, 3.5vw, 26px); line-height: 1.18;
    transform: perspective(900px) rotateY(-16deg) rotateZ(-3deg);
    transform-origin: left center;
  }
  .hero__gallery a {
    display: grid; grid-template-columns: 1.5em 1fr; align-items: center; gap: .55em;
    min-height: 44px; padding: .4em .8em;
    border: 1px solid #d9b5748c; border-left: 2px solid #efd49b;
    background: linear-gradient(100deg, #191a16ed, #29251edb);
    box-shadow: 5px 8px 16px #0005; color: #fff0d0;
  }
  .hero__gallery a:hover, .hero__gallery a:focus-visible { background: #453c2eee; }
  .hero__gallery a > span { display: none; }
  .hero__gallery a::after { content: var(--sign-label); white-space: pre-line; }
  .hero__gallery i { margin: 0; font-size: .8em; font-style: normal; font-weight: normal; color: #d8b97c; }
  .hero__gallery--bird { --sign-left: 10%; --sign-top: 32%; --sign-width: 58%; --sign-label: "Bird & Flower\a Motif Gallery"; }
  .hero__gallery--poetry { --sign-left: 14%; --sign-top: 42.5%; --sign-width: 60%; --sign-label: "Poetry & Text\a Motif Gallery"; }
  .hero__gallery--figure { --sign-left: 18%; --sign-top: 53%; --sign-width: 62%; --sign-label: "Figure\a Motif Gallery"; }
  .hero__gallery--geometric { --sign-left: 22%; --sign-top: 63.5%; --sign-width: 64%; --sign-label: "Geometric\a Motif Gallery"; }
  .hero__gallery--vessel { --sign-left: 26%; --sign-top: 74%; --sign-width: 66%; --sign-label: "Vessel\a Motif Gallery"; }
  .hero__prompt { left: 8%; width: 84%; bottom: 4%; font-size: clamp(12px, 3vw, 22px); line-height: 1.5; }
  .patterns__intro { max-width: 100%; line-height: 1.7; }
  .patterns__heading h2 { font-size: clamp(42px, 10vw, 70px); line-height: 1; }
  .patterns__list { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: center; }
  .patterns__item:last-child { grid-column: 1 / -1; width: 65%; justify-self: center; }
  .dialog { padding: 24px 18px; overflow-y: auto; }
  .dialog h2 { font-size: 22px; overflow-wrap: anywhere; }
  .hall-nav__links { flex-wrap: wrap; }
  .hall-nav__links a, .hall-nav__links button { min-height: 44px; display: inline-flex; align-items: center; gap: 5px; }
  .extraction > * { min-width: 0; }
  .hall-footer, .hall-source-note { overflow-wrap: anywhere; }
}
@media (max-width: 420px) {
  .brand { gap: 7px; font-size: 15px; }
  .brand img { width: 34px; height: 34px; }
  .header__inner { gap: 8px; }
  .header__actions { width: 100%; justify-content: flex-end; }
  .header__menu { min-height: 44px; }
  .icon-button { min-width: 44px; min-height: 44px; }
  .gallery-switch { gap: 8px; }
  .gallery-switch a { padding: 10px; font-size: 13px; }
}


/* Keep the additional design/original comparison controls usable on phones. */
.pattern-controls { flex-wrap: wrap; }
.pattern-scan.is-refined { background-color: #ede4d2; background-image: linear-gradient(45deg, #e2d7c3 25%, transparent 25%), linear-gradient(-45deg, #e2d7c3 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e2d7c3 75%), linear-gradient(-45deg, transparent 75%, #e2d7c3 75%); background-size: 20px 20px; background-position: 0 0, 0 10px, 10px -10px, -10px 0; }
