/* ============================================================================
   CARDS — the Work grid card, the Greatest Hits marquee, the award flare, and the
   outbound half of the signal-drop page transition. Split out of case.css 2026-09-22.

   Loaded by BOTH the home page and every /work/ page. The home page used to pull all
   of case.css for this: ~15KB of case-study-page rules (and one real .fig-frame
   collision with the hero box) on a page with no case study on it.

   Case-study PAGE styling stays in case.css. A rule whose selector list spans both
   lives here, because every page that loads case.css also loads this file.
   ============================================================================ */

/* ============================================================================
   CASE STUDIES — shared layer for the Work grid and the case-study pages.
   Loads after assets/site.css. Tokens and conventions: docs/design-system/SUPERCOLOR.md
   Art slots, specs and what fills them: docs/case-studies-2026-09-03/10-asset-inventory-and-specs.md

   The shell:
     card  = color panel (.wc-panel) + ONE art element (.wc-art: a subject cutout, a logo
             mark, anything transparent) + lower-third chyron. Hover contracts the panel to
             a circle of the photo (SUPERCOLOR §5) and the art lifts / signal-splits.
     click = the signal drop (§4b): the page falls to moving static and only the card's art
             keeps its picture, riding on top of the snow to its spot in the featured band, then
             losing its signal as the static clears. Cross-document View Transitions (browser-
             native, no router). Fallback: the channel wipe. Calm modes (reduced-motion / .a11y): plain link.
     slot  = .cs-stage[data-art=…] "tunes in" on arrival: static burst, then the media
             behind the art appears. Art types: still · loop · facade · pan · anim · idents
   ============================================================================ */

/* ---------- WORK GRID CARDS ----------
   Hover/focus is the card's live state. On touch (no hover) case.js gives .is-on to the card nearest the
   viewport centre as you scroll, so the one-column grid flips through the cards like channels (Phil, 2026-09-11). */
.wgrid{display:grid; grid-template-columns:repeat(3,1fr); gap:26px; padding-top:48px}  /* headroom: art stands above the panel */
.wcard{position:relative; display:block; aspect-ratio:3/4; color:inherit; text-decoration:none; border-radius:16px; --cx:50%; --cy:54%; isolation:isolate}   /* its own stacking context, so neighbours never paint over each other's art */
.wcard:focus-visible{outline:3px solid var(--focus); outline-offset:10px}
.wc-panel, .wc-photo{position:absolute; inset:0; border-radius:16px;
  -webkit-clip-path:circle(150% at var(--cx) var(--cy)); clip-path:circle(150% at var(--cx) var(--cy));
  transition:clip-path .55s cubic-bezier(.6,0,.2,1), -webkit-clip-path .55s cubic-bezier(.6,0,.2,1), opacity .3s ease}
.wc-panel{background:var(--pc); z-index:1; overflow:hidden}
.wc-panel .spd{position:absolute; inset:0; background:repeating-linear-gradient(120deg, transparent 0 20px, rgba(18,25,18,.26) 20px 22px);
  -webkit-mask:linear-gradient(120deg,#000,transparent 60%); mask:linear-gradient(120deg,#000,transparent 60%)}
.wc-photo{z-index:2; opacity:0; overflow:hidden}   /* the reveal window; the image inside may be larger than the card */
.wc-photo img{position:absolute; left:var(--photo-left, 0); bottom:var(--photo-bottom, 0); height:var(--photo-h, 100%); width:auto; max-width:none; display:block}
.wc-photo img:not([style]){left:0; width:100%; height:100%; object-fit:cover}
.wcard:hover .wc-panel, .wcard:focus-visible .wc-panel, .wcard.is-on .wc-panel,
.wcard:hover .wc-photo, .wcard:focus-visible .wc-photo, .wcard.is-on .wc-photo{-webkit-clip-path:circle(40% at var(--cx) var(--cy)); clip-path:circle(40% at var(--cx) var(--cy))}
.wcard:hover .wc-photo, .wcard:focus-visible .wc-photo, .wcard.is-on .wc-photo{opacity:1}
/* the art: auto-sized against BOTH max constraints so its aspect is never squished (the
   2026-08-13 bug was height + max-width together). Cutouts: portrait, subject touches the
   bottom edge. Marks/logos: centered instead — add .wc-art--mark */
.wc-art{position:absolute; left:50%; bottom:var(--art-bottom, 0); transform:translateX(-50%); width:auto; height:auto; max-height:104%; max-width:var(--art-maxw, 108%);
  z-index:3; pointer-events:none; filter:drop-shadow(0 12px 20px rgba(0,0,0,.42));
  transition:transform .55s cubic-bezier(.6,0,.2,1), filter .4s ease}
.wc-art--mark{bottom:auto; top:var(--mark-top, 38%); transform:translate(-50%,-50%); max-height:var(--mark-h, 52%); max-width:var(--mark-w, 72%)}
/* hover state-change on the art: lifts, and the signal splits (chromatic fringes) */
.wcard:hover .wc-art, .wcard:focus-visible .wc-art, .wcard.is-on .wc-art{transform:translateX(-50%) translateY(-10px) scale(1.04);
  filter:drop-shadow(0 18px 24px rgba(0,0,0,.5))
         drop-shadow(4px 0 0 color-mix(in srgb, var(--cyan) 75%, transparent))
         drop-shadow(-4px 0 0 color-mix(in srgb, var(--magenta) 75%, transparent))}
.wcard:hover .wc-art--mark, .wcard:focus-visible .wc-art--mark, .wcard.is-on .wc-art--mark{transform:translate(-50%,-50%) translateY(-10px) scale(1.06)}
/* DE{CODE} mark = the bracket-to-flower spin (alpha video). Idle: the poster, which is the open orange
   flower four seconds into the loop rather than the brace it starts on. Hover/focus: the loop plays
   (brace → orange → purple → teal → brace). Where hover doesn't exist or motion is calm, the keyed
   flower still stands in (.wc-spin-fallback). */
/* WebKit drops a <video>'s alpha when a CSS filter is on it (iPhone showed the flower in a white
   box, 2026-09-18: the spin is the only alpha video here that carried one). No shadow or fringe
   on the video in Safari; every other browser keeps them. Never put a filter on an alpha video. */
:root.is-safari video.wc-spin{filter:none !important}
.wc-spin{display:none; background:transparent; pointer-events:none}   /* size and position come from .wc-art--mark, so the video and the still are identical */
@media (prefers-reduced-motion:no-preference){   /* touch too: the scroll flip plays it (2026-09-11) */
  :root:not(.a11y) .wc-spin{display:block}
  :root:not(.a11y) .wc-spin-fallback{display:none}
}
/* rolling scanlines masked to the art's silhouette (the hero carousel's treatment); needs --cut on the card */
.wc-scan{position:absolute; left:50%; bottom:var(--art-bottom, 0); transform:translateX(-50%); width:var(--art-maxw, 108%); height:104%; z-index:4; pointer-events:none; opacity:0;
  background:repeating-linear-gradient(to bottom, transparent 0 2px, rgba(0,0,0,.55) 2px 3px); mix-blend-mode:multiply;
  -webkit-mask:var(--cut) center bottom / contain no-repeat; mask:var(--cut) center bottom / contain no-repeat;
  transition:opacity .3s ease}
.wcard:hover .wc-scan, .wcard:focus-visible .wc-scan, .wcard.is-on .wc-scan{opacity:.6; animation:scanRoll 2.4s linear infinite}
/* meta as a lower-third chyron band: readable over any art */
.wc-num{font-weight:700; color:var(--dim)}   /* lives in the chyron band, where overhanging art can never cover it */
.wc-body{position:absolute; left:14px; right:14px; bottom:14px; z-index:5; padding:14px 16px 15px; pointer-events:none; color:var(--cream);
  background:rgba(12,17,12,.9); border-left:4px solid var(--pc); border-radius:3px; box-shadow:0 3px 0 rgba(0,0,0,.4);
  transition:transform .45s cubic-bezier(.6,0,.2,1)}
.wcard:hover .wc-body, .wcard:focus-visible .wc-body, .wcard.is-on .wc-body{transform:translateY(-8px)}
.wc-tag{display:block; font-family:var(--mono); font-size:.6562rem; font-weight:700; letter-spacing:.12em; text-transform:uppercase; color:var(--pc); margin-bottom:6px}
.wc-title{display:block; font-family:var(--disp); font-weight:900; font-variation-settings:"wght" 900,"wdth" 115; text-transform:uppercase; font-size:1.3rem; line-height:1.0; letter-spacing:-.01em; overflow-wrap:break-word; -webkit-hyphens:auto; hyphens:auto}
.wc-tease{display:block; font-size:.9rem; color:var(--dim); margin-top:8px; text-wrap:pretty; max-height:0; opacity:0; overflow:hidden; transition:max-height .45s cubic-bezier(.6,0,.2,1), opacity .35s ease .1s}
.wcard:hover .wc-tease, .wcard:focus-visible .wc-tease, .wcard.is-on .wc-tease{max-height:6em; opacity:1}
/* LEAVING: set by JS the instant the navigation starts. Snaps the card to its rest pose so
   the snapshot the browser carries into the next page is a clean panel + art. */
.wcard.leaving .wc-panel, .wcard.leaving .wc-photo, .wcard.leaving .wc-art, .wcard.leaving .wc-scan{transition:none; animation:none}
.wcard.leaving .wc-panel, .wcard.leaving .wc-photo{-webkit-clip-path:circle(150% at var(--cx) var(--cy)); clip-path:circle(150% at var(--cx) var(--cy))}
.wcard.leaving .wc-photo, .wcard.leaving .wc-scan, .wcard.leaving .wc-body{opacity:0}
.wcard.leaving .wc-art{transform:translateX(-50%); filter:drop-shadow(0 12px 20px rgba(0,0,0,.42))}
.wcard.leaving .wc-art--mark{transform:translate(-50%,-50%)}
.wcard.leaving .wc-art{view-transition-name:cs-art}   /* only the art travels; the panel stays behind under the static */
/* The traveller is the STILL, never the spin video: Safari snapshots a <video> for the view
   transition without its alpha, so the flower/cog crossed to the case page in a white box on
   iPhone (2026-09-18). The still is eager-loaded so it is already decoded at the swap. */
.wcard.leaving .wc-spin{display:none !important; view-transition-name:none}
.wcard.leaving .wc-spin-fallback{display:block !important}
@media(max-width:820px){ .wgrid{grid-template-columns:repeat(2,1fr)} }
@media(max-width:560px){ .wgrid{grid-template-columns:1fr; max-width:22rem; margin-left:auto; margin-right:auto} }
:root.a11y .wc-panel, :root.a11y .wc-photo, :root.a11y .wc-art{transition:none}
:root.a11y .wc-scan{display:none}
:root.a11y .wc-tease{opacity:1; max-height:6em}

/* ---------- FALLBACK: CHANNEL WIPE (SUPERCOLOR §4b) for browsers without cross-document transitions ---------- */
.pagefx{position:fixed; inset:0; z-index:80; pointer-events:none; display:none; overflow:hidden}
.pagefx.on{display:block}
.pagefx.in .pf-bars{animation:pfIn .5s cubic-bezier(.7,0,.2,1) both}
.pagefx.out .pf-bars{animation:pfOut .55s cubic-bezier(.7,0,.2,1) both}
:root.a11y .pagefx{display:none !important}                          /* the brand board hands off to the panning pages */

/* ---------- FLARE: award sticker that sits on the card's corner and rides into the hero ---------- */
.flare{display:block; filter:drop-shadow(0 8px 14px rgba(0,0,0,.45)); pointer-events:none}
.wc-flare{position:absolute; top:-7%; right:-7%; width:36%; z-index:6; transform:rotate(-12deg); transition:transform .5s cubic-bezier(.6,0,.2,1)}
.wcard:hover .wc-flare, .wcard:focus-visible .wc-flare, .wcard.is-on .wc-flare{transform:rotate(-4deg) scale(1.08)}
.wcard.leaving .wc-flare{transition:none; transform:rotate(-12deg); view-transition-name:cs-flare}
@media(max-width:640px){ .wc-flare{width:40%}
}

:root.a11y .flare{filter:none}
/* the ring text turns slowly inside its band; calm modes stop it via the global animation kill */
.flare-ring{transform-box:view-box; transform-origin:50% 50%; animation:flareSpin 26s linear infinite}

/* PHOTO CARDS: a supplied graphic fills the panel (no cutout); hover contracts it to the circle and zooms a touch */
.wc-cover{position:absolute; inset:0; width:100%; height:100%; object-fit:cover; display:block; transition:transform .6s cubic-bezier(.6,0,.2,1)}
.wcard:hover .wc-cover, .wcard:focus-visible .wc-cover, .wcard.is-on .wc-cover{transform:scale(1.06)}
.wcard.leaving .wc-cover{transition:none; transform:none}
.wc-panel:has(.wc-cover) .spd{display:none}

/* ---------- GREATEST HITS MARQUEE: a lit sign scrolling above the Work section. Full-bleed, the type glows in the
   section's channel and hums like a neon tube. Reduced motion: still, steady glow. High contrast: plain type. ---------- */
.marquee{position:relative; width:100vw; margin:-.2em 0 var(--s1) calc(50% - 50vw); padding:1.25em 0 .95em;   /* the type is 2.5× tall and the glow bleeds past the line box, so the box is sized from the type */
  font-size:clamp(3.2rem, 9.5vw, 8.4rem); line-height:1; overflow-x:clip; overflow-y:visible}   /* clip only sideways so the track never widens the page; the glow stays free above and below */
.marquee::before, .marquee::after{content:""; position:absolute; top:-1em; bottom:-1em; width:9%; z-index:2; pointer-events:none}   /* soft edges, full height so the glow fades too */
.marquee::before{left:0; background:linear-gradient(90deg, var(--black), transparent)}
.marquee::after{right:0; background:linear-gradient(270deg, var(--black), transparent)}
.mq-track{display:flex; align-items:center; gap:.35em; width:max-content; white-space:nowrap; animation:mqScroll 38s linear infinite;
  font-family:var(--disp); font-weight:900; font-variation-settings:"wght" 900,"wdth" 125; text-transform:uppercase; letter-spacing:-.02em; color:var(--cyan)}
.mq-item{display:inline-block; transform:scaleY(2.5); transform-origin:50% 50%;   /* 2.5× taller, same width */
  text-shadow:0 0 6px color-mix(in srgb, var(--cyan) 70%, transparent), 0 0 22px color-mix(in srgb, var(--cyan) 55%, transparent),
  0 0 64px color-mix(in srgb, var(--cyan) 40%, transparent), 0 0 140px color-mix(in srgb, var(--cyan) 25%, transparent);
  animation:mqHum 3.6s ease-in-out infinite}
.mq-item:nth-child(4n+3){animation-delay:-1.2s} .mq-item:nth-child(4n+5){animation-delay:-2.3s}
.mq-sep{color:var(--yellow); font-size:.55em; margin:0 .4em; text-shadow:0 0 14px color-mix(in srgb, var(--yellow) 70%, transparent); animation:mqBlink 2.4s steps(1) infinite}
@media (prefers-reduced-motion:reduce){ .mq-track, .mq-item, .mq-sep{animation:none} }
:root.a11y .mq-item, :root.a11y .mq-sep{text-shadow:none}   /* click toggles it, since it carries no controls while it plays itself */

/* ---------- FADE CARDS: no photo behind the art, the panel just warms to another colour on hover.
   For art that was drawn on white in the first place, so hovering puts it back where it belongs. ---------- */
.wcard--fade .wc-panel{transition:background-color .5s ease, clip-path .55s cubic-bezier(.6,0,.2,1), -webkit-clip-path .55s cubic-bezier(.6,0,.2,1)}
.wcard--fade .wc-panel .spd{transition:opacity .45s ease}
.wcard--fade:hover .wc-panel, .wcard--fade:focus-visible .wc-panel{background:var(--hover-bg, #fff);
  -webkit-clip-path:circle(150% at var(--cx) var(--cy)); clip-path:circle(150% at var(--cx) var(--cy))}
.wcard--fade:hover .wc-panel .spd, .wcard--fade:focus-visible .wc-panel .spd{opacity:0}
:root.a11y .wcard--fade .wc-panel{transition:none}
