/* Gallery — the specimen cabinet, the casebook, the works wall, GEO and the PDFs. */

.cabinet-hero,
.gallery-body,
.case-dlg,
.lightbox {
  --grp-projects: var(--data-1);
  --grp-skills: var(--accent-ink);
  --grp-community: var(--data-3);
}

/* ── hero tank: the cabinet ────────────────── */

.cabinet-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  min-height: max(760px, min(100svh, 1000px));
  background: #dfe6e6;
}

.cabinet-hero__poster {
  object-position: 62% 40%;
  filter: blur(6px) saturate(0.85);
  transform: scale(1.04);
}

.cabinet-hero.is-live .cabinet-hero__poster {
  opacity: 0;
  transition: opacity 1s var(--ease-out);
}

.cabinet-hero__veil {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgb(238 240 239 / 0.94) 0%, rgb(238 240 239 / 0.82) 26%, rgb(238 240 239 / 0.3) 46%, transparent 58%),
    radial-gradient(ellipse 52% 44% at 22% 22%, rgb(238 240 239 / 0.7), transparent 70%);
}

[data-theme="dark"] .cabinet-hero {
  background: #061720;
}

[data-theme="dark"] .cabinet-hero__poster {
  filter: blur(6px) saturate(0.6) brightness(0.36);
}

[data-theme="dark"] .cabinet-hero__veil {
  background:
    linear-gradient(to bottom, rgb(6 23 32 / 0.92) 0%, rgb(6 23 32 / 0.78) 26%, rgb(6 23 32 / 0.25) 46%, transparent 60%),
    radial-gradient(ellipse 52% 44% at 22% 22%, rgb(6 23 32 / 0.6), transparent 70%);
}

.cabinet-hero__inner {
  grid-row: 1;
  padding-top: calc(var(--header-h) + clamp(40px, 6vh, 76px));
  pointer-events: none;
}

.cabinet-hero__copy {
  max-width: 760px;
  pointer-events: auto;
}

.cabinet-hero__label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9375rem;
  font-weight: 620;
  color: var(--ink-2);
}

.cabinet-hero__label::before {
  content: "";
  width: 18px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

.cabinet-hero__title {
  margin: 12px 0 18px;
}

.cabinet-hero__lede {
  max-width: 50ch;
  color: var(--ink);
  opacity: 0.84;
}

.cabinet-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

/* the canvas owns the middle of the tank; drags start anywhere on it */
.cabinet-hero.has-webgl .tank__canvas {
  cursor: grab;
  touch-action: pan-y;
}

.cabinet-hero.is-dragging .tank__canvas {
  cursor: grabbing;
}

/* the index rail at the foot of the tank */
.cabinet-dock {
  grid-row: 3;
  align-self: end;
  position: relative;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 28px;
  padding: 0 var(--margin) clamp(18px, 2.4vw, 28px);
  pointer-events: none;
}

.cabinet-dock > * {
  pointer-events: auto;
}

.cabinet-dock__hint {
  /* no backdrop-filter: this sits on a live 3D scene or video; blurring it re-reads that
     surface every frame and flickers on some GPUs */
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8125rem;
  font-weight: 560;
  color: var(--ink-2);
  padding: 8px 14px 8px 10px;
  border-radius: var(--r-pill);
  background: var(--surface-glass-solid);
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--line) 60%, transparent) inset;
}

.cabinet-dock__drag {
  position: relative;
  width: 26px;
  height: 14px;
}

.cabinet-dock__drag::before,
.cabinet-dock__drag::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 7px;
  height: 7px;
  border-top: 1.5px solid currentColor;
  border-left: 1.5px solid currentColor;
  translate: 0 -50%;
}

.cabinet-dock__drag::before {
  left: 1px;
  rotate: -45deg;
}

.cabinet-dock__drag::after {
  right: 1px;
  rotate: 135deg;
}

.cabinet-rail {
  /* no backdrop-filter: this sits on a live 3D scene or video; blurring it re-reads that
     surface every frame and flickers on some GPUs */
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 5px;
  border-radius: var(--r-pill);
  background: var(--surface-glass-solid);
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--line) 60%, transparent) inset;
}

.cabinet-rail button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 620;
  font-variant-numeric: lining-nums proportional-nums;
  color: var(--ink-2);
  transition: background-color var(--t-fast), color var(--t-fast), box-shadow var(--t-fast);
}

.cabinet-rail button:hover {
  color: var(--ink);
  box-shadow: 0 0 0 1px var(--line-strong) inset;
}

.cabinet-rail button[aria-current="true"] {
  background: var(--ink);
  color: var(--ink-inverse);
}

.cabinet-rail [data-grp="projects"] button[aria-current="true"] { background: var(--grp-projects); color: #fff; }
.cabinet-rail [data-grp="skills"] button[aria-current="true"] { background: var(--grp-skills); color: #fff; }
.cabinet-rail [data-grp="community"] button[aria-current="true"] { background: var(--grp-community); color: #fff; }

.cabinet-rail li + li[data-break]::before {
  content: "";
  display: block;
  width: 1px;
  height: 16px;
  margin: 7px 3px;
  background: var(--line-strong);
}

.cabinet-rail li[data-break] {
  display: flex;
}

/* hover read-out tied to the plate by a hairline */
.plate-card {
  position: absolute;
  z-index: 6;
  top: 0;
  left: 0;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  width: 340px;
  padding: 10px;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-pop), 0 0 0 1px var(--line-soft) inset;
  pointer-events: none;
  opacity: 0;
  transform: translate3d(var(--x, 0), var(--y, 0), 0) scale(0.97);
  transition: opacity var(--t-fast) var(--ease-out), transform 70ms linear;
}

.plate-card.is-on {
  opacity: 1;
  transform: translate3d(var(--x, 0), var(--y, 0), 0) scale(1);
}

.plate-card__thumb {
  width: 96px;
  height: 96px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-2);
}

.plate-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.plate-card__thumb .mini-flow {
  height: 100%;
  padding: 10px 8px;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 5px;
}

.plate-card__thumb .mini-flow li {
  font-size: 0.5625rem;
  padding: 3px 5px;
}

.plate-card__thumb .mini-flow li::after {
  display: none;
}

.plate-card__body {
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 2px 4px 2px 0;
  min-width: 0;
}

.plate-card__no {
  font-size: 0.75rem;
  font-weight: 650;
  color: var(--grp, var(--ink-3));
}

.plate-card__title {
  font-weight: 640;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.plate-card__status {
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.plate-card__open {
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--ink-3);
}

.cabinet-leader {
  z-index: 5;
  opacity: 0;
  transition: opacity var(--t-fast);
}

.cabinet-leader.is-on {
  opacity: 1;
}

/* no WebGL / reduced motion: the plates as a scrollable grid strip */
.cabinet-fallback {
  grid-row: 2;
  min-width: 0;
  position: relative;
  z-index: 3;
  align-self: end;
  padding: 28px 0 8px;
}

.cabinet-fallback__strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(200px, 19vw, 248px);
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--margin);
  padding: 8px var(--margin) 18px;
  scrollbar-width: thin;
}

.dom-plate {
  scroll-snap-align: start;
}

.dom-plate__btn {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 104px auto 1fr;
  gap: 12px;
  width: 100%;
  height: 100%;
  min-height: 300px;
  padding: 16px;
  border-radius: 20px;
  text-align: left;
  background: var(--surface);
  box-shadow: var(--shadow-float), 0 0 0 1px var(--line-soft) inset;
  transition: transform var(--t-med) var(--ease-out);
}

.dom-plate__btn:hover {
  transform: translateY(-4px);
}

.dom-plate__top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--ink-3);
}

.dom-plate__no {
  font-weight: 680;
  color: var(--grp);
}

.dom-plate .mini-flow {
  height: 104px;
  border-radius: 14px;
}

.dom-plate__title {
  font-weight: 640;
  line-height: 1.28;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dom-plate__status {
  align-self: end;
  font-size: 0.8125rem;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 760px) {
  .cabinet-hero {
    min-height: max(700px, 100svh);
  }

  .cabinet-hero__inner {
    padding-top: calc(var(--header-h) + 40px);
  }

  .cabinet-hero__actions .btn {
    flex: 1 1 auto;
  }

  .cabinet-dock {
    justify-content: center;
  }

  .cabinet-dock__hint {
    display: none;
  }

  .cabinet-rail {
    justify-content: center;
    border-radius: 22px;
    max-width: 340px;
  }

  .cabinet-rail button {
    width: 26px;
    height: 26px;
    font-size: 0.6875rem;
  }

  .cabinet-rail li[data-break]::before {
    display: none;
  }

  .plate-card {
    width: min(300px, calc(100vw - 32px));
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .plate-card__thumb {
    width: 72px;
    height: 72px;
  }
}

/* ── tabs ──────────────────────────────────── */

.gallery-body {
  padding: clamp(40px, 5vw, 72px) 0 var(--section);
}

.gallery-tabs {
  margin-bottom: clamp(36px, 5vw, 64px);
}

.gallery-tabs [role="tab"] {
  font-size: 1rem;
  padding: 16px 0 17px;
}

.gallery-panel:focus-visible {
  outline-offset: 12px;
}

.issue-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9375rem;
  font-weight: 620;
  color: var(--ink-2);
}

.issue-label__mark {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 30%, #fff 0 18%, transparent 19%),
    radial-gradient(circle at 50% 50%, var(--accent) 0 46%, transparent 47%);
  box-shadow: 0 0 0 1px var(--line) inset;
}

.issue-label__mark--teal {
  background:
    radial-gradient(circle at 34% 30%, #fff 0 18%, transparent 19%),
    radial-gradient(circle at 50% 50%, var(--data-1) 0 46%, transparent 47%);
}

/* ── 1. casebook ───────────────────────────── */

.casebook__head {
  display: grid;
  gap: 16px;
  max-width: 860px;
}

.casebook__intro {
  max-width: 62ch;
}

.casebook__tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
  margin-top: clamp(28px, 3.4vw, 44px);
}

.casebook__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.casebook__filters .chip {
  height: 36px;
  padding-inline: 14px;
  font-size: 0.875rem;
}

.casebook__filters .chip__count:not(:empty) {
  margin-left: 2px;
}

.casebook__search {
  position: relative;
  flex: 0 1 340px;
  min-width: 240px;
}

.casebook__search .input {
  padding-left: 42px;
  border-radius: var(--r-pill);
}

.casebook__search-ic {
  position: absolute;
  left: 16px;
  top: 50%;
  translate: 0 -50%;
  color: var(--ink-3);
  pointer-events: none;
}

.casebook__count {
  margin-top: 18px;
  font-size: 0.875rem;
  font-weight: 560;
  color: var(--ink-3);
}

.casebook__loading {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gutter);
  margin-top: 32px;
}

.casebook__skel {
  height: 420px;
  border-radius: var(--r-panel);
}

.casebook__none,
.casebook__error {
  margin-top: 24px;
  border-radius: var(--r-panel);
  background: var(--surface);
}

.case-group {
  margin-top: clamp(40px, 5vw, 64px);
}

.case-group__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 6px 20px;
  padding-top: 18px;
  margin-bottom: 22px;
  border-top: 1px solid var(--line);
}

.case-group__title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.375rem;
  font-weight: 650;
  font-stretch: 92%;
  letter-spacing: -0.015em;
}

.case-group__title::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--grp);
}

.case-group__n {
  font-size: 0.875rem;
  color: var(--ink-3);
  font-weight: 560;
}

.case-group__desc {
  grid-column: 1 / -1;
  font-size: 0.9375rem;
  color: var(--ink-2);
  max-width: 70ch;
}

[data-grp="projects"] { --grp: var(--grp-projects); }
[data-grp="skills"] { --grp: var(--grp-skills); }
[data-grp="community"] { --grp: var(--grp-community); }

/* status line with a stage dot */
.stage {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.8125rem;
  font-weight: 560;
  line-height: 1.4;
  color: var(--ink-2);
}

.stage::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  margin-top: 0.36em;
  border-radius: 50%;
  background: var(--tone, var(--ink-3));
}

.stage--ok { --tone: var(--ok); }
.stage--held { --tone: var(--held); }
.stage--warn { --tone: var(--warn); }
.stage--muted { --tone: var(--ink-3); }

/* a case's own workflow, drawn small */
.mini-flow {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: 14px;
  background:
    radial-gradient(ellipse 80% 90% at 20% 10%, color-mix(in oklab, var(--grp, var(--data-1)) 14%, transparent), transparent 70%),
    var(--surface-2);
  counter-reset: step;
}

.mini-flow li {
  position: relative;
  flex: 1;
  min-width: 0;
  padding: 7px 9px;
  border-radius: 9px;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line-soft) inset;
  font-size: 0.6875rem;
  line-height: 1.3;
  color: var(--ink-2);
  counter-increment: step;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mini-flow li::before {
  content: counter(step);
  display: block;
  margin-bottom: 3px;
  font-weight: 700;
  font-size: 0.625rem;
  color: var(--grp, var(--data-1));
}

.mini-flow li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -14px;
  width: 14px;
  height: 1px;
  background: var(--line-strong);
}

/* projects: plates */
.plates {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gutter);
}

.case-plate {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  border-radius: var(--r-panel);
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line-soft) inset;
  transition: transform var(--t-med) var(--ease-out), box-shadow var(--t-med) var(--ease-out);
}

.case-plate:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-float), 0 0 0 1px var(--line) inset;
}

/* the issue's lead story takes a double plate */
/* the issue's lead story runs the full width; a last plate that would sit alone in its row
   widens to close the row (3 columns: when the count is a multiple of 3) */
.case-plate:first-child,
.case-plate:last-child:nth-child(3n) {
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  grid-template-rows: none;
  align-items: stretch;
}

.case-plate:first-child {
  grid-column: 1 / -1;
}

.case-plate:last-child:nth-child(3n) {
  grid-column: span 2;
}

.case-plate:first-child .case-visual,
.case-plate:last-child:nth-child(3n) .case-visual {
  margin: 10px;
  aspect-ratio: auto;
  min-height: 300px;
}

.case-plate:first-child .case-body,
.case-plate:last-child:nth-child(3n) .case-body {
  align-content: center;
  padding: 26px 30px 26px 14px;
}

/* in a wide plate the picture fills its half instead of setting the height */
.case-plate:first-child .case-visual img,
.case-plate:last-child:nth-child(3n) .case-visual img {
  position: absolute;
  inset: 0;
}

.case-visual {
  position: relative;
  margin: 10px 10px 0;
  aspect-ratio: 16 / 10;
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface-2);
}

.case-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--t-slow) var(--ease-out);
}

.case-plate:hover .case-visual img,
.order:hover .case-visual img,
.wide-case:hover .case-visual img {
  transform: scale(1.025);
}

.case-visual .mini-flow {
  position: absolute;
  inset: 0;
  border-radius: 0;
  padding: 18px;
}

.case-visual__label {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 4px 9px;
  border-radius: var(--r-pill);
  background: rgb(7 22 31 / 0.66);
  color: #eef3f4;
  font-size: 0.6875rem;
  font-weight: 600;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.case-visual__no {
  position: absolute;
  top: 10px;
  left: 10px;
  min-width: 34px;
  height: 26px;
  padding: 0 9px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--grp);
  font-size: 0.75rem;
  font-weight: 700;
  font-variant-numeric: lining-nums proportional-nums;
  box-shadow: 0 1px 2px rgb(11 34 48 / 0.12);
}

.case-body {
  display: grid;
  grid-template-rows: auto auto 1fr auto auto;
  gap: 10px;
  padding: 18px 22px 20px;
}

.case-body__title {
  font-size: 1.1875rem;
  font-weight: 640;
  line-height: 1.28;
  letter-spacing: -0.008em;
}

.case-plate:first-child .case-body__title {
  font-size: 1.5rem;
  font-stretch: 92%;
}

.case-body__summary {
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.case-team {
  display: grid;
  gap: 2px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  font-size: 0.8125rem;
  color: var(--ink-3);
}

.case-team b {
  font-weight: 620;
  color: var(--ink-2);
}

.case-open {
  justify-self: start;
  font-size: 0.9375rem;
  font-weight: 600;
}

/* the whole card opens the story; the link stays the real target */
.case-open::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.case-plate:focus-within,
.order:focus-within,
.wide-case:focus-within {
  box-shadow: 0 0 0 2px var(--focus), var(--shadow-float);
}

.case-open:focus-visible {
  outline: none;
}

/* market specialists: an order ledger */
.orders {
  display: grid;
  border-top: 1px solid var(--line);
}

.order {
  position: relative;
  display: grid;
  grid-template-columns: 56px 168px minmax(0, 1fr) minmax(0, 0.62fr) auto;
  align-items: center;
  gap: 22px;
  padding: 16px 12px 16px 4px;
  border-bottom: 1px solid var(--line);
  border-radius: 14px;
  transition: background-color var(--t-fast);
}

.order:hover {
  background: color-mix(in oklab, var(--surface) 80%, transparent);
}

.order__no {
  font-size: 2rem;
  font-weight: 300;
  font-stretch: 82%;
  letter-spacing: -0.05em;
  line-height: 1;
  color: var(--grp);
}

.order .case-visual {
  margin: 0;
  aspect-ratio: 16 / 10;
  border-radius: 12px;
}


.order .case-visual__label,
.order .case-visual__no {
  display: none;
}

/* a small thumbnail can't hold the step text: show the strand, keep the words for screen readers */
.mini-flow--strand {
  position: relative;
  justify-content: space-between;
  gap: 0;
  padding: 0 20px;
}

.mini-flow--strand::before {
  content: "";
  position: absolute;
  left: 30px;
  right: 30px;
  top: 50%;
  height: 1.5px;
  background: color-mix(in oklab, var(--grp) 45%, var(--line));
}

.mini-flow--strand li {
  position: relative;
  z-index: 1;
  flex: none;
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0;
  color: transparent;
  background: radial-gradient(circle at 35% 32%, #fff 0 14%, var(--grp) 60%, color-mix(in oklab, var(--grp) 60%, #0b2230));
  box-shadow: 0 0 0 3px var(--surface-2);
}

.mini-flow--strand li::before {
  margin: 0;
  font-size: 0.625rem;
  color: #fff;
}

.mini-flow--strand li::after {
  display: none;
}

.order__main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.order__title {
  font-size: 1.0625rem;
  font-weight: 640;
  line-height: 1.3;
}

.order__cat {
  font-size: 0.8125rem;
  color: var(--ink-3);
}

.order__facts {
  display: grid;
  gap: 4px;
  min-width: 0;
  font-size: 0.8125rem;
  color: var(--ink-3);
}

.order__facts b {
  color: var(--ink-2);
  font-weight: 620;
  overflow-wrap: anywhere;
}

.order .case-open {
  white-space: nowrap;
}

/* community products: wide cards */
.wide-cases {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gutter);
}

.wide-case {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  border-radius: var(--r-panel);
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line-soft) inset;
  overflow: hidden;
}

.wide-case .case-visual {
  margin: 10px;
  aspect-ratio: auto;
  min-height: 220px;
}

.wide-case .case-body {
  padding: 22px 22px 22px 8px;
}

@media (max-width: 1100px) {
  .plates {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .case-plate:last-child:nth-child(3n) {
    grid-column: auto;
    grid-template-columns: none;
    grid-template-rows: auto 1fr;
  }

  .case-plate:last-child:nth-child(3n) .case-visual {
    margin: 10px 10px 0;
    aspect-ratio: 16 / 10;
    min-height: 0;
  }

  .case-plate:last-child:nth-child(3n) .case-body {
    padding: 18px 22px 20px;
  }

  .case-plate:last-child:nth-child(even) {
    grid-column: span 2;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    grid-template-rows: none;
  }

  .case-plate:last-child:nth-child(even) .case-visual {
    margin: 10px;
    aspect-ratio: auto;
    min-height: 260px;
  }

  .case-plate:last-child:nth-child(even) .case-visual img {
    position: absolute;
    inset: 0;
  }

  .case-plate:last-child:nth-child(3n) .case-visual img {
    position: static;
  }

  .order {
    grid-template-columns: 48px 140px minmax(0, 1fr) auto;
  }

  .order__facts {
    grid-column: 3;
    grid-row: 2;
  }

  .order .case-open {
    grid-column: 4;
    grid-row: 1 / span 2;
  }

  .wide-cases {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 700px) {
  .casebook__loading,
  .plates {
    grid-template-columns: minmax(0, 1fr);
  }

  .case-plate:first-child,
  .case-plate:last-child:nth-child(even),
  .case-plate:last-child:nth-child(3n) {
    grid-column: auto;
    grid-template-columns: none;
    grid-template-rows: auto 1fr;
  }

  .case-plate:first-child .case-visual,
  .case-plate:last-child:nth-child(even) .case-visual,
  .case-plate:last-child:nth-child(3n) .case-visual {
    margin: 10px 10px 0;
    aspect-ratio: 16 / 10;
    min-height: 0;
  }

  .case-plate:first-child .case-body,
  .case-plate:last-child:nth-child(even) .case-body,
  .case-plate:last-child:nth-child(3n) .case-body {
    padding: 18px 22px 20px;
  }

  .case-plate:first-child .case-visual img,
  .case-plate:last-child:nth-child(even) .case-visual img,
  .case-plate:last-child:nth-child(3n) .case-visual img {
    position: static;
  }

  .casebook__search {
    flex: 1 1 100%;
  }

  .order {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 10px 14px;
    padding: 18px 4px;
  }

  .order .case-visual {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .order__no {
    grid-row: 2;
    font-size: 1.6rem;
  }

  .order__main {
    grid-row: 2;
  }

  .order__facts {
    grid-column: 2;
    grid-row: 3;
  }

  .order .case-open {
    grid-column: 2;
    grid-row: 4;
  }

  .wide-case {
    grid-template-columns: minmax(0, 1fr);
  }

  .wide-case .case-visual {
    min-height: 0;
    aspect-ratio: 16 / 10;
    margin-bottom: 0;
  }

  .wide-case .case-body {
    padding: 18px 22px 22px;
  }
}

/* the names behind the work */
.credits {
  display: grid;
  gap: clamp(36px, 4vw, 52px);
  margin-top: clamp(64px, 8vw, 112px);
  padding: clamp(28px, 4vw, 52px);
  border-radius: var(--r-panel);
  background: var(--surface);
}

.credits__group {
  display: grid;
  gap: 10px;
}

.credits__title {
  font-size: 1.25rem;
  font-weight: 650;
  font-stretch: 92%;
}

.credits__note {
  font-size: 0.875rem;
  color: var(--ink-3);
  max-width: 72ch;
}

.credits__wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.credit {
  position: relative;
  display: grid;
  place-items: center;
  height: 80px;
  padding: 0 16px;
  border-radius: 14px;
  background: var(--surface-2);
  text-align: center;
  transition: background-color var(--t-fast);
}

.credit:hover {
  background: color-mix(in oklab, var(--surface-2) 70%, var(--surface));
}

.credit__logo {
  max-width: 116px;
  max-height: 32px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: brightness(0);
  opacity: 0.62;
  transition: opacity var(--t-fast);
}

[data-theme="dark"] .credit__logo {
  filter: brightness(0) invert(1);
  opacity: 0.72;
}

.credit:hover .credit__logo {
  opacity: 0.9;
}

.credit--logo .credit__word {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.credit--logo.is-broken .credit__logo {
  display: none;
}

.credit--logo.is-broken .credit__word,
.credit:not(.credit--logo) .credit__word {
  position: static !important;
  width: auto;
  height: auto;
  clip: auto;
  font-size: 1.0625rem;
  font-weight: 720;
  font-stretch: 84%;
  letter-spacing: -0.02em;
  color: var(--ink-2);
  line-height: 1.15;
}

.credits__users {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  padding-top: 22px;
  border-top: 1px solid var(--line-soft);
  font-size: 0.875rem;
  color: var(--ink-3);
}

.credits__users-n {
  font-size: 2rem;
  font-weight: 340;
  font-stretch: 84%;
  letter-spacing: -0.04em;
  color: var(--ink);
}

/* ── 2. works wall ─────────────────────────── */

.works__head {
  display: grid;
  gap: 14px;
  justify-items: start;
  max-width: 860px;
}

.works__intro {
  max-width: 64ch;
}

.works__link {
  font-weight: 560;
}

.works__bar {
  display: grid;
  gap: 10px;
  margin: clamp(28px, 3.4vw, 44px) 0 28px;
  padding: 16px 18px;
  border-radius: var(--r-panel);
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line-soft) inset;
}

.works__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
}

.works__row[hidden] {
  display: none;
}

.works__lab {
  flex: 0 0 64px;
  font-size: 0.8125rem;
  font-weight: 620;
  color: var(--ink-3);
}

.works__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.works__count {
  margin-left: auto;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-2);
}

.works__grid {
  columns: 3 260px;
  column-gap: 18px;
}

.wtile {
  break-inside: avoid;
  margin-bottom: 22px;
}

.wtile__btn {
  display: block;
  width: 100%;
  text-align: left;
  border-radius: 18px;
}

.wtile__btn:focus-visible {
  outline-offset: 4px;
}

.wtile__media {
  position: relative;
  display: block;
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface-2);
  isolation: isolate;
}

.wtile__media img,
.wtile__media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 28%;
}

.wtile__media img {
  opacity: 0;
  transition: opacity var(--t-slow) var(--ease-out), transform var(--t-slow) var(--ease-out);
}

.wtile__media img.is-on {
  opacity: 1;
}

.wtile__media video {
  z-index: 1;
  opacity: 0;
  transition: opacity var(--t-med);
}

.wtile__media video.is-on {
  opacity: 1;
}

.wtile__btn:hover .wtile__media img {
  transform: scale(1.02);
}

.wtile__dur,
.wtile__play {
  position: absolute;
  z-index: 2;
  display: inline-grid;
  place-items: center;
  border-radius: var(--r-pill);
  background: rgb(7 22 31 / 0.62);
  color: #fff;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: opacity var(--t-med);
}

.wtile__dur {
  right: 10px;
  bottom: 10px;
  height: 22px;
  padding: 0 8px;
  font-size: 0.6875rem;
  font-weight: 650;
  font-variant-numeric: lining-nums proportional-nums;
}

.wtile__play {
  left: 10px;
  bottom: 10px;
  width: 30px;
  height: 30px;
}

.wtile__play .icon {
  width: 13px;
  height: 13px;
  fill: currentColor;
  margin-left: 2px;
}

.wtile__btn:hover .wtile__dur,
.wtile.is-previewing .wtile__dur {
  opacity: 0;
}

.wtile__body {
  display: grid;
  gap: 4px;
  padding: 12px 4px 0;
}

.wtile__title {
  font-weight: 620;
  font-size: 0.9375rem;
  line-height: 1.35;
}

.wtile__meta {
  font-size: 0.8125rem;
  color: var(--ink-3);
}

.wtile__ev {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.75rem;
  color: var(--ink-3);
}

.wtile__ev::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ev, var(--line-strong));
}

.wtile__ev--settled {
  --ev: var(--ok);
}

/* concept cases: an open ring, never the settled dot */
.wtile__ev--concept::before {
  background: transparent;
  box-shadow: 0 0 0 1.5px var(--ink-3) inset;
}

.wtile__badge {
  position: absolute;
  z-index: 2;
  top: 10px;
  left: 10px;
  display: inline-grid;
  place-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: var(--r-pill);
  background: var(--brand-grad, var(--accent));
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 720;
  letter-spacing: 0.01em;
  box-shadow: 0 2px 10px rgb(11 34 48 / 0.28);
}

.works__notice {
  column-span: all;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 22px;
  padding: 14px 16px;
  border-radius: var(--r-card);
  background: var(--warn-soft);
  color: var(--ink-2);
  font-size: 0.9rem;
}

.wtile--skel {
  break-inside: avoid;
  margin-bottom: 22px;
}

.wtile__skel {
  display: block;
  border-radius: 16px;
}

.works__none,
.works__soon {
  border-radius: var(--r-panel);
  background: var(--surface);
}

.works__soon-actions {
  justify-content: center;
  margin-top: 8px;
}

@media (max-width: 560px) {
  .works__grid {
    columns: 2 150px;
    column-gap: 12px;
  }

  .wtile__title {
    font-size: 0.875rem;
  }

  .works__lab {
    flex-basis: 100%;
  }

  .works__count {
    margin-left: 0;
  }
}

/* ── 3. GEO ────────────────────────────────── */

.geo__intro {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(28px, 4vw, 64px);
  align-items: center;
}

.geo__copy {
  display: grid;
  gap: 16px;
  justify-items: start;
}

.geo__shot {
  margin: 0;
}

.geo__frame {
  position: relative;
  padding: 30px 8px 8px;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-float), 0 0 0 1px var(--line-soft) inset;
}

.geo__dots {
  position: absolute;
  top: 12px;
  left: 14px;
  display: flex;
  gap: 6px;
}

.geo__dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line);
}

.geo__frame img {
  width: 100%;
  border-radius: 12px;
}

.geo__cap {
  margin-top: 10px;
  font-size: 0.8125rem;
  color: var(--ink-3);
}

.geo__steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: clamp(44px, 6vw, 80px);
  border-top: 1px solid var(--line);
}

.geo__step {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 22px 24px 24px 0;
}

.geo__step + .geo__step {
  padding-left: 24px;
  border-left: 1px solid var(--line);
}

.geo__n {
  font-size: 2.75rem;
  font-weight: 300;
  font-stretch: 82%;
  line-height: 1;
  letter-spacing: -0.05em;
  color: var(--data-1);
}

.geo__step-t {
  font-size: 1.125rem;
  font-weight: 640;
}

.geo__step p {
  font-size: 0.9375rem;
  color: var(--ink-2);
}

.geo__notes {
  display: grid;
  gap: 8px;
  margin-top: 28px;
  font-size: 0.875rem;
  color: var(--ink-3);
  max-width: 82ch;
}

@media (max-width: 960px) {
  .geo__intro {
    grid-template-columns: minmax(0, 1fr);
  }

  .geo__steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .geo__step:nth-child(3) {
    padding-left: 0;
    border-left: 0;
  }

  .geo__step:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 560px) {
  .geo__steps {
    grid-template-columns: minmax(0, 1fr);
  }

  .geo__step,
  .geo__step + .geo__step {
    padding: 20px 0;
    border-left: 0;
  }

  .geo__step + .geo__step {
    border-top: 1px solid var(--line);
  }
}

/* contact card (GEO and PDFs) */
.contact-card {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.8fr) minmax(0, 1fr);
  gap: 24px 40px;
  align-items: center;
  margin-top: clamp(48px, 6vw, 80px);
  padding: clamp(24px, 3vw, 40px);
  border-radius: var(--r-panel);
  background:
    radial-gradient(ellipse 60% 120% at 100% 0%, color-mix(in oklab, var(--data-1) 10%, transparent), transparent 70%),
    var(--surface);
  box-shadow: 0 0 0 1px var(--line-soft) inset;
}

.contact-card__copy {
  display: grid;
  gap: 8px;
}

.contact-card__lede {
  color: var(--ink-2);
  max-width: 46ch;
}

.contact-card__person {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 14px;
  align-items: center;
}

.contact-card__avatar {
  --size: 48px;
  grid-row: span 2;
}

.contact-card__name {
  font-weight: 660;
}

.contact-card__role {
  font-size: 0.875rem;
  color: var(--ink-3);
}

.contact-card__lines {
  display: grid;
  gap: 8px;
}

.contact-card__lines > div {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  font-size: 0.9375rem;
}

.contact-card__lines dt {
  font-size: 0.8125rem;
  color: var(--ink-3);
}

.contact-card__lines dd {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  min-width: 0;
}

.contact-card__id {
  font-weight: 620;
  font-variant-numeric: lining-nums proportional-nums;
}

.contact-card__copy-btn {
  height: 26px;
  padding: 0 10px;
  border-radius: var(--r-pill);
  box-shadow: 0 0 0 1px var(--line) inset;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-2);
}

.contact-card__copy-btn:hover,
.contact-card__copy-btn.is-done {
  color: var(--ink);
  box-shadow: 0 0 0 1px var(--line-strong) inset;
}

@media (max-width: 1000px) {
  .contact-card {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ── 4. PDFs ───────────────────────────────── */

.pdfs__head {
  display: grid;
  gap: 16px;
  max-width: 860px;
}

.pdfs__list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--gutter);
  margin-top: clamp(32px, 4vw, 56px);
  align-items: start;
}

.pdf__link {
  display: grid;
  gap: 16px;
}

.pdf__cover {
  display: grid;
  place-items: end center;
  aspect-ratio: 3 / 4;
  padding: 18px 14px 0;
  border-radius: 20px;
  background:
    radial-gradient(ellipse 70% 50% at 50% 100%, color-mix(in oklab, var(--ink) 10%, transparent), transparent 70%),
    var(--surface-2);
  overflow: hidden;
}

.pdf__cover img {
  width: 82%;
  height: auto;
  border-radius: 4px 4px 0 0;
  box-shadow: 0 -2px 0 rgb(255 255 255 / 0.6) inset, 0 18px 40px -12px rgb(11 34 48 / 0.4);
  transform-origin: 50% 100%;
  transition: transform var(--t-slow) var(--ease-out);
}

.pdf--wide .pdf__cover img {
  width: 100%;
  margin-bottom: 18%;
  border-radius: 4px;
}

.pdf__link:hover .pdf__cover img {
  transform: translateY(-8px) rotate(-1.4deg);
}

.pdf__body {
  display: grid;
  gap: 6px;
}

.pdf__name {
  font-weight: 640;
  line-height: 1.3;
}

.pdf__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 0.8125rem;
  color: var(--ink-3);
}

.pdf__lang {
  padding-left: 10px;
  border-left: 1px solid var(--line);
}

.pdf__open {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--link);
}

.pdf__link:hover .pdf__open span {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

@media (max-width: 1100px) {
  .pdfs__list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .pdfs__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 14px;
  }
}

/* ── case dialog ───────────────────────────── */

.case-dlg__panel {
  padding: clamp(24px, 3.4vw, 48px);
}

.case-dlg__body {
  display: grid;
  gap: 18px;
}

.case-dlg__kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 44px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-3);
}

.case-dlg__no {
  min-width: 38px;
  height: 26px;
  padding: 0 10px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--r-pill);
  background: var(--grp, var(--ink));
  color: #fff;
  font-weight: 700;
  font-size: 0.75rem;
}

.case-dlg__status .stage {
  font-size: 0.9375rem;
}

.case-dlg__title {
  max-width: 24ch;
}

.case-dlg__summary {
  max-width: 64ch;
}

.case-dlg__figure {
  margin: 6px 0 0;
}

.case-dlg__media {
  overflow: hidden;
  border-radius: 20px;
  background: var(--surface-2);
  box-shadow: 0 0 0 1px var(--line-soft) inset;
}

.case-dlg__media img {
  width: auto;
  max-width: 100%;
  max-height: 540px;
  margin-inline: auto;
  object-fit: contain;
}

.case-dlg__media .mini-flow {
  min-height: 160px;
  border-radius: 0;
  padding: 28px;
}

.case-dlg__media .mini-flow li {
  font-size: 0.8125rem;
  padding: 12px 14px;
}

.case-dlg__media .mini-flow li::before {
  font-size: 0.75rem;
}

.case-dlg__caption {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 10px;
  font-size: 0.8125rem;
  color: var(--ink-3);
}

.case-dlg__tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--ink-2);
  font-weight: 600;
  font-size: 0.75rem;
}

.case-dlg__cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 6px;
}

.case-dlg__col {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 22px 24px;
  border-radius: 18px;
  background: var(--surface-2);
}

.case-dlg__h {
  font-size: 1rem;
  font-weight: 650;
}

.case-dlg__col p {
  color: var(--ink-2);
}

.case-dlg__list {
  display: grid;
  gap: 8px;
}

.case-dlg__list li {
  position: relative;
  padding-left: 22px;
  color: var(--ink-2);
}

.case-dlg__list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.42em;
  width: 10px;
  height: 6px;
  border-left: 1.6px solid var(--ok);
  border-bottom: 1.6px solid var(--ok);
  transform: rotate(-45deg);
}

.case-dlg__flow {
  display: grid;
  gap: 14px;
  margin-top: 8px;
}

/* the workflow as a numbered rail (a real sequence) */
.flow {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--steps, 4), minmax(0, 1fr));
  gap: 16px;
  padding-top: 8px;
}

.flow::before {
  content: "";
  position: absolute;
  top: 26px;
  left: 18px;
  right: 18px;
  height: 1px;
  background: color-mix(in oklab, var(--grp, var(--data-1)) 50%, var(--line));
}

.flow li {
  position: relative;
  display: grid;
  gap: 10px;
  align-content: start;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--ink-2);
}

.flow__n {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 0 0 1.5px var(--grp, var(--data-1)) inset;
  color: var(--grp, var(--data-1));
  font-weight: 700;
  font-size: 0.8125rem;
  font-variant-numeric: lining-nums proportional-nums;
}

.case-dlg__fine {
  font-size: 0.8125rem;
  color: var(--ink-3);
}

.case-dlg__people {
  display: grid;
  gap: 12px;
  margin-top: 8px;
}

.case-dlg__team {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.person {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 14px;
  align-items: center;
  padding: 16px 18px;
  border-radius: 16px;
  box-shadow: 0 0 0 1px var(--line) inset;
}

.person .avatar {
  --size: 42px;
  grid-row: span 3;
}

.person__k {
  font-size: 0.75rem;
  font-weight: 620;
  color: var(--ink-3);
}

.person__name {
  font-weight: 660;
}

.person__role {
  font-size: 0.875rem;
  color: var(--ink-2);
}

.case-dlg__order {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--held-soft);
  font-size: 0.875rem;
  color: var(--ink-2);
}

.case-dlg__order b {
  color: var(--ink);
  font-weight: 640;
}

.case-dlg__notes {
  display: grid;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--ink-3);
  max-width: 78ch;
}

.case-dlg__notes b {
  color: var(--ink-2);
  font-weight: 620;
}

.case-dlg__related {
  display: grid;
  gap: 12px;
  margin-top: 8px;
}

.case-dlg__works {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.case-dlg__works button {
  display: grid;
  gap: 6px;
  width: 100%;
  text-align: left;
  font-size: 0.75rem;
  color: var(--ink-3);
}

.case-dlg__works .thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-2);
}

.case-dlg__works img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--t-med) var(--ease-out);
}

.case-dlg__works button:hover img {
  transform: scale(1.04);
}

.case-dlg__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding-top: 22px;
  border-top: 1px solid var(--line-soft);
}

.case-dlg__actions .has-claw {
  margin-left: auto;
}

@media (max-width: 760px) {
  .case-dlg__cols,
  .case-dlg__team {
    grid-template-columns: minmax(0, 1fr);
  }

  .flow {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    padding-left: 52px;
    padding-top: 0;
  }

  .flow::before {
    top: 18px;
    bottom: 18px;
    left: 18px;
    right: auto;
    width: 1px;
    height: auto;
  }

  .flow li {
    min-height: 36px;
    align-content: center;
  }

  .flow__n {
    position: absolute;
    left: -52px;
    top: 0;
  }

  .case-dlg__actions .has-claw {
    margin-left: 0;
  }

  .case-dlg__actions .btn {
    width: 100%;
  }
}

/* ── lightbox ──────────────────────────────── */

.lightbox {
  --dialog-w: 1240px;
}

.lightbox__panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  padding: 0;
  overflow: hidden;
  background: #061219;
  color: #e7eef0;
}

.lightbox__close {
  color: #cfdde1;
  background: rgb(255 255 255 / 0.06);
}

.lightbox__close:hover {
  background: rgb(255 255 255 / 0.14);
  color: #fff;
}

.lightbox__stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: min(70svh, 640px);
  background: #000;
}

.lightbox__video {
  width: 100%;
  height: 100%;
  max-height: min(80svh, 720px);
  object-fit: contain;
  background: #000;
}

/* a short preview standing in for a full video that is not available */
.lightbox__badge {
  position: absolute;
  z-index: 2;
  top: 14px;
  left: 14px;
  display: inline-grid;
  place-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: var(--r-pill);
  background: rgb(7 22 31 / 0.72);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  pointer-events: none;
}

.lightbox__step {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgb(7 22 31 / 0.62);
  color: #fff;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0.82;
  transition: opacity var(--t-fast), background-color var(--t-fast);
}

.lightbox__step:hover {
  opacity: 1;
  background: rgb(7 22 31 / 0.82);
}

.lightbox__step--prev {
  left: 14px;
}

.lightbox__step--next {
  right: 14px;
}

.lightbox__side {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 60px 26px 26px;
  --ink: #e7eef0;
  --ink-2: #b5c6cc;
  --ink-3: #8aa1a9;
  --line: #1f3a4b;
  --line-soft: #173142;
  --surface: #0c2230;
  --surface-2: #122b3b;
}

.lightbox__kind {
  font-size: 0.8125rem;
  font-weight: 620;
  color: #8ad1d2;
}

.lightbox__title {
  color: #f3f7f8;
}

.lightbox__ev {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--ink-2);
}

.lightbox__ev::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ev, #4d6b78);
}

.lightbox__ev--settled {
  --ev: #5cc28f;
}

.lightbox__ev--concept::before {
  background: transparent;
  box-shadow: 0 0 0 1.5px #8aa1a9 inset;
}

.lightbox__facts {
  display: grid;
  margin-top: 6px;
  border-top: 1px solid var(--line);
}

.lightbox__facts > div {
  display: grid;
  gap: 2px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.lightbox__facts dt {
  font-size: 0.75rem;
  color: var(--ink-3);
}

.lightbox__facts dd {
  margin: 0;
  font-size: 0.875rem;
  color: var(--ink);
}

.lightbox__fine {
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--ink-3);
}

.lightbox__actions {
  display: grid;
  gap: 8px;
  margin-top: 6px;
}

.lightbox__actions .btn {
  width: 100%;
}

.lightbox__actions .btn--primary {
  --btn: #e7eef0;
  --btn-ink: #07161f;
  --btn-hover: #fff;
}

.lightbox__actions .btn--secondary {
  background: transparent;
  color: #e7eef0;
  box-shadow: 0 0 0 1px #2f5063 inset;
}

.lightbox__actions .btn--secondary:hover {
  background: rgb(255 255 255 / 0.06);
}

.lightbox__pos {
  font-size: 0.75rem;
  color: var(--ink-3);
}

@media (max-width: 900px) {
  .lightbox__panel {
    grid-template-columns: minmax(0, 1fr);
    max-height: 94svh;
    overflow-y: auto;
  }

  .lightbox__stage {
    min-height: 0;
  }

  .lightbox__video {
    max-height: 52svh;
  }

  .lightbox__side {
    padding: 20px 20px 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .case-plate,
  .dom-plate__btn,
  .pdf__cover img,
  .case-visual img {
    transition: none;
  }
}
