.site-settings .locale-menu {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: clamp(5px, 1vw, 15px);
  direction: ltr;
}
.site-settings .locale-menu a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 2px;
  color: var(--muted);
  white-space: nowrap;
  font: inherit;
  font-size: clamp(13px, 1vw, 16px);
}
.site-settings .locale-menu a[aria-current],
.site-settings .locale-menu a:hover { color: var(--paper); text-decoration: underline; text-underline-offset: 5px; }
html:lang(zh) { font-family: system-ui, "PingFang SC", "Microsoft YaHei", sans-serif; }
.collection-choices a:not([aria-current]) { background: transparent; color: var(--paper); border-color: var(--muted); }
.collection-choices a[aria-current] { color: var(--bg); background: var(--paper); border-color: var(--paper); }
@media (max-width: 680px) {
  .site-header .site-settings { gap: 6px; }
  .site-header .locale-menu { gap: 6px; }
  .portfolio-home .site-header nav { gap: 0; }
}
@media (max-width: 480px) {
  .site-header, .portfolio-home .site-header { display: grid; grid-template-columns: auto 1fr; }
  .site-header .wordmark { grid-area: 1 / 1; }
  .site-header .site-settings { grid-area: 1 / 2; justify-self: end; }
  .site-header nav, .portfolio-home .site-header nav { grid-column: 1/-1; grid-row: 2; justify-self: stretch; justify-content: flex-start; margin: 0; gap: 15px; }
  .site-header nav a { min-height: 32px; }
}

.profile-intro .about-portrait { isolation: isolate; background: transparent; }
.profile-intro .about-portrait::after { content: none; }
/* All editions are square, registered on the eyes and chin at export. */
.profile-intro .about-portrait img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
}
.profile-intro .about-portrait .portrait-alternate { display: none; }
html[data-portrait="luffy"] .about-portrait .portrait-luffy,
html[data-portrait="winter"] .about-portrait .portrait-winter { display: block; }
html:is([data-portrait="luffy"],[data-portrait="winter"]) .profile-intro .about-portrait > img:first-child { display: none; }
html:not([data-portrait]) .portrait-switch { display: none; }
.about-portrait .portrait-switch {
  position: absolute; inset: 0; display: flex; justify-content: end; align-items: start;
  width: 100%; height: 100%; padding: clamp(2px,.3vw,5px); background: transparent; border: 0; cursor: pointer;
  color: var(--muted); -webkit-tap-highlight-color: transparent;
}
.portrait-switch svg { display: block; width: clamp(11px, 1.1vw, 16px); height: auto; }
.portrait-switch:focus-visible { outline: 3px solid #c64d31; outline-offset: -3px; }
.film-lead-media > .hero-outgoing {
  position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }

  .portrait-switch svg { transition: rotate 350ms cubic-bezier(.2,.8,.22,1); }
  html[data-portrait="luffy"] .portrait-switch svg { rotate: 120deg; }
  html[data-portrait="winter"] .portrait-switch svg { rotate: 240deg; }
  .collection-choices a, .download-link { transition: translate 160ms ease, background-color 180ms, color 180ms; }
  .collection-choices a:active, .download-link:active { translate: 0 2px; }
  dialog[open] { animation: player-arrive 200ms ease-out; }
  @keyframes player-arrive { from { opacity: .7; scale: .99; } to { opacity: 1; scale: 1; } }
}

.profile-intro .intro-identity, .profile-intro .intro-bio,
.film-lead-caption > *, .work-title-row > * { min-inline-size: 0; }
.film-first .brand-intro.profile-intro {
  padding-block: clamp(22px,3vw,40px);
  row-gap: clamp(10px,1.3vw,18px);
}
.profile-intro .intro-identity :is(h1,p), .profile-intro p.intro-bio { margin: 0; letter-spacing: normal; }
.profile-intro .intro-identity h1, .film-lead-caption h2, .work-title-row h1 { overflow-wrap: break-word; text-wrap: balance; }
.profile-intro .intro-identity p { margin-block-start: .25rem; line-height: 1.4; }
.profile-intro p.intro-bio { max-inline-size: 65ch; line-height: 1.6; text-wrap: pretty; }
:lang(ar) .profile-intro p.intro-bio { max-inline-size: 63ch; line-height: 1.85; }
:lang(zh) .profile-intro p.intro-bio { max-inline-size: 34em; line-height: 1.8; }
html:lang(zh) :is(h1,h2,h3,.intro-bio,.collection-choices,.work-role,.film-dialog) {
  font-family: system-ui,"PingFang SC","Microsoft YaHei",sans-serif; letter-spacing: normal; line-break: strict;
}
.collection-choices { flex-wrap: wrap; row-gap: 8px; }
.collection-choices a { max-inline-size: 100%; text-align: start; }
.film-card[hidden], .exhibit-shot[hidden], .gallery-empty[hidden] { display: none !important; }
.site-footer { flex-wrap: wrap; gap: clamp(12px,2vw,28px); }
.watch-summary { max-width: var(--width); margin: auto; padding: var(--gutter); }
.watch-summary :is(video, .watch-poster) { display: block; width: min(100%, 56rem); max-height: 70vh; object-fit: contain; margin-block: 1rem; }
.watch-summary a { text-decoration: underline; text-underline-offset: .2em; }
.watch-summary .watch-photos { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr)); gap: 1rem; padding: 0; list-style: none; }
.watch-summary .watch-photos img { display: block; width: 100%; height: auto; }
.watch-summary nav { margin-block: 1.5rem; }
/* Keep the shared contact and download areas below the selected work without repeating the archive. */
.exhibit-main:has(.watch-summary) > :is(.brand-intro, .film-lead, .collection-bar, .exhibit-gallery) { display: none; }
@media (max-width: 600px) {
  .film-first .brand-intro.profile-intro { column-gap: clamp(10px,3.8vw,18px); }
  .film-first .profile-intro .intro-identity h1 { font-size: clamp(22px,6.2vw,35px); line-height: 1.24; }
  html:lang(ar) .profile-intro .intro-identity h1 { line-height: 1.45; }
  .profile-intro .collection-choices { gap: 8px; }
  .profile-intro .collection-choices a { min-block-size: 44px; }
  .site-footer a { margin-block: 0; }
}
@media (max-width: 900px) {
  :is(.work-page,.biography-page) .site-header {
    display: grid; grid-template-columns: auto minmax(0,1fr); height: auto;
    padding-block: 8px; gap: 4px 12px;
  }
  :is(.work-page,.biography-page) .site-header .wordmark { grid-area: 1 / 1; }
  :is(.work-page,.biography-page) .site-header .site-settings { grid-area: 1 / 2; justify-self: end; }
  :is(.work-page,.biography-page) .site-header nav {
    grid-area: 2 / 1 / 3 / -1; display: flex; flex-wrap: wrap;
    justify-content: start; min-width: 0; margin: 0; padding: 0; gap: 0 clamp(8px,2.6vw,24px);
  }
  :is(.work-page,.biography-page) .site-header nav a {
    min-height: 40px; min-width: 0; white-space: normal; text-wrap: balance;
  }
}
.work-title-row .work-role { white-space: normal; max-inline-size: 100%; }
@media (max-width: 900px) {
  .work-title-row { flex-direction: column; align-items: start; gap: 8px; }
  .work-title-row .work-role { margin: 0; }
}

.film-lead-stage { position: relative; }
.film-lead-stage .film-lead-caption {
  position: absolute; inset-inline-end: 12px; bottom: 12px; z-index: 2; padding: 0; min-height: 0;
}
.film-lead-stage .film-play .play-circle { background: #142d30; color: #fff8ed; }


/* Both archives start at the same rule, with the same title, count and search row. */
.portfolio-home #films.selected { display: block; padding-block-start: 0; }
.collection-bar {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(14rem, 30%); align-items: center;
  gap: 8px 28px; border-block-start: 1px solid var(--line);
  margin-block: clamp(24px, 3.8vw, 52px) clamp(16px, 2.2vw, 32px);
  padding-block-start: clamp(14px, 2vw, 26px);
}
.film-lead + .collection-bar {
  width: calc(100% - 2 * var(--gutter)); max-width: calc(var(--width) - 2 * var(--gutter)); margin-inline: auto;
}
.collection-bar .collection-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.collection-bar h2 { margin: 0; font-size: clamp(26px, 3.2vw, 40px); line-height: 1.35; }
.collection-bar [data-work-count] { color: var(--muted); font-size: 14px; white-space: nowrap; }
.collection-bar .work-search { margin: 0; }
.collection-bar .work-search input { width: 100%; min-width: 0; font: inherit; font-size: max(16px, 1em); border: 1px solid var(--line); padding-inline: 12px; }
.collection-bar .no-work-results { grid-column: 1 / -1; margin: 0; }
@media (max-width: 680px) {
  .collection-bar { grid-template-columns: minmax(0, 1fr); }
  .collection-bar .collection-title { justify-content: space-between; }
}

@media (max-width: 440px) {
  .collection-bar .collection-title { display: grid; justify-content: start; gap: 2px; }
}
@media (max-width: 360px) {
  .collection-bar h2 { font-size: 22px; }
}
