.case-page {
  padding: 0 24px 40px;
  --case-rail-top: 130px;
  --case-gap: 24px;
  --case-copy-font: -apple-system, BlinkMacSystemFont, Arial, sans-serif;
}
.case-page .home-header {
  position: sticky;
  top: 0;
  z-index: 3;
  min-height: 80px;
  margin: 0 -24px;
  padding: 20px 24px;
  background: rgb(255 255 255 / 94%);
  backdrop-filter: blur(12px);
}
.case-page .skip { position: fixed; z-index: 4; }
.case-page .home-avatar:focus-visible { outline-offset: 3px; }
.case-main {
  max-width: var(--project-grid-max-width);
  margin-inline: auto;
  padding-top: 38px;
}
.case-layout, .other-projects {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--case-gap);
}
.case-sidebar {
  position: sticky;
  top: var(--case-rail-top);
  max-height: calc(100dvh - var(--case-rail-top) - 24px);
  overflow: auto;
  scrollbar-width: thin;
  align-self: start;
  display: grid;
  gap: 24px;
}
.case-category, .case-product-link, .case-sidebar h2 {
  color: var(--secondary);
  font-size: 18px;
  font-weight: 400;
  line-height: 26px;
}
.case-intro h1 {
  margin-top: 6px;
  font-size: 26px;
  font-weight: 500;
  line-height: 32px;
}
.case-sidebar section { display: grid; gap: 6px; }
.case-summary, .case-sidebar section p, .case-sidebar li {
  font-family: var(--case-copy-font);
  font-size: 18px;
  line-height: 26px;
  letter-spacing: -.03em;
}
.case-sidebar ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.case-product-link { justify-self: start; text-underline-offset: 3px; }
.case-product-link:is(:hover, :focus-visible) { text-decoration: underline; }
@media (prefers-reduced-motion: no-preference) {
  .case-sidebar > * {
    animation: case-text-in 360ms cubic-bezier(.2, .75, .2, 1)
      calc(90ms + var(--case-text-order, 0) * 34ms) backwards;
  }
  .case-sidebar > :nth-child(2) { --case-text-order: 1; }
  .case-sidebar > :nth-child(3) { --case-text-order: 2; }
  .case-sidebar > :nth-child(4) { --case-text-order: 3; }
  .case-sidebar > :nth-child(5) { --case-text-order: 4; }
}
@keyframes case-text-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
.case-gallery {
  min-width: 0;
  grid-column: span 2;
  display: grid;
  gap: var(--case-gap);
}
.case-main--a101 {
  --art-base: #ed7c73;
  --art-decor: url("assets/home/a101-glow.svg");
  --art-start: -30%;
}
.case-panel {
  container-type: inline-size;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2.61%;
  width: 100%;
  min-width: 0;
  padding: min(3.48%, 40px);
  border-radius: 40px;
  background: var(--art-decor) var(--art-start) 100% no-repeat, var(--art-base);
}
.case-panel--hero {
  aspect-ratio: 920 / 610;
  gap: 3.91%;
  padding: 0;
}
.case-asset {
  display: block;
  min-width: 0;
  overflow: hidden;
  border-radius: clamp(8px, 1.65vw, 22px);
  cursor: zoom-in;
}
.case-asset img { width: 100%; height: auto; }
.case-panel--hero .case-asset {
  flex: 0 0 25.65%;
  border-radius: min(32px, 3.48cqi);
  box-shadow: 0 12px 37px -30px #513899cc, 0 15px 37px -12px #51389940;
}
.case-panel--hero .case-asset img { aspect-ratio: 236 / 513; object-fit: cover; }
.case-panel--phones .case-asset { flex: 1 1 0; }
.case-panel--single .case-asset { max-width: 100%; width: fit-content; }
.case-panel--single .case-asset img { max-width: 100%; }
.case-main--a101 .case-panel--hero .case-asset {
  box-shadow: 0 12px 37px -30px #c25a51cc, 0 15px 37px -12px #c25a5140;
}
.case-section { display: grid; gap: var(--case-gap); }
.case-caption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 14px;
  font-size: 16px;
  line-height: 22px;
}
.case-caption h2 { font-size: inherit; font-weight: 500; }
.case-caption p { color: var(--secondary); }
.other-projects { align-items: center; margin-top: 70px; }
.other-projects > h2 { font-size: 26px; font-weight: 500; line-height: 32px; }
.case-contact { display: flex; justify-content: center; margin-top: 70px; }
body:has(.viewer[open]) { overflow: hidden; }
.viewer {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  color: #fff;
  background: transparent;
}
.viewer::backdrop { background: rgb(10 10 10 / 88%); }
.viewer-scroll {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 64px clamp(12px, 3vw, 48px) 24px;
  cursor: zoom-out;
}
.viewer-image {
  flex: none;
  max-width: min(100%, 1760px);
  height: auto;
  margin: auto;
  cursor: default;
}
.viewer-image:not([src]) { visibility: hidden; }
.viewer-close {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  right: max(10px, env(safe-area-inset-right));
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: #222;
  font: 28px/1 system-ui, sans-serif;
  cursor: pointer;
}
.viewer-close:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
@media (max-width: 900px) {
  .case-page { --case-rail-top: 116px; }
  .case-main { padding-top: 24px; }
  .case-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1.75fr); }
  .case-gallery { grid-column: auto; }
  .case-panel { border-radius: 24px; }
}
@media (max-width: 760px) {
  .case-page { padding-bottom: 60px; --case-gap: 16px; }
  .case-page .home-header { min-height: 60px; padding-block: 20px 0; }
  .case-main { padding-top: 48px; }
  .case-layout, .other-projects { grid-template-columns: minmax(0, 1fr); gap: 60px; }
  .case-sidebar { position: static; max-height: none; overflow: visible; }
  .case-panel { border-radius: 16px; }
  .other-projects { margin-top: 60px; gap: 40px; }
  .other-projects > h2 { line-height: 26px; }
  .case-contact { margin-top: 60px; }
}
.case-gallery-images { display: grid; gap: var(--case-gap); }
.case-gallery-frame { margin: 0; min-width: 0; }
.case-gallery-caption {
  margin-bottom: 12px;
  font-size: 18px;
  line-height: 26px;
}
.case-gallery-frame a { display: block; cursor: zoom-in; }
.case-gallery-frame img {
  width: 100%;
  height: auto;
}
