/* ==========================================================================
   LEAK HUNTER · SITE A · css/fig-reel.css — figure "reel" (section #reel)
   Scoped to #reel / .fig--reel. Loaded after base.css (overrides its static §8).
   Clips first at every size; the head (statement · lede · controls) sits under
   the row. Desktop (≥1200 wide × ≥640 tall, the hero's own band gates): the row also rises
   into the hero's PEEK band.
   ========================================================================== */

/* the "white" of copy and HUD: the light text tone */
#reel { --rw: var(--text-rgb); }

/* ---- head: the statement, the pitch as a lede, the controls ------------------------- */
#reel .reel__head { overflow-x: clip; }              /* the controls' run-up never widens a phone page */
#reel .reel__title { max-width: none; text-wrap: balance; }
#reel .reel__tl { display: block; }
#reel .reel__pitch {
  margin-top: 16px; max-width: 54ch;
  font: 400 clamp(17px, .5vw + 12px, 21px)/1.5 var(--f-ui); letter-spacing: -0.006em;
  color: rgb(var(--rw) / .82);
}
#reel .reel__lead { color: rgb(var(--rw)); }

/* ---- order: the clips lead at every size; the statement and the pitch follow them -------- */
#reel { display: flex; flex-direction: column; }
#reel .fig--reel { order: 1; }
#reel .reel__head { order: 2; margin-top: 26px; margin-bottom: 0; align-items: flex-start; }
@media (min-width: 1280px) {
  #reel .reel__head {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 54ch) auto;
    align-items: start; column-gap: clamp(40px, 4vw, 88px);
  }
  #reel .reel__intro { display: contents; }
  #reel .reel__title { font-size: clamp(36px, 1.9vw + 13px, 54px); line-height: .94; }
  #reel .reel__pitch { margin-top: 1px; }
  #reel .reel__ctrl { align-self: start; padding-top: 2px; }
}
/* stacked heads (≤1023): the pager sits right under the clips it drives */
@media (max-width: 1023px) {
  #reel .reel__ctrl { order: -1; align-self: stretch; }
  #reel .reel__count { margin-right: auto; }
}

/* ---- controls: round buttons, a rolling counter --------------------------------------- */
#reel .reel__ctrl { gap: 8px; }
#reel .reel__count {
  display: inline-flex; align-items: baseline; gap: 5px; margin-right: 8px;
  font: 600 13px/1 var(--f-ui); letter-spacing: 0; color: var(--muted-2); font-variant-numeric: tabular-nums;
}
#reel .reel__count b { display: inline-block; min-width: 2ch; text-align: right; color: rgb(var(--rw)); font-weight: 600; }
#reel .reel__ctrl .iconbtn {
  position: relative; width: 40px; height: 40px; border-radius: 50%;
  transition: background-color .25s ease, color .25s ease, opacity .3s ease, transform .5s var(--ease-out);
}
#reel .reel__ctrl .iconbtn::after {                  /* hover halo: opacity only */
  content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  box-shadow: 0 0 0 5px var(--lime-24), 0 8px 30px -8px rgb(var(--lime-rgb) / .55);
  opacity: 0; transition: opacity .35s var(--ease-out);
}
#reel .reel__ctrl .iconbtn .i { width: 15px; height: 15px; transition: transform .45s var(--ease-out); }
#reel .reel__ctrl .iconbtn:active { transform: scale(.94); }
#reel .reel__ctrl .iconbtn[aria-disabled="true"] { opacity: .32; cursor: default; background: rgb(var(--rw) / .05); color: rgb(var(--rw)); box-shadow: inset 0 0 0 1px var(--line-2); }
#reel .reel__ctrl .iconbtn[aria-disabled="true"]::after { opacity: 0; }
#reel .reel__ctrl .iconbtn[aria-disabled="true"] .i { transform: none; }
@media (hover: hover) and (pointer: fine) {
  #reel .reel__ctrl .iconbtn:hover::after { opacity: 1; }
  #reel .reel__ctrl [data-reel="prev"]:hover .i { transform: translateX(-2px); }
  #reel .reel__ctrl [data-reel="next"]:hover .i { transform: translateX(2px); }
}
@media (pointer: coarse) {
  #reel .reel__ctrl .iconbtn { width: 44px; height: 44px; }
}
html.is-touch #reel .reel__ctrl .iconbtn { width: 44px; height: 44px; }

/* ---- track: drag affordance, free mode while JS drives the scroll ---------------------- */
.fig--reel .reel__track {
  perspective: 1600px;
  padding-inline: max(var(--gutter), calc((100% - var(--wrap)) / 2 + var(--gutter)));
  scroll-padding-inline: max(var(--gutter), calc((100% - var(--wrap)) / 2 + var(--gutter)));
  padding-top: 8px; margin-top: -8px;           /* room for the focus ring (scrollers clip both axes) */
  padding-bottom: 12px;
}
.fig--reel .reel__track.is-free { scroll-snap-type: none; }
html:not(.is-touch) .fig--reel.is-live .reel__track { cursor: grab; }
.fig--reel .reel__track.is-dragging,
.fig--reel .reel__track.is-dragging * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }
.fig--reel .reel__track.is-dragging .reel-card__link { pointer-events: none; }
.fig--reel .reel-card__link { -webkit-user-drag: none; -webkit-tap-highlight-color: transparent; }
.fig--reel .reel-card__link:focus-visible { outline-offset: 5px; border-radius: 14px; }

/* ---- media: the clip (fades in on its first frame), its push-in, the HUD ---------------- */
.fig--reel .reel-card__media { transform: translateZ(0); }
.fig--reel .reel-card__media > canvas {
  opacity: 0; transform: scale(1.001); transform-origin: 50% 55%;
  transition: opacity .5s ease, transform 1.2s var(--ease-out);
  will-change: transform;
}
.fig--reel .reel-card__media.is-on > canvas { opacity: 1; }
.fig--reel .reel-card__link:focus-visible .reel-card__media > canvas { transform: scale(1.04); }

.fig--reel .reel-hud {
  position: absolute; inset: 0; z-index: 5; pointer-events: none; border-radius: inherit;
  font: 400 11px/1 var(--f-mono); letter-spacing: .06em; text-transform: uppercase;
  color: rgb(var(--rw) / .8);
}
.fig--reel .reel-hud::before,
.fig--reel .reel-hud::after { content: ""; position: absolute; left: 0; right: 0; pointer-events: none; }
.fig--reel .reel-hud::before { top: 0; height: 46px; background: linear-gradient(180deg, rgba(4, 5, 7, .62), rgba(4, 5, 7, 0)); }
.fig--reel .reel-hud::after { bottom: 0; height: 40px; background: linear-gradient(0deg, rgba(4, 5, 7, .5), rgba(4, 5, 7, 0)); }
.fig--reel .reel-hud__edge {
  position: absolute; inset: 0; border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgb(var(--rw) / .16); opacity: 0; transition: opacity .5s ease;
}
.fig--reel .reel-hud__id {
  position: absolute; left: 12px; top: 14px; z-index: 1; display: inline-flex; align-items: center; gap: 7px;
  white-space: nowrap; text-shadow: 0 1px 8px rgba(0, 0, 0, .85);
}
.fig--reel .reel-hud__id i {
  flex: none; width: 5px; height: 5px; border-radius: 50%; background: rgb(var(--rw) / .5);
  transition: background-color .4s ease, box-shadow .4s ease;
}
.fig--reel .reel-hud__tc {
  position: absolute; right: 12px; bottom: 12px; z-index: 1;
  font-variant-numeric: tabular-nums; letter-spacing: .04em; text-shadow: 0 1px 8px rgba(0, 0, 0, .85);
}
.fig--reel .reel-hud__bar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; height: 2px; transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, rgb(var(--lime-rgb) / .2), var(--lime)); box-shadow: 0 0 10px rgb(var(--lime-rgb) / .6);
  opacity: 0; transition: opacity .5s ease;
}
/* honesty tags: the one .tag spec — Space Grotesk 700, 11px, 18px tall, 4px radius */
.fig--reel .reel-hud__tag {
  position: absolute; right: 11px; top: 11px; z-index: 1; display: inline-flex; align-items: center;
  height: 18px; padding: 0 6px; border-radius: 4px;
  font: 700 11px/1 var(--f-display); letter-spacing: .04em; text-transform: uppercase; white-space: nowrap;
}
.fig--reel .reel-hud__tag--sim { background: var(--pink); color: var(--ink); }
.fig--reel .reel-hud__tag--ill { background: rgba(10, 11, 13, .8); color: rgb(var(--rw) / .9); box-shadow: inset 0 0 0 1px rgb(var(--rw) / .22); }
.fig--reel .reel-card.is-active .reel-hud__id { color: rgb(var(--rw)); }
.fig--reel .reel-card.is-active .reel-hud__id i { background: var(--lime); box-shadow: 0 0 8px var(--lime); }
.fig--reel .reel-card.is-active .reel-hud__bar { opacity: 1; }

/* ---- meta below the media --------------------------------------------------------------- */
.fig--reel .reel-card__title { letter-spacing: -0.025em; transition: color .4s ease; }
.fig--reel .reel-card__line { transition: color .4s ease; }
.fig--reel .reel-card__link:focus-visible .reel-hud__edge { opacity: 1; }

@media (hover: none), (pointer: coarse) {            /* base §8 shows the arrow on :hover; a tap must not leave it stuck */
  .fig--reel .reel-card__link:hover:not(:focus-visible) .reel-card__arrow { opacity: 0; transform: translateX(-10px); }
}
@media (hover: hover) and (pointer: fine) {
  .fig--reel .reel-card__link:hover .reel-card__media > canvas { transform: scale(1.04); }
  .fig--reel .reel-card__link:hover .reel-hud__edge { opacity: 1; }
  .fig--reel .reel-card__link:hover .reel-card__line { color: var(--muted-2); }
}

/* ---- desktop PEEK: the clips rise into the hero's bottom band ---------------------------- */
@media (min-width: 1200px) and (min-height: 640px) {
  #reel {
    position: relative; z-index: 2; display: flex; flex-direction: column;
    margin-top: calc(-1 * clamp(88px, 11svh, 124px)); padding-top: 0;
  }
  #reel .fig--reel { order: 1; }
  #reel .reel__head {
    order: 2; margin-top: 26px; margin-bottom: 0;
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 54ch) auto;
    align-items: start; column-gap: clamp(40px, 4vw, 88px);
  }
  #reel .reel__intro { display: contents; }
  #reel .reel__title { font-size: clamp(36px, 2.2vw + 14px, 54px); line-height: .94; }
  #reel .reel__pitch { margin-top: 1px; }
  #reel .reel__ctrl { align-self: start; padding-top: 2px; }
}
/* short laptops (640–799 px tall): the hero's slimmer band (fig-hero.css) */
@media (min-width: 1200px) and (min-height: 640px) and (max-height: 799.98px) {
  #reel { margin-top: calc(-1 * clamp(56px, 10svh, 124px)); }
}

/* ---- phones ------------------------------------------------------------------------------- */
@media (max-width: 767px) {
  #reel .reel__head { margin-top: 18px; gap: 16px; }
  /* the statement and its first sentence carry it; the rest of the pitch reads as small print */
  #reel .reel__pitch { margin-top: 12px; font-size: 15px; line-height: 1.55; color: rgb(var(--rw) / .7); }
  #reel .reel__lead { display: block; margin-bottom: 8px; font-size: 17px; line-height: 1.45; }
  .fig--reel .reel-card__line { font-size: 15px; }
  .fig--reel .reel-hud { font-size: 12px; }
  .fig--reel .reel-hud__id { left: 10px; top: 13px; }
  .fig--reel .reel-hud__tc { right: 10px; bottom: 10px; }
  .fig--reel .reel-hud__tag { right: 10px; top: 10px; }
}

/* ---- reduced motion: final states, no transitions ----------------------------------------- */
html.is-reduced .fig--reel .reel-card__media > canvas { transition: none; }
html.is-reduced .fig--reel .reel-hud__bar { display: none; }
@media (prefers-reduced-motion: reduce) {
  .fig--reel .reel-card__media > canvas { transition: none; }
}
