/* Case studies open as a bottom drawer over the blurred homepage (Figma 1431:5784, without the menu) */
.drawer { --drawer-gap: clamp(12px, 1.4vw, 24px); position: fixed; inset: 0; z-index: 100; }
.drawer[hidden] { display: none; }

.drawer__backdrop {
  position: absolute; inset: 0; cursor: pointer;
  background: rgba(24, 24, 22, .22);
  backdrop-filter: blur(18px) saturate(1.15); -webkit-backdrop-filter: blur(18px) saturate(1.15);
  opacity: 0; transition: opacity .45s ease;
}
.drawer.is-open .drawer__backdrop { opacity: 1; }

.drawer__sheet {
  position: absolute; left: 0; right: 0; bottom: 0; top: var(--drawer-gap);
  background: var(--sheet-bg, #f7f7f5);
  border-radius: 12px 12px 0 0; overflow: hidden;
  box-shadow: 0 -12px 48px rgba(0, 0, 0, .14);
  transform: translateY(100%);
  transition: transform .6s cubic-bezier(.32, .72, 0, 1), background-color .6s ease;
}
.drawer.is-open .drawer__sheet { transform: none; }
.drawer.is-dragging .drawer__sheet { transition: none; }
/* Closing: the same slide in reverse (the opening ease, mirrored) */
.drawer.is-closing .drawer__sheet { transition: transform .6s cubic-bezier(1, 0, .68, .28); }
.drawer.is-closing .drawer__backdrop { transition: opacity .6s ease .1s; }
.drawer.is-closing { pointer-events: none; }

.drawer__frame {
  position: absolute; inset: 0; display: block; width: 100%; height: 100%; border: 0; background: transparent;
  transition: opacity .55s ease, transform .7s cubic-bezier(.22, .8, .24, 1);
}
/* Next project: the old page lifts away and fades; the new one rises into place */
.drawer__frame.is-leaving { opacity: 0; transform: translateY(-28px); pointer-events: none;
  transition: opacity .35s ease, transform .38s cubic-bezier(.5, 0, .75, 0); }
.drawer__frame.is-entering { opacity: 0; transform: translateY(40px); pointer-events: none; transition: none; }

/* Grab handle: drag down (or click the blurred strip above) to close */
.drawer__grip {
  position: absolute; z-index: 2; top: 0; left: 50%; transform: translateX(-50%);
  width: 160px; height: 26px; display: flex; justify-content: center; padding-top: 10px;
  cursor: grab; touch-action: none; box-sizing: border-box;
}
.drawer.is-dragging .drawer__grip { cursor: grabbing; }
.drawer__grip span { width: 36px; height: 4px; border-radius: 2px; background: rgba(128, 128, 128, .5); transition: background .2s; }
.drawer__grip:hover span { background: rgba(128, 128, 128, .8); }

html.drawer-open { overflow: hidden; }

@media (max-width: 720px) {
  .drawer { --drawer-gap: 10px; }
  .drawer__sheet { border-radius: 10px 10px 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  .drawer .drawer__sheet, .drawer .drawer__backdrop, .drawer__frame { transition-duration: .01s !important; transition-delay: 0s !important; }
}
