/* ============================================================
   Showcase — the Hairline figure above the project list, and the
   category colours used across the work section.

   The four category hues were run through the dataviz palette
   validator against --surface in both modes. Light passes outright;
   dark warns on amber/green under protanopia (ΔE 6.2), which is
   legal with secondary encoding — every place a hue appears it also
   has its name beside it (key, filter tab, card kicker, panel), and
   the card file punches the category in one of four tab positions.
   ============================================================ */

:root {
  --cat-ai: #8b5cf6;
  --cat-web: #0891b2;
  --cat-content: #d97706;
  --cat-infra: #16a34a;
}
@media (prefers-color-scheme: light) {
  :root {
    --cat-ai: #7c3aed;
    --cat-web: #0284c7;
    --cat-content: #c2730a;
    --cat-infra: #059669;
  }
}

/* one property per category, so every consumer just reads var(--cat) */
[data-cat="ai-automation"] { --cat: var(--cat-ai); }
[data-cat="web-apps"] { --cat: var(--cat-web); }
[data-cat="content-systems"] { --cat: var(--cat-content); }
[data-cat="infrastructure"] { --cat: var(--cat-infra); }

/* the colour as a dot beside the category's name: filter tabs, card kickers, the key */
.fbtn[data-cat]:not([data-cat="all"])::before,
.case-cat::before,
.showcase-key li::before,
.sr-cat::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--cat);
}
.fbtn.is-on[data-cat]::before { box-shadow: 0 0 0 1.5px var(--on-accent); }
.case-cat::before { margin-right: 8px; vertical-align: 1px; }

/* ---------- layout ---------- */
.showcase {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  grid-template-areas: "bar bar" "plate read";
  gap: var(--s4) var(--s5);
  align-items: center;
  margin: var(--s5) 0 var(--s6);
}
.showcase[hidden] { display: none; }

.showcase-bar {
  grid-area: bar;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3) var(--s4);
  flex-wrap: wrap;
}
.showcase-bar .b-group { flex-wrap: wrap; }

.showcase-key {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.showcase-key li { display: inline-flex; align-items: center; gap: 7px; }

.showcase-plate {
  grid-area: plate;
  border: 1px solid var(--line);
  border-radius: var(--r-tile);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow-tile);
}

/* ---------- the figure's palette ----------
   The neutral parts (tray, shelf, platter, block) take the site's ink on
   its surface; each project's group takes its category's hue, with the
   bright edge lifted a little toward the ink so the picked one stands out
   from its own kind. Fills stay the plate colour, so nearer plates still
   cover farther ones. */
.showcase {
  --hairline-plate: var(--surface);
  --hairline-hi: var(--text);
  --hairline-edge: color-mix(in oklab, var(--text) 40%, var(--surface));
  --hairline-mid: color-mix(in oklab, var(--text) 26%, var(--surface));
  --hairline-lo: color-mix(in oklab, var(--text) 13%, var(--surface));
}
.showcase-stage { cursor: pointer; }
.showcase-stage [data-cat] {
  --hl-hi: color-mix(in oklab, var(--cat) 78%, var(--text));
  --hl-edge: color-mix(in oklab, var(--cat) 70%, var(--hl-plate));
  --hl-mid: color-mix(in oklab, var(--cat) 46%, var(--hl-plate));
  --hl-lo: color-mix(in oklab, var(--cat) 26%, var(--hl-plate));
}
/* a filter greys the other categories rather than fading them, so the plates stay opaque */
.showcase[data-filter="ai-automation"] .showcase-stage [data-cat]:not([data-cat="ai-automation"]),
.showcase[data-filter="web-apps"] .showcase-stage [data-cat]:not([data-cat="web-apps"]),
.showcase[data-filter="content-systems"] .showcase-stage [data-cat]:not([data-cat="content-systems"]),
.showcase[data-filter="infrastructure"] .showcase-stage [data-cat]:not([data-cat="infrastructure"]) {
  --hl-hi: color-mix(in oklab, var(--text) 34%, var(--hl-plate));
  --hl-edge: color-mix(in oklab, var(--text) 16%, var(--hl-plate));
  --hl-mid: color-mix(in oklab, var(--text) 12%, var(--hl-plate));
  --hl-lo: color-mix(in oklab, var(--text) 7%, var(--hl-plate));
}
.showcase[data-filter="ai-automation"] .showcase-key li:not([data-cat="ai-automation"]),
.showcase[data-filter="web-apps"] .showcase-key li:not([data-cat="web-apps"]),
.showcase[data-filter="content-systems"] .showcase-key li:not([data-cat="content-systems"]),
.showcase[data-filter="infrastructure"] .showcase-key li:not([data-cat="infrastructure"]) { opacity: .45; }

/* ---------- the panel ---------- */
.showcase-read {
  grid-area: read;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--s2);
  min-height: 200px;
  padding: var(--s4) 0 var(--s4) var(--s5);
  border-left: 2px solid var(--cat, var(--line));
  transition: border-color .26s var(--ease-out);
}
.showcase-read p { margin: 0; }
.sr-cat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.showcase-read.is-rest .sr-cat::before { display: none; }
.sr-title {
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -.01em;
  color: var(--text);
}
.sr-hook {
  max-width: 42ch;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
  text-wrap: pretty;
}
.sr-open { align-self: flex-start; margin-top: var(--s2); text-decoration: none; }
.sr-open[hidden] { display: none; }

@media (max-width: 760px) {
  .showcase {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "bar" "plate" "read";
  }
  .showcase-read {
    min-height: 168px;
    padding: var(--s2) 0 var(--s2) var(--s4);
  }
}

/* the full site's two views (js/work.js): Reel is the figure on its own,
   Grid is the cards on their own */
#work[data-view="reel"] .work-grid,
#work[data-view="reel"] .reel-bar { display: none; }
#work[data-view="grid"] .showcase { display: none; }

.showcase-pause { margin-right: auto; }
.showcase-pause .i-play, .showcase-pause[aria-pressed="true"] .i-pause { display: none; }
.showcase-pause[aria-pressed="true"] .i-play { display: inline; }
