/* Work: ONE's quiet frames, KeepGrading's media scale. No additional media requests.
   The first exhibit leads; alternating wide/narrow pairs follow in DOM/tab order. */
.work-head { padding: clamp(28px, 4vw, 48px) 0 20px; gap: 10px; }
.work-head h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); }
.work-head .lede { margin: 0 0 8px; max-width: 64ch; font-size: 1rem; }
#work-count { font-size: .75rem; margin: 0; }
.work-filter-rail { position: relative; min-width: 0; }
.work-filter-rail::after { content: ""; position: absolute; inset: 0 0 12px auto; width: 24px; background: linear-gradient(90deg, transparent, var(--ink-0)); pointer-events: none; }
#work-filters { flex-wrap: nowrap; overflow-x: auto; padding: 6px 24px 12px 4px; scrollbar-width: thin; scrollbar-color: var(--faint) var(--ink-1); }
#work-filters .chip { flex: 0 0 auto; min-height: 44px; padding-inline: 12px; white-space: nowrap; font-size: .8rem; transition: transform var(--t-fast) var(--ease-spring); }
#work-filters .chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
#work-filters .chip:active { transform: scale(.97); }
#work-filters::-webkit-scrollbar { height: 6px; }
#work-filters::-webkit-scrollbar-track { background: var(--ink-1); }
#work-filters::-webkit-scrollbar-thumb { background: var(--faint); border-radius: var(--r-pill); }
.work-gallery { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.work-more { height: 1px; } /* sentinel after the grid: pages.js work() appends the next chunk of cards as it nears */
.work-gallery .card { grid-column: span 6; position: relative; isolation: isolate; display: grid; align-content: stretch; min-width: 0; min-height: 0; gap: 0; border: 0; border-radius: var(--r-md); overflow: visible; background: var(--ink-0); opacity: 1; transform: none; transition: transform var(--t-fast) var(--ease-spring); }
.work-gallery .card:nth-child(4n + 2), .work-gallery .card:nth-child(4n + 5) { grid-column: span 7; }
.work-gallery .card:nth-child(4n + 3), .work-gallery .card:nth-child(4n + 4) { grid-column: span 5; }
.work-gallery .card:first-child, .work-gallery .card:last-child:nth-child(even) { grid-column: 1 / -1; }
.work-gallery .card[data-action] { cursor: pointer; }
.work-gallery .card[data-action]:hover { transform: none; }
.work-gallery .card:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.work-gallery .card[data-action]:active { transform: scale(.995); }
.work-gallery .card .media { grid-area: 1 / 1; width: 100%; height: 100%; min-height: clamp(300px, 34vw, 420px); aspect-ratio: auto; border-radius: var(--r-md); background: var(--ink-1); }
.work-gallery .card:first-child .media, .work-gallery .card:last-child:nth-child(even) .media { aspect-ratio: 16 / 9; min-height: 360px; }
.work-gallery .media img { transition: transform var(--t-cinematic) var(--ease-spring); }
.work-gallery .portrait .media img { object-position: center 35%; }
.work-gallery .card .body { grid-area: 1 / 1; align-self: end; position: relative; z-index: 1; min-width: 0; padding: 64px clamp(20px, 3vw, 32px) 24px; gap: 8px; border-radius: 0 0 var(--r-md) var(--r-md); background: linear-gradient(180deg, transparent, rgba(0,0,0,.88) 30%, rgba(0,0,0,.96)); pointer-events: none; }
.work-gallery .body .chips { gap: 10px; align-items: center; }
.work-gallery .body .tag { padding: 0; border: 0; border-radius: 0; background: none; color: var(--muted); font-size: .9rem; font-family: var(--font-body); letter-spacing: 0; text-transform: none; }
.work-gallery .body .tag + .tag { padding-left: 14px; border-left: 0; color: var(--text); }
.work-gallery .body h3 { max-width: 30ch; font-size: clamp(1.25rem, 2.1vw, 1.8rem); line-height: 1.1; }
.work-gallery .card:first-child h3 { max-width: 24ch; font-size: clamp(1.75rem, 3.8vw, 3rem); }
.work-gallery .body p { max-width: 62ch; color: var(--muted); font-size: .875rem; line-height: 1.5; }
.work-gallery .media .play { top: 16px; right: 16px; bottom: auto; z-index: 2; width: 48px; height: 48px; background: var(--ink-0); border-color: var(--faint); cursor: pointer; transition: transform var(--t-fast) var(--ease-spring); }
.work-gallery .media .play:hover { border-color: var(--accent); transform: scale(1.06); }
.work-gallery .media .play:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.work-gallery .media .play:active { transform: scale(.94); }
.work-gallery > p { grid-column: 1 / -1; }
/* Keep every line readable on touch. Fine-pointer users reveal rig detail without reflow. */
@media (min-width: 900px) and (hover: hover) and (pointer: fine) {
  .work-gallery .card .body { padding-bottom: 28px; }
  .work-gallery .body > .chips, .work-gallery .body > h3 { transform: translateY(16px); transition: transform var(--t-base) var(--ease-spring); }
  .work-gallery .body p { opacity: 0; transform: translateY(8px); transition: opacity var(--t-base) var(--ease-out), transform var(--t-base) var(--ease-spring); }
  .work-gallery .card:is(:hover, :focus-within) .body > * { opacity: 1; transform: none; }
  .work-gallery .card:is(:hover, :focus-within) .media img { transform: scale(1.025); }
}
@media (max-width: 899px) {
  .work-gallery { gap: 12px; }
  .work-gallery .card .body { padding: 56px 18px 20px; }
  .work-gallery .card:nth-child(n) { grid-column: span 6; }
  .work-gallery .card:first-child, .work-gallery .card:last-child:nth-child(even) { grid-column: 1 / -1; }
}
@media (max-width: 599px) {
  .work-head { padding-top: 28px; }
  .work-gallery { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .work-gallery .card:nth-child(n) { grid-column: 1; }
  .work-gallery .card:nth-child(n) .media { aspect-ratio: 4 / 3; min-height: 300px; }
  .work-gallery .card.portrait .media { aspect-ratio: 3 / 4; }
  .work-gallery .card:first-child h3 { font-size: 1.65rem; }
  .work-gallery .body h3 { font-size: 1.3rem; }
}
@media (prefers-reduced-motion: reduce) {
  .work-gallery .card, .work-gallery .card[data-action]:active, .work-gallery .body > .chips, .work-gallery .body > h3,
  .work-gallery .body > p, .work-gallery .card:is(:hover, :focus-within) .media img,
  .work-gallery .media .play:is(:hover, :focus-visible, :active), #work-filters .chip:active { transform: none; }
}

/* Work page: the booking invitation follows the last complete gallery row. */
.work-close { border-top: 0; margin-top: clamp(48px, 8vw, 96px); padding: clamp(36px, 6vw, 72px) 0 clamp(20px, 4vw, 40px); }
.work-close .btn { transition: transform var(--t-fast) var(--ease-spring), opacity var(--t-fast); }
.work-close h2 { font-size: clamp(2rem, 4.6vw, 3.4rem); letter-spacing: -0.035em; line-height: .99; margin: 12px 0 14px; }
.work-close p { color: var(--muted); max-width: 58ch; line-height: 1.7; margin: 0 0 24px; }

/* 09-13 audit: the rail hid a whole category behind a 24px fade at 1440 — wrap on desktop, full-bleed scroll on phones */
@media (min-width: 1100px) { #work-filters { flex-wrap: wrap; overflow: visible; padding-right: 4px; row-gap: 8px; } .work-filter-rail::after { display: none; } }
@media (max-width: 899px) { .work-filter-rail { margin-inline: calc(var(--gutter) * -1); } #work-filters { padding-inline: var(--gutter); scroll-padding-inline: var(--gutter); } }

/* ============ EVOLVE 2026-09-13 (kit) — additions only; the filter rail, masonry, lightbox and caption grammar are locked. ============ */

/* The exhibits settle in instead of snapping: .xe-img carries the opacity/scale, but .work-gallery .media img
   already owned `transition`, which dropped the opacity leg. Restore it; the transforms stay the kit's. */
.work-gallery .media.xe-img > img { transition: opacity .9s var(--ease-out), transform var(--t-cinematic) var(--ease-spring); }
/* the hover push has to out-rank .xe-img.in's settled transform: none */
@media (min-width: 900px) and (hover: hover) and (pointer: fine) {
  .work-gallery .card:is(:hover, :focus-within) .media.xe-img.in > img { transform: scale(1.025); }
}

/* a filter can only come back empty through a deep link to a category with no photographs yet */
.work-empty { grid-column: 1 / -1; margin: 0; padding: clamp(28px, 5vw, 44px) 0; color: var(--muted); font-size: 1rem; }

/* the closing invitation becomes the console panel that ends the page */
.work-close.xe-glass { border-top: 0; padding: clamp(30px, 5vw, 56px) clamp(22px, 4vw, 52px) clamp(28px, 4vw, 48px); margin-bottom: clamp(26px, 5vw, 52px); }

@media (prefers-reduced-motion: reduce) {
  .work-gallery .media.xe-img > img, .work-gallery .card:is(:hover, :focus-within) .media.xe-img.in > img { transform: none; opacity: 1; transition: none; }
}

/* ============ EVOLVE 2 (2026-09-13, a16) — additions only; the filter rail, masonry, lightbox and caption grammar stay locked. ============ */

/* AW-09 (P2) — the par-can fan cut for this page (atmos-workhdr.jpg) never mounted: work.html does not
   load home.css, and the rule there (home.css:277) targets section:has(#work-filters), which matches
   nothing — the rail's chain is div.chips > div.work-filter-rail > div.page-head.work-head > div.wrap.
   Anchored to .work-head, which exists. Desktop only: mobile is at 0.54 of a 0.60 MB budget. The dead
   home.css rule is filed as a cssRequest. */
.work-head { position: relative; isolation: isolate; }
@media (min-width: 900px) {
  .work-head::before {
    /* Bleeds to the wrap edge, not calc(50% - 50vw): 100vw includes the classic scrollbar, so a
       true full-bleed plate hangs ~15px past clientWidth on a real desktop and trips h-scroll. The
       side mask keeps DESIGN-LOCK.md:75 honest ("no straight lines") at both ends. */
    content: ""; position: absolute; inset: -84px calc(var(--gutter) * -1) 0; z-index: -1; pointer-events: none; opacity: .3;
    background: linear-gradient(180deg, transparent 40%, #000 96%), url("media/atmos/atmos-workhdr.jpg") center top / cover no-repeat;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  }
}

/* AW-16 (P3) — the per-category count was styled with an inline style attribute in the renderer,
   outside the token and selector discipline. pages.js now emits .chip-n. */
#work-filters .chip .chip-n { opacity: .6; margin-left: 6px; }

/* AW-07 (P2) — on phones the .body scrim reaches rgba(0,0,0,.88) only at 30% of the box while the body
   is padded 56px at the top, so the category tag sat in the thin part of the gradient: measured 3.56:1
   on "Reception hall in pink" and 4.41:1 on "RCFA fight night" at 10.88px, both under AA. Deepen the
   early stops on phones only and lift the tag a shade (#CFCFCF on the worst sampled card = 4.9:1).
   The desktop hover grammar is untouched. */
@media (max-width: 899px) {
  .work-gallery .card .body { background: linear-gradient(180deg, transparent, rgba(0,0,0,.74) 20%, rgba(0,0,0,.93) 44%, rgba(0,0,0,.97)); }
  .work-gallery .body .tag { color: #CFCFCF; }
}

/* AW-13 (P2) — the closing panel is a 1084x396 glass slab with everything in its left 60%: the h2's
   lines end at x=699, the paragraph at x=881, the button at x=387, inside a column running to x=1209.
   Two columns on desktop; the phone stack is unchanged. */
@media (min-width: 900px) {
  .work-close.xe-glass { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); column-gap: clamp(32px, 4vw, 64px); align-items: center; }
  .work-close .eyebrow { grid-area: 1 / 1; }
  .work-close h2 { grid-area: 2 / 1; margin: 12px 0 0; }
  .work-close p { grid-area: 2 / 2; align-self: end; max-width: 38ch; margin: 0 0 18px; }
  .work-close .btn { grid-area: 3 / 2; justify-self: start; }
}
