/* Gallery controls: change these values to tune spacing across screen sizes. */
.animation-page {
  --animation-page-padding: clamp(20px, 5vw, 80px);
  --animation-tile-gap: clamp(16px, 2vw, 30px);
  --animation-copy-padding: clamp(16px, 1.5vw, 24px);
  --animation-section-padding: clamp(12px, 2vw, 24px);
  --animation-max-width: 1600px;
}
.animation-page .masthead,
.animation-page footer,
.animation-main {
  width: min(calc(100% - 2 * var(--animation-page-padding)), var(--animation-max-width));
  margin-inline: auto;
}
.animation-intro { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; padding-block: var(--animation-section-padding); }
.animation-period { color: var(--accent); }
.animation-intro > p { font-size: 13px; line-height: 1.7; margin: 0 0 4px; }
.animation-gallery-note { font-size: 9px; letter-spacing: .08em; }
.animation-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--animation-tile-gap); }
.animation-tile { position: relative; display: block; aspect-ratio: 16 / 27; overflow: hidden; isolation: isolate; background: #0e658b; color: white; }
.animation-tile img { display: block; width: 100%; height: 100%; object-fit: cover; transform: scale(1.03); transition: transform .45s ease, opacity .45s ease; }
.animation-tile::after { content: ''; position: absolute; inset: 0; background: linear-gradient(transparent 10%, #053850e8 100%); opacity: 0; transition: opacity .3s ease; pointer-events: none; }
.animation-copy { position: absolute; inset: auto 0 0; z-index: 1; padding: var(--animation-copy-padding); display: flex; flex-direction: column; gap: 16px; opacity: 0; transform: translateY(16px); transition: opacity .3s ease, transform .3s ease; }
.animation-title { font-family: 'Space Grotesk', Arial, sans-serif; font-size: clamp(20px, 1.65vw, 28px); font-weight: 600; line-height: 1.1; letter-spacing: -.04em; overflow-wrap: anywhere; }
.animation-credits { font-size: 12px; line-height: 1.6; }
.animation-watch { font-size: 9px; letter-spacing: .1em; display: flex; justify-content: space-between; gap: 10px; }
.animation-tile:hover img, .animation-tile:focus-visible img { transform: scale(1.08) translateY(-8px); opacity: .65; }
.animation-tile:hover::after, .animation-tile:focus-visible::after, .animation-tile:hover .animation-copy, .animation-tile:focus-visible .animation-copy { opacity: 1; }
.animation-tile:hover .animation-copy, .animation-tile:focus-visible .animation-copy { transform: translateY(0); }
.animation-tile:focus-visible { outline-offset: 4px; }
.video-dialog { width: min(1080px, 92vw); max-width: 1080px; max-height: 92dvh; overflow-y: auto; }
.video-dialog[open] { display: block; }
.video-dialog-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 24px; }
.video-dialog-bar h2 { margin: 0; font-size: 18px; font-weight: 500; }
.video-close { width: 44px; height: 44px; background: none; border: 0; font-size: 30px; }
.video-player { aspect-ratio: 16 / 9; background: #111; }
.video-player iframe, .video-player video { width: 100%; height: 100%; display: block; border: 0; }
.video-fallback { padding: 0 24px; font-size: 12px; line-height: 1.6; }
.video-source { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 1200px) { .animation-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 900px) { .animation-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .animation-title { font-size: 24px; } }
@media (max-width: 650px) {
  .animation-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .animation-intro { display: block; }
  .animation-intro > p { margin-top: 12px; }
  .animation-gallery-note { display: none; }
  .animation-title { font-size: 21px; }
  .animation-credits { font-size: 11px; }
  .animation-copy { gap: 12px; }
}
/* Touch visitors can read the credits and tap once to watch. */
@media (hover: none), (pointer: coarse) {
  .animation-tile::after, .animation-copy { opacity: 1; }
  .animation-copy { transform: none; }
}
@media (max-width: 380px) { .animation-grid { grid-template-columns: 1fr; } }
