/* Homepage "The original Pocket Pixel" close-ups (#s5). Uses the --pp-* tokens from home-lower.css.
   1. The console film: the white R36H's screen on its own, then its two control pieces glide in and lock on automatically
      once in view, and the screen powers on (15 Oct 2026).
   2. A reel of the other close-ups to swipe through, captions under the pictures, running off the right edge
      (option C, white, 15 Oct 2026). */

.pp-film, .pp-reel { --ease-out: cubic-bezier(0.23, 1, 0.32, 1); }

/* ---------- 1. the console film ----------
   Frames of a Higgsfield clip (Kling 3.0, first frame the screen alone, last frame our straight-on photo), in
   art/home-lower/film/. home-closeup.js plays the film once on arrival, without pinning or extra scroll space;
   the photo itself takes over for the last frame, so the end is sharp. Without JavaScript, or with reduced
   motion, it is simply the photo with its three captions. */
.pp-film { --film-w: min(1100px, 92vw, max(300px, (100svh - 330px) * 20 / 9));   /* room for the store bar, and the screen caption above the console */ margin-top: clamp(28px, 4vw, 48px); }
.pp-film__pin { display: grid; justify-items: center; }
.pp-film__fig { width: var(--film-w); margin: 0; }
/* the frames are 20:9 and their studio is the page colour; the edges fade into the page. While the film plays,
   home-closeup.js widens the side fade (--fade) as the pieces slide in from outside the clip, so they come out of the
   dark rather than from a cut line, and narrows it back to 4% as they land */
.pp-film__pic { position: relative; aspect-ratio: 20 / 9;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 var(--fade, 4%), #000 calc(100% - var(--fade, 4%)), transparent), linear-gradient(180deg, transparent, #000 3.5%, #000 96.5%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent, #000 var(--fade, 4%), #000 calc(100% - var(--fade, 4%)), transparent), linear-gradient(180deg, transparent, #000 3.5%, #000 96.5%, transparent);
  mask-composite: intersect; }
.pp-film .pp-film__end, .pp-film__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.pp-film__canvas { display: none; }
.pp-film__end { z-index: 1; }
.pp-film__screen { z-index: 2; }
.pp-film__screen, .pp-film__screen .pp-screen__in { transition: opacity 250ms var(--ease-out); }

/* captions under the piece they name: left, middle, right */
.pp-film__caps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: clamp(12px, 1.8vw, 22px); padding-inline: 5%; }
.pp-film__cap { display: grid; gap: 4px; align-content: start; margin: 0; }
.pp-film__cap--m { justify-items: center; text-align: center; }
.pp-film__fig > .pp-film__cap--m { margin-bottom: clamp(10px, 1.6vw, 18px); padding-inline: 20px; }   /* above the console, centred over its screen (owner, 15 Oct) */
.pp-film__cap--r { justify-items: end; text-align: right; }
.pp-film__cap b { font: 700 clamp(19px, 1.6vw, 21px)/1.15 var(--pp-display); letter-spacing: -.025em; }
.pp-film__cap > span { max-width: 28ch; color: var(--pp-muted); font-size: 16px; line-height: 1.45; }

/* Playback stays in normal page flow, with no sticky position or scroll spacer. */
.pp-film[data-film-on] .pp-film__canvas { display: block; }
.pp-film[data-film-on] .pp-film__end { opacity: 0; transition: opacity 240ms var(--ease-out); }
.pp-film[data-film-on][data-film-end] .pp-film__end { opacity: 1; }
.pp-film[data-film-on]:not([data-film-lit]) .pp-film__screen { opacity: 0; }
/* the side captions arrive as their pieces land, the screen's as it powers on */
.pp-film[data-film-on] .pp-film__cap { opacity: 0; transform: translateY(8px); transition: opacity 400ms var(--ease-out), transform 600ms var(--ease-out); }
.pp-film[data-film-landed] .pp-film__cap--l, .pp-film[data-film-landed] .pp-film__cap--r,
.pp-film[data-film-lit] .pp-film__cap--m { opacity: 1; transform: none; }
.pp-film[data-film-landed] .pp-film__cap--r { transition-delay: 60ms; }
.pp-film[data-film-lit] .pp-film__cap--m { transition-delay: 80ms; }

@media (max-width: 640px) {
  .pp-film { --film-w: min(100vw, max(260px, (100svh - 330px) * 20 / 9)); }
  .pp-film__caps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 16px; padding-inline: 20px; }
  .pp-film__cap > span { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  .pp-film .pp-film__pic { transform: none !important; }
  .pp-film .pp-film__cap { opacity: 1; transform: none; transition: none; }
  .pp-film__screen, .pp-film__screen .pp-screen__in { transition-duration: 200ms; }
}

/* ---------- 2. the reel ---------- */
/* --lead lines the first card up with the column the heading sits in */
.pp-reel { --lead: max(56px, (100vw - 1100px) / 2); }
@media (max-width: 1190px) { .pp-reel { --lead: max(36px, (100vw - 1100px) / 2); } }
@media (max-width: 850px) { .pp-reel { --lead: 24px; } }
@media (max-width: 640px) { .pp-reel { --lead: 20px; } }

.pp-reel__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.pp-reel .pp-lede { margin-top: 14px; }
/* the reel's buttons: right above the reel, at the column's right edge */
.pp-reel__bar { display: flex; justify-content: flex-end; margin-top: clamp(48px, 6vw, 80px); }
.pp-reel__bar + .pp-reel__track { margin-top: 14px; }
.pp-reel__bar:has(> .pp-reel__nav[hidden]) + .pp-reel__track { margin-top: 0; }
.pp-reel__nav { display: flex; gap: 10px; }
.pp-reel__nav[hidden] { display: none; }
.pp-reel__btn { display: inline-grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--pp-ink); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35); cursor: pointer; }
.pp-reel__btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pp-reel__btn:disabled { color: rgba(243, 243, 240, .3); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); cursor: default; }
@media (hover: hover) { .pp-reel__btn:not(:disabled):hover { box-shadow: inset 0 0 0 1px var(--pp-ink); } }
.pp-reel__btn:not(:disabled):active { transform: scale(.96); }

.pp-reel__track { list-style: none; margin: clamp(48px, 6vw, 80px) 0 0; padding: 0 0 6px var(--lead); display: flex; gap: 16px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scroll-padding-inline: var(--lead); scrollbar-width: none; overscroll-behavior-x: contain; }
.pp-reel__track::-webkit-scrollbar { display: none; }
.pp-reel__track::after { content: ""; flex: 0 0 calc(var(--lead) - 16px); }   /* room after the last card */
.pp-reel__track:focus-visible { outline: 3px solid var(--pp-gold); outline-offset: 4px; }
.pp-reel__card { flex: 0 0 min(clamp(260px, 26vw, 372px), (1100px - 32px) / 3); min-width: 0; scroll-snap-align: start; }   /* three fit the 1100px column */
.pp-reel__card figure { margin: 0; }

.pp-reel__pic { position: relative; aspect-ratio: 1; overflow: hidden; border-radius: 14px; background: #0d0e10; isolation: isolate; }
.pp-reel__pic > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* number cards: a studio photo with the number and its boxed unit on top */
.pp-reel__pic--fig { display: flex; flex-wrap: wrap; align-items: flex-end; align-content: flex-end; gap: 10px; padding: 26px; background: radial-gradient(120% 90% at 85% 0%, #1d1f24 0%, #0d0e10 62%); }
.pp-reel__pic--fig > :not(img) { position: relative; }
.pp-reel__num { font: 700 clamp(72px, 7.2vw, 104px)/.8 var(--pp-display); letter-spacing: -.07em; font-variant-numeric: tabular-nums; }
.pp-reel__unit { margin-bottom: 4px; padding: 5px 8px 6px; border: 1.5px solid rgba(243, 243, 240, .55); border-radius: 6px; font: 700 15px/1 var(--pp-display); }

.pp-reel__card figcaption { margin-top: 16px; display: grid; gap: 4px; padding-right: 8px; }
.pp-reel__card figcaption b { font: 700 clamp(19px, 1.6vw, 21px)/1.15 var(--pp-display); letter-spacing: -.025em; }
.pp-reel__card figcaption span { color: var(--pp-muted); font-size: 16px; line-height: 1.45; max-width: 30ch; }
.pp-reel__more { display: inline-flex; align-items: center; min-height: 44px; margin-top: 18px; }

@media (max-width: 640px) {
  .pp-reel__nav { display: none; }
  /* phones: all three close-ups side by side on one screen, no swiping (owner, 15 Oct: "make these tiles smaller so that they all fit on mobile") */
  .pp-reel__track { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; overflow: visible; scroll-snap-type: none; padding: 0 var(--lead) 6px; }
  .pp-reel__track::after { display: none; }
  .pp-reel__pic { border-radius: 10px; }
  .pp-reel__pic--fig { padding: 10px; gap: 4px; }
  .pp-reel__num { font-size: min(34px, 9vw); }   /* 3000 fits a 86px tile (320px screen); the unit drops below it when it must */
  .pp-reel__unit { margin-bottom: 2px; padding: 3px 4px 4px; border-width: 1px; border-radius: 4px; font-size: 10px; }
  .pp-reel__card figcaption { margin-top: 10px; gap: 3px; padding-right: 0; }
  .pp-reel__card figcaption b { font-size: 14px; }
  .pp-reel__card figcaption span { font-size: 12.5px; line-height: 1.4; }
}

/* the cards rise as each comes into view (on phones, as you swipe to them). home-closeup.js only arms this while the
   reel is still below the screen, so nothing empties in front of anyone; with reduced motion it never arms. */
.pp-reel__card { transition: opacity 700ms ease-out, transform 900ms var(--ease-out); }
.pp-reel__card[data-rise] { opacity: 0; transform: translateY(28px); }

/* keep "USB-C" and "USB-A" on one line in the small phone captions */
.pp-reel .pp-nowrap { white-space: nowrap; }
