/* ---------------------------------------------------------------- films, motion and viewers (v3) */
button.project-link, button.film-card, button.still-card { display: block; width: 100%; padding: 0; margin: 0; border: 0; background: none; color: inherit; font: inherit; text-align: start; cursor: pointer; }
.play { position: absolute; inset-inline-start: 14px; bottom: 14px; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: var(--paper); color: var(--ink); box-shadow: 0 6px 20px rgba(18,19,17,.28); transition: background .25s, color .25s, transform .25s var(--ease); }
.play svg { margin-inline-start: 2px; }
.project-link:hover .play, .film-card:hover .play, .project-link:focus-visible .play, .film-card:focus-visible .play { background: var(--accent); color: #fff; transform: scale(1.08); }
.project-film .project-image, .film-frame { background: #1b1d1b; }
.project-tall.project-film .project-image { aspect-ratio: .705; }
.project-landscape .project-image { aspect-ratio: 1.45; }

/* more stills strip */
.more-stills { margin-top: 64px; padding-top: 24px; border-top: 1px solid var(--line); }
.more-title { margin: 0 0 18px; font: 500 13px var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.stills-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.still-card { display: grid !important; grid-template-columns: 112px 1fr; gap: 16px; align-items: center; }
.still-frame { display: block; aspect-ratio: 1; overflow: hidden; background: #d3d0c9; border: 1px solid rgba(29,33,31,.08); }
.still-frame img { transition: transform .6s var(--ease); }
.still-card:hover .still-frame img { transform: scale(1.05); }
.still-text { display: flex; flex-direction: column; gap: 3px; }
.still-title { font-size: 19px; font-weight: 500; line-height: 1.3; }
.still-card:hover .still-title, .still-card:focus-visible .still-title { color: var(--accent-text); }

/* motion graphics */
.motion-section { padding-bottom: 90px; }
.motion-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 24px; }
.film-card-wide .film-frame { aspect-ratio: 16 / 9; }

/* film gallery */
.films-section { padding-top: 40px; padding-bottom: 100px; border-top: 1px solid var(--line); }
.film-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 32px; }
.film-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 16px; border: 1px solid var(--line); border-radius: 999px; background: transparent; font-size: 15px; font-weight: 500; cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.film-chip:hover { border-color: var(--ink); }
.film-chip.is-active { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip-count { font: 12px var(--mono); opacity: .7; }
.film-status { margin-inline-start: auto; color: var(--muted); font: 13px var(--mono); }
.film-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 36px 20px; }
.film-item[hidden] { display: none; }
.film-frame { display: block; position: relative; aspect-ratio: 9 / 16; overflow: hidden; border: 1px solid rgba(29,33,31,.08); }
.film-frame img { transition: transform .7s var(--ease); }
.film-card:hover .film-frame img { transform: scale(1.04); }
.film-title { display: block; padding-top: 12px; font-size: 16px; font-weight: 500; line-height: 1.35; }
.film-card:hover .film-title, .film-card:focus-visible .film-title { color: var(--accent-text); }
.film-time { position: absolute; inset-inline-end: 10px; bottom: 14px; padding: 3px 8px; border-radius: 4px; background: rgba(18,19,17,.78); color: #f4f1ea; font: 12px var(--mono); }
.film-tag { position: absolute; inset-inline-start: 10px; top: 10px; padding: 3px 9px; border-radius: 3px; background: var(--paper); color: var(--accent-text); font: 600 11px var(--mono); letter-spacing: .05em; text-transform: uppercase; }
.film-card:focus-visible, .project-link:focus-visible, .still-card:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 5px; }

/* film viewer */
.film-viewer { width: min(max(430px, calc((100dvh - 200px) * 9 / 16)), calc(100vw - 24px)); min-width: 0; max-width: calc(100vw - 24px); max-height: calc(100dvh - 20px); padding: 0; border: 0; border-radius: 12px; background: #121311; color: var(--paper); overflow: hidden; }
.film-viewer[data-ratio="16/9"] { width: min(1040px, calc(100vw - 24px)); }
.film-viewer::backdrop { background: rgba(14,15,13,.88); }
.film-viewer[open] { animation: cv-enter .3s var(--ease) both; display: flex; flex-direction: column; }
.fv-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 14px 12px 20px; }
.fv-count { margin: 0; font: 12px var(--mono); letter-spacing: .05em; text-transform: uppercase; color: #aeb0a6; }
.fv-bar h2 { margin: 2px 0 0; font-size: 19px; line-height: 1.25; font-weight: 600; color: var(--paper); }
.film-viewer .dialog-close { color: var(--paper); border-color: rgba(238,234,227,.4); }
.film-viewer .dialog-close:hover { background: var(--paper); color: var(--ink); }
.fv-stage { display: grid; place-items: center; background: #000; }
.fv-stage video { display: block; background: #000; object-fit: contain; height: calc(100dvh - 200px); max-width: 100%; aspect-ratio: 9 / 16; }
.film-viewer[data-ratio="16/9"] .fv-stage video { width: 100%; height: auto; max-height: calc(100dvh - 200px); aspect-ratio: 16 / 9; }
.fv-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; }
.fv-credit { font: 12px var(--mono); color: #aeb0a6; text-align: center; }
.fv-step { min-height: 44px; padding: 0 14px; border: 1px solid rgba(238,234,227,.3); border-radius: 999px; background: transparent; color: var(--paper); font-size: 14px; font-weight: 600; cursor: pointer; }
.fv-step:hover { background: var(--paper); color: var(--ink); }
.film-viewer :focus-visible { outline: 2px solid var(--accent-light); outline-offset: 3px; }
.fv-error { margin: 0; padding: 10px 20px 16px; color: #f0b8a8; font-size: 14px; }

@media (max-width: 1100px) {
  .film-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stills-strip { grid-template-columns: 1fr; gap: 14px; }
}
@media (max-width: 900px) {
  .project-tall.project-film .project-image { aspect-ratio: .8; }
  .project-landscape .project-image { aspect-ratio: 16 / 9; }
  .motion-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .film-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 12px; }
  .film-title { font-size: 14px; }
  .film-status { margin-inline-start: 0; width: 100%; }
  .film-filters { gap: 8px; }
  .film-chip { min-height: 40px; padding: 0 13px; font-size: 14px; }
  .play { width: 42px; height: 42px; inset-inline-start: 10px; bottom: 10px; }
  .film-time { bottom: 12px; inset-inline-end: 8px; }
}
@media (max-width: 620px) {
  .film-viewer, .film-viewer[data-ratio="16/9"] { width: calc(100vw - 16px); max-width: calc(100vw - 16px); border-radius: 10px; }
  .fv-stage video { height: calc(100dvh - 190px); }
  .fv-step span { display: none; }
  .fv-bar h2 { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  .film-viewer[open] { animation: none; }
  .film-frame img, .still-frame img { transition: none; }
}
