.work {
  max-width: 1560px;
  margin: 0 auto;
  padding: clamp(100px, 10vw, 156px) clamp(16px, 4vw, 64px) 80px;
}
.work-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 32px;
}
.work h1 {
  font-size: clamp(48px, 7vw, 100px);
  letter-spacing: -.06em;
  line-height: 1;
  font-weight: 600;
}
.work-heading a, .channel {
  font: 12px/1.5 var(--mono);
  color: #b3b3ad;
}
.work-heading a:hover { text-decoration: underline; }
.projects {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px clamp(14px, 1.8vw, 28px);
  list-style: none;
}
.project { display: block; }
.frame { position: relative; background: #171717; }
.frame img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.play {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 6px 9px;
  background: #050505db;
  color: white;
  font-size: 11px;
}
.project:hover .play, .project:focus-visible .play { background: #b92720; }
.work :focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.channel { margin: 13px 0 4px; }
.project h2 {
  font-size: clamp(17px, 1.55vw, 23px);
  line-height: 1.2;
  letter-spacing: -.025em;
  font-weight: 500;
}
.capabilities-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 44px;
  gap: 12px;
  margin: clamp(48px, 6vw, 80px) auto 0;
  padding: 12px 22px;
  border: 1px solid currentColor;
  font: 12px/1.4 var(--mono);
}
.capabilities-link:hover { background: var(--ink); color: var(--bg); }
#viewer {
  margin: auto;
  width: min(1040px, 100%, max(560px, 142dvh));
  max-width: 100%;
  max-height: 94dvh;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
}
#viewer[open] {
  display: grid;
  --arrow-size: clamp(44px, 5vw, 56px);
  grid-template-columns: var(--arrow-size) minmax(0, 1fr) var(--arrow-size);
  column-gap: clamp(4px, 1vw, 14px);
  grid-template-areas: ". header ." "prev screen next";
}
#viewer::backdrop { background: rgb(0 0 0 / 84%); }
.viewer-bar {
  grid-area: header;
  background: #101010;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  gap: 12px;
}
.viewer-bar h2 { font-size: clamp(16px, 2vw, 23px); line-height: 1.2; }
#viewer-channel { margin-top: 5px; font: 12px var(--mono); color: #b3b3ad; }
#viewer-close { flex: none; padding: 8px; font: 12px var(--mono); }
#viewer-screen { grid-area: screen; }
#viewer-prev { grid-area: prev; }
#viewer-next { grid-area: next; }
.viewer-arrow {
  place-self: center;
  display: grid;
  place-items: center;
  width: var(--arrow-size);
  height: var(--arrow-size);
  padding: 0;
  background: #292929;
  color: white;
}
.viewer-arrow svg {
  display: block;
  width: 32px;
  height: 32px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#viewer button:hover, #viewer button:focus-visible { color: white; background: #404040; }
#viewer-screen iframe { display: block; width: 100%; aspect-ratio: 16/9; border: 0; background: black; }
body:has(#viewer[open]) { overflow: hidden; }
@media (max-width: 900px) {
  .projects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .projects { grid-template-columns: 1fr; gap: 28px; }
  .work-heading { margin-bottom: 24px; }
  .site-head { background: var(--bg); }
  #viewer { width: calc(100% - 16px); }
  #viewer[open] {
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "header header" "screen screen" "prev next";
    column-gap: 10px;
  }
  .viewer-arrow { margin-top: 10px; }
  #viewer-prev { justify-self: end; }
  #viewer-next { justify-self: start; }
}
@media (prefers-reduced-motion: no-preference) {
  body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 80;
    pointer-events: none;
    background: var(--bg);
    animation: reveal-work 280ms ease-in-out both;
  }
  @keyframes reveal-work {
    from { opacity: 1; }
    to { opacity: 0; visibility: hidden; }
  }
}
