.work-hero {
  overflow: clip;
  isolation: isolate;
  border-bottom: 1px solid var(--line);
}

.work-hero-intro { position: relative; }
.work-hero-copy {
  position: relative;
  padding-block: clamp(48px, 5.8vw, 100px) clamp(48px, 4.7vw, 82px);
  text-align: center;
}
.work-hero-copy .eyebrow {
  margin: 0 0 1.4em;
  font-size: clamp(12px, .94vw, 16px);
}
#work .work-hero-copy h1 {
  max-width: 17ch;
  margin: 0 auto;
  font: 580 clamp(58px, 6.15vw, 102px)/.99 var(--site-font);
  letter-spacing: -.052em;
  text-wrap: balance;
}
.work-hero-copy h1 span { display: block; }
.work-hero-summary {
  max-width: 49ch;
  margin: clamp(22px, 2.6vw, 43px) auto 0;
  color: #e0e4f2;
  font: 430 clamp(17px, 1.45vw, 22px)/1.45 var(--site-font);
  text-wrap: pretty;
}

/* All five faces meet at the same depth, like the walls of a studio. */
.work-room {
  --depth: clamp(180px, 23vw, 460px);
  --columns: 21;
  --rows: 9;
  position: absolute;
  inset: 0 0 -28%;
  overflow: hidden;
  perspective: clamp(240px, 28vw, 540px);
  perspective-origin: 50% 47%;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 12%, #3354b245, transparent 65%);
  mask-image: linear-gradient(to bottom, black 72%, transparent);
}
.work-room i {
  position: absolute;
  --line-color: rgb(149 172 237 / 19%);
  background-image: linear-gradient(90deg, var(--line-color) 1px, transparent 1px),
    linear-gradient(0deg, var(--line-color) 1px, transparent 1px);
  background-size: calc(100% / var(--columns)) calc(100% / var(--rows));
  box-shadow: inset 0 0 0 1px var(--line-color);
}
.room-back { inset: 0; transform: translateZ(calc(-1 * var(--depth))); }
.room-ceiling, .room-floor { --rows: 6; left: 0; width: 100%; height: var(--depth); }
.room-ceiling { top: 0; transform-origin: center top; transform: rotateX(-90deg); }
.room-floor { bottom: 0; transform-origin: center bottom; transform: rotateX(90deg); }
.room-left, .room-right { --columns: 6; top: 0; width: var(--depth); height: 100%; }
.room-left { left: 0; transform-origin: left center; transform: rotateY(90deg); }
.room-right { right: 0; transform-origin: right center; transform: rotateY(-90deg); }

.work-gallery {
  position: relative;
  width: 100%;
  padding-bottom: clamp(30px, 3.4vw, 58px);
}
.work-gallery-stage {
  --card-width: clamp(142px, 15.5vw, 210px);
  --pair-width: calc(var(--card-width) * .84);
  --gutter-between-slots: 9px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding-inline: var(--gutter);
  height: clamp(360px, 38vw, 550px);
  overflow-x: auto;
}
.work-gallery[data-enhanced] .work-gallery-stage {
  display: block;
  position: relative;
  padding: 0;
  overflow: clip;
  perspective: 1200px;
  perspective-origin: 50% 45%;
  cursor: grab;
  touch-action: pan-y pinch-zoom;
  user-select: none;
}
.work-gallery[data-dragging] .work-gallery-stage { cursor: grabbing; }
.work-gallery-stage:focus-visible { outline: 2px solid #90b3ff; outline-offset: -4px; }
.work-gallery-card {
  display: grid;
  gap: var(--gutter-between-slots);
  flex: none;
  width: var(--card-width);
}
.work-gallery[data-enhanced] .work-gallery-card {
  position: absolute;
  top: 50%;
  left: 50%;
  pointer-events: none;
  backface-visibility: hidden;
}
.work-gallery-card.card-pair { width: var(--pair-width); }
.work-gallery-card.card-four-five { width: calc(var(--pair-width) * .8); }

.work-slot {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 9 / 16;
  border: 1px solid var(--edge);
  border-radius: 6px;
  color: var(--guide);
  background: linear-gradient(145deg, var(--fill), var(--shade));
}
.card-pair .work-slot { aspect-ratio: 1; }
.card-four-five .work-slot { aspect-ratio: 4 / 5; }
.slot-cobalt { --fill: #294fc7; --shade: #182e80; --guide: #9bb2ff; --edge: #5573d3; }
.slot-ice { --fill: #bdcbea; --shade: #8f9ebb; --guide: #526482; --edge: #cbd5e9; }
.slot-ink { --fill: #222e45; --shade: #141b29; --guide: #8e9cb5; --edge: #4b5770; }
.slot-stone { --fill: #e4e0da; --shade: #c6c1bc; --guide: #817d78; --edge: #e4e0dc; }
.slot-slate { --fill: #62728c; --shade: #434e63; --guide: #b7c3d6; --edge: #7e8da3; }
/* Crop marks and a small picture symbol identify the empty media slots. */
.work-slot::before {
  content: "";
  position: absolute;
  inset: 8%;
  border: 1px solid currentColor;
  opacity: .55;
  mask: conic-gradient(at 9px 9px, transparent 25%, black 0) 0 0 / calc(100% - 9px) calc(100% - 9px);
}
.work-slot::after {
  content: "";
  width: 29px;
  height: 23px;
  border: 1.3px solid currentColor;
  border-radius: 3px;
  background:
    radial-gradient(circle at 72% 29%, currentColor 2px, transparent 2.4px),
    linear-gradient(135deg, transparent 44%, currentColor 46% 52%, transparent 54%) 0 100% / 55% 58% no-repeat,
    linear-gradient(45deg, transparent 44%, currentColor 46% 52%, transparent 54%) 69% 100% / 55% 58% no-repeat;
}
.work-gallery-playback {
  position: absolute;
  right: max(var(--gutter), calc((100% - 1660px) / 2));
  bottom: 12px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid #637086;
  border-radius: 50%;
  background: #0a0e17;
  color: #eef2ff;
  cursor: pointer;
}
.work-gallery-playback[hidden] { display: none; }
.work-gallery-playback:hover { border-color: currentColor; }
.work-gallery-playback span { width: 9px; height: 12px; border-inline: 3px solid currentColor; }
.work-gallery[data-paused] .work-gallery-playback span {
  width: 0;
  height: 0;
  margin-left: 2px;
  border: solid transparent;
  border-width: 6px 0 6px 9px;
  border-left-color: currentColor;
}

@media (max-width: 991px) {
  .work-hero-copy { text-align: left; }
  #work .work-hero-copy h1, .work-hero-summary { margin-inline: 0; }
  .work-gallery-stage { height: clamp(360px, 56vw, 480px); }
  .work-gallery[data-enhanced] .work-gallery-stage { perspective: 920px; }
}
@media (max-width: 575px) {
  .work-hero-copy { padding-block: 44px 36px; }
  #work .work-hero-copy h1 { font-size: clamp(46px, 11.2vw, 62px); }
  .work-hero-summary { margin-top: 20px; }
  .work-room { --columns: 13; --depth: 130px; }
  .work-gallery { padding-bottom: 32px; }
  .work-gallery-playback { bottom: 4px; }
}

@media (max-width: 650px) {
  .work-page .header { padding-block: 24px 12px; gap: 14px; }
  .work-page .header nav { justify-content: space-between; column-gap: 8px; }
  .work-page .header nav a:not(.outline) { padding-block: 6px; }
  .work-page .header .outline { position: absolute; top: 18px; right: 0; }
}
@media (max-width: 370px) {
  .work-page .header nav { column-gap: 5px; font-size: 12px; }
  .work-page .header .brand { width: 164px; }
}
