.case-project-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 20px; width: 100%; margin-bottom: 12px; }
.case-project-links a { display: inline-flex; align-items: center; min-height: 44px; gap: 10px; color: var(--accent, var(--home-turquoise, #32dac8)); text-decoration: underline; text-underline-offset: .24em; }
.case-project-links a:hover { text-decoration-thickness: 2px; }
.case-gallery { margin-block: 32px; }
.case-gallery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 16px; margin-top: 14px; }
.case-gallery-grid figure { min-width: 0; margin: 0; }
.case-gallery-grid a { display: grid; place-items: center; padding: 8px; border-radius: 6px; background: var(--wash, var(--home-bg-soft, #142028)); border: 1px solid var(--rule, var(--home-line-dark, #56616b)); }
.case-gallery-grid a:hover { border-color: currentColor; }
.case-gallery-grid img { display: block; width: 100%; height: 220px; object-fit: contain; }
.case-gallery-grid figcaption { margin-top: 8px; font-size: 15px; color: var(--soft, var(--home-text-muted, inherit)); }
.case-gallery .case-gallery-dialog {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(1520px, calc(100% - 32px));
  max-width: none;
  height: min(980px, calc(100dvh - 32px));
  max-height: none;
  overflow: hidden;
  padding: clamp(12px, 1.65vw, 24px);
  background: var(--surface, #101820);
  color: var(--text, #f5f7fa);
  border: 1px solid color-mix(in srgb, var(--accent, #2ae8c6) 28%, var(--line, #52626f));
  border-radius: 12px;
}
.case-gallery-dialog[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 12px; }
.case-gallery-dialog::backdrop { background: #080d12e8; }
.case-gallery-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 14px; }
.case-gallery-dialog button { min-width: 44px; min-height: 44px; border: 1px solid var(--line, #647581); border-radius: 6px; background: transparent; color: inherit; font: inherit; font-size: 23px; cursor: pointer; }
.case-gallery-dialog button:hover { background: var(--surface2, #32404c); }
.case-gallery-viewer { min-height: 0; min-width: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.case-gallery-frame {
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  min-height: 0;
  min-width: 0;
  padding: clamp(10px, 1.5vw, 24px);
  border: 1px solid var(--line, #52626f);
  border-radius: 8px;
  background: var(--bg, #0b131b);
  overflow: hidden;
}
.case-gallery-frame img { display: block; width: 100%; height: 100%; object-fit: contain; touch-action: pinch-zoom; }
.case-gallery-side { display: flex; justify-content: center; gap: 8px; padding-top: 8px; }
.case-gallery-side[hidden] { display: none; }
.case-gallery-dialog [data-case-caption] { margin: 0; color: var(--muted, #e1e7ec); flex: 1 1 240px; font-size: 15px; line-height: 1.4; }
.case-gallery-dialog [data-case-count] { white-space: nowrap; }
.case-gallery-dialog [data-case-original] { margin-left: auto; color: var(--accent, #85ede1); text-decoration: underline; text-underline-offset: .23em; }
.case-gallery-dialog :focus-visible { outline: 2px solid var(--accent, #85ede1); outline-offset: 3px; }

@media (max-width: 600px) {
  .case-gallery .case-gallery-dialog { width: calc(100% - 16px); height: min(640px, calc(100dvh - 16px)); }
  .case-gallery-dialog[open] { gap: 8px; }
}
