/* Amazon film: the landing section (#amazon-demo) and the full-film page (/demo/amazon).
   Loaded after ds.css and site-ds.css, only on those two pages. Behaviour is in film.js. */

/* Shared frame: the video sits in a dark, rounded frame and always scales to its column. */
.af-frame { position: relative; overflow: hidden; border: 1px solid var(--lp-edge-2); border-radius: var(--lp-radius-lg); background: #0b0f0d; box-shadow: var(--lp-shadow), 0 0 0 0.375rem color-mix(in oklab, var(--lp-surface) 35%, transparent); }
.af-frame video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; background: #0b0f0d; }
.af-play { position: absolute; left: 50%; top: 50%; display: inline-flex; align-items: center; gap: 0.625rem; height: 3.5rem; padding: 0 1.375rem 0 1.125rem; border: 0; border-radius: var(--ds-radius-full); background: color-mix(in oklab, var(--lp-surface) 86%, transparent); box-shadow: inset 0 0 0 1px var(--lp-edge-2), 0 16px 40px -12px var(--lp-drop); color: var(--ds-ink); font: 600 var(--ds-text-base)/1 var(--ds-font-text); white-space: nowrap; cursor: pointer; transform: translate(-50%, -50%); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.af-play[hidden] { display: none; }
.af-play .ds-icon { width: 1.25rem; height: 1.25rem; fill: currentColor; color: var(--ds-green-ink); }
.af-play:hover { box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--ds-green) 55%, var(--lp-edge-2)), 0 16px 40px -12px var(--lp-drop); }
.af-play:focus-visible { outline: 2px solid var(--ds-accent); outline-offset: 3px; }

/* Landing section: title and line on the left, the button on the right, the loop under them.
   On phones the button goes under the loop. */
.af-home { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "head more" "media media"; align-items: end; gap: clamp(1.5rem, 1rem + 2vw, 2.5rem) var(--ds-space-8); }
.af-head { grid-area: head; display: grid; gap: var(--ds-space-4); max-width: 46rem; }
.af-head .ds-h2 { max-width: 20ch; text-wrap: balance; }
.af-head .lp-lead { max-width: 40em; }
.af-more { grid-area: more; }
.af-media { grid-area: media; margin: 0; }

/* Full-film page */
.af-page .dv-hero { padding-bottom: clamp(1.25rem, 0.8rem + 1.5vw, 2rem); }
.af-page .dv-hero__copy { max-width: 64rem; }
.af-page .dv-hero__title { text-wrap: balance; }
.af-player { display: grid; gap: var(--ds-space-4); }
.af-caption { color: var(--ds-ink-3); font-size: var(--ds-text-sm); }
.af-chapters { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--ds-space-3); grid-template-columns: repeat(4, minmax(0, 1fr)); counter-reset: none; }
.af-chapters a { display: grid; gap: var(--ds-space-2); height: 100%; padding: var(--ds-space-2) var(--ds-space-2) var(--ds-space-3); border: 1px solid var(--lp-edge); border-radius: var(--lp-radius); background: var(--lp-surface); color: var(--ds-ink-2); text-decoration: none; transition: border-color var(--ds-dur-2) var(--ds-ease-out), background-color var(--ds-dur-2) var(--ds-ease-out); }
.af-chapters a:hover { border-color: var(--lp-edge-2); color: var(--ds-ink); }
.af-chapters a:focus-visible { outline: 2px solid var(--ds-accent); outline-offset: 2px; }
.af-chapters a[aria-current="true"] { border-color: color-mix(in oklab, var(--ds-green) 60%, var(--lp-edge)); background: color-mix(in oklab, var(--ds-green-wash) 40%, var(--lp-surface)); color: var(--ds-ink); }
.af-chapters img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; border-radius: calc(var(--lp-radius) - 4px); background: #0b0f0d; }
.af-chapters__row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--ds-space-2); padding-inline: var(--ds-space-1); }
.af-chapters__title { font-weight: 600; color: var(--ds-ink); }
.af-chapters__t { flex: none; font: 500 var(--ds-text-xs)/1 var(--ds-font-code); color: var(--ds-ink-3); }
.af-chapters a[aria-current="true"] .af-chapters__t { color: var(--ds-green-ink); }
.af-chapters__what { padding-inline: var(--ds-space-1); font-size: var(--ds-text-sm); line-height: 1.45; color: var(--ds-ink-3); }

@media (max-width: 900px) { .af-chapters { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .af-home { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "media" "more"; gap: var(--ds-space-6); }
  .af-more { width: 100%; }
  .af-play { height: 2.75rem; padding: 0 1rem 0 0.875rem; gap: 0.5rem; font-size: var(--ds-text-md); }
  .af-play .ds-icon { width: 1rem; height: 1rem; }
  .af-frame { box-shadow: var(--lp-shadow); }
}
@media (max-width: 480px) {
  .af-chapters { grid-template-columns: minmax(0, 1fr); }
  .af-chapters a { grid-template-columns: 7.5rem minmax(0, 1fr); grid-template-rows: auto 1fr; align-items: start; column-gap: var(--ds-space-3); }
  .af-chapters img { grid-row: span 2; }
  .af-chapters__row, .af-chapters__what { padding-inline: 0; }
}
@media (prefers-reduced-motion: reduce) { .af-chapters a { transition: none; } }
