/* ==========================================================================
   KUTAY OS — Work & Project
   Styles owned by work.html, project.html and every work/<slug>/index.html
   page: the project grid (grid/list/gallery), the work-kind badge, and the
   project case-study layout (gallery, facts, palette, pager, related work,
   archive record, not-found state). Everything else these pages need
   (chrome, split-view Finder layout, buttons, dialogs…) already lives in
   shell.css.
   ========================================================================== */

/* The project grid/card/badge rules (".project-grid", ".project-card",
   ".work-badge", ".media-badge") are NOT here: that component also renders
   inside index.html's pre-built "Work" mini window, whose <head> never links
   this stylesheet. js/apps/work.js injects that one small stylesheet itself
   (see `injectWorkStyles()`). Everything below is work.html-only. */

/* ---------------------------------------------------------------------- */
/* Work window palette — the original's final Work styling (v127-work.css) */
/* gave this one window its own deep-green surface and warm-yellow accent. */
/* Dark theme only; light theme keeps the system's light tokens.           */
/* ---------------------------------------------------------------------- */
:root:not([data-theme="light"]) .app-window:has(> .work-page) {
  --text: #f7f2e6; --text-muted: #c2cec5; --text-dim: #93a69a;
  --accent: #efd06a; --accent-ink: #171406;
  --line: rgba(217, 233, 218, .16); --line-2: rgba(217, 233, 218, .09);
  background: linear-gradient(125deg, rgba(25, 43, 34, .96), rgba(9, 22, 17, .98));
  color: var(--text);
}
:root:not([data-theme="light"]) .app-window > .work-page > .sidebar { background: rgba(10, 24, 18, .44); }

/* ---------------------------------------------------------------------- */
/* Layout: sidebar + explorer                                              */
/* ---------------------------------------------------------------------- */
.app-window .work-page { grid-template-columns: 180px minmax(0, 1fr); }
.app-window .work-page > .sidebar { display: block; padding: var(--space-4) var(--space-3); }
.work-page .side-link { cursor: pointer; }
.work-page .side-link.active { color: var(--text); background: color-mix(in srgb, var(--accent) 13%, transparent); }
.work-page .side-link.active .side-symbol, .work-page .side-link.active small { color: var(--accent); }
.work-page .side-link:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.work-page .side-link small { color: var(--text-dim); font-variant-numeric: tabular-nums; }

.work-page .finder-main { container: work-main / inline-size; }
.work-page .page-toolbar { border-bottom: 0; padding: var(--space-3) var(--space-4) var(--space-2); }
.work-page .search { min-width: 0; }
.work-page .search:focus { border-color: color-mix(in srgb, var(--accent) 55%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }
.work-page .sort-select { width: 112px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line); background-color: rgba(255, 255, 255, .055); color: var(--text); cursor: pointer; }
.work-page .sort-select:hover { border-color: color-mix(in srgb, var(--text) 30%, transparent); }
.work-page .sort-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.work-page .view-toggle button { cursor: pointer; transition: background var(--dur-fast), color var(--dur-fast); }
.work-page .view-toggle button:hover { color: var(--text); }
.work-page .view-toggle button.on { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.work-page .view-toggle button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.work-page .filter-strip {
  display: flex; align-items: center; gap: var(--space-2); padding: 0 var(--space-4) var(--space-3);
  border-bottom: 1px solid var(--line-2); overflow-x: auto; scrollbar-width: none;
}
.work-page .filter-strip::-webkit-scrollbar { display: none; }
.chip-group { display: flex; gap: 6px; flex-shrink: 0; }
.cat-chips { display: none; }
.work-page .filter-chip { min-height: 32px; padding: 6px 12px; border-radius: var(--r-pill); cursor: pointer; transition: background var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast); }
.work-page .filter-chip:hover { color: var(--text); border-color: var(--line); background: rgba(255, 255, 255, .04); }
.work-page .filter-chip:active { transform: scale(.97); }
.work-page .filter-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.work-page .filter-chip.on { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: color-mix(in srgb, var(--accent) 13%, transparent); }

.work-page .project-grid { flex: 1 1 0; min-height: 0; }
.work-page .explorer-status { font-variant-numeric: tabular-nums; }

/* Empty state (search/filter with no results) — centred in the full pane. */
.project-grid > .empty-state { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: auto; padding: var(--space-8) var(--space-4); }
.work-page .project-grid:has(> .empty-state) { display: flex; }
.empty-state .empty-icon { width: 40px; height: 40px; color: var(--text-dim); margin-bottom: 4px; }
.empty-state p { margin: 0 0 8px; }

/* Grid card selection follows the Work accent. */
.work-page .project-card.is-selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

/* Tablet: narrower sidebar (the original kept it at tablet widths). */
@media (min-width: 700px) and (max-width: 1099px) {
  .app-window .work-page { grid-template-columns: 170px minmax(0, 1fr); }
  .app-window .work-page > .sidebar { display: block; padding: var(--space-3) var(--space-2); }
}
/* Phone: the sidebar goes, its categories come back as chips. */
@media (max-width: 699px) {
  .app-window .work-page { grid-template-columns: minmax(0, 1fr); }
  .app-window .work-page > .sidebar { display: none; }
  .cat-chips { display: flex; }
  .cat-chips::after { content: ""; width: 1px; align-self: stretch; margin: 4px 2px 4px 4px; background: var(--line); }
}
@media (max-width: 599px) {
  .work-page .page-toolbar { padding: var(--space-2) var(--space-3); gap: 6px; flex-wrap: nowrap; }
  .work-page .view-toggle [data-view="list"], .work-page .view-toggle [data-view="gallery"] { display: none; }
  .work-page .view-toggle button { width: 38px; height: 38px; }
  .work-page .search { height: 40px; font-size: 16px; }
  .work-page .sort-select { width: 96px; height: 40px; font-size: 13px; }
  .work-page .filter-strip { padding: 0 var(--space-3) var(--space-2); -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
  .work-page .filter-chip { min-height: 38px; font-size: 13px; }
}

/* ---------------------------------------------------------------------- */
/* Split view — index · artwork · details                                  */
/* ---------------------------------------------------------------------- */
.work-page .project-grid[data-view="split"] { display: block; padding: var(--space-4); overflow: hidden; }
.wv { display: grid; grid-template-columns: 228px minmax(0, 1fr); gap: var(--space-4); height: 100%; min-height: 0; }

.wv-index { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.wv-list {
  list-style: none; margin: 0; padding: 2px 6px 2px 2px; flex: 1; min-height: 0;
  display: flex; flex-direction: column; gap: 4px; overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; border-radius: var(--r-md); outline: none;
}
.wv-row {
  display: grid; grid-template-columns: 20px 56px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  min-height: 70px; padding: 7px 8px; border-radius: 10px; border: 1px solid transparent; cursor: pointer;
  user-select: none; transition: background var(--dur-fast), border-color var(--dur-fast);
}
.wv-row:hover { background: rgba(255, 255, 255, .05); }
.wv-row:active { background: rgba(255, 255, 255, .08); }
.wv-row.on { background: color-mix(in srgb, var(--accent) 14%, transparent); border-color: color-mix(in srgb, var(--accent) 42%, transparent); }
.wv-list:focus-visible .wv-row.on { outline: 2px solid var(--accent); outline-offset: -2px; }
.wv-num { font: 600 11px/1 var(--font-mono); color: var(--text-dim); }
.wv-row.on .wv-num { color: var(--accent); }
.wv-thumbmini { display: block; width: 56px; aspect-ratio: 1.12; border-radius: 7px; overflow: hidden; background: #14171d; }
.wv-thumbmini img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wv-rowtext { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wv-rowtext b { font-size: 13.5px; font-weight: 600; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wv-rowtext small { font-size: 11.5px; line-height: 1.35; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wv-badge { font-size: 9px; color: var(--accent); }

.wv-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 30%); gap: var(--space-4); min-height: 0; min-width: 0; overflow: hidden; }
.wv-stage {
  position: relative; margin: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--line-2); border-radius: var(--r-md); background: #0a0d12;
}
.wv-media {
  flex: 1 1 0; width: 100%; height: 0; min-height: 0; display: block; object-fit: contain; object-position: center;
  background: radial-gradient(ellipse at 40% 30%, rgba(255, 255, 255, .06), transparent 70%), #0a0d12;
}
:root:not([data-theme="light"]) .app-window:has(> .work-page) .wv-stage { background: #07110d; }
:root:not([data-theme="light"]) .app-window:has(> .work-page) .wv-media { background: radial-gradient(ellipse at 40% 30%, #22362a, #08120e); }
.wv-thumbs { display: flex; gap: 8px; padding: 10px; flex-shrink: 0; overflow-x: auto; scrollbar-width: none; border-top: 1px solid var(--line-2); }
.wv-thumbs::-webkit-scrollbar { display: none; }
.wv-thumb {
  position: relative; width: 68px; aspect-ratio: 16 / 11; flex-shrink: 0; padding: 0; border-radius: 7px; overflow: hidden;
  border: 1px solid transparent; background: #14171d; cursor: pointer; opacity: .6; transition: opacity var(--dur-fast), border-color var(--dur-fast);
}
.wv-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wv-thumb:hover { opacity: 1; }
.wv-thumb.on { opacity: 1; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.wv-thumb:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; opacity: 1; }
.wv-play { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; color: #fff; background: rgba(0, 0, 0, .35); }

.wv-info {
  display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; min-height: 0; overflow: auto; scrollbar-width: thin;
  padding: 18px; border: 1px solid var(--line-2); border-radius: var(--r-md); background: rgba(255, 255, 255, .03);
}
.wv-head { display: flex; flex-direction: column; gap: 4px; }
.wv-head .work-badge { margin-bottom: 8px; }
.wv-kicker { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-dim); line-height: 1.5; }
.wv-name { margin: 2px 0 0; font-size: clamp(24px, 2.1vw, 34px); font-weight: 600; line-height: 1.08; letter-spacing: -.02em; overflow-wrap: anywhere; }
.wv-headline { margin: 6px 0 0; font-size: 14.5px; line-height: 1.5; color: var(--text-muted); }
.wv-desc { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--text-muted); }
.wv-case { display: grid; gap: 10px; margin: 0; }
.wv-case > div { padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 10px; background: rgba(255, 255, 255, .025); min-width: 0; }
.wv-case dt { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-dim); }
.wv-case dt span { font: 700 10px/1 var(--font-mono); letter-spacing: 0; color: var(--accent); background: rgba(255, 255, 255, .06); padding: 3px 5px; border-radius: 5px; }
.wv-case dd { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--text); }
.wv-palette { display: flex; flex-wrap: wrap; gap: 6px; }
.wv-swatch {
  width: 30px; height: 20px; padding: 0; border-radius: 5px; background: var(--c); border: 1px solid rgba(255, 255, 255, .18);
  cursor: copy; transition: transform var(--dur-fast) var(--ease-out);
}
.wv-swatch:hover { transform: translateY(-2px); }
.wv-swatch:active { transform: scale(.94); }
.wv-swatch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (pointer: coarse) { .wv-swatch { width: 40px; height: 30px; } }
.wv-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 2px; }
.wv-actions .btn { min-height: 40px; flex: 1 1 auto; }
.wv-actions .btn:focus-visible, .empty-state .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Narrower explorer: lighter index, details stack under the artwork in one
   scroll column (the artwork keeps a fixed, generous height). */
@container work-main (max-width: 900px) {
  .wv { grid-template-columns: 188px minmax(0, 1fr); gap: var(--space-3); }
  .wv-row { grid-template-columns: 48px minmax(0, 1fr); min-height: 62px; gap: 9px; }
  .wv-num, .wv-badge { display: none; }
  .wv-thumbmini { width: 48px; }
  .wv-detail { display: flex; flex-direction: column; gap: var(--space-3); overflow-y: auto; overscroll-behavior: contain; }
  .wv-stage { flex: 0 0 auto; height: clamp(260px, 46vh, 480px); }
  .wv-info { flex: 0 0 auto; overflow: visible; }
}
/* Phone: a horizontal project chooser on top, then artwork and details. */
@container work-main (max-width: 560px) {
  .work-page .project-grid[data-view="split"] { padding: var(--space-3); }
  .wv { display: flex; flex-direction: column; gap: var(--space-3); }
  .wv-index { flex: 0 0 auto; }
  .wv-list { flex-direction: row; overflow-x: auto; overflow-y: hidden; padding: 2px; gap: 6px; scrollbar-width: none; }
  .wv-list::-webkit-scrollbar { display: none; }
  .wv-row { flex: 0 0 196px; min-height: 64px; background: rgba(255, 255, 255, .03); }
  .wv-detail { flex: 1 1 0; }
  .wv-stage { height: clamp(220px, 40vh, 380px); }
  .wv-info { padding: 14px; }
}

/* ---------------------------------------------------------------------- */
/* Project case study                                                      */
/* ---------------------------------------------------------------------- */
.collection-detail { overflow: auto; padding: var(--space-6) !important; display: block !important; }
.case-heading { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); font-size: 12px; color: var(--text-muted); }
.case-intro { max-width: 760px; margin: 40px 0 28px; }
.case-intro .eyebrow { font-size: 10px; color: var(--text-dim); letter-spacing: .16em; }
.case-intro h1 { font-size: clamp(34px, 5vw, 68px); font-weight: 500; letter-spacing: -.05em; margin: 14px 0; }
.case-intro h2 { font-size: 21px; font-weight: 400; line-height: 1.3; color: var(--text-muted); }
.case-intro p { font-size: 15px; line-height: 1.8; color: var(--text-muted); max-width: 630px; }
.collection-detail.is-archive .case-intro h2 { font-weight: 400; color: var(--text); }

/* The work-kind badge ("Client Work" / "Studio Concept" / "Experiment").
   Also defined by js/apps/work.js's injectWorkStyles() for the grid-card
   copy that must render inside index.html's off-limits Work window — this
   is the same component, defined here too so project.html and every
   work/<slug>/index.html page (which link this sheet but never run
   work.js) get it as well. */
.work-badge { display: inline-block; padding: 3px 7px; border: 1px solid var(--line); border-radius: var(--r-sm); font: 9px/1.4 var(--font-mono); letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); }
.case-intro .work-badge { display: block; width: fit-content; margin: 0 0 12px; }

.case-study { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); margin: 0 0 30px; }
.case-study article { padding: 20px 22px; border: 1px solid var(--line-2); border-radius: var(--r-md); background: rgba(255, 255, 255, .028); }
.case-study article h3 { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-dim); display: flex; align-items: center; gap: 8px; margin: 0 0 10px; }
.case-study article h3 span { color: var(--accent); font-weight: 700; background: rgba(255, 255, 255, .06); padding: 2px 6px; border-radius: var(--r-sm); font-size: 11px; }
.case-study article p { font-size: 14px; line-height: 1.7; color: var(--text-muted); margin: 0; }
@media (max-width: 820px) { .case-study { grid-template-columns: 1fr; gap: var(--space-5); } }

.case-gallery { display: grid; gap: var(--space-6); }
.case-gallery figure { margin: 0; }
.case-image { display: block; width: 100%; padding: 0; background: #0b0e12; border-radius: var(--r-md); overflow: hidden; cursor: zoom-in; }
.case-image img { display: block; width: 100%; max-height: 720px; object-fit: contain; }
.case-gallery figcaption { display: flex; justify-content: space-between; padding: 10px 2px; font-size: 11px; color: var(--text-muted); }
.case-gallery video { width: 100%; max-height: 680px; background: #07090c; border-radius: var(--r-md); }

.case-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-3); margin: 26px 0 4px; }
.case-facts div { padding: 14px 16px; border: 1px solid var(--line-2); border-radius: var(--r-md); background: rgba(255, 255, 255, .028); }
.case-facts span { display: block; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 6px; }
.case-facts b { font-size: 14px; font-weight: 600; line-height: 1.35; display: block; }
@media (max-width: 820px) { .case-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.case-palette { margin: 22px 0 4px; }
.case-palette header { display: flex; align-items: baseline; gap: var(--space-3); margin-bottom: 10px; }
.case-palette header span { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted); font-weight: 600; }
.case-palette header small { font-size: 11px; color: var(--text-dim); }
.swatch-row { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.swatch-chip {
  flex: 1 1 0; min-width: 92px; border: 1px solid var(--line-2); border-radius: var(--r-md);
  overflow: hidden; background: rgba(255, 255, 255, .028); cursor: pointer; padding: 0;
  display: flex; flex-direction: column; transition: transform var(--dur-base) var(--ease-out), border-color var(--dur-base), box-shadow var(--dur-base);
}
.swatch-chip:hover { transform: translateY(-3px); border-color: var(--line); box-shadow: var(--shadow-sm); }
.swatch-fill { display: block; height: 52px; background: var(--c); }
.swatch-hex { display: block; padding: 7px 9px; font: 600 11px/1.4 var(--font-mono); letter-spacing: .03em; color: var(--text-muted); text-align: left; }
@media (max-width: 600px) { .case-palette { display: none; } }

.case-pager { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); margin: 26px 0 6px; }
.pager-link { padding: 15px 17px; border: 1px solid var(--line-2); border-radius: var(--r-md); background: rgba(255, 255, 255, .028); display: flex; flex-direction: column; gap: 5px; min-width: 0; transition: transform var(--dur-base) var(--ease-out), border-color var(--dur-base), background var(--dur-base); }
.pager-link:hover { transform: translateY(-3px); border-color: var(--line); background: rgba(255, 255, 255, .06); }
.pager-link.next { text-align: right; align-items: flex-end; }
.pager-link span { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-dim); }
.pager-link b { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
@media (max-width: 600px) { .case-pager { grid-template-columns: 1fr; } .pager-link.next { text-align: left; align-items: flex-start; } }

.case-related { margin: 28px 0 4px; }
.case-related header { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted); font-weight: 600; margin-bottom: 12px; }
.related-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-3); }
.related-card { display: flex; flex-direction: column; gap: 8px; border-radius: var(--r-md); padding: 7px 7px 10px; border: 1px solid transparent; background: rgba(255, 255, 255, .028); min-width: 0; transition: transform var(--dur-base) var(--ease-out), border-color var(--dur-base), background var(--dur-base); }
.related-card:hover { transform: translateY(-4px); border-color: var(--line); background: rgba(255, 255, 255, .07); }
.related-thumb { display: block; border-radius: var(--r-sm); overflow: hidden; aspect-ratio: 16/10; background: #14171d; }
.related-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform var(--dur-slow); }
.related-card:hover .related-thumb img { transform: scale(1.05); }
.related-meta { display: flex; flex-direction: column; gap: 2px; padding: 0 3px; min-width: 0; }
.related-meta b { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.related-meta small { font-size: 10px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 900px) { .related-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.case-footer { display: flex; flex-wrap: wrap; gap: var(--space-2); padding: 24px 0; }

.archive-note { margin-top: 14px; font-size: 13px; color: var(--text-muted); border-left: 2px solid var(--line); padding-left: 12px; }
.archive-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--space-3); margin: 24px 0 6px; }
.archive-facts div { padding: 15px 17px; border: 1px solid var(--line-2); border-radius: var(--r-md); background: rgba(255, 255, 255, .028); }
.archive-facts span { display: block; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 6px; }
.archive-facts b { font-size: 14px; font-weight: 600; }
@media (max-width: 700px) { .archive-facts { grid-template-columns: 1fr; } }

@media (max-width: 600px) {
  .collection-detail { padding: var(--space-4) !important; }
  .case-intro { margin: 26px 0; }
  .case-intro h2 { font-size: 18px; }
  .case-intro p { font-size: 14px; }
  .case-heading { align-items: flex-start; }
  .case-heading > span { max-width: 45%; text-align: right; }
  .case-gallery { gap: var(--space-4); }
}

/* ---------------------------------------------------------------------- */
/* Image viewer dialog (lightbox)                                          */
/* ---------------------------------------------------------------------- */
.image-dialog { width: min(1200px, 95vw) !important; max-width: 95vw !important; }
.image-viewer img { width: 100%; max-height: 70dvh; object-fit: contain; border-radius: var(--r-sm); }
.image-viewer > div { display: flex; align-items: center; justify-content: center; gap: var(--space-5); padding-top: 10px; font-size: 13px; color: var(--text-muted); }

/* ---------------------------------------------------------------------- */
/* Case study — round 2: sizing fixes, states and motion                   */
/* ---------------------------------------------------------------------- */
.case-intro h2 { margin: 0 0 12px; }
.case-intro p { margin: 0; }
.case-image { position: relative; border: 0; transition: box-shadow var(--dur-base); }
.case-image img { height: auto; opacity: 0; transform: scale(1.012); transition: opacity .5s var(--ease-out), transform .9s var(--ease-out); }
.case-image img.is-loaded { opacity: 1; transform: none; }
.case-image::after {
  content: "⤢"; position: absolute; right: 12px; top: 12px; width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: var(--r-pill); background: rgba(8, 11, 16, .72); color: #fff; font-size: 15px;
  opacity: 0; transform: translateY(-4px); transition: opacity var(--dur-base), transform var(--dur-base) var(--ease-out); pointer-events: none;
}
.case-image:hover::after, .case-image:focus-visible::after { opacity: 1; transform: none; }
.case-image:hover img.is-loaded { transform: scale(1.015); }
.case-image:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.case-image:active img.is-loaded { transform: scale(.995); }
.pager-link:focus-visible, .related-card:focus-visible, .swatch-chip:focus-visible, .case-heading .btn:focus-visible, .case-footer .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.swatch-chip:active { transform: translateY(-1px) scale(.98); }
.pager-link:active, .related-card:active { transform: translateY(-1px); }
.pager-link.prev span, .pager-link.next span { transition: letter-spacing var(--dur-base) var(--ease-out); }
.pager-link:hover span { letter-spacing: .2em; }

/* Scroll reveal (js adds .reveal/.is-in; no-JS and reduced motion show all). */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--ease-out), transform .7s var(--ease-out); }
.reveal.is-in { opacity: 1; transform: none; }
.reduce-motion .reveal { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } .case-image img { opacity: 1; transform: none; } }

/* Lightbox: each frame fades/settles in. */
.image-viewer .viewer-img { animation: viewerIn .32s var(--ease-out); }
@keyframes viewerIn { from { opacity: 0; transform: scale(.985); } to { opacity: 1; transform: none; } }
.image-viewer .btn:disabled { opacity: .4; cursor: default; }

/* Split view motion: a new selection's artwork settles in, details follow. */
.wv-media { animation: wvMedia .45s var(--ease-out) both; }
.wv-info { animation: wvInfo .4s var(--ease-out) .05s both; }
.wv-row .wv-thumbmini img { transition: transform var(--dur-slow) var(--ease-out); }
.wv-row:hover .wv-thumbmini img, .wv-row.on .wv-thumbmini img { transform: scale(1.08); }
@keyframes wvMedia { from { opacity: 0; transform: scale(.985); } to { opacity: 1; transform: none; } }
@keyframes wvInfo { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .wv-media, .wv-info { animation: none; } }
