.works-page .page-hero { padding-bottom: clamp(34px, 5vw, 65px); }
.works-page .section { padding-block: clamp(34px, 5vw, 68px); }
.works-page .section-head { margin-bottom: 21px; }
.works-page .page-hero h1 { max-width: 22ch; overflow-wrap: anywhere; }

.case-filter-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px 18px;
  margin-bottom: 17px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
}
.case-filter-bar fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.case-filter-bar legend { margin-bottom: 8px; padding: 0; font-size: .83rem; font-weight: 710; }
.case-filter-options { display: flex; flex-wrap: wrap; gap: 6px; }
.case-filter-options label { position: relative; max-width: 100%; }
.case-filter-options input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.case-filter-options span {
  display: flex;
  align-items: center;
  min-height: 41px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  font-size: .8rem;
  font-weight: 620;
  line-height: 1.3;
  cursor: pointer;
}
.case-filter-options label:hover span { border-color: var(--orange-ink); }
.case-filter-options input:checked + span {
  border-color: var(--orange-ink);
  background: var(--orange);
}
.case-filter-options input:focus-visible + span { outline: 2px solid var(--orange-ink); outline-offset: 2px; }
.case-filter-count { padding-block: 5px; font-size: .82rem; font-weight: 650; white-space: nowrap; }

.case-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.home-works-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.case-card { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.case-card-cover { border-bottom: 1px solid var(--line); background: var(--paper); }
.case-card-cover img, .case-photo-placeholder { width: 100%; aspect-ratio: 2.1; object-fit: cover; }
.case-photo-placeholder { display: grid; place-items: center; background: var(--paper); }
.case-photo-placeholder .empty-work-icon { width: 41px; height: 41px; background: var(--white); }
.case-photo-placeholder .empty-work-icon > span { width: 20px; height: 15px; }
.case-card-copy { display: flex; flex: 1; flex-direction: column; gap: 8px; padding: 15px; }
.case-card-label { color: var(--orange-ink); font-size: .78rem; font-weight: 700; line-height: 1.3; }
.case-card h3 { line-height: 1.19; overflow-wrap: anywhere; }
.case-card-summary { font-size: .91rem; }
.case-card .text-link { margin-top: auto; padding-top: 4px; }
.home-works-empty .text-link { flex: 0 0 auto; margin-left: auto; }

.works-page .page-hero .case-example-tag {
  width: fit-content;
  max-width: 100%;
  margin-top: 15px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--white);
  color: var(--orange-ink);
  font-size: .81rem;
  font-weight: 680;
}
.case-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(200px, .36fr);
  gap: 22px clamp(18px, 4vw, 52px);
  align-items: start;
}
.case-story {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  padding-inline: clamp(14px, 2.8vw, 33px);
}
.case-story-section { padding-block: clamp(13px, 2vw, 22px); }
.case-story-section + .case-story-section { border-top: 1px solid var(--line); }
.case-story-section h2, .case-services h2 {
  font-size: clamp(1.19rem, 2.2vw, 1.67rem);
  line-height: 1.2;
  letter-spacing: -.038em;
}
.case-story-section p { margin-top: 6px; white-space: pre-line; overflow-wrap: anywhere; }
.case-table { margin-top: 10px; }
.case-table table { table-layout: fixed; }
.case-table th, .case-table td { padding: 8px 6px 8px 0; text-align: left; white-space: normal; overflow-wrap: anywhere; }
.case-table th:first-child { width: 46%; }
.case-extra { margin-top: 15px; }
.case-extra h3 { font-size: 1rem; }
.case-extra dl { margin-bottom: 0; }
.case-extra dl > div { padding: 5px 0; }
.case-extra dt { font-weight: 680; }
.case-extra dd { margin: 0; color: var(--secondary); overflow-wrap: anywhere; }

.case-gallery-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.case-gallery-grid figure { overflow: hidden; border: 1px solid var(--line); border-radius: 5px; background: var(--white); }
.case-gallery-grid figure > *:first-child { border-bottom: 1px solid var(--line); }
.case-gallery-grid figcaption { padding: 8px 9px; color: var(--secondary); font-size: .84rem; line-height: 1.34; overflow-wrap: anywhere; }
.case-gallery-image { display: block; position: relative; }
.case-gallery-image:focus-visible { outline-offset: -3px; }
.case-gallery-image img, .case-gallery-grid .case-photo-placeholder { width: 100%; aspect-ratio: 1.55; object-fit: cover; }
.case-gallery-image span {
  position: absolute;
  right: 7px;
  bottom: 7px;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--white);
  color: var(--orange-ink);
}
.case-lightbox {
  width: min(96vw, 1040px);
  max-height: 94vh;
  max-height: 94dvh;
  padding: clamp(9px, 2vw, 20px);
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--white);
  color: var(--ink);
}
.case-lightbox::backdrop { background: rgba(28, 35, 38, .82); }
.case-lightbox-head, .case-lightbox-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.case-lightbox-head { margin-bottom: 9px; }
.case-lightbox-head h3 { font-size: 1.06rem; }
.case-lightbox-frame { background: var(--muted); }
.case-lightbox-frame img {
  width: 100%;
  height: auto;
  max-height: min(65vh, 670px);
  max-height: min(65dvh, 670px);
  object-fit: contain;
}
.case-lightbox-nav { margin-top: 9px; text-align: center; }
.case-lightbox-nav p { overflow-wrap: anywhere; }
.case-lightbox [data-gallery-position] { font-size: .8rem; }
.case-lightbox button {
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 44px;
  padding-inline: 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 680;
}
.case-lightbox button:hover { border-color: var(--orange-ink); }

.case-cta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px 22px;
  padding: clamp(15px, 3vw, 31px);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
}
.case-cta h2 { font-size: clamp(1.5rem, 2.9vw, 2.55rem); }
.case-cta p { margin-top: 7px; }
.case-cta .button { flex: 0 0 auto; }

@media (max-width: 820px) {
  .case-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .case-filter-bar { grid-template-columns: minmax(0, 1fr); }
  .case-filter-count { padding-block: 0; }
}
@media (max-width: 620px) {
  .case-grid, .case-layout { grid-template-columns: minmax(0, 1fr); }
  .case-gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .case-filter-options span { min-height: 44px; }
  .case-table table { font-size: .81rem; }
  .case-table th:first-child { width: 41%; }
  .case-cta { flex-direction: column; align-items: flex-start; }
  .home-works-empty { display: grid; grid-template-columns: auto minmax(0, 1fr); }
  .home-works-empty .text-link { grid-column: 2; margin-left: 0; }
}

.case-videos-heading { margin-top: 1.5rem; }
.case-gallery-grid.case-videos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.case-videos video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #161616; }
@media (max-width: 540px) {
  .case-gallery-grid.case-videos { grid-template-columns: 1fr; }
}
