/* Redlab — Work, the case index (v9). Loaded after base.css, blocks.css, service.css and hub.css (crumbs).
   The title with the filters on its row, then a lead project across the row and staggered pairs. Every cover is
   one composition from the project's real screens (compose_work_covers.py), then the name, two lines on what it
   is, and chips for the industry and what we did. Filters are real pages (/cases/websites/ and so on) for search. */

.work-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; column-gap: clamp(32px, 6vw, 120px); row-gap: 20px; padding-block: clamp(24px, 4vh, 48px) clamp(36px, 5vh, 56px); }
.work-hero .crumbs { grid-column: 1 / -1; }
.work-hero h1 { font-size: var(--t-display); line-height: .92; letter-spacing: -.055em; }

/* Filters: one segmented pill on the title's row, right-aligned; the current page in ink. */
.work-filter { padding-bottom: 8px; }
.wf-chips { display: inline-flex; gap: 4px; padding: 5px; border-radius: var(--r-pill); background: var(--surface); }
.wf-chip { padding: 9px 18px; border-radius: var(--r-pill); font-size: var(--t-small); color: var(--ink-2); text-decoration: none; transition: background .2s var(--ease), color .2s var(--ease); }
.wf-chip:hover { background: var(--white); }
.wf-chip[aria-current='page'] { background: var(--ink); color: #fff; }

/* The list follows the hero straight away. */
.work-hero + .work-list { padding-top: 0; }

/* Grid: a lead across the row, then staggered pairs as on Halo Lab. Twelve columns; each pair is a large (7)
   and a small (5) cover of the same shape, and the large one swaps sides every row. data-size (f, l, s) comes
   from the generator and from js/work.js after a filter, so the rhythm holds on every filter page. */
.work-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: start; gap: clamp(64px, 7vw, 112px) clamp(20px, 2.4vw, 36px); overflow-anchor: none; transition: opacity .16s var(--ease); }
.work-grid.is-swapping { opacity: 0; }
.work-grid > li[hidden] { display: none; }
.work-grid > [data-size='f'] { grid-column: 1 / -1; }
.work-grid > [data-size='l'] { grid-column: span 7; }
.work-grid > [data-size='s'] { grid-column: span 5; }

.wcard { display: block; text-decoration: none; color: inherit; }
/* Cover: one composed picture per project from its real screens; the tone shows while it loads. */
.wcard-cover { position: relative; isolation: isolate; display: block; overflow: hidden; aspect-ratio: 4 / 3; border-radius: 20px; background: var(--tone, var(--pc-bg)); }
[data-size='f'] .wcard-cover { aspect-ratio: 2 / 1; }
.wcard-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--op, 50% 50%); transition: transform 1.2s var(--ease); }
.wcard:hover .wcard-cover img { transform: scale(1.03); }
/* A white cover (Kasper's chat) gets a hairline so it doesn't melt into the page. */
.pc-kasperai .wcard-cover::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--hair); pointer-events: none; }

.wcard-name { margin-top: 26px; font-size: clamp(26px, .9vw + 18px, 34px); font-weight: 500; line-height: 1.05; letter-spacing: -.035em; }
[data-size='f'] .wcard-name { font-size: var(--t-h2); }
.wcard-what { margin-top: 10px; max-width: 30em; font-size: var(--t-lead); line-height: 1.45; color: var(--ink-2); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
/* Chips: what the project belongs to, as quiet pills on a hairline. */
.wcard-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.wcard-tags li { padding: 5px 12px; border: 1px solid var(--hair); border-radius: var(--r-pill); font-size: 13px; font-weight: 500; line-height: 1.4; color: var(--muted); }

/* The pointer over a cover becomes an ink square with an arrow (js/work-cursor.js); touch keeps a plain cursor. */
.work-cursor { position: fixed; left: 0; top: 0; z-index: 30; display: grid; place-items: center; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; background: var(--ink); color: #fff; pointer-events: none; opacity: 0; transform: translate3d(var(--x, -200px), var(--y, -200px), 0) scale(.4); transition: opacity .25s var(--ease), transform .35s var(--ease); will-change: transform; }
.work-cursor.is-on { opacity: 1; transform: translate3d(var(--x), var(--y), 0) scale(1); transition: opacity .25s var(--ease); }
.work-cursor svg { width: 22px; height: 22px; }
.has-work-cursor .wcard-cover { cursor: none; }

/* Covers rise into place as they scroll in (js/work.js adds .is-in); still for reduced motion and without JS. */
.js .wcard-cover { opacity: 0; transform: translateY(32px); transition: opacity .8s var(--ease), transform .9s var(--ease); }
.js .is-in .wcard-cover { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .wcard-cover { opacity: 1; transform: none; transition: none; } .wcard-cover img { transition: none; } }

@media (max-width: 1000px) {
  .work-grid > [data-size='l'], .work-grid > [data-size='s'] { grid-column: span 6; }
}
@media (max-width: 760px) {
  .work-hero { grid-template-columns: 1fr; }
  .wf-chips { display: flex; max-width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 82%, transparent); mask-image: linear-gradient(90deg, #000 82%, transparent); }
  .wf-chips:has(.wf-chip:last-child[aria-current]) { -webkit-mask-image: none; mask-image: none; }
  .wf-chips::-webkit-scrollbar { display: none; }
  .wf-chip { flex: none; }
  .work-grid { grid-template-columns: 1fr; row-gap: 52px; }
  .work-grid > [data-size] { grid-column: auto; }
  [data-size='f'] .wcard-cover { aspect-ratio: 4 / 3; }
  .wcard-cover { border-radius: 16px; }
  .wcard-name, [data-size='f'] .wcard-name { margin-top: 18px; font-size: 28px; }
  .wcard-what { font-size: var(--t-body); }
  /* The assistant orb would sit on the covers' corners while scrolling; Work and case pages end with the brief instead. */
  [data-page='work'] .agent { display: none; }
}
