/* ============================================================
   LC-A Projects — B8 grid + filter chips · B9 Featured strip
   ------------------------------------------------------------
   ⚠️ BUILT FROM SOURCE by tools/build-projects-css.js. DO NOT EDIT BY
   HAND — the next build silently discards anything added here.
   Change the generator, which asserts what must survive the lift,
   then re-run it. To check the generator still reproduces this
   file: run it and confirm "git diff" is empty.
   Lifted from projects.html:121-232. Loaded only where a projects
   widget is present (get_style_depends), so the other pages never
   fetch it.

   .phead is NOT here — the page header is LCA_Widget_Page_Header,
   which already ships contact.css. Extracting it twice would put
   two copies of the same rules in the cascade.

   Assertions carried by tools/build-projects-css.js and re-checked
   on every build: the 12-column dense grid, all six width classes
   and their derived ratios, min-width:0 (the right-edge bleed fix),
   the --nav-h sticky offset, the full-bleed bar with shell-aligned
   chips, the night chip overrides, the auto-fit featured strip, the
   hover zoom riding the media rather than the 3D lift, the
   reduced-motion cancel, and the 880px single-column collapse.

   DEVIATIONS from the static source:

   1 · The sticky offset gains + var(--lca-admin-bar, 0px).
     The nav is position:fixed and the WordPress admin bar moves its BOTTOM edge
     without changing its height, so a logged-in editor would see the bar tuck
     32px too high and a strip of page slide under the header. --nav-h itself is
     now published by core.js from a live measurement (70.19px), so the -1px tuck
     finally sits against the real height rather than the 70px fallback.

   2 · .empty is scoped to .work .empty.
     Measured hazard, not a hypothetical: the Elementor editor canvas loads the
     stylesheet of EVERY registered widget, so a class as generic as .empty would
     reach into any other widget that happens to use the word. hero.css's
     unscoped .titlecard colour already did exactly this to the studio page.

   3 · .proj__glow gains pointer-events:none.
     It is a 46px-blurred radial gradient positioned bottom:-20%, so it hangs a
     fifth of the media height BELOW the card on purpose — the cast shadow on the
     floor. Being a real box, it was also the topmost hit target over everything
     in that overhang. Measured on the Compose Grid screen: the full-width -w12
     card glow sat over its own shape menu AND over the next row header, so
     document.elementFromPoint returned div.proj__glow and the menus would not
     open. On the front end the damage is invisible only because the whole card
     is one link and the glow is inside it; the bug is the same. Decoration that
     deliberately escapes its own box must never be a hit target.

   4 · .proj__excerpt drops 2px at every width. A DESIGN CHANGE, requested,
     and the first deliberate departure from the static site in this file.
     16px at 1440, 14px at 880 and 620 — was 18 / 16 / 16.

     The whole clamp is shifted, not just its ends: subtracting 2px from the
     PREFERRED term keeps the ramp in exactly the same viewport band. The
     original reaches its floor at 1280 (1.25vw = 16) and its ceiling at 1440
     (1.25vw = 18); with -2px it reaches 14 at 1280 and 16 at 1440. Writing
     clamp(14px,1.25vw,16px) instead would have moved that band and left
     widths around 1200 unchanged at 15px, which is not a 2px reduction.

     line-height is UNTOUCHED and deliberately so. It is the unitless 1.6,
     which is already a ratio, so it follows the font-size on its own:
     28.8 -> 25.6px at 1440 and 25.6 -> 22.4px below. An absolute
     line-height would have needed recomputing; this one must not be.

     The featured strip is NOT changed, because it has no description to
     change. .lcard__meta holds the title and a 10px uppercase meta line
     (category and year) and nothing else — the comment on .proj__excerpt
     ::after in this very file says as much. Shrinking .lcard__c would not
     make the two consistent; it would shrink a different kind of element.

   5 · card titles lead at 1.15. A DESIGN CHANGE, requested 2026-11-15.
     .proj__title and .lcard__t declare no line-height and inherited the
     body 1.6, which is body-copy leading on a display face: 46.1px lines on
     28.8px type at 1440. It showed only on a title long enough to wrap;
     #159 wraps to 2 lines in the grid and 3 in the strip. 1.15 is the
     display setting the homepage block already uses (CLAUDE.md divergence 1).
     Unitless, so it follows the clamp at every width.

   3 · Card shape is decoupled from card width (7 rules), and a chosen
       shape survives below 880px under a 65svh cap. Both are new
       behaviour with no counterpart in the source; the long notes are
       at the rules themselves.
   ============================================================ */

/* ---- FILTER CHIPS ---- */
/* SECTION RULE above the sticky filter bar. It used to sit 40-72px above the "Selected Projects"
   eyebrow, with only 24-48px above itself — deliberately lopsided, because a label hung beneath it.
   With the label gone that asymmetry read as a dead band, so --rule-space now feeds BOTH sides and
   the hairline is centred in its own whitespace by construction. One knob; they cannot drift apart.
   padding-inline dropped: border-top spans the full box width regardless, so it did nothing here. */
.filters__head{--rule-space:clamp(24px,4vh,48px);
  width:var(--shell);margin:var(--rule-space) auto 0;
  border-top:1px solid var(--line-soft);padding-top:var(--rule-space)}
/* STICKY OFFSET IS DERIVED, NOT A MAGIC NUMBER. --nav-h is measured off .nav in JS (see the
   ResizeObserver below) so any future header resize closes the seam by itself. The old top:72px
   was calibrated against a 76px header (--d:40px toggle + 2*18px padding); the 2026-07-29 toggle
   resize to 34.2px cut the header to 70.19px and left a 1.81px see-through strip beneath it.
   ⚠️ The -1px is a deliberate TUCK, not a fudge: .nav is z-index 50 against this bar's 30, so the
   overlap is painted over and a sub-pixel rounding hairline can never open. The 70px fallback is
   for the no-JS path and is also deliberately 1px under the real height. */
.filters{position:sticky;top:calc(var(--nav-h, 70px) + var(--lca-admin-bar, 0px) - 1px);z-index:30;width:100%;margin:0;            /* FULL-BLEED bar: span 100%, edge to edge */
  padding-block:clamp(16px,2.4vh,24px);
  /* inner chips stay aligned to the page shell; the frosted ::before still spans full width */
  padding-inline:max(clamp(20px,4vw,56px), calc((100% - var(--shell))/2 + clamp(20px,4vw,56px)));
  display:flex;flex-wrap:wrap;gap:10px;align-items:center}
.filters::before{content:"";position:absolute;inset:0;z-index:-1;background:var(--nav-bg);
  -webkit-backdrop-filter:blur(12px) saturate(1.3);backdrop-filter:blur(12px) saturate(1.3);
  opacity:.9}
.chip{font-family:var(--font-body);font-size:11px;letter-spacing:var(--track-mid);text-transform:uppercase;
  color:var(--muted);background:transparent;border:1px solid var(--line);border-radius:999px;
  padding:9px 17px;cursor:pointer;position:relative;
  transition:color .3s var(--ease-soft),background-color .4s var(--ease-zha),border-color .3s var(--ease-soft)}
.chip:hover{color:var(--fg);border-color:var(--fg);background:var(--bg-2)}
.chip.is-active{color:var(--chip-on-fg);background:var(--chip-on-bg);border-color:var(--chip-on-bg)}
/* NIGHT: lift inactive chip text + border so they read against the dark frosted bar over imagery.
   Hover + active are re-asserted at matching specificity so they keep winning in night mode. */
html[data-mode="night"] .chip{color:#d2d1cc;border-color:rgba(243,242,239,.5)}
html[data-mode="night"] .chip:hover{color:var(--fg);border-color:var(--fg);background:var(--bg-2)}
html[data-mode="night"] .chip.is-active{color:#15151a;background:#e0dfdb;border-color:#e0dfdb}
html[data-mode="night"] .filters::before{background:rgba(10,10,13,.68)}
.filters__count{margin-left:auto;font-size:10px;letter-spacing:var(--track-wide);text-transform:uppercase;color:var(--muted)}
/* the old .filters{top:64px} here is GONE — the header is 70.19px at this width too, so it
   over-tucked the bar by 6.19px and hid part of its padding. --nav-h covers both widths.
   .filters__count is dead CSS kept per house convention; do not delete the block. */
@media(max-width:880px){.filters__count{display:none}}

/* ---- EDITORIAL REFLOW GRID ---- */
.work{width:var(--shell);margin:0 auto;padding:clamp(36px,6vh,72px) clamp(20px,4vw,56px) clamp(60px,10vh,120px)}
.grid{display:grid;grid-template-columns:repeat(12,1fr);gap:clamp(28px,4vw,68px);grid-auto-flow:dense}
.proj{grid-column:span 6;min-width:0;will-change:transform,opacity}  /* min-width:0 = lets spans shrink to track, no right-edge bleed */
.proj.-w4{grid-column:span 4}
.proj.-w5{grid-column:span 5}
.proj.-w6{grid-column:span 6}
.proj.-w7{grid-column:span 7}
.proj.-w8{grid-column:span 8}
.proj.-w12{grid-column:span 12}
.proj.is-hidden{display:none}
.proj__media{position:relative;aspect-ratio:4/3}
.proj.-w7 .proj__media,.proj.-w8 .proj__media{aspect-ratio:16/10}
.proj.-w5 .proj__media{aspect-ratio:5/6}
.proj.-w4 .proj__media{aspect-ratio:3/4}
.proj.-w12 .proj__media{aspect-ratio:16/7}
.proj__lift{position:absolute;inset:0;z-index:2;transform-style:preserve-3d;border-radius:3px;will-change:transform}
.proj__frame{position:absolute;inset:0;border-radius:3px;overflow:hidden;border:1px solid var(--pane-edge);
  box-shadow:0 2px 0 rgba(255,255,255,.05) inset,0 1px 1px rgba(0,0,0,.12);background:var(--bg-2)}
.proj__frame img,.proj__frame video{width:100%;height:100%;object-fit:cover}  /* FULL COLOUR */
.proj__glow{pointer-events:none;position:absolute;left:3%;right:3%;top:22%;bottom:-20%;z-index:0;
  background:radial-gradient(56% 62% at 50% 56%,var(--cast),transparent 73%);
  filter:blur(46px);opacity:var(--cast-op,.85);will-change:transform,opacity;transition:opacity var(--mode-fade)}
.proj__meta{margin-top:22px;display:flex;flex-direction:column;align-items:flex-start;gap:6px;color:var(--fg)}
.proj__idx{font-size:11px;letter-spacing:.22em;color:var(--muted);font-weight:500;font-variant-numeric:tabular-nums}
.proj__title{font-family:var(--font-disp);font-stretch:100%;font-weight:600;font-size:clamp(1.2rem,2.3vw,1.8rem);letter-spacing:.01em;line-height:1.15;min-width:0;overflow-wrap:anywhere}
.proj__disc{font-size:11px;letter-spacing:var(--track-mid);text-transform:uppercase;color:var(--muted)}
.proj__excerpt{margin-top:2px;font-size:clamp(14px,1.25vw - 2px,16px);font-weight:300;line-height:1.6;color:var(--fg);letter-spacing:.01em;max-width:54ch}
.proj__excerpt::after{content:"…"}   /* presentational trailing ellipsis — kept out of the data so it survives text edits; Latest strip (lcard) has no excerpt */
.work .empty{padding:60px 0;text-align:center;color:var(--muted);font-size:13px;letter-spacing:var(--track-mid);text-transform:uppercase;display:none}
@media(max-width:880px){
  .grid{grid-template-columns:1fr;gap:clamp(40px,9vw,64px)}
  .proj,.proj.-w4,.proj.-w5,.proj.-w6,.proj.-w7,.proj.-w8,.proj.-w12{grid-column:1/-1}
  .proj__media,.proj.-w4 .proj__media,.proj.-w5 .proj__media,.proj.-w7 .proj__media,.proj.-w8 .proj__media,.proj.-w12 .proj__media{aspect-ratio:16/10}
}

/* ---- LATEST LEAD STRIP (orthogonal highlight; not filtered by chips) ---- */
.latest{width:var(--shell);margin:0 auto;padding:clamp(8px,2vh,20px) clamp(20px,4vw,56px) 0}
.lstrip{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:clamp(20px,2.5vw,40px)}
.lcard{position:relative}
.lcard__media{position:relative;aspect-ratio:16/10;border-radius:3px;overflow:hidden;border:1px solid var(--pane-edge);
  box-shadow:0 1px 1px rgba(0,0,0,.12);background:var(--bg-2)}
.lcard__media img,.lcard__media video{width:100%;height:100%;object-fit:cover}
.lcard__tag{position:absolute;top:12px;left:12px;z-index:2;font-size:9px;letter-spacing:var(--track-wide);
  text-transform:uppercase;color:#f6f5f2;background:rgba(10,10,13,.5);padding:5px 9px;border-radius:999px;
  -webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px)}
.lcard__meta{margin-top:14px;display:flex;flex-direction:column;align-items:flex-start;gap:5px}
.lcard__t{font-family:var(--font-disp);font-stretch:100%;font-weight:600;font-size:clamp(1.05rem,1.8vw,1.4rem);line-height:1.15;
  min-width:0;overflow-wrap:anywhere;transition:color var(--mode-fade)}
.lcard__c{font-size:10px;letter-spacing:var(--track-mid);text-transform:uppercase;color:var(--muted);
  transition:color var(--mode-fade)}

/* ---- HOVER AFFORDANCE (visual only — cards aren't linked yet) ----
   Zoom rides the <img>/<video>, which GSAP never animates, so it can't collide with the 3D
   lift transform. Frame/media already clip overflow, so scale(1.03) stays inside the card. */
.proj__link,.lcard__link{position:absolute;inset:0;z-index:5}
.proj,.lcard{cursor:pointer}
.proj__frame img,.proj__frame video,
.lcard__media img,.lcard__media video{transition:transform .6s var(--ease-zha)}
.proj:hover .proj__frame img,.proj:hover .proj__frame video,
.lcard:hover .lcard__media img,.lcard:hover .lcard__media video{transform:scale(1.03)}
.proj__title{transition:transform .5s var(--ease-zha),background-color var(--mode-fade),color var(--mode-fade),opacity var(--mode-fade)}
.lcard__t{transition:transform .5s var(--ease-zha),color var(--mode-fade)}
.proj:hover .proj__title,.lcard:hover .lcard__t{transform:translateX(5px)}
@media(prefers-reduced-motion:reduce){
  .proj:hover .proj__frame img,.proj:hover .proj__frame video,
  .lcard:hover .lcard__media img,.lcard:hover .lcard__media video,
  .proj:hover .proj__title,.lcard:hover .lcard__t{transform:none}
}

/* ---- CARD SHAPE — the ratio, decoupled from the width ----------------------
   NOT in the static site. There, aspect-ratio is DERIVED from the width class,
   so a card can only be portrait at span 4 or 5 and nowhere else. That is what
   blocked "two narrow cards side by side": -w5 + -w5 is 10 of 12 columns, and
   grid-auto-flow:dense fills the 2-column hole by pulling a later card up,
   silently reordering the page.

   A second, independent class dimension fixes it in seven rules. -w6 + -w6 is a
   full row AND both cards can be portrait. Measured at 1440: 578 x 770 each.
   The height range across the grid goes from x1.33 to x1.80, and no row
   arithmetic changes, so dense never reorders.

   Higher specificity than the width-derived defaults above, which is what lets
   a chosen shape win — including inside the <=880px block below. */
.grid .proj.-p23   .proj__media{aspect-ratio:2/3}
.grid .proj.-p34   .proj__media{aspect-ratio:3/4}
.grid .proj.-p56   .proj__media{aspect-ratio:5/6}
.grid .proj.-p11   .proj__media{aspect-ratio:1/1}
.grid .proj.-p43   .proj__media{aspect-ratio:4/3}
.grid .proj.-p1610 .proj__media{aspect-ratio:16/10}
.grid .proj.-p167  .proj__media{aspect-ratio:16/7}

/* ---- MOBILE: portrait survives, but capped ---------------------------------
   The static site flattens EVERYTHING to 16/10 below 880px, so a deliberately
   vertical card silently stops being vertical on exactly the devices most
   visitors use. A card with no chosen shape still flattens — that is the
   fallback rhythm keeping the original behaviour — but a chosen shape is
   honoured, and capped.

   65svh, measured rather than picked. Media + meta as a share of the viewport
   for a 3:4 card:

       iPhone 14  390x844    66%   cap inert
       620x900              92% -> 80%
       iPad       820x1180  89% -> 77%
       880x1080            104% -> 78%     (taller than the screen, uncapped)

   On real phones the cap never engages, so portrait is fully honoured where it
   matters. It bites only in the 620-880 band — small tablets, split screens,
   landscape phones — and lands the whole band at 77-80%, leaving about a fifth
   of the screen showing the next card's top edge, which is what tells a reader
   this is a list. 70svh leaves only 15%; 60svh crops harder than needed.

   svh not vh, matching .hero{height:100svh}: the SMALL viewport height is
   measured with browser chrome showing, so a card never exceeds the screen even
   before the URL bar collapses.

   ⚠️ width:100% is REQUIRED, not tidiness. With only aspect-ratio + max-height
   the browser shrinks BOTH dimensions to preserve the ratio and the card ends up
   narrower than its column, sitting in empty space — measured. width:100% makes
   the width definite, so max-height clamps the height alone and object-fit:cover
   crops. Verified widthHeld=true at every size. */
@media(max-width:880px){
  .grid .proj[class*="-p"] .proj__media{width:100%;max-height:65svh}
}
