/* =========================================================
   Work page, Nov 2026 revision:
   hiring-path filter, readable HTML case studies, annotated artifacts
   ========================================================= */

.path-toggle [hidden], .chip[hidden], .case-dialog [hidden], .cs-article [hidden], .lightbox [hidden] { display: none !important; }

/* ---------- Hiring path: All / Web & digital / Graphic & marketing ---------- */
.path-toggle {
  display: inline-flex; gap: 4px; padding: 6px; justify-self: start;
  border-radius: var(--radius-pill);
  background: var(--glass); border: 1px solid var(--glass-edge);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
@media (min-width: 900px) { .path-toggle { justify-self: end; } }
.path-opt {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 0 20px; border-radius: var(--radius-pill);
  color: var(--text-dim); font-weight: 600; font-size: .95rem; white-space: nowrap;
  transition: color .25s, background .25s;
}
.path-opt:hover { color: var(--cream); background: rgba(241,238,227,.06); }
.path-opt[aria-current="true"] { color: var(--black); background: linear-gradient(115deg, var(--gold-light), var(--gold)); }
@media (max-width: 640px) {
  .path-toggle { display: flex; width: 100%; }
  .path-opt { flex: 1 1 auto; padding: 0 10px; font-size: .84rem; min-height: 44px; }
}

/* ---------- Case library: plain readable HTML when scripts are off ---------- */
.js .case-library { display: none; }
.case-library { padding-bottom: var(--section-y); }
.case-library-title { font-family: var(--font-display); font-stretch: 125%; font-weight: 800; text-transform: uppercase; font-size: var(--step-3); margin-bottom: 24px; }
.case-library .cs-article { border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; background: #1d1611; margin-bottom: 40px; }

/* ---------- Case study (inside the dialog or the library) ---------- */
.cs-top { display: grid; grid-template-columns: 1fr; }
@media (min-width: 960px) { .cs-top { grid-template-columns: minmax(0, 1.35fr) minmax(380px, 1fr); } }

.cs-stage {
  position: relative; overflow: hidden; isolation: isolate;
  height: 52vh; height: 52svh; min-height: 300px;
  background:
    radial-gradient(70% 70% at 50% 62%, rgba(182,154,88,.18), transparent 70%),
    linear-gradient(180deg, rgba(8,6,5,.5), rgba(8,6,5,.78)),
    url("../img/portfolio-decoration/p01-decoration-64-800.webp?v=13") 50% 50% / cover,
    var(--black);
}
@media (min-width: 960px) { .cs-stage { height: min(74vh, 740px); } }
.cs-stage-scroll {
  position: absolute; inset: 0; overflow: auto; overscroll-behavior: contain;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(16px, 3vw, 44px) clamp(16px, 3vw, 64px) 70px;
  cursor: zoom-in;
}
.cs-stage.is-light .cs-stage-scroll { background: radial-gradient(80% 80% at 50% 45%, #fbf9f2, var(--cream) 60%, #e2d9c3); }
.cs-stage-img {
  max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain;
  border-radius: 8px; filter: drop-shadow(0 30px 50px rgba(0,0,0,.55));
  transition: opacity .25s;
}
.cs-stage-img.is-tall { align-self: flex-start; max-height: none; width: min(100%, 560px); }
.cs-stage-img.is-swapping { opacity: 0; }
.cs-nav, .cs-zoom {
  position: absolute; z-index: 2; width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(8,6,5,.62); border: 1px solid var(--line-strong); color: var(--cream);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: background .25s, color .25s;
}
.cs-nav { top: 50%; translate: 0 -50%; }
.cs-prev { left: 14px; } .cs-next { right: 14px; }
.cs-zoom { top: 14px; left: 14px; width: 44px; height: 44px; }
.cs-nav:hover, .cs-zoom:hover { background: var(--cream); color: var(--black); }
.cs-nav svg, .cs-zoom svg { width: 18px; height: 18px; }
.cs-cap {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; margin: 0;
  padding: 44px 96px 14px 20px; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(8,6,5,.86));
  color: var(--cream); font-size: .86rem; line-height: 1.45;
}
.cs-count { position: absolute; right: 16px; bottom: 12px; z-index: 2; padding: 4px 12px; border-radius: var(--radius-pill); background: rgba(8,6,5,.6); color: var(--text-dim); font-size: .8rem; font-variant-numeric: tabular-nums; }
.cs-count:empty { display: none; }

.cs-intro { display: flex; flex-direction: column; gap: 16px; padding: clamp(24px, 3vw, 44px); padding-top: clamp(28px, 4vw, 64px); min-width: 0; }
.cs-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cs-chips .work-tag { margin: 0; padding: 4px 12px; font-size: .76rem; }
.chip-cat { padding: 4px 12px; border-radius: var(--radius-pill); background: rgba(241,238,227,.06); color: var(--text-dim); font-size: .76rem; }
.cs-title { font-family: var(--font-display); font-stretch: 125%; font-weight: 800; text-transform: uppercase; font-size: clamp(1.6rem, 1rem + 1.6vw, 2.6rem); line-height: .98; overflow-wrap: anywhere; }
.cs-dek { font-size: clamp(1.05rem, .98rem + .35vw, 1.25rem); line-height: 1.5; color: var(--cream); max-width: 46ch; }
.cs-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 22px; padding-top: 16px; border-top: 1px solid var(--line); font-size: .92rem; line-height: 1.45; }
.cs-facts dt { color: var(--text-faint); font-size: .76rem; margin-bottom: 2px; }
.cs-facts dd { color: var(--cream); }
@media (max-width: 420px) { .cs-facts { grid-template-columns: 1fr; } }

.cs-live { display: grid; gap: 10px; justify-items: start; padding: 18px; border-radius: 16px; background: rgba(46,36,28,.6); border: 1px solid var(--glass-edge); }
.cs-live--soon { background: linear-gradient(150deg, rgba(182,154,88,.2), rgba(34,26,20,.6)); }
.cs-live p { color: var(--text-dim); font-size: .9rem; line-height: 1.55; }
.cs-live .status { color: var(--gold-light); }
.cs-live-title { font-family: var(--font-display); font-stretch: 125%; font-weight: 800; text-transform: uppercase; font-size: 1.1rem !important; line-height: 1.05; color: var(--cream) !important; }
.cs-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.cs-btns .btn { min-height: 44px; padding: 0 18px; font-size: .9rem; }
.cs-fine { color: var(--text-faint) !important; font-size: .76rem !important; }

/* body: comfortable reading width, wider room for annotated artifacts */
.cs-body { padding: 0 clamp(20px, 4vw, 64px) clamp(40px, 5vw, 80px); border-top: 1px solid var(--line); }
.cs-sec { padding-top: clamp(36px, 4vw, 60px); }
.cs-text { max-width: 72ch; }
.cs-h { display: flex; align-items: baseline; gap: 10px; font-family: var(--font-display); font-stretch: 125%; font-weight: 700; text-transform: uppercase; font-size: .9rem; letter-spacing: .04em; color: var(--gold-light); margin-bottom: 16px; }
.cs-h-count { font-family: var(--font-body); font-stretch: 100%; font-weight: 500; letter-spacing: 0; color: var(--text-faint); font-size: .85rem; }
.cs-sec p { color: var(--cream); line-height: 1.7; }
.cs-sec p + p, .cs-sec p + ul, .cs-sec ul + p { margin-top: 14px; }
.cs-lead { font-size: clamp(1.12rem, 1rem + .5vw, 1.4rem); line-height: 1.55 !important; }
.cs-sub { color: var(--text-dim) !important; margin-top: -6px; margin-bottom: 18px; }
.cs-note { color: var(--text-dim) !important; font-size: .92rem; padding-left: 14px; border-left: 2px solid var(--line-strong); }
.cs-challenge { display: grid; gap: 6px; margin-bottom: 18px; padding: 14px 16px; border-left: 2px solid var(--gold); background: linear-gradient(90deg, rgba(182,154,88,.12), transparent); line-height: 1.5; }
.cs-challenge span { color: var(--gold-light); font-size: .76rem; font-weight: 600; }
.cs-list { display: grid; }
.cs-list li { position: relative; padding: 10px 0 10px 20px; border-bottom: 1px solid var(--line); line-height: 1.5; }
.cs-list li:last-child { border-bottom: 0; }
.cs-list li::before { content: ""; position: absolute; left: 0; top: 1.25em; width: 9px; height: 1px; background: var(--gold); }

.cs-map { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); }
.cs-map > li { padding: 14px 16px; border-radius: 14px; background: rgba(46,36,28,.6); border: 1px solid var(--line); }
.cs-map > li > b { display: block; font-family: var(--font-display); font-stretch: 125%; font-weight: 700; text-transform: uppercase; font-size: .82rem; color: var(--gold-light); margin-bottom: 8px; }
.cs-map ul { display: grid; gap: 4px; }
.cs-map ul li { font-size: .84rem; color: var(--text-dim); line-height: 1.4; }

/* annotated decisions */
.cs-decision { display: grid; gap: 18px 40px; padding: 28px 0; border-top: 1px solid var(--line); }
.cs-decisions .cs-h + .cs-decision { border-top: 0; padding-top: 4px; }
@media (min-width: 960px) { .cs-decision { grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); align-items: start; } }
/* decisions described in text only (no annotated image yet) */
.cs-decision--text { max-width: 72ch; }
@media (min-width: 960px) { .cs-decision--text { grid-template-columns: 1fr; } }
.annot { margin: 0; display: grid; gap: 10px; min-width: 0; }
.annot-media {
  position: relative; display: block; width: 100%; padding: 0;
  border-radius: 14px; overflow: hidden; border: 1px solid var(--line);
  background: var(--espresso); cursor: zoom-in;
}
.annot--trans .annot-media {
  background:
    linear-gradient(180deg, rgba(8,6,5,.3), rgba(8,6,5,.62)),
    url("../img/portfolio-decoration/p01-decoration-64-800.webp?v=13") 50% 50% / cover;
}
.annot-media img { display: block; width: 100%; height: auto; }
.pin, .pin-n {
  display: grid; place-items: center; border-radius: 50%;
  background: var(--gold-light); color: var(--black);
  font-weight: 700; font-size: .8rem; line-height: 1; font-variant-numeric: tabular-nums;
}
.pin {
  position: absolute; width: 28px; height: 28px; transform: translate(-50%, -50%);
  box-shadow: 0 0 0 3px rgba(8,6,5,.6), 0 8px 18px rgba(0,0,0,.45);
}
.pin-n { width: 26px; height: 26px; flex: none; }
@media (max-width: 640px) { .pin { width: 22px; height: 22px; font-size: .7rem; box-shadow: 0 0 0 2px rgba(8,6,5,.6); } }
.annot figcaption { color: var(--text-faint); font-size: .82rem; line-height: 1.45; }
.cs-decision-text h4 { font-size: clamp(1.1rem, 1rem + .4vw, 1.35rem); font-weight: 600; line-height: 1.3; color: var(--cream); margin-bottom: 10px; }
.cs-decision-text p { color: var(--text-dim) !important; }
.annot-key { display: grid; gap: 12px; margin-top: 18px; }
.annot-key li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 12px; align-items: start; font-size: .94rem; line-height: 1.5; color: var(--cream); }

/* delivered / limits */
.cs-outcome { display: grid; gap: 16px; }
@media (min-width: 900px) { .cs-outcome { grid-template-columns: 1fr 1fr; align-items: start; } }
.cs-outcome > div { padding: 22px; border-radius: 16px; background: rgba(46,36,28,.55); border: 1px solid var(--line); }
.cs-outcome > div:last-child p { color: var(--text-dim); }

/* gallery thumbnails (open the enlarged view) */
.cs-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.cs-thumb {
  display: block; width: 100%; aspect-ratio: 1; padding: 8%;
  border-radius: 12px; overflow: hidden; border: 1px solid var(--line); cursor: zoom-in;
  background: linear-gradient(180deg, rgba(8,6,5,.3), rgba(8,6,5,.62)), url("../img/portfolio-decoration/p01-decoration-64-800.webp?v=13") 50% 50% / cover;
  transition: border-color .25s, transform .4s var(--ease-out);
}
.cs-thumb[data-light] { background: radial-gradient(80% 80% at 50% 45%, #fbf9f2, var(--cream) 60%, #e2d9c3); }
.cs-thumb img { width: 100%; height: 100%; object-fit: contain; }
.cs-thumb:hover { border-color: rgba(251,231,178,.45); transform: translateY(-2px); }
.cs-thumb[aria-current="true"] { border-color: var(--gold-light); }

/* ---------- Case dialog ---------- */
html.case-open { overflow: hidden; }
.case-dialog {
  width: 100%; max-width: none; height: 100%; max-height: none;
  margin: 0; padding: 0; border: 0; background: transparent; color: var(--text);
}
.case-dialog::backdrop { background: rgba(8,6,5,.84); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.case-dialog[open] { display: grid; place-items: center; }
.case-shell {
  position: relative; width: min(100% - 24px, 1480px); height: calc(100% - 24px);
  display: grid; grid-template-rows: minmax(0, 1fr) auto;
  border-radius: var(--radius-lg); overflow: hidden;
  background: #1d1611; border: 1px solid var(--glass-edge);
  box-shadow: 0 60px 120px -40px rgba(0,0,0,.9);
}
@media (prefers-reduced-motion: no-preference) { .case-dialog[open] .case-shell { animation: viewer-in .5s var(--ease-out); } }
.case-scroll { overflow-y: auto; overscroll-behavior: contain; outline: none; }
.case-scroll.is-swapping { opacity: 0; transition: opacity .18s; }
.case-close {
  position: absolute; top: 12px; right: 12px; z-index: 6;
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(8,6,5,.72); border: 1px solid var(--line-strong); color: var(--cream);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: background .3s, color .3s, transform .4s var(--ease-out);
}
.case-close:hover { background: var(--cream); color: var(--black); transform: rotate(90deg); }
.case-close svg { width: 18px; height: 18px; }
.case-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px clamp(14px, 2vw, 28px); border-top: 1px solid var(--line); background: #1d1611;
}
.case-foot .btn { min-height: 44px; padding: 0 16px; font-size: .88rem; }
.case-pos { color: var(--text-faint); font-size: .82rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 379px) { .case-pos { display: none; } }
@media (min-width: 960px) {
  .case-dialog .cs-intro { padding-right: 72px; }
  /* the image stays in view while the intro column scrolls past it */
  .case-dialog .cs-top { align-items: start; }
  .case-dialog .cs-stage { position: sticky; top: 0; height: calc(100vh - 94px); height: calc(100dvh - 94px); min-height: 520px; }
}
@media (max-width: 759px) {
  .case-shell { width: 100%; height: 100%; border-radius: 0; border: 0; }
  .case-foot { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .case-foot .btn { padding: 0 12px; }
}

/* ---------- Lightbox (enlarged images) ---------- */
.lightbox {
  width: 100%; max-width: none; height: 100%; max-height: none;
  margin: 0; padding: 0; border: 0; background: transparent; color: var(--text);
}
.lightbox::backdrop { background: rgba(8,6,5,.9); }
.lightbox[open] { display: grid; place-items: center; }
.lb-shell {
  position: relative; width: min(100% - 24px, 1600px); height: calc(100% - 24px);
  display: grid; grid-template-rows: minmax(0, 1fr) auto;
  border-radius: var(--radius-lg); overflow: hidden; background: rgba(8,6,5,.94); border: 1px solid var(--glass-edge);
}
.lb-stage { position: relative; min-height: 0; }
.lb-scroll { position: absolute; inset: 0; overflow: auto; overscroll-behavior: contain; display: flex; align-items: center; justify-content: center; padding: clamp(16px, 3vw, 48px); }
.lb-scroll.is-light { background: radial-gradient(80% 80% at 50% 45%, #fbf9f2, var(--cream) 60%, #e2d9c3); }
.lb-img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 8px; transition: opacity .25s; }
.lb-img.is-tall { align-self: flex-start; max-height: none; width: min(100%, 760px); }
.lb-img.is-swapping { opacity: 0; }
.lb-nav, .lb-close {
  position: absolute; z-index: 2; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(8,6,5,.65); border: 1px solid var(--line-strong); color: var(--cream);
  transition: background .25s, color .25s;
}
.lb-nav { top: 50%; translate: 0 -50%; } .lb-prev { left: 14px; } .lb-next { right: 14px; }
.lb-close { top: 12px; right: 12px; }
.lb-nav:hover, .lb-close:hover { background: var(--cream); color: var(--black); }
.lb-nav svg, .lb-close svg { width: 18px; height: 18px; }
.lb-count { position: absolute; left: 50%; bottom: 14px; translate: -50% 0; padding: 4px 12px; border-radius: var(--radius-pill); background: rgba(8,6,5,.65); color: var(--text-dim); font-size: .8rem; }
.lb-count:empty { display: none; }
.lb-cap { padding: 14px 20px 16px; color: var(--text-dim); font-size: .9rem; border-top: 1px solid var(--line); }
@media (max-width: 759px) { .lb-shell { width: 100%; height: 100%; border-radius: 0; border: 0; } }

/* narrow phones: the focus switch and intro never push past the screen edge */
@media (max-width: 640px) {
  .page-hero-row { grid-template-columns: minmax(0, 1fr); }
  .path-toggle { min-width: 0; max-width: 100%; }
}
@media (max-width: 374px) {
  .path-opt { white-space: normal; text-align: center; line-height: 1.15; padding: 4px 8px; font-size: .8rem; }
}
