/* ──────────────────────────────────────────────────────────────────────────
   Visual Suspect — portfolio v2, SCROLL MOTION layer.

   The locked stylesheet ships two moves, .reveal and .wipe, driven by
   `animation-timeline: view()`. Measured on the HKIA page, that engine is
   mechanically correct — elements below the fold really do sit at opacity 0
   with a live view timeline — and still reads as no animation at all:

     - a scroll-driven animation is SCRUBBED, not played. The 28-36px of
       travel is spread across the element's entry, so it is already finished
       by the time the element is anywhere near reading position. Nothing ever
       "moves" on its own;
     - `entry` is a poor range for the blocks this page is made of. The facts
       card, the film plate and the collage sheets are all taller than the
       viewport, and an element that can never fully enter gets a clamped,
       lurching progress curve;
     - and it is Chromium-and-Safari-26-only. Firefox and older Safari took
       the locked `@supports not` escape hatch and showed a static page.

   So this layer runs ONE engine for every browser: the element is watched,
   and on entry it PLAYS a transition on a timer. Same grammar, same easing,
   but the motion is a fixed 1s performance you cannot miss, identical
   everywhere, and tunable from the four numbers at the top.

   The grammar is borrowed from the IIVPA site and re-tuned for Visual
   Suspect. IIVPA's moves are: a 40px fade-up (its workhorse, nine per project
   page), a hairline that draws itself out of scaleX(0), and a 0.99 scale
   settle on big media. Kept, at IIVPA's own 40px. Dropped: its rotateX(110deg)
   card flip, its scale(0,0) sweep, and — after seeing it on the page — its
   kinetic headline, which splits a line into per-word masks that rise in
   sequence. On Visual Suspect's display type that reads as a performance of
   the words rather than the words themselves.

   So there are two moves here: BLOCKS fade up (just below), and the DISPLAY
   LINES fade in LINE BY LINE, each a little after the one above it and
   softly left to right within itself (the last section). Nothing moves in
   the text — it is opacity only.

   LOCKED-DESIGN §1.8 bans an IntersectionObserver because a re-render drops
   the class, the observer has already unobserved the node, and the section
   stays invisible for good. That cannot happen here: nothing is hidden unless
   <html> carries .vs-m, and only the script sets .vs-m — no script, no
   hiding, and the page renders complete and static exactly as the locked
   escape hatch intends. The script never unobserves, re-scans anything added
   later, and tears the whole mechanism down if it ever finds something stuck.
   See the .js.

   Load AFTER vs-portfolio-v2.css and vs-portfolio-v2-host.css.
   ────────────────────────────────────────────────────────────────────────── */

[data-vs-portfolio-v2]{
  --vs-ease:cubic-bezier(.16,1,.3,1);
  --vs-travel:40px;     /* IIVPA's own fade-up distance */
  --vs-dur:1s;
  --vs-step-ms:90ms;    /* per --i, for staggered groups */
  --vs-line-dur:.9s;    /* one line's fade */
  /* A dissolve wants an even curve. The locked cubic-bezier(.16,1,.3,1) is an
     ARRIVAL curve — three quarters of the way there in the first quarter of
     the time — which on a fade reads as a flash followed by a long crawl.
     This is the one deliberate exception to one-easing-throughout. */
  --vs-line-ease:cubic-bezier(.4,0,.3,1);
}

/* ── Nothing below applies until the script says it is alive ─────────────── */

html.vs-m [data-vs-portfolio-v2] .vs-rise,
html.vs-m [data-vs-portfolio-v2] .reveal{
  opacity:0;
  transform:translateY(var(--vs-travel));
  transition:opacity var(--vs-dur) var(--vs-ease),
             transform var(--vs-dur) var(--vs-ease);
  transition-delay:calc(var(--i,0) * var(--vs-step-ms));
  will-change:opacity,transform;
}

html.vs-m [data-vs-portfolio-v2] .vs-settle{
  opacity:0;
  transform:scale(.985) translateY(22px);
  transition:opacity calc(var(--vs-dur) + .15s) var(--vs-ease),
             transform calc(var(--vs-dur) + .15s) var(--vs-ease);
  transition-delay:calc(var(--i,0) * var(--vs-step-ms));
  will-change:opacity,transform;
}

html.vs-m [data-vs-portfolio-v2] .wipe{
  opacity:0;
  clip-path:inset(22% 0 0 0);
  transform:translateY(32px) scale(.99);
  transition:opacity calc(var(--vs-dur) + .2s) var(--vs-ease),
             transform calc(var(--vs-dur) + .2s) var(--vs-ease),
             clip-path calc(var(--vs-dur) + .2s) var(--vs-ease);
  will-change:opacity,transform,clip-path;
}

html.vs-m [data-vs-portfolio-v2] .vs-rule::before{
  transform:scaleX(0);
  transition:transform calc(var(--vs-dur) + .2s) var(--vs-ease);
}

/* The locked sheet's own view()-driven animation stands down — ALWAYS, not
   only while this engine is running.

   It used to stand down only under .vs-m, on the theory that it was the
   fallback. It is not a fallback, it is the engine this file retired, and it
   came back on its own: the script's watchdog had a false positive (fixed —
   see the .js) that dropped .vs-m about eight seconds into most visits, and
   from then on every .reveal and .wipe was SCRUBBED against the scroll. A
   block faded in from nothing as it crossed the bottom of the screen, tied to
   scroll speed — which at reading pace reads as no motion and at a glide's
   pace reads as the page flickering. It also left the film's plate at
   opacity .998 for good.

   Without the script the contract is "the page renders complete and static".
   This is what makes that true in Chromium. */
[data-vs-portfolio-v2] .reveal,
[data-vs-portfolio-v2] .wipe{animation:none}

/* ── Passing through ─────────────────────────────────────────────────────
   A glide crosses several screens in a second. Nothing may START animating
   in that second: a block that fades up while it flies past is not read as
   an entrance, it is read as flicker — and the film's own plate was still
   mid-fade when the scroll landed on it. So when a glide leaves, the script
   reveals everything between here and there at once, under this class, and
   this is what makes "at once" mean no transition at all. The class is on
   for two frames. */
html.vs-now [data-vs-portfolio-v2] .vs-rise,
html.vs-now [data-vs-portfolio-v2] .vs-settle,
html.vs-now [data-vs-portfolio-v2] .reveal,
html.vs-now [data-vs-portfolio-v2] .wipe,
html.vs-now [data-vs-portfolio-v2] .vs-rule::before,
html.vs-now [data-vs-portfolio-v2] [data-vs-lines] .vs-ln{transition:none !important}

/* ── Arrived ─────────────────────────────────────────────────────────────── */
html.vs-m [data-vs-portfolio-v2] .vs-rise[data-vs-in],
html.vs-m [data-vs-portfolio-v2] .vs-settle[data-vs-in],
html.vs-m [data-vs-portfolio-v2] .reveal[data-vs-in]{
  opacity:1;transform:none;will-change:auto;
}
html.vs-m [data-vs-portfolio-v2] .wipe[data-vs-in]{
  opacity:1;transform:none;clip-path:inset(0 0 0 0);will-change:auto;
}
html.vs-m [data-vs-portfolio-v2] .vs-rule[data-vs-in]::before{transform:scaleX(1)}

/* ── The drawn hairline ──────────────────────────────────────────────────
   A section that already carries a border-top hands the line to a pseudo
   element so it can be drawn from the left. With the script absent the rule
   below leaves it at full width, so the page never loses a border. */
[data-vs-portfolio-v2] .vs-rule{position:relative;border-top-color:transparent !important}
[data-vs-portfolio-v2] .vs-rule::before{
  content:"";position:absolute;left:0;right:0;top:-1px;height:1px;
  background:#e9e9ed;transform-origin:left center;pointer-events:none;
}
[data-vs-portfolio-v2] #films.vs-rule::before{background:rgba(255,255,255,.12)}

/* ── TEXT: the display lines fade in, line by line ───────────────────────
   The .js wraps each word in a plain inline <span class="vs-ln"> and then
   groups those spans into lines by where the browser actually laid them out,
   writing each one a --d: its line's turn, plus its own position across that
   line. Everything else is here.

   Why per word when the move is per line. A line cannot be wrapped in an
   element — the two-tone display lines break mid-colour, so "to <ink>the
   third runway,</ink> and" is one visual line spanning three parents. The
   word is the largest thing that is always inside one parent; the LINE is
   then only a delay group, and the markup keeps its shape.

   Why the spans are safe. They are `display:inline` and carry nothing but
   opacity, so they have no box of their own, change no baseline and break no
   line: the text wraps exactly as it did unwrapped. This is the whole reason
   the earlier per-word version is gone — it used inline-block masks, and an
   inline-block whose overflow is not visible takes its baseline from its
   bottom margin edge, which lifted every word off the line.

   A colour of their own is the one thing these spans must never have. The
   theme paints `blockquote span:not(.quote-right):not(.quote-left)` in the
   brand red at (0,2,2) — a rule the authored two-tone wrappers never felt,
   because an inline style beats any selector, but a generated span has none,
   and the whole pull quote came back red. !important because no scoped
   selector outranks (0,2,2) without a specificity trick, and because the
   answer is categorical. */
[data-vs-portfolio-v2] .vs-ln{color:inherit !important}

html.vs-m [data-vs-portfolio-v2] [data-vs-lines] .vs-ln{
  opacity:0;
  transition:opacity var(--vs-line-dur) var(--vs-line-ease);
  transition-delay:var(--d,0ms);
}
html.vs-m [data-vs-portfolio-v2] [data-vs-lines][data-vs-in] .vs-ln{opacity:1}

/* A display line carries its motion in its words, so it does not ALSO fade
   and slide as a block — three of them are .reveal or .vs-rise in the locked
   markup and would otherwise play both at once. (0,3,2) against the block
   rules' (0,3,1), so no !important is needed. */
html.vs-m [data-vs-portfolio-v2] :is(h1.big,h2.big,h3.big,blockquote.big){
  opacity:1;transform:none;clip-path:none;animation:none;
}

/* ── Hover: the film's two-level bounce (owner, 2026-11-18) ────────────────
   The film gets the What Next plates' hover, exactly: the white plate rises
   12px on a spring that overshoots ~23%, and the film card inside it follows
   70ms later, 6px higher and scaled to 1.02, on a looser spring. No colour or
   opacity change. The numbers and the linear() springs are the What Next
   set's own (bake_what_next.py, set visual-suspect-three-plates-keep-watchin-vyfk);
   do not retype them from memory.

   - It moves `translate` and `scale`, never `transform`: the plate is also a
     .reveal, whose fade-up owns `transform`. So the plate's transition list
     carries the reveal's two entries as well — one rule's list replaces the
     other's whole, and leaving them out would make the plate snap in instead
     of fading up.
   - The glide centres the plate where it RESTS (vs-portfolio-v2.js §4,
     restingTop takes the translate and scale back out), so arriving with the
     pointer on the film lifts it 12px and the drop on leaving lands it dead
     centre.
   - The plate is the hover target, so its hit area reaches 14px below it
     (::after): lifted 12px, it still covers the pointer at its old bottom
     edge and cannot flicker up and down there.
   - Not on the film wall's plate (#films), and only where the pointer can
     hover. Off under reduced motion. */
[data-vs-portfolio-v2] #film [data-vs-stage]::after{
  content:"";position:absolute;left:0;right:0;top:100%;height:14px;
}
@media (hover:hover){
  [data-vs-portfolio-v2] #film [data-vs-stage]{
    transition:translate .8s linear(0, 0.057, 0.195, 0.368, 0.545, 0.706, 0.84, 0.942, 1.013, 1.056, 1.078, 1.083, 1.078, 1.066, 1.052, 1.037, 1.024, 1.013, 1.004, 0.999, 0.995, 0.993, 0.993, 0.994, 1),
               box-shadow .6s ease-out;
  }
  html.vs-m [data-vs-portfolio-v2] #film [data-vs-stage]{
    transition:opacity var(--vs-dur) var(--vs-ease),
               transform var(--vs-dur) var(--vs-ease),
               translate .8s linear(0, 0.057, 0.195, 0.368, 0.545, 0.706, 0.84, 0.942, 1.013, 1.056, 1.078, 1.083, 1.078, 1.066, 1.052, 1.037, 1.024, 1.013, 1.004, 0.999, 0.995, 0.993, 0.993, 0.994, 1),
               box-shadow .6s ease-out;
  }
  [data-vs-portfolio-v2] #film [data-vs-stage]:hover{
    translate:0 -12px;
    box-shadow:0 80px 130px -28px rgba(0,0,0,.24),0 28px 50px -16px rgba(0,0,0,.12),inset 0 1px 0 rgba(255,255,255,.6);
    transition:translate .9s linear(0, 0.058, 0.205, 0.402, 0.613, 0.813, 0.98, 1.107, 1.188, 1.228, 1.232, 1.209, 1.169, 1.121, 1.072, 1.028, 0.992, 0.967, 0.951, 0.946, 0.947, 0.954, 0.965, 0.976, 0.987, 0.997, 1.004, 1.009, 1.012, 1.013, 1),
               box-shadow .5s ease-out;
  }
  html.vs-m [data-vs-portfolio-v2] #film [data-vs-stage]:hover{
    transition:opacity var(--vs-dur) var(--vs-ease),
               transform var(--vs-dur) var(--vs-ease),
               translate .9s linear(0, 0.058, 0.205, 0.402, 0.613, 0.813, 0.98, 1.107, 1.188, 1.228, 1.232, 1.209, 1.169, 1.121, 1.072, 1.028, 0.992, 0.967, 0.951, 0.946, 0.947, 0.954, 0.965, 0.976, 0.987, 0.997, 1.004, 1.009, 1.012, 1.013, 1),
               box-shadow .5s ease-out;
  }
  [data-vs-portfolio-v2] #film .showreel-main-card{
    transition:translate .8s linear(0, 0.057, 0.195, 0.368, 0.545, 0.706, 0.84, 0.942, 1.013, 1.056, 1.078, 1.083, 1.078, 1.066, 1.052, 1.037, 1.024, 1.013, 1.004, 0.999, 0.995, 0.993, 0.993, 0.994, 1),
               scale .8s linear(0, 0.057, 0.195, 0.368, 0.545, 0.706, 0.84, 0.942, 1.013, 1.056, 1.078, 1.083, 1.078, 1.066, 1.052, 1.037, 1.024, 1.013, 1.004, 0.999, 0.995, 0.993, 0.993, 0.994, 1),
               box-shadow .6s ease-out;
  }
  /* The front page's own -2px card lift stands down here, so the film moves
     exactly as a What Next plate does and not by 2px more. */
  [data-vs-portfolio-v2] #film .showreel-main-card:hover{transform:none}
  [data-vs-portfolio-v2] #film [data-vs-stage]:hover .showreel-main-card{
    translate:0 -6px;scale:1.02;
    box-shadow:0 34px 54px -16px rgba(0,0,0,.44),0 14px 22px -10px rgba(0,0,0,.2);
    transition:translate 1.1s linear(0, 0.058, 0.206, 0.409, 0.632, 0.844, 1.026, 1.164, 1.253, 1.293, 1.292, 1.259, 1.205, 1.14, 1.075, 1.016, 0.968, 0.935, 0.917, 0.912, 0.917, 0.931, 0.949, 0.969, 0.988, 1.003, 1.015, 1.023, 1.026, 1.026, 1.023, 1.018, 1.012, 1.006, 1) .07s,
               scale 1.1s linear(0, 0.058, 0.206, 0.409, 0.632, 0.844, 1.026, 1.164, 1.253, 1.293, 1.292, 1.259, 1.205, 1.14, 1.075, 1.016, 0.968, 0.935, 0.917, 0.912, 0.917, 0.931, 0.949, 0.969, 0.988, 1.003, 1.015, 1.023, 1.026, 1.026, 1.023, 1.018, 1.012, 1.006, 1) .07s,
               box-shadow .6s ease-out .07s;
  }
}

@media (prefers-reduced-motion:reduce){
  [data-vs-portfolio-v2] #film [data-vs-stage]:hover{translate:none}
  [data-vs-portfolio-v2] #film [data-vs-stage]:hover .showreel-main-card{translate:none;scale:none}
  html.vs-m [data-vs-portfolio-v2] .vs-rise,
  html.vs-m [data-vs-portfolio-v2] .vs-settle,
  html.vs-m [data-vs-portfolio-v2] .reveal,
  html.vs-m [data-vs-portfolio-v2] .wipe{
    opacity:1 !important;transform:none !important;clip-path:none !important;
    transition:none !important;animation:none !important;
  }
  html.vs-m [data-vs-portfolio-v2] .vs-rule::before{transform:none !important;transition:none !important}
  html.vs-m [data-vs-portfolio-v2] [data-vs-lines] .vs-ln{
    opacity:1 !important;transition:none !important;
  }
}
