/* ════════════════════════════════════════════════════════════════════
   PAGE — THE PROJECT FILES (page-projects).
   ALL selectors scoped under .pfiles (the <main> root) so nothing leaks into
   the shared nav/footer chrome.

   Authority: WOW_CONTRACTS "page:projects" + picks.json "page:projects" (G001
   tab plates + red week counts; GRAFTS: filter tabs + search + IN-PROGRESS
   %-complete gauge dials from G003; Current|Completed split kept; the gallery
   block, catalog #12) + the locked board slice (section-page-projects.jpg)
   + DESIGN.md.

   Palette from tokens.css ONLY: base #222222 · accent #C2231B Signal Red ·
   support #B7BCC1 Polished Steel · breath #E9E6E1 Primer · ink-deep #141414.
   Radius 0 = machined edge everywhere. Big Shoulders display / Plex Mono labels.

   THE ONE CONSISTENT GRADE (DESIGN.md photography treatment), shared verbatim
   with the home cells so every image on the site reads one look:
     filter: saturate(0.92) contrast(1.03) brightness(1.0) sepia(0.14) hue-rotate(-6deg);

   THE SEMANTIC TELL (WOW contract): Current cards' gauge dials idle-TREMBLE
   (still running); Completed dials rest FULL + still. Same dial, different life.
   ════════════════════════════════════════════════════════════════════ */

/* ════════════════════════════════════════════════════════════════════
   CLS GUARD (MECHANICAL) — metric-adjusted fallback for the display heading.
   Big Shoulders is a hard CONDENSED face (~65% the width of a system sans);
   on font-swap the wide default fallback wraps to MORE lines than the final
   condensed cut (e.g. "THE PROJECT FILES" = 1 line condensed / 2 lines raw at
   desktop; 2 vs 3 on mobile), jumping the whole page down (CLS 0.23). This
   fallback squeezes the pre-swap text to Big Shoulders' width so it wraps to
   the SAME line count → the swap doesn't move the grid/filter/lede. Paired with
   a min-height reservation on .pfiles__title below (belt-and-suspenders).
   size-adjust:68% tuned on-page across the full width spectrum (desktop 1440 →
   mobile 300px): the adjusted fallback wraps to the SAME line count as the final
   condensed cut at every breakpoint (measured lineDelta = 0), so the swap moves
   nothing. Scoped to my page only. */
@font-face {
  font-family: 'GYR Shoulders Fallback';
  src: local('Arial'), local('Helvetica Neue'), local('Helvetica'), local('Roboto'), local('Arial');
  size-adjust: 68%;
  font-weight: 500 800;
  font-style: normal;
  font-display: swap;
}

.pfiles {
  --pf-grade: saturate(0.92) contrast(1.03) brightness(1.0) sepia(0.14) hue-rotate(-6deg);
  background: var(--ink-900);
  color: var(--text-on-dark);
}
/* My sections carry data-bg for intent, but are NOT .section class (I own their
   padding, so I don't inherit .section's --section-pad-y). Paint the data-bg
   families EXPLICITLY here so the rhythm engine's dark run reads: masthead +
   grid = charcoal #222222 (ink); the gallery steps to a same-family deeper
   #1d1d1d (ink-2) so "Documented, week by week" reads as its own beat via a
   seamless same-family seam (section color rhythm law), not a hard cut. */
.pfiles__masthead[data-bg="ink"],
.pfiles__grid-sec[data-bg="ink"]   { background: var(--ink-900); }
.pfiles__gallery-sec[data-bg="ink-2"] { background: var(--ink-850); }

/* the fixed nav sits over the masthead; push the first content below it so the
   page head clears the bar (subpages have no full-bleed hero to bleed under). */
.pfiles__masthead { padding-top: calc(var(--nav-h) + clamp(2rem, 5vw, 4rem)); }

/* ════════════════════════════════════════════════════════════════════
   MASTHEAD — page head + tabs + filter bar. data-bg="ink" already paints the
   charcoal field; this adds the ambient worklight + composed head layout.
   ════════════════════════════════════════════════════════════════════ */
.pfiles__masthead {
  position: relative;
  isolation: isolate;
  overflow: clip;
  padding-bottom: clamp(1.5rem, 3vw, 2.5rem);
  border-bottom: 1px solid var(--ink-700);
}
/* warm tungsten worklight breath, kept upper-right away from the type mass so
   the headline stays honest-lit. Shared tungsten-idle keyframe (base.css). */
.pfiles__tungsten {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  mix-blend-mode: screen;
  background:
    radial-gradient(48% 60% at 88% 8%,
      rgba(255,176,96,0.18) 0%, rgba(255,150,70,0.06) 46%, rgba(255,150,70,0) 70%),
    radial-gradient(40% 50% at 6% 96%,
      rgba(255,176,96,0.10) 0%, rgba(255,150,70,0) 66%);
}

/* Row 18: the tabs moved OUT of the head into the filter bar, so the head is now
   a single full-width column (eyebrow / title / lede) — no more 1fr|auto split. */
.pfiles__head {
  margin-bottom: clamp(1.5rem, 3.2vw, 2.5rem);
}
.pfiles__eyebrow {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-family: var(--font-mono);
  color: var(--support);
  margin-bottom: var(--space-s);
}
.pfiles__eyebrow-rule {
  display: inline-block;
  width: clamp(1.75rem, 4vw, 3rem);
  height: 1px;
  background: var(--support);
  flex: none;
}
.pfiles__title {
  /* Big Shoulders first; the metric-adjusted 'GYR Shoulders Fallback' sits AHEAD
     of the wide generics so the swap fallback wraps to the condensed line count
     (CLS guard — see @font-face above). */
  font-family: 'Big Shoulders', 'Big Shoulders Display', 'GYR Shoulders Fallback', 'Archivo Narrow', sans-serif;
  font-weight: 800;
  text-transform: uppercase;
  font-size: var(--step-hero);
  line-height: 0.88;
  letter-spacing: 0.004em;
  color: var(--breath);
  text-wrap: balance;
  /* RESERVE the final condensed height so any residual swap delta can't push the
     grid/filter/lede. Desktop condensed = 1 line; reserve 1 line (0.88em, the
     line-height). At the stacked breakpoints condensed goes 2-line — the
     reservation grows there (media queries below). min-height only sets a floor;
     the adjusted fallback above keeps the pre-swap text from exceeding it. */
  min-height: 0.88em;
}
/* H1A-red — the single Signal-Red word */
.pfiles__title-accent { color: var(--accent); }
.pfiles__lede {
  font-size: var(--step-mini);
  line-height: 1.55;
  color: var(--text-on-dark);
  max-width: 42ch;
  margin-top: var(--space-s);
}

/* ── CURRENT | COMPLETED TAB PLATES — stamped steel, active = Signal Red.
   Riveted machined plates matching the board. ── */
.pfiles__tabs {
  display: flex;
  gap: 0.6rem;
  flex: none;
}
/* sized to sit inline with the chips (Row 18) — still the heaviest control in the
   bar (stamped plate + red ready-glow), but no longer a masthead-scale block. */
.pfiles__tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  /* Row 16 (P3): the toggle must DOMINATE the four category chips. Kept a touch
     more presence than the chips (padding + label below) so the stamped plates
     clearly out-weigh the shrunk, quieted filters. */
  padding: 0.66rem 1.15rem;
  background: linear-gradient(to bottom, #2c2c2c 0%, #1c1c1c 52%, #232323 100%);
  border: 1px solid var(--ink-700);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06),
              0 3px 0 rgba(0,0,0,0.45);
  transition: transform 140ms var(--ease-out),
              box-shadow 140ms var(--ease-out),
              border-color 140ms var(--ease-out),
              background 140ms var(--ease-out);
}
.pfiles__tab-label {
  font-family: var(--font-mono);
  font-size: 0.82rem;                 /* Row 16: > the 0.65rem chips → toggle wins */
  font-weight: 600;                   /* heavier than the 500 chips */
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--breath);              /* brighter than the chips' dim slate-500 */
  transition: color 140ms var(--ease-out);
}
.pfiles__tab-count {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--slate-400);
  padding: 0.1em 0.45em;
  border: 1px solid var(--ink-700);
  background: rgba(0,0,0,0.35);
  transition: color 140ms var(--ease-out), border-color 140ms var(--ease-out);
}
/* the two rivets — steel bolt heads on each plate */
.pfiles__tab-rivet {
  position: absolute;
  top: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;                 /* rivets ARE round — the intentional
                                         exception to the machined 0px edge */
  transform: translateY(-50%);
  background: radial-gradient(circle at 35% 30%, #6a6d70, #2a2b2c 70%);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.5);
}
.pfiles__tab-rivet--l { left: 7px; }
.pfiles__tab-rivet--r { right: 7px; }

/* ACTIVE plate — Signal Red, white label, a red ready-glow behind it (alive) */
.pfiles__tab.is-active {
  background: linear-gradient(to bottom, #d1291f 0%, #a51a12 100%);
  border-color: #7d140e;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.14),
              0 3px 0 var(--terracotta-deep);
}
.pfiles__tab.is-active .pfiles__tab-label { color: #fff; }
.pfiles__tab.is-active .pfiles__tab-count {
  color: #fff;
  border-color: rgba(255,255,255,0.3);
  background: rgba(0,0,0,0.18);
}
.pfiles__tab.is-active .pfiles__tab-rivet {
  background: radial-gradient(circle at 35% 30%, #f4c9c4, #7d140e 70%);
}
/* the ready-glow behind the active plate — opacity-only ambient pulse, never a
   blur animation (motion lib). Present at t0. */
.pfiles__tab::before {
  content: "";
  position: absolute;
  inset: -7px;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(62% 120% at 50% 50%, rgba(194,35,27,0.42), rgba(194,35,27,0) 72%);
  opacity: 0;
  transition: opacity 200ms var(--ease-out);
}
.pfiles__tab.is-active::before { opacity: 0.5; }
@media (hover: hover) {
  .pfiles__tab:not(.is-active):hover {
    transform: translateY(2px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 1px 0 rgba(0,0,0,0.45);
    border-color: var(--support);
  }
  .pfiles__tab:not(.is-active):hover .pfiles__tab-label { color: var(--breath); }
}

/* ── FILTER WORK-ORDER BAR — ONE row: [tabs · chips] control cluster left,
   de-emphasized search right (Row 18). ── */
.pfiles__filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-m) clamp(1rem, 3vw, 2rem);
  flex-wrap: wrap;
}
/* the left control cluster: the CURRENT|COMPLETED tab plates, a thin steel
   separator, then the category chips — all browsing controls in one line. */
.pfiles__controls {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
  flex: 1 1 auto;
}
/* vertical steel hairline dividing the tab plates from the type chips */
.pfiles__controls-sep {
  align-self: stretch;
  width: 1px;
  min-height: 1.6rem;
  margin: 0 0.2rem;
  background: linear-gradient(to bottom, transparent, var(--ink-700) 22%, var(--ink-700) 78%, transparent);
  flex: none;
}
.pfiles__chips {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.pfiles__chip {
  /* Row 16 (P3): the four category filters are SUBORDINATE to the CURRENT|COMPLETED
     toggle. Shrunk ~10% (0.72→0.65rem, padding 0.5/0.9→0.44/0.8rem) AND pushed
     visually quieter — dimmer ink label (slate-500), a fainter hairline border, no
     stamped-plate weight — so they read as a secondary type-filter, not a peer of
     the stamped tab plates. The active state still lifts to Signal-Red for a clear
     current-filter tell; only the RESTING chips recede. */
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--slate-500);
  padding: 0.44rem 0.8rem;
  background: transparent;
  border: 1px solid rgba(183,188,193,0.14);   /* fainter than the tabs' solid --ink-700 seam → recessive */
  transition: color 140ms var(--ease-out),
              border-color 140ms var(--ease-out),
              background 140ms var(--ease-out);
}
@media (hover: hover) {
  .pfiles__chip:not(.is-active):hover { color: var(--breath); border-color: var(--support); }
}
.pfiles__chip.is-active {
  color: #fff;
  border-color: #7d140e;
  background: linear-gradient(to bottom, #d1291f 0%, #a51a12 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
}

/* DE-EMPHASIZED (Row 18): the search is secondary to the tabs+chips — keep it fully
   functional (David tested it) but drop its visual weight. No gradient/inset-shadow
   plate anymore: a flat translucent fill + a soft bottom-rule that only firms up on
   focus. Smaller footprint so the browsing controls lead the row. */
.pfiles__search {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 0 1 220px;
  max-width: 260px;
  border: 1px solid transparent;
  border-bottom-color: var(--ink-700);
  background: rgba(255,255,255,0.025);
  transition: border-color 140ms var(--ease-out), background 140ms var(--ease-out);
}
@media (hover: hover) {
  .pfiles__search:hover { border-bottom-color: var(--slate-600); }
}
/* the magnifier glyph — CSS-drawn (icon rule §4: no hand-authored SVG) */
.pfiles__search-icon {
  flex: none;
  width: 12px;
  height: 12px;
  margin-left: 0.65rem;
  border: 1.5px solid var(--slate-600);
  border-radius: 50%;
  position: relative;
}
.pfiles__search-icon::after {
  content: "";
  position: absolute;
  right: -5px;
  bottom: -4px;
  width: 6px;
  height: 1.5px;
  background: var(--slate-500);
  transform: rotate(45deg);
  transform-origin: left center;
}
.pfiles__search-vh {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap;
}
.pfiles__search-input {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.02em;
  color: var(--breath);
  background: transparent;
  border: none;
  padding: 0.5rem 0.75rem 0.5rem 0.55rem;
}
.pfiles__search-input::placeholder { color: var(--slate-500); }
.pfiles__search-input:focus { outline: none; }
/* focus firms the bottom rule to Signal Red (a clear, restrained affordance —
   no full-box glow, keeping the field de-emphasized). */
.pfiles__search:focus-within {
  border-bottom-color: var(--accent);
  background: rgba(255,255,255,0.04);
}
.pfiles__search-input::-webkit-search-cancel-button { -webkit-appearance: none; }

/* ════════════════════════════════════════════════════════════════════
   THE CASE-FILE GRID — GYR-#### stamped case-file plates.
   ════════════════════════════════════════════════════════════════════ */
/* Row 19: give the grid section real bottom breathing room so it reads as a
   distinct section from the shop-wall below (the two used to slam together with
   only a 1px hairline). This padding also guarantees separation whether the grid
   is full OR collapsed to the composed empty state. */
.pfiles__grid-sec {
  position: relative;
  padding-bottom: clamp(2.5rem, 6vw, 5rem);
}
.pfiles__panel { display: none; }
.pfiles__panel.is-active { display: block; }
/* no-JS floor: both panels visible (progressive enhancement — every card present) */
html:not(.js) .pfiles__panel { display: block; }
html:not(.js) .pfiles__panel + .pfiles__panel { margin-top: clamp(2rem, 5vw, 4rem); }

.pfiles__grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1rem, 2vw, 1.6rem);
}
/* The CURRENT panel holds exactly 4 in-build cards — give it a 4-up grid so
   they fill ONE clean row (no orphaned tile broadcasting a dead void, T2.20),
   and the row count matches the tab's "04". The COMPLETED panel (13 cards)
   keeps the 3-up grid: an orphan on the last row of a tall grid is negligible,
   and 3-up keeps its cards comfortably sized for the award line + dial. */
.pfiles__panel[data-pf-panel="current"] .pfiles__grid {
  grid-template-columns: repeat(4, 1fr);
}
.pfiles__card { display: flex; }
/* filtered-out cards (JS sets hidden) collapse cleanly */
.pfiles__card[hidden] { display: none; }

.pfiles__card-link {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  background: linear-gradient(to bottom, #262626 0%, var(--ink-850) 100%);
  border: 1px solid var(--ink-700);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
  transition: transform 150ms var(--ease-out),
              border-color 150ms var(--ease-out);
}
/* LOCKED CARDS (T2.38 · David 07.05): the roster cards navigated to nowhere real
   — most just reloaded page-projects.html (refresh-to-top; "I don't like that when
   I click on one of the cars at the top, it just refreshes"). Per David they are
   DISABLED for now: href stripped in markup (no <a> target ⇒ no navigation), and
   here we remove every click affordance so a locked card does NOT read as a link
   (T2.38 inverse — nothing should look clickable that isn't). The card stays fully
   ALIVE at t0 though: the photo sheen sweeps and the Current gauges still tremble —
   those are ambient, not interaction. */
.pfiles__card-link[data-pf-locked] {
  cursor: default;
  pointer-events: none;   /* kills hover-lift + any click; card is display-only */
}
/* the "Open the file →" CTA promised a destination the locked card can't honor —
   drop it so we don't dangle a dead link cue. The case-id / spec / award / gauge
   all remain: the card still reads as a documented file, just not a button. */
.pfiles__card-link[data-pf-locked] .pfiles__card-cta { display: none; }
/* pre-rendered hover shadow layer (opacity-only transition — never animate
   box-shadow blur; motion lib §1.2) */
.pfiles__card-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  box-shadow: 0 24px 46px -30px rgba(0,0,0,0.7), 0 8px 20px -16px rgba(0,0,0,0.5);
  transition: opacity 150ms var(--ease-out);
}

.pfiles__card-media {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-bottom: 1px solid var(--ink-700);
}
.pfiles__card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: var(--pf-grade);
  transition: transform 400ms var(--ease-out);
}
/* per-card sheen — a slow tungsten highlight sweeping across the photo. Own-clock
   ambient (atmosphere allowed its own clock per WOW). transform-only. Present at
   t0 so the grid is alive even before scroll. Staggered per card below. */
.pfiles__card-sheen {
  position: absolute;
  top: 0; bottom: 0;
  left: 0;
  /* Row 15 (P3): widened 40% → 56% and pulled the transparent end-stops INWARD
     (0/100% → 18/82%). The band is a ~100deg-tilted gradient inside a straight
     rectangle: at the tilt, the OLD transparent-at-0/100% stops still carried
     non-zero alpha where the tilted band crossed the element's own vertical edges
     → a hard visible seam swept past every card (diagnostic capture confirmed a
     clip line on both edges). Now the alpha reaches 0 well before the physical
     left/right edges, and a horizontal mask forces alpha to exactly 0 AT the
     edges regardless of the tilt — no seam. The visible highlight (its color,
     softness, 8%-span core) is unchanged; only the dead margins grew. Extra 16%
     width keeps the same on-photo sweep coverage after the inward stops. */
  width: 56%;
  pointer-events: none;
  background: linear-gradient(100deg,
    transparent 18%, rgba(255,214,170,0.10) 44%, rgba(255,224,190,0.16) 50%,
    rgba(255,214,170,0.10) 56%, transparent 82%);
  /* belt-and-suspenders: clamp the element's own horizontal edges to zero alpha
     so a tilted band can never clip a hard seam at the rectangle boundary. */
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 14%, #000 86%, transparent 100%);
          mask-image: linear-gradient(to right, transparent 0%, #000 14%, #000 86%, transparent 100%);
  transform: translateX(-190%);
  mix-blend-mode: screen;
  animation: pf-card-sheen 11s ease-in-out infinite;
  will-change: transform;
}
@keyframes pf-card-sheen {
  0%   { transform: translateX(-160%); }
  55%  { transform: translateX(340%); }
  100% { transform: translateX(340%); }   /* long dark rest between passes */
}
/* stagger the sheen across the visible grid so they don't pulse in lockstep */
.pfiles__card:nth-child(3n+2) .pfiles__card-sheen { animation-delay: 2.2s; }
.pfiles__card:nth-child(3n)   .pfiles__card-sheen { animation-delay: 4.4s; }
.pfiles__card:nth-child(4n)   .pfiles__card-sheen { animation-delay: 6.1s; }

/* IN-BUILD status corner tag (Current cards only) — a red stamped chip */
.pfiles__card-status {
  position: absolute;
  top: 0; right: 0;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #fff;
  padding: 0.4em 0.7em;
}
.pfiles__card-status--live {
  background: linear-gradient(to bottom, #d1291f 0%, #a51a12 100%);
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
/* a tiny live-pip before the word — a red beacon breath (alive, opacity-only) */
.pfiles__card-status--live::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  margin-right: 0.5em;
  border-radius: 50%;
  background: #ffd8cf;
  box-shadow: 0 0 6px rgba(255,180,160,0.9);
  vertical-align: 0.05em;
  animation: pf-live-pip 2.4s ease-in-out infinite;
}
@keyframes pf-live-pip { 0%,100% { opacity: 0.55; } 50% { opacity: 1; } }

.pfiles__card-body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: clamp(0.9rem, 1.6vw, 1.2rem);
  flex: 1;
}
.pfiles__card-case {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--accent);
}
.pfiles__card-name {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  font-size: clamp(1.1rem, 1.7vw, 1.32rem);
  line-height: 0.98;
  letter-spacing: 0.01em;
  color: var(--breath);
}
.pfiles__card-spec {
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--slate-400);
}
.pfiles__card-award {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--support);
}

/* ── THE %-COMPLETE GAUGE DIAL — the standout invention (WOW contract).
   A tach-style bar: dark ticked track + red fill to --pf-pct + odometer % readout.
   CURRENT (data-pf-live): idle-trembles (still running). COMPLETED (--done):
   rests full + still. The bar width is set from --pf-pct so it's correct at t0
   even with no JS; JS sweeps it 0→reading on scroll-in, then trembles Current. ── */
.pfiles__gauge {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  /* pin the gauge (and the CTA that follows it) to a SHARED card-bottom baseline
     so a shorter text block above never floats the gauge up (kills the §4#5
     step-ladder across the Current row — every card's gauge aligns). The body is
     a flex column; this footer group absorbs the slack. */
  margin-top: auto;
}
.pfiles__gauge-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
}
.pfiles__gauge-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--support);
}
.pfiles__gauge-pct {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  line-height: 1;
  color: var(--breath);
  font-variant-numeric: tabular-nums;
}
.pfiles__gauge-unit {
  font-size: 0.6em;
  color: var(--accent);
  margin-left: 0.05em;
}
.pfiles__gauge-track {
  position: relative;
  height: 8px;
  overflow: hidden;
  border-top: 1px solid rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(0,0,0,0.5);
  background: linear-gradient(to bottom, #161616, #202020);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.6);
}
/* faint ruled tach ticks behind the fill (spec-sheet honesty) */
.pfiles__gauge-track::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(to right,
    rgba(183,188,193,0.14) 0 1px, transparent 1px 10%);
}
.pfiles__gauge-fill {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 100%;
  transform-origin: left center;
  transform: scaleX(var(--pf-pct, 0));   /* alive at t0: seats at the reading */
  background: linear-gradient(to right, #8f1810 0%, var(--accent) 62%, #e0473d 100%);
  box-shadow: 0 0 8px rgba(194,35,27,0.45);
  z-index: 1;
}
/* the needle — bright tick at the fill's leading edge (Current only). Idle
   tremor keyframe lives in the MOTION LAYER (added only when JS confirms). */
.pfiles__gauge-needle {
  position: absolute;
  top: -1px; bottom: -1px;
  left: var(--pf-pct, 0%);
  width: 2px;
  margin-left: -1px;
  background: #ffd8cf;
  box-shadow: 0 0 6px rgba(255,120,100,0.9);
  z-index: 2;
}
/* completed dials: no needle rendered (markup omits it), fill is full + still.
   the readout color for Delivered = steel, not the live white, to differentiate. */
.pfiles__gauge--done .pfiles__gauge-label { color: var(--slate-400); }

.pfiles__card-cta {
  /* NO margin-top:auto here — the gauge above owns the bottom-pin (shared
     footer baseline). The CTA sits glued directly under its gauge. */
  padding-top: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
}
.pfiles__card-arrow { transition: transform 150ms var(--ease-out); }

/* plate-press hover — scale-not-shift, ≤150ms, hover-capable ONLY (T2.27/T2.30) */
@media (hover: hover) {
  .pfiles__card-link:hover {
    transform: translateY(-0.28rem) scale(1.012);
    border-color: #4a4a4a;
  }
  .pfiles__card-link:hover::after { opacity: 1; }
  .pfiles__card-link:hover .pfiles__card-media img { transform: scale(1.04); }
  .pfiles__card-link:hover .pfiles__card-arrow { transform: translateX(3px); }
}

/* COMPOSED EMPTY STATE (Row 19) — JS shows this when a filter/search yields no
   matches in the active panel. It's a centered stamped-steel card that OCCUPIES
   real vertical space (min-height) so the shop-wall never slams up when the grid
   empties. Honest copy: the in-build queue simply has nothing of that type now. */
.pfiles__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.75rem;
  min-height: clamp(15rem, 34vh, 22rem);
  margin-top: clamp(1.5rem, 3vw, 2.5rem);
  padding: clamp(2rem, 5vw, 3.25rem) clamp(1.25rem, 4vw, 2.5rem);
  border: 1px dashed var(--ink-700);
  background:
    radial-gradient(120% 130% at 50% 0%, rgba(194,35,27,0.05), transparent 62%),
    linear-gradient(to bottom, #232323 0%, var(--ink-850) 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}
/* the class `display:flex` above overrides the UA [hidden]{display:none};
   restore the guard so the empty-state stays hidden until JS shows it (0 matches).
   Without this, the empty-state renders under a full grid (verified in capture). */
.pfiles__empty[hidden] { display: none; }
/* stamped "NO FILE" negative-strip mark over the card */
.pfiles__empty-mark {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 0.3em 0.7em;
  border: 1px solid var(--ink-700);
  background: rgba(0,0,0,0.3);
}
.pfiles__empty-head {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  font-size: clamp(1.25rem, 2.4vw, 1.7rem);
  line-height: 1.02;
  letter-spacing: 0.01em;
  color: var(--breath);
  max-width: 24ch;
}
.pfiles__empty-head [data-pf-empty-type] { color: var(--accent); }
.pfiles__empty-sub {
  font-family: var(--font-body);
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--slate-400);
  max-width: 46ch;
}
.pfiles__empty-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6rem 1.4rem;
  margin-top: 0.5rem;
}
/* primary empty-state action — a stamped red plate CTA */
.pfiles__empty-cta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
  padding: 0.62rem 1.2rem;
  border: 1px solid #7d140e;
  background: linear-gradient(to bottom, #d1291f 0%, #a51a12 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  transition: transform 140ms var(--ease-out), box-shadow 140ms var(--ease-out);
}
@media (hover: hover) {
  .pfiles__empty-cta:hover {
    transform: translateY(-1px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 4px 14px -8px rgba(194,35,27,0.7);
  }
}
/* secondary empty-state action — the quiet text-link reset */
.pfiles__empty-reset {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--support);
  border-bottom: 1px solid var(--ink-700);
  padding-bottom: 1px;
  transition: color 140ms var(--ease-out), border-color 140ms var(--ease-out);
}
@media (hover: hover) {
  .pfiles__empty-reset:hover { color: var(--breath); border-bottom-color: var(--support); }
}

/* ════════════════════════════════════════════════════════════════════
   THE GALLERY — best-of contact sheet (catalog #12). A shop wall of framed
   negatives; a slow tungsten sheen crawls the whole wall (ambient life at t0).
   data-bg="ink-2" gives a subtle darker seam vs the grid above (same family).
   ════════════════════════════════════════════════════════════════════ */
.pfiles__gallery-sec {
  border-top: 1px solid var(--ink-700);
  /* Row 19: matching top breathing room — the wall header no longer slams under
     the grid; the same-family 1px seam still marks the beat change. */
  padding-top: clamp(2.5rem, 6vw, 5rem);
}
.pfiles__gallery-head { margin-bottom: clamp(1.5rem, 3vw, 2.5rem); max-width: 46rem; }
.pfiles__gallery-title {
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  font-size: var(--step-section);
  line-height: 0.92;
  letter-spacing: 0.004em;
  color: var(--breath);
  margin-top: var(--space-2xs);
}
.pfiles__gallery-lede {
  font-size: var(--step-mini);
  line-height: 1.55;
  color: var(--text-on-dark);
  margin-top: var(--space-s);
  max-width: 48ch;
}

/* HONEST-ASPECT WALL (T2.18 · David 07.05): a masonry column-flow, NOT a
   fixed-row grid. The old grid-auto-rows:8.5rem + object-fit:cover cropped every
   photo to a 136px strip ("so flat you can't see anything" — David). Now each
   frame gets aspect-ratio: var(--fr-ar) (its image's TRUE w/h from the inline
   var), so every photo renders at its real proportions: portraits stand tall,
   wides read wide. Frames flow into balanced columns; the wall grows past one
   viewport and EARNS its scroll (David: "you can have a little bit of a scroll").
   "Relative sizing kept" — a photo's footprint tracks its own shape, not a forced
   uniform cell. */
.pfiles__contact {
  position: relative;
  isolation: isolate;
  list-style: none;
  margin: 0;
  padding: 0.55rem;
  column-count: 3;
  column-gap: 0.55rem;
  border: 1px solid var(--ink-700);
  background: linear-gradient(to bottom, #1c1c1c, #161616);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}
.pfiles__frame {
  position: relative;
  overflow: hidden;
  margin: 0 0 0.55rem;              /* column-gap handles the horizontal rhythm */
  border: 1px solid var(--ink-700);
  background: var(--ink-deep);
  aspect-ratio: var(--fr-ar, 1.5);  /* the frame IS the image's true shape */
  break-inside: avoid;              /* never split a frame across two columns */
  -webkit-column-break-inside: avoid;
}
.pfiles__frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;                /* frame already carries the true AR, so cover
                                       trims ~0 — it just guards sub-pixel rounding */
  filter: var(--pf-grade);
  transition: transform 500ms var(--ease-out);
}
/* mono negative-strip tag in the corner of each frame */
.pfiles__frame-tag {
  position: absolute;
  bottom: 0; left: 0;
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.14em;
  color: var(--support);
  padding: 0.25em 0.5em;
  background: color-mix(in srgb, var(--ink-deep) 74%, transparent);
  border-top: 1px solid var(--hairline);
  border-right: 1px solid var(--hairline);
}
@media (hover: hover) {
  .pfiles__frame:hover img { transform: scale(1.05); }
}
/* the slow tungsten sheen crawl over the whole wall — ambient life at t0.
   A wide diagonal highlight sweeping the sheet, own-clock, transform-only. */
.pfiles__contact-sheen {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  list-style: none;
  background: linear-gradient(105deg,
    transparent 40%, rgba(255,214,170,0.07) 49%, rgba(255,224,190,0.11) 52%,
    rgba(255,214,170,0.07) 55%, transparent 64%);
  background-size: 260% 100%;
  background-position: 130% 0;
  mix-blend-mode: screen;
  animation: pf-wall-sheen 13s ease-in-out infinite;
  will-change: background-position;
}
@keyframes pf-wall-sheen {
  0%   { background-position: 130% 0; }
  60%  { background-position: -30% 0; }
  100% { background-position: -30% 0; }
}

/* the stamped "Follow the Builds" plate — machined steel + corner rivets */
.pfiles__gallery-cta { margin-top: clamp(2rem, 4vw, 3rem); display: flex; justify-content: center; }
.pfiles__filesbtn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: clamp(16rem, 34vw, 24rem);
  padding: 1.05rem 2.2rem;
  /* Row 21: was a near-invisible ghost band (dark #2c2c2c gradient + steel
     outline + low-contrast label). Restyled to the brand red-button standard
     (matches .jrnl-cta-plate / SEE-EVERY-SERVICE plate): Signal-Red field,
     white label (AA 5.92:1), stamped-steel drop. Corner rivets kept — on-brand
     with the red SEE-EVERY-SERVICE plate. */
  background: var(--accent);
  border: 1px solid var(--terracotta-deep);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12),
              0 3px 0 var(--terracotta-deep);
  transition: transform 140ms var(--ease-out),
              box-shadow 140ms var(--ease-out),
              border-color 140ms var(--ease-out),
              background 140ms var(--ease-out);
}
.pfiles__filesbtn-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #fff;
}
.pfiles__filesbtn-rivet {
  position: absolute;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #6a6d70, #2a2b2c 70%);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.5);
}
.pfiles__filesbtn-rivet--tl { top: 7px; left: 9px; }
.pfiles__filesbtn-rivet--tr { top: 7px; right: 9px; }
.pfiles__filesbtn-rivet--bl { bottom: 7px; left: 9px; }
.pfiles__filesbtn-rivet--br { bottom: 7px; right: 9px; }
@media (hover: hover) {
  .pfiles__filesbtn:hover {
    transform: translateY(2px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 1px 0 var(--terracotta-deep);
    border-color: var(--terracotta-deep);
    background: var(--accent);
  }
}

/* ════════════════════════════════════════════════════════════════════
   MOTION LAYER — added only when js confirms motion is on (root.pf-ready).
   Static (root.pf-static / reduced-motion / no-JS): everything above is already
   the correct RESTING state (gauges filled, cards present, grid alive via CSS
   sheens). t0-safe.
   ════════════════════════════════════════════════════════════════════ */

/* SWEEP-IN — before a Current card's gauge goes live, js holds fill+needle at 0
   and hands them a one-shot transition to the reading. Completed dials are never
   held (they belong full at rest — but we still sweep them on entry for polish). */
.pf-ready .pfiles__gauge:not(.pf-gauge-live) .pfiles__gauge-fill { transform: scaleX(0); }
.pf-ready .pfiles__gauge:not(.pf-gauge-live) .pfiles__gauge-needle { left: 0; }
.pf-ready .pfiles__gauge .pfiles__gauge-fill { transition: transform 900ms var(--ease-out); }
.pf-ready .pfiles__gauge .pfiles__gauge-needle { transition: left 900ms var(--ease-out); }
.pf-ready .pfiles__gauge.pf-gauge-live .pfiles__gauge-fill { transform: scaleX(var(--pf-pct, 0)); }
.pf-ready .pfiles__gauge.pf-gauge-live .pfiles__gauge-needle { left: var(--pf-pct, 0%); }

/* NEEDLE TREMOR — the semantic tell. ONLY Current (data-pf-live) dials tremble
   after sweep-in; Completed dials have no needle and never tremble. Irregular
   ≤1px jitter = engine idle, not a sine. */
@keyframes pf-needle-idle {
  0%,100% { transform: translateX(0); }
  18% { transform: translateX(0.6px); }
  33% { transform: translateX(-0.4px); }
  52% { transform: translateX(0.8px); }
  71% { transform: translateX(-0.5px); }
  86% { transform: translateX(0.3px); }
}
.pf-ready .pfiles__gauge[data-pf-live].pf-gauge-live .pfiles__gauge-needle {
  animation: pf-needle-idle 1.7s ease-in-out infinite;
  will-change: transform;
}

/* reduced-motion belt-and-suspenders: kill every ambient animation, seat gauges
   at their reading, no sheen/tremor/pip. Content stays fully present. */
@media (prefers-reduced-motion: reduce) {
  .pfiles__card-sheen,
  .pfiles__contact-sheen,
  .pfiles__gauge-needle,
  .pfiles__card-status--live::before { animation: none !important; }
  .pfiles__gauge-fill { transition: none !important; transform: scaleX(var(--pf-pct, 0)); }
  .pfiles__gauge-needle { transition: none !important; left: var(--pf-pct, 0%); }
  .pfiles__contact-sheen { display: none; }
}

/* ════════════════════════════════════════════════════════════════════
   RESPONSIVE — mobile is desktop RECOMPOSED, not squished (T2.31).
   ════════════════════════════════════════════════════════════════════ */

/* laptop: grids step down. Current 4-up → 2-up (stays a filled 2×2); Completed
   3-up → 2-up. Both stay even at this width. */
@media (max-width: 1080px) {
  .pfiles__grid { grid-template-columns: repeat(2, 1fr); }
  .pfiles__panel[data-pf-panel="current"] .pfiles__grid { grid-template-columns: repeat(2, 1fr); }
}

/* tablet: the one-row browsing bar (Row 18) breaks to two lines — the [tabs·chips]
   control cluster sits above, the de-emphasized search drops full-width beneath it.
   Wall → 2 columns (frames keep their true AR — masonry just rebalances). */
@media (max-width: 820px) {
  .pfiles__filter { align-items: stretch; }
  .pfiles__controls { flex: 1 1 100%; }
  .pfiles__search { flex: 1 1 100%; max-width: none; }
  .pfiles__contact { column-count: 2; }
}

/* phone: cards → 1-up; wall stays 2 columns so photos don't blow up full-width
   (a single column would make each honest-AR frame huge). True ratios preserved.
   The tab plates + chips wrap naturally within the control cluster (no forced
   column-stack — they read as a compact browsing cluster). */
@media (max-width: 560px) {
  .pfiles__grid,
  .pfiles__panel[data-pf-panel="current"] .pfiles__grid { grid-template-columns: 1fr; }
  .pfiles__contact { column-count: 2; column-gap: 0.4rem; }
  .pfiles__frame { margin-bottom: 0.4rem; }
  .pfiles__filesbtn { width: 100%; min-width: 0; }
  .pfiles__tabs { flex: 1 1 100%; }
  .pfiles__tab { flex: 1; justify-content: center; }
  .pfiles__controls-sep { display: none; }
}
