/* Virgin Australia, Journey Tracker: section 03, the turn (#turn and #fix).
   This section's own styles. The frame loads ../../kit.css (the shared
   tokens and parts) first, then each section in order. Paths resolve
   against this file. Split out of middle.css on 13 Oct 2026.

   27 Oct 2026 (chat THE CATCH, his pick "Two, before and after"): two sections,
   The catch and The fix that works, each the study's own head over one picture at
   16:9 (2:3 on phones). Until 31 Oct (EIGHT HOURS, below): The catch sat on Virgin's dark purple with on-ink colours;
   the fix on the grey plate (his gtrack pick). Every picture is a size container
   (vj3pic): the scene inside sizes off it. Virgin's red is the one accent: the
   eight hour line and the gone flag. Virgin's own type and colours appear only
   inside the coded phone.

   EIGHT HOURS (his picks locked 31 Oct 2026, chat EIGHT HOURS; built 1 Nov, chat VA STUDY BUILDER 1 NOV):
   both pictures sit on the light dot grid (the plum ink plate and the fix's film sky are gone), the card bars
   fade green to red at the 8 hour line, the countdown takes the status colour, a stretch with no card is
   the Live Activity card's own dotted line, and The fix's phone stands still. Contrast on the light ground:
   countdown green 5.37, amber 4.74, red 5.12, grey 6.19; white bar words on green 4.95; dots and bars 3.3+. */
.vj-turn{--hue:var(--client-primary);--vj3-shadow:0 1px 2px var(--color-overlay-soft),0 18px 40px -24px var(--color-overlay-soft);
  --vj3-canvas:radial-gradient(circle,var(--color-border-strong) 1px,transparent 1.5px) 0 0/var(--space-500) var(--space-500)}
.vj3{display:grid;grid-template-columns:minmax(0,1fr);gap:var(--space-600)}
.vj3-head{display:grid;gap:var(--space-400);align-content:start;align-items:start}
.vj3-head .vj-eb{margin:0}
.vj3-h2{max-width:20ch}
.vj-turn :is(.vj-p,.vj3-h2){text-wrap:pretty}

/* ---- the picture: a coded iPhone beside (wide) or above (tall) the trip clock ---- */
.vj3-pic{position:relative;container:vj3pic/size;width:100%;aspect-ratio:16/9;border-radius:var(--radius-xl);overflow:hidden;box-shadow:0 0 0 1px var(--color-border),var(--vj3-shadow);
  background:var(--vj3-canvas),var(--va-page);cursor:pointer}
.vj3-scene{position:absolute;inset:0;display:grid;gap:4cqmin;padding:5cqmin;align-items:center;
  --fs-l:clamp(var(--text-label),2.4cqmin,var(--text-caption));--fs-m:clamp(var(--text-caption),3cqmin,var(--size-base));color:var(--color-text-primary)}
.vj3-scene[data-o="l"]{grid-template-columns:auto minmax(0,1fr);padding-inline:6cqmin}
.vj3-scene[data-o="p"]{grid-template-rows:auto minmax(0,1fr);align-items:start;padding-top:6cqmin}
.vj3-scene .ph{display:grid;place-items:center;min-width:0}
.vj3-scene .vj-phone{margin:0}
.vj3-scene .tl{display:grid;gap:3cqmin;align-content:center;min-width:0}
.vj3-scene .smono{font:var(--weight-medium) var(--fs-l)/1.3 var(--font-mono);letter-spacing:var(--tracking-label);text-transform:uppercase;color:var(--color-text-secondary)}
.vj3-scene .clk{display:grid;gap:1cqmin}
/* the countdown in the status colour (his pick 31 Oct 2026, chat EIGHT HOURS): green, amber in the card's last two
   hours, red once Apple ends it, a readable grey between cards (section.js sets near, hit and idle) */
.vj3-scene .clk b{font:var(--weight-regular) clamp(var(--size-2xl),12cqmin,var(--display-stat-num))/1 var(--font-display);letter-spacing:var(--display-tight);font-variant-numeric:tabular-nums;transition:color var(--duration-moderate);
  color:color-mix(in srgb,var(--va-green-70) 85%,var(--va-ink))}
.vj3-scene .clk.near b{color:color-mix(in srgb,var(--va-amber) 85%,var(--va-ink))}
.vj3-scene .clk.hit b{color:var(--va-cancel)}
.vj3-scene .clk.idle b{color:var(--va-grey-72)}
.vj3-scene .rows{display:grid;gap:3.2cqmin}
.vj3-scene .row{display:grid;gap:1.2cqmin}
.vj3-scene .rl{display:flex;justify-content:space-between;align-items:baseline;gap:2cqmin;font:var(--weight-semibold) var(--fs-m)/1.25 var(--font-body);padding-right:0}
.vj3-scene .fl{flex:none;font:var(--weight-semibold) var(--fs-l)/1.3 var(--font-mono);letter-spacing:var(--tracking-label);text-transform:uppercase;color:var(--color-text-secondary);opacity:0;transition:opacity var(--duration-moderate)}
.vj3-scene .fl.on{opacity:1}
.vj3-scene .row[data-r="0"] .fl{color:var(--client-text)}
.vj3-scene .trk{position:relative;height:clamp(var(--space-400),5.4cqmin,var(--space-700));border-radius:var(--bar-radius);background:var(--va-grey-12)}
/* the bars sit inside their grey track, clipped to its round ends, so a bar starting at 0h is square on the left and
   the track's own end shapes it (his pick 31 Oct 2026, chat EIGHT HOURS); the red limit line stays outside the clip.
   Neither the clip nor a bar takes a z-index, so the no card pill still sits over the line. */
.vj3-scene .trk>.clip{position:absolute;inset:0;border-radius:inherit;overflow:hidden}
.vj3-scene .seg{position:absolute;top:0;bottom:0;width:0;border-radius:var(--bar-radius);overflow:hidden}
.vj3-scene .seg.first{border-top-left-radius:0;border-bottom-left-radius:0}
.vj3-scene .seg b{transition:opacity var(--duration-moderate);position:absolute;left:1.6cqmin;top:50%;transform:translateY(-50%);font:var(--weight-semibold) var(--fs-l)/1 var(--font-body);white-space:nowrap}
.vj3-scene .seg.tight b{opacity:0}
/* green fading to red (his pick 31 Oct 2026, chat EIGHT HOURS): each card bar is its slice of one run pinned to its
   tracker, from the card's start to that tracker's 8 hour line (section.js sets --vj3-gx and --vj3-gw); past the line
   the bar is red, and a bar starting after it (the landed blip) is green */
.vj3-scene .k-on{background:linear-gradient(90deg in oklch,var(--va-green-70) 0 50%,var(--va-amber) 80%,var(--va-red) 100%) var(--vj3-gx,0) 0/var(--vj3-gw,100%) 100% no-repeat,var(--va-red)}
.vj3-scene .k-on.late{background:var(--va-green-70)}
.vj3-scene .k-on b{color:var(--color-static-white)}
/* no card on the lock screen (The fix in the air, The catch after eight hours): no fill, the Live Activity card's own
   dotted flight path along the middle (his pick 31 Oct 2026, chat EIGHT HOURS) */
.vj3-scene :is(.k-gap,.k-ghost){background:radial-gradient(circle,color-mix(in srgb,var(--va-ink) 62%,transparent) 0 2px,transparent 2.5px) 0 50%/var(--space-300) var(--space-300) repeat-x} /* lint-ok: the path's dot size in px, as the plate's dot grid */
.vj3-scene .k-ghost b{display:none}
/* the "In the air, no card" pill: solid, even room round its words, over the red limit line so the line never cuts them */
.vj3-scene .k-gap b{color:var(--va-ink);background:var(--color-static-white);padding:var(--space-100) var(--space-300);border-radius:var(--chip-radius);box-shadow:0 0 0 1px var(--color-border);z-index:3}
.vj3-scene .lim{position:absolute;top:-1.6cqmin;bottom:-1.6cqmin;width:2px;margin-left:-1px;background:var(--hue);z-index:2}
.vj3-scene .tks{position:relative;height:calc(var(--fs-l) * 1.4);font:var(--weight-medium) var(--fs-l)/1 var(--font-mono);color:var(--va-grey-72)}
.vj3-scene .tks span{position:absolute;top:0;transform:translateX(-50%);white-space:nowrap}
.vj3-scene .tks span:first-child{transform:none}
.vj3-scene .say{min-height:calc(var(--fs-m) * 2.4);opacity:0;transform:translateY(1cqmin);transition:opacity var(--duration-moderate),transform var(--duration-slow) var(--vj-ease)}
.vj3-scene .say.on{opacity:1;transform:none}
.vj3-scene .sch{display:inline-flex;align-items:center;max-width:100%;padding:1.2cqmin 2.4cqmin;border-radius:var(--chip-radius);background:var(--color-surface);box-shadow:0 0 0 1px var(--color-border),var(--vj3-shadow);font:var(--weight-semibold) var(--fs-m)/1.25 var(--font-body);color:var(--color-text-primary)}
.vj3-scene .say.bad .sch{background:var(--hue);box-shadow:none;color:var(--color-static-white)}
/* the legend for the red line: Apple's eight hour limit */
.vj3-scene .lg{display:inline-flex;align-items:center;gap:1.2cqmin;color:var(--client-text)}
.vj3-scene .lg i{width:2px;height:1.2em;background:var(--hue)}
/* tall pictures: the phone is cropped in on its card; the moment's chip sits over the crop */
.vj3-scene[data-o="p"] .ph{display:flex;flex-direction:column;justify-content:flex-end;align-items:center;overflow:hidden;align-self:start;-webkit-mask-image:linear-gradient(to bottom,transparent,black 22%);mask-image:linear-gradient(to bottom,transparent,black 22%)}
.vj3-scene[data-o="p"] .say{position:absolute;top:4cqmin;left:5cqmin;right:5cqmin;z-index:3;min-height:0}
.vj3-scene[data-o="p"] .lg{grid-column:1/-1}
.vj3-scene[data-o="p"] .clk{grid-template-columns:auto 1fr;align-items:baseline;gap:2cqmin}
.vj3-scene[data-o="p"] .clk b{font-size:clamp(var(--size-xl),9cqmin,var(--size-3xl))}

@container (max-width:599px){.vj3-pic{aspect-ratio:2/3}}
@container (min-width:900px){
  .vj3{gap:var(--space-700)}
  .vj3-head{grid-template-columns:minmax(0,7fr) minmax(0,5fr);column-gap:var(--space-800)}
  .vj3-head .vj-eb{grid-column:1/-1}
  .vj3-head .vj-p{max-width:46ch}
}

/* pictures loop; a click or Enter pauses and plays (21 Oct) */
.vj3-pic:focus-visible{outline:var(--border-focus);outline-offset:var(--focus-ring-offset)}
.vj3-pic[aria-pressed="true"]::after{content:"Paused";position:absolute;right:var(--space-300);top:var(--space-300);padding:var(--space-100) var(--space-300);background:var(--color-text-primary);color:var(--color-bg);font:var(--weight-semibold) var(--text-label)/1.4 var(--font-mono);letter-spacing:var(--tracking-label);text-transform:uppercase;pointer-events:none}

/* The fix's phone stands still like The catch's (his pick 31 Oct 2026, chat EIGHT HOURS): no phone focus, so no
   tilt, camera or floor shadow, and the clock sits in its own column again (the 27 Oct film sky and the nudge
   across for the tilted phone are gone). The silver Apple picture still comes from phone-focus.js, as on every phone. */

/* ---- THE FIX ON PHONES (27 Oct 2026, chat VA MOBILE PASS, his pick "Card alone, no phone") ----
   No phone under 768: the lock screen card on its own (section.js drives it beside the phone), filling the plate
   16px in, flat with a hairline, nothing to clip. The plate hugs its parts; the clock stacked in the middle; the
   tracker bars 32px tall, 24px apart; the moment pill on top, in the middle, 8px all round.
   The limit takes the same layout on phones (9 Nov 2026, chat VIRGIN MOBILE, his note on his iPhone: the cropped phone
   clipped, the countdown squeezed and the plate left empty below), so both pictures match as they do on desktop. */
.vj-turn .vj3-card{display:none}
@media (max-width:767.98px){
  .vj-turn .vj3-pic{aspect-ratio:auto;container-type:inline-size}
  .vj-turn .vj3-scene{position:relative;inset:auto;grid-template-columns:minmax(0,1fr);grid-template-rows:none;align-items:start;gap:var(--space-400);padding:var(--card-pad-compact)}
  .vj-turn .vj3-scene .ph{display:none}
  .vj-turn .vj3-scene .tl{grid-template-columns:minmax(0,1fr);gap:var(--space-400)}
  .vj-turn .vj3-scene .clk{grid-template-columns:minmax(0,1fr);justify-items:center;text-align:center;gap:var(--space-100)}
  .vj-turn .vj3-scene .rows{gap:var(--space-500)}
  .vj-turn .vj3-scene .row{gap:var(--space-200)}
  .vj-turn .vj3-scene .trk{height:var(--space-600)}
  .vj-turn .vj3-scene .lim{top:calc(var(--space-100) * -1);bottom:calc(var(--space-100) * -1)}
  .vj-turn .vj3-scene .seg b{left:var(--space-300)}
  /* the pill keeps its line while it has no words yet, so the plate holds its height as each pass starts */
  .vj-turn .vj3-scene .say{position:static;order:-1;min-height:calc(var(--fs-m) * 1.25 + var(--space-400));text-align:center}
  .vj-turn .vj3-scene .sch{padding:var(--space-200)}
  /* the card's slot holds the tallest state (--vj3-slot, from section.js), so the plate never jumps */
  .vj-turn .vj3-card{display:grid;align-items:center;justify-items:center;min-height:var(--vj3-slot,auto)}
  .vj-turn .vj3-card .la{box-shadow:0 0 0 1px var(--color-border);transition:opacity var(--duration-slow) var(--ease-default)}
  /* no card on the lock screen (between the two, and in the air): the card fades and its place stays as a dashed
     outline, drawn on the wrapper so the coded card itself is never restyled */
  .vj-turn .vj3-card .vj-solo::before{content:"";position:absolute;inset:0;border:1px dashed var(--color-border-strong);border-radius:44px;opacity:0;transition:opacity var(--duration-slow) var(--ease-default)} /* lint-ok: the Live Activity card's own corner (la-card.css), zoomed with it */
  .vj-turn .vj3-card.gone .vj-solo::before{opacity:1}
  .vj-turn .vj3-card.gone .la{opacity:0}
}

/* reduced motion and Still: the scene holds its end state, nothing slides. Stays last in this file. */
@media (prefers-reduced-motion:reduce){.vj3-scene *{transition:none!important}}
html[data-motion="still"] .vj3-scene *{transition:none!important}
