@font-face {
  font-family: "Hanken Grotesk V2";
  src: url("/assets/fonts/HankenGrotesk-V2-SemiBold.ttf") format("truetype");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Hanken Grotesk V2";
  src: url("/assets/fonts/HankenGrotesk-V2-ExtraBold.ttf") format("truetype");
  font-style: normal;
  font-weight: 800;
  font-display: swap;
}

@font-face {
  font-family: "Hanken Grotesk V2";
  src: url("/assets/fonts/HankenGrotesk-900.ttf") format("truetype");
  font-style: normal;
  font-weight: 900;
  font-display: swap;
}

.case-study {
  --case-columns: 4;
  --case-margin: 12px;
  --case-gutter: 20px;
  --case-spacing: 20px;
  --case-copy-size: 16px;
  background: #fff;
  font-family: "Hanken Grotesk V2", "Hanken Grotesk", Arial, sans-serif;
}

.case-grid {
  display: grid;
  grid-template-columns: repeat(var(--case-columns), minmax(0, 1fr));
  column-gap: var(--case-gutter);
}

.case-content, .case-footer {
  margin-inline: var(--case-margin);
}

.case-header {
  padding: 13px var(--case-margin) 0;
  margin-bottom: 24px;
}

.case-nav {
  font-family: "Portfolio Nav", "Hanken Grotesk V2", Arial, sans-serif;
  min-height: 34px;
  align-items: start;
  justify-items: start;
  font-size: 16px;
  font-weight: 800;
  line-height: 25px;
  letter-spacing: -.03em;
}

.case-brand { grid-column: span 2; }
.case-info { grid-column: 3; }
.case-contact { grid-column: 4; }

.case-nav button, .case-footer button {
  padding: 0;
  background: none;
  letter-spacing: inherit;
  cursor: pointer;
}

.case-heading {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.case-content { row-gap: var(--case-spacing); }
.case-content > * { grid-column: 1 / -1; }

.case-copy {
  min-width: 0;
  font-size: var(--case-copy-size);
  font-weight: 600;
  line-height: 1.2544;
  letter-spacing: -.06em;
  overflow-wrap: break-word;
}

.case-image {
  margin: 0;
  background: #fff;
  overflow: clip;
  aspect-ratio: 16 / 9;
}

.case-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.case-footer {
  margin-block: 32px 0;
  padding-bottom: 20px;
  font-size: 32px;
  font-weight: 900;
  line-height: 1.2544;
  letter-spacing: -.06em;
}

.case-footer button { justify-self: start; }
.case-footer a:first-of-type {
  grid-column: span 2;
  justify-self: center;
}
.case-footer a:last-of-type { justify-self: end; }

.sfw-hero {
  margin-inline: calc(-1 * var(--case-margin));
  aspect-ratio: 3 / 2;
}

.sfw-detail .case-image { background: #f4f4f4; }
.sfw-detail .sfw-logo { background: #e3e3e3; }
.sfw-detail .case-image picture { display: block; height: 100%; }
.sfw-detail .case-image img { object-fit: cover; }

.sfw-social, .sfw-shopfront, .sfw-device { position: relative; }

.sfw-screen {
  position: absolute;
  display: block;
  padding: 0;
  background: transparent;
  overflow: clip;
  cursor: pointer;
}

.sfw-screen:focus-visible { outline-color: #bfff00; outline-offset: -2px; }

.sfw-screen video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  visibility: hidden;
}

.sfw-screen[data-video-ready] video { visibility: visible; }

/* Insets match the screen and post edges in the supplied stills. */
.sfw-screen-type { inset: 56.934% 39.1604% 5.8897% 38.5338%; }
.sfw-screen-flash { inset: 56.934% 7.1742% 5.5973% 70.3321%; }
.sfw-screen-laptop {
  inset: 5.6391% 6.0464% 10.7769% 5.9837%;
  border-radius: .25% / .35%;
}

.sfw-devices {
  display: grid;
  grid-template-columns: repeat(2, 31%);
  grid-template-rows: repeat(2, 48%);
  place-content: center;
  align-items: center;
  gap: 2.6% 8.2%;
}

.sfw-device {
  margin: 0;
  aspect-ratio: 744 / 1523;
  overflow: clip;
}

/* Both live phone screens use identically sized frames. Their stills are
   cropped out of the original 2394 × 3192 four-device composition. */
.sfw-detail .sfw-device > img { object-fit: contain; }
.sfw-detail .sfw-device .sfw-device-still {
  position: absolute;
  width: var(--still-width);
  height: auto;
  left: var(--still-left);
  top: var(--still-top);
}
.sfw-device-mail { --still-width: 321.7742%; --still-left: -47.9839%; --still-top: -107.3539%; }
.sfw-device-product { --still-width: 325.7143%; --still-left: -176.4626%; --still-top: -110.5294%; }

/* Extend the video fractionally beneath the bezel to hide the still at the seam. */
.sfw-screen-phone { border-radius: 8.8% / 4.05%; }
.sfw-screen-mail { inset: 2.07% 4.70% 2.20% 4.84%; }
.sfw-screen-product { inset: 2.16% 4.90% 2.13% 4.76%; }
.sfw-screen-phone[data-video-ready]::after {
  content: "";
  position: absolute;
  top: .45%;
  left: 50%;
  width: 18.5%;
  height: 2.85%;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #080808;
}

.sfw-disclosure {
  margin-top: -8px;
  color: #a9a9a9;
}
.sfw-overview { margin-top: -10px; }

.sfw-identity, .echo-posters {
  grid-template-columns: subgrid;
  row-gap: var(--case-spacing);
}
.sfw-identity { margin-top: 4px; }
.sfw-identity > *, .echo-posters > * { grid-column: 1 / -1; }
.sfw-identity .case-image, .sfw-devices, .echo-posters .case-image { aspect-ratio: 3 / 4; }
.sfw-landscape { aspect-ratio: 4 / 3; }
.sfw-signage { aspect-ratio: 3 / 2; }

.echo-crop { position: relative; }
.echo-crop img {
  position: absolute;
  left: var(--art-left, 0);
  top: var(--art-top);
  width: var(--art-width);
  height: var(--art-height);
  object-fit: cover;
}

/* Crop positions are relative to the 16:9 masks, so they scale with the grid. */
.echo-isolation { --art-left: -38.058%; --art-top: -308.605%; --art-width: 165.428%; --art-height: 415.954%; }
.echo-space { --art-top: -64.893%; --art-width: 100.504%; --art-height: 252.633%; }
.echo-campaign { --art-left: -.7615%; --art-top: 1.7434%; --art-width: 100.7612%; --art-height: 96.5133%; }
.echo-type { --art-left: -142.614%; --art-top: -40.05%; --art-width: 285.58%; --art-height: 273.433%; }
.echo-typography p + p { margin-top: 1.2544em; }

@media (min-width: 1000px) {
  .case-study {
    --case-columns: 12;
    --case-margin: 22px;
    --case-gutter: 26px;
    --case-spacing: 28px;
    --case-copy-size: 32px;
  }

  .case-header { margin-bottom: 80px; }
  [data-page="work"] .case-header { margin-bottom: 152px; }
  .case-nav { min-height: 37.5px; font-size: 30px; line-height: 1.25; }
  .case-brand { grid-column: 1 / 7; }
  .case-info { grid-column: 7 / 11; }
  .case-contact { grid-column: 11 / -1; }

  .case-copy { grid-column: 7 / -1; }
  .echo-detail .case-copy { grid-column: 6 / -1; }
  .echo-posters .case-image { grid-column: span 4; }

  .case-footer {
    margin-top: 48px;
    padding-bottom: 24px;
    font-size: 128px;
  }
  [data-page="work"] .case-footer { margin-top: 64px; }
  .case-footer button, .case-footer a:first-of-type, .case-footer a:last-of-type {
    grid-column: span 4;
  }

  .sfw-detail { --case-spacing: 24px; }
  .sfw-disclosure { display: none; }
  .sfw-overview { margin-top: 5px; }
  .sfw-identity { margin-top: 91px; }
  .sfw-identity .sfw-logo { grid-area: 1 / 1 / 2 / 7; }
  .sfw-identity .sfw-palette { grid-area: 1 / 7 / 2 / -1; }
  .sfw-identity .case-copy { grid-area: 2 / 7 / 3 / -1; }

  .sfw-detail > :is(.sfw-landscape, .sfw-triptych, .sfw-devices, .sfw-signage) { margin-top: 40px; }
  .sfw-detail .sfw-logo { background: #f4f4f4; }
  .sfw-detail .sfw-devices { grid-column: 4 / -1; }
}

/* Match the homepage navigation feedback on case-study links and buttons. */
@media (hover: hover) {
  .case-nav :is(a, button):hover,
  .case-footer :is(a, button):hover { color: #b4b4b4; }
}
