/* Static case studies and shared lightbox. */
/* ---------- Project view ---------- */
[hidden] { display: none !important; }
.featured { scroll-margin-top: calc(16px + env(safe-area-inset-top, 0px)); }
.project { display: flex; flex-direction: column; gap: 56px; scroll-margin-top: calc(16px + env(safe-area-inset-top, 0px)); }
.project .lead-panel { position: relative; background: var(--panel); aspect-ratio: 1300 / 912; max-height: calc(100vh - 2 * var(--top)); width: 100%; display: grid; place-items: center; overflow: hidden; }
.project .lead-panel > img { width: 100%; height: 100%; object-fit: cover; }
.project .lead-panel .phone { height: 88%; }
/* Project text, stacked in the work area's 8 columns: title, subtitle and details across columns 1–5,
   case study text below. */
.project-text { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); column-gap: var(--g); row-gap: 32px; }
.project-text .head { grid-column: 1 / 6; display: flex; flex-direction: column; gap: 16px; }
.project-text h1 { font: inherit; font-size: 48px; line-height: 52px; letter-spacing: -0.01em; margin: 0; text-wrap: balance; font-weight: 700; }
.project-text .sub { margin: 0; font-size: 20px; line-height: 30px; color: var(--muted); text-wrap: pretty; }
.project-text { align-items: start; }
.project-text dl { grid-column: 1 / 6; margin: 0; padding-top: 32px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px var(--g); align-content: start; font-size: 16px; line-height: 24px;
  background: repeating-linear-gradient(to right, var(--muted) 0 6px, transparent 6px 11px) left top / 100% 1px no-repeat; }
.project-text dl > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.project-text dt { color: var(--muted); }
.project-text dd { margin: 0; }
.project-text .body { grid-column: 1 / 5; margin-top: 16px; display: flex; flex-direction: column; gap: 24px; font-size: 18px; line-height: 28px; }
.project-text .body p, .project-text .body li, .bio p { text-wrap: pretty; }
.project-text .body h2 { font-size: 18px; line-height: 28px; font-weight: 700; margin: 24px 0 -12px; }
.project-text .body h2:first-child { margin-top: 0; }
.project-text .body b { font-weight: 700; }
.project-text .body ul, .project-text .body ol { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 12px; }
.project-text .body li::marker { color: var(--muted); }
.project-text .body .tbl { overflow-x: auto; }
.project-text .body table { width: 100%; border-collapse: collapse; font-size: 16px; line-height: 24px; }
.project-text .body th { text-align: left; font-weight: 400; color: var(--muted); padding: 0 16px 8px 0; }
.project-text .body td { padding: 10px 16px 10px 0; border-top: 1px solid rgba(255,255,255,.22); vertical-align: top; }
.project-text .body td:first-child { width: 38%; }
.project-text .body figure.clip { margin: 8px 0; height: 600px; background: var(--wt-green); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; position: relative; }
.project-text .body figure.clip { box-sizing: border-box; padding: 24px 0 56px; }
.project-text .body figure.clip .phone { height: 100%; }
.project-text .body figure.clip figcaption { position: absolute; left: 12px; bottom: 10px; right: 12px; font-size: 12px; line-height: 16px; color: var(--muted); }
.project-text .body .clip-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 8px 0; }
.project-text .body .clip-row figure.clip { margin: 0; }
/* Clips break out of the text column to the full work area (cols 5–12) */
.project-text .body > figure.clip, .project-text .body > .clip-row, .project-text .body > .series { width: 100cqw; max-width: none; align-self: flex-start; }
.project-text .body .more { margin-top: 16px; }
.project-text dd a { text-decoration: underline; text-underline-offset: 3px; }
.project-text .body .more a { text-decoration: underline; text-underline-offset: 4px; }
.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--g); }
.gallery figure { margin: 0; display: flex; flex-direction: column; gap: 7px; }
.gallery figure.wide { grid-column: 1 / -1; }
.gallery img { width: 100%; height: auto; background: var(--tile); }
.gallery figcaption { font-size: 11px; color: var(--muted); }
.series { display: flex; flex-direction: column; gap: 16px; }
.series h2, .series h3 { margin: 0; font-size: 20px; line-height: 32px; font-weight: 700; }
.series-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.series-grid img { width: 100%; aspect-ratio: 422 / 528; object-fit: cover; background: var(--tile); display: block; }
.soon-tag { color: var(--muted); }
.tile.soon { cursor: default; }
.index .soon { color: var(--fg); }
.back { color: var(--muted); }
.back:hover { color: var(--fg); }
.next a { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.next .next-name { margin-left: -10px; }
.next .chev { width: 9px; height: 15px; fill: currentColor; flex: none; }
.next { display: flex; justify-content: space-between; gap: 24px; padding-top: 24px; font-size: 16px; line-height: 24px;
  background: repeating-linear-gradient(to right, var(--muted) 0 6px, transparent 6px 11px) left top / 100% 1px no-repeat; }

/* ---------- Lightbox ---------- */
.lightbox[open] { display: grid; }
.lightbox {
  border: 0; padding: 0; margin: 0; max-width: none; max-height: none; width: 100%; height: 100%;
  background: var(--bg); color: var(--fg); place-items: center;
}
.lightbox::backdrop { background: var(--bg); }
.lb-inner { display: flex; flex-direction: column; gap: 10px; max-width: min(1100px, 92vw); padding: 24px; }
.lb-inner img { max-height: 78vh; width: auto; margin: 0 auto; }
.lb-ph { width: min(560px, 80vw); aspect-ratio: 4 / 5; background: var(--tile); display: grid; place-items: center; color: var(--dim); }
.lb-row { display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.lb-row span { color: var(--muted); }
.lb-close { font: inherit; color: var(--muted); background: none; border: 0; cursor: pointer; padding: 0; line-height: 0; position: relative; }
.lb-close::after { content: ''; position: absolute; inset: -10px; } /* bigger tap area, same visual position */
.lb-close:focus { outline: none; }
.lb-close:focus-visible { outline: 1px solid var(--muted); outline-offset: 4px; }
.lb-inner:focus { outline: none; }
.lb-close svg { width: 21px; height: 21px; fill: currentColor; display: block; } /* Pixelarticons close (MIT) */
.lb-close:hover { color: var(--fg); }

/* Editing utilities: keep content semantic and styles outside HTML. */
.project .lead-panel > img.cover-hmhp { object-position: 70% 50%; }
.project .lead-panel > img.cover-stag { object-position: 50% 60%; }
.series-grid img.is-square { aspect-ratio: 1 / 1; }
.lb-row .lb-title { font-weight: 400; }
.lb-media img { max-height: 78vh; max-width: 100%; object-fit: contain; }
/* The original UI used a dialog; preserve Escape-to-close and focus trapping. */
.item:focus-visible { outline-offset: 4px; }
/* Reduced-motion visitors get a paused <video> poster via site.js. */
