/* ---------------------------------------------------------------
   The reel: a calm carousel of real product screenshots.
   One frame at a time, a crossfade with a slow settle between
   frames, and one caption below the frame in the site's own
   voice: the problem in plain words, then the feature in bold.
   Two modes, same markup:
     data-reel="auto"    advances by itself, slowly, while on screen;
                         arrows, dots and the keyboard move it too.
     data-reel="scroll"  sits inside a scroll-craft pinned act and
                         the wheel advances it (reads --sc-p).
   Outside the frame everything comes from tokens.css. Inside the
   frame is a photograph of the product, so it wears its own look.
   Transforms and opacity only. Under 861px, with scripts off or
   with motion reduced, every frame is laid out in a column with
   its caption, nothing hidden.
   --------------------------------------------------------------- */
.reel { position: relative; }
.reel__frame {
  position: relative; aspect-ratio: 16 / 10; width: 100%;
  overflow: hidden; isolation: isolate; border-radius: 6px;
  border: 1px solid var(--ink-line); background: var(--ink-1);
  box-shadow: 0 40px 100px -40px rgba(0,0,0,0.9);
}
.reel__slide { position: absolute; inset: 0; margin: 0; opacity: 0; z-index: 0;
  transform: scale(1.035); transform-origin: 50% 50%;
  transition: opacity 0.9s var(--ease-out), transform 1.8s var(--ease-out); }
.reel__slide img, .reel__slide video { display: block; width: 100%; height: 100%; object-fit: cover; }
/* a still drifts a little while it is on, so nothing on the stage is dead */
.reel__slide.is-on img { animation: reel-drift 18s var(--ease-in-out) infinite alternate; transform-origin: 50% 50%; }
@keyframes reel-drift { from { transform: scale(1); } to { transform: scale(1.05) translate(-0.8%, -0.5%); } }
.reel__slide.is-on { opacity: 1; transform: none; z-index: 1; }
.reel__slide.is-out { opacity: 0; transform: scale(1); z-index: 0; transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out); }
.js .reel__slide figcaption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* --- the caption row under the frame -------------------------- */
.reel__row { display: grid; grid-template-columns: auto 1fr auto; gap: 1.4rem; align-items: start; margin-top: 1.1rem; }
.reel__n { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.12em; color: var(--text-on-ink-faint); padding-top: 0.35rem; white-space: nowrap; }
.reel__n b { color: var(--text-on-ink); font-weight: 500; }
.reel__cap { position: relative; padding-top: 0.35rem; min-height: 3.2rem; }
.reel__cap::before { content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 1px; background: var(--accent);
  transform: scaleX(0); transform-origin: left; transition: transform 1.2s var(--ease-out); }
.reel__cap.is-drawn::before { transform: scaleX(1); }
.reel__cap span, .reel__cap b { display: block; transition: opacity 0.45s var(--ease-out), transform 0.45s var(--ease-out); }
.reel__cap span { font-family: var(--font-body); font-size: 0.95rem; color: var(--text-on-ink-muted); }
.reel__cap b { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.05rem, 0.9rem + 0.5vw, 1.35rem); color: var(--text-on-ink); margin-top: 0.2rem; }
.reel__cap.is-swap span, .reel__cap.is-swap b { opacity: 0; transform: translateY(6px); }
.reel__nav { display: flex; align-items: center; gap: 0.6rem; padding-top: 0.1rem; }
.reel__btn { width: 2.4rem; height: 2.4rem; border-radius: 999px; border: 1px solid var(--ink-line-strong); background: none;
  color: var(--text-on-ink); font: inherit; cursor: pointer; display: grid; place-items: center;
  transition: border-color var(--dur-base), color var(--dur-base), transform var(--dur-base); }
.reel__btn:hover, .reel__btn:focus-visible { border-color: var(--accent); color: var(--accent); }
.reel__btn:active { transform: scale(0.94); }
.reel__btn svg { width: 0.9rem; height: 0.9rem; }
.reel__dots { display: flex; gap: 0.45rem; list-style: none; margin: 0 0.3rem; padding: 0; }
.reel__dot { width: 0.5rem; height: 0.5rem; border-radius: 999px; border: 1px solid var(--ink-line-strong); background: none; padding: 0; cursor: pointer;
  transition: background var(--dur-base), border-color var(--dur-base), transform var(--dur-base); }
.reel__dot[aria-current="true"] { background: var(--accent); border-color: var(--accent); transform: scale(1.25); }

/* --- scroll mode: the frame fits inside one viewport with its caption --- */
.reel--stage { display: grid; align-content: center; min-height: 100svh; padding: 5.5rem 0 3rem; }
.reel--stage .reel__frame { width: min(100%, calc((100svh - 15rem) * 1.6)); margin: 0 auto; }
.reel--stage .reel__row { width: min(100%, calc((100svh - 15rem) * 1.6)); margin-left: auto; margin-right: auto; }

/* --- static fallback: scripts off, motion reduced, phones --------- */
html:not(.js) .reel__frame, .reel--static .reel__frame { aspect-ratio: auto; overflow: visible; border: 0; background: none; box-shadow: none; }
html:not(.js) .reel__slide, .reel--static .reel__slide { position: static; opacity: 1; transform: none; margin: 0 0 1.6rem; }
html:not(.js) .reel__slide img, .reel--static .reel__slide img { aspect-ratio: 16 / 10; border-radius: 6px; border: 1px solid var(--ink-line); }
html:not(.js) .reel__slide figcaption, .reel--static .reel__slide figcaption { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal;
  display: block; margin-top: 0.7rem; padding-top: 0.5rem; border-top: 1px solid var(--accent); }
html:not(.js) .reel__slide figcaption span, .reel--static .reel__slide figcaption span { display: block; font-size: 0.95rem; color: var(--text-on-ink-muted); }
html:not(.js) .reel__slide figcaption b, .reel--static .reel__slide figcaption b { display: block; font-family: var(--font-display); font-weight: 400; font-size: 1.1rem; color: var(--text-on-ink); margin-top: 0.2rem; }
html:not(.js) .reel__row, .reel--static .reel__row { display: none; }
html:not(.js) .reel--stage, .reel--static.reel--stage { min-height: 0; padding: 0; }
@media (max-width: 860px) {
  .reel__frame { aspect-ratio: auto; overflow: visible; border: 0; background: none; box-shadow: none; }
  .reel__slide { position: static; opacity: 1; transform: none; margin: 0 0 1.6rem; }
  .reel__slide img { aspect-ratio: 16 / 10; border-radius: 6px; border: 1px solid var(--ink-line); }
  .js .reel__slide figcaption { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal;
    display: block; margin-top: 0.7rem; padding-top: 0.5rem; border-top: 1px solid var(--accent); }
  .reel__slide figcaption span { display: block; font-size: 0.95rem; color: var(--text-on-ink-muted); }
  .reel__slide figcaption b { display: block; font-family: var(--font-display); font-weight: 400; font-size: 1.1rem; color: var(--text-on-ink); margin-top: 0.2rem; }
  .reel__row { display: none; }
  .reel--stage { min-height: 0; padding: 0; }
}
/* On a light case page the frame border reads better a shade darker. */
.paper .reel__frame, .paper .reel__slide img { border-color: var(--paper-line, var(--ink-line)); }
