:root {
  --interaction-yellow: #ffcd26;
  --interaction-ink: #1b190f;
  --interaction-arrow: polygon(0 44%, 73% 44%, 41% 13%, 50% 4%, 98% 50%, 50% 96%, 41% 87%, 73% 56%, 0 56%);
}

:where(.portal, .page-footer a, .film-controls button, .ninja-lightbox-close) {
  -webkit-tap-highlight-color: rgb(255 205 38 / 45%);
}
:where(a.work-card-content, .related-card, .figure-link) {
  -webkit-tap-highlight-color: rgb(26 40 32 / 12%);
}

/* The title and link target stay still as the artwork unfolds. */
:is(a.work-card-content .work-card-title, .related-card strong) {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .6em;
  text-decoration: underline;
  text-decoration-color: var(--title-rule, transparent);
  text-decoration-thickness: .085em;
  text-underline-offset: .13em;
}
:is(a.work-card-content .work-card-title, .related-card strong)::after {
  content: "";
  flex: 0 0 .68em;
  height: .68em;
  clip-path: var(--interaction-arrow);
  background: currentColor;
  opacity: var(--arrow-opacity, .6);
  transform: translateX(var(--arrow-shift, 0));
  transition: opacity 180ms ease, transform 240ms ease;
}
:is(a.work-card-content, .related-card):is(:focus-visible, :active),
:where(html:not([data-touch-input])) :is(a.work-card-content, .related-card):hover {
  --arrow-opacity: 1;
  --arrow-shift: .2em;
  --title-rule: var(--interaction-yellow);
  --cover-keyline: var(--interaction-yellow);
  --back-sheet: translate(-14%, .5%) rotate(-7deg) scale(.66);
  --middle-sheet: translate(-1.5%, -1.5%) rotate(-2deg) scale(.68);
  --top-sheet: translate(13%, 2%) rotate(5deg) scale(.69);
}
:is(a.work-card-content, .related-card):focus-visible {
  outline: 2px solid var(--interaction-ink);
  outline-offset: 3px;
}

.project-deck {
  position: relative;
  isolation: isolate;
  background-color: #e4e8e2;
}
.project-deck::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 3px var(--cover-keyline, transparent);
  pointer-events: none;
}
.project-sheet {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgb(16 28 22 / 18%);
}
.sheet-front {
  display: grid;
  place-items: center;
  background: var(--sheet-paper, #e9ece7);
}
.sheet-back {
  background: var(--sheet-paper, #e9ece7) var(--sheet-image) center / cover no-repeat;
}
:is(.work-card-media--identity, .related-cover--brand) { --sheet-paper: #0a302d; }
:is(.work-card-media--website, .related-cover--website) { --sheet-paper: #052a29; }

:where(html[data-motion="play"]) .project-sheet {
  transition: transform var(--fan-duration, 500ms) cubic-bezier(.22,.72,.22,1);
}
:where(html[data-motion="play"]) .sheet-back:first-child {
  transform: var(--back-sheet, translate(-2%, -1%) rotate(-2deg) scale(.90));
}
:where(html[data-motion="play"]) .sheet-back:nth-child(2) {
  transform: var(--middle-sheet, translate(-.8%, -.5%) rotate(-.8deg) scale(.92));
}
:where(html[data-motion="play"]) .sheet-front {
  transform: var(--top-sheet, translate(.6%, .5%) scale(.94));
}
:where(html[data-motion="play"][data-hover-ready] a.work-card-content[data-preview-in-view]) {
  --back-sheet: translate(-10%, 0) rotate(-4deg) scale(.80);
  --middle-sheet: translate(-1%, -.5%) rotate(-1.4deg) scale(.81);
  --top-sheet: translate(8%, 1%) rotate(3deg) scale(.82);
  --fan-duration: 780ms;
}
:where(html[data-motion="play"][data-touch-input] [data-preview-in-view],
       html[data-motion="play"][data-reading-end][data-touch-input] .related-card) {
  --back-sheet: translate(-14%, 0) rotate(-6deg) scale(.72);
  --middle-sheet: translate(-1%, -1%) rotate(-2deg) scale(.74);
  --top-sheet: translate(12%, 1%) rotate(4deg) scale(.77);
  --fan-duration: 680ms;
}
/* Keep the preview sheets visible at a fixed angle when motion is reduced. */
:where(html:not([data-motion="play"])) .sheet-back:first-child {
  transform: translate(-9%, 0) rotate(-4deg) scale(.82);
}
:where(html:not([data-motion="play"])) .sheet-back:nth-child(2) {
  transform: translate(-1%, -.5%) rotate(-1.4deg) scale(.84);
}
:where(html:not([data-motion="play"])) .sheet-front {
  transform: translate(7%, 1%) rotate(2.5deg) scale(.86);
}

/* The zoom cue belongs to the image link, including the smaller modelling studies. */
:where(.figure-link:not([data-guide-figure])) {
  position: relative;
  overflow: hidden;
}
:where(.figure-link:not([data-guide-figure]))::after {
  content: "";
  pointer-events: none;
  position: absolute;
  z-index: 1;
  inset: .65rem .65rem auto auto;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  background:
    linear-gradient(var(--interaction-ink),var(--interaction-ink)) center / .62rem 1.5px no-repeat,
    linear-gradient(var(--interaction-ink),var(--interaction-ink)) center / 1.5px .62rem no-repeat,
    var(--interaction-yellow);
  opacity: var(--zoom-indicator, 0);
  transition: opacity 180ms ease;
}
.figure-link:is(:active, :focus-visible), :where([data-hover-ready]) .figure-link:hover {
  --zoom-indicator: 1;
  --photo-scale: 1.025;
}
:where(html[data-motion="play"]) :where(.case-figure, .study-strip, .venue-gallery, .hero-media) .figure-link > img {
  transform: scale(var(--photo-scale, 1));
  transition: transform 480ms cubic-bezier(.2,.68,.26,1);
}

.page-footer a {
  --fill-start: 0%;
  background: linear-gradient(var(--interaction-yellow), var(--interaction-yellow)) left bottom / var(--fill-start) 3px no-repeat, #fff;
}
.page-footer a, .film-controls button, .ninja-lightbox-close {
  transition: background-color 170ms ease, color 170ms ease, border-color 170ms ease, background-size 210ms ease;
}
.page-footer a:is(:focus-visible, :active) { --fill-start: 100%; border-color: currentColor; }
.film-controls button:is(:focus-visible, :active) { color: white; border-color: var(--interaction-yellow); }
.ninja-lightbox-close:is(:focus-visible, :active) {
  background: #fcf4d8;
  border-color: #8f7c45;
  color: var(--interaction-ink);
}
:where([data-hover-ready]) .page-footer a:hover {
  --fill-start: 100%;
  background: linear-gradient(var(--interaction-yellow), var(--interaction-yellow)) left bottom / var(--fill-start) 3px no-repeat, #fff;
  color: var(--interaction-ink);
}
:where([data-hover-ready]) .film-controls button:hover {
  color: white;
  background: #0b2622;
  border-color: var(--interaction-yellow);
}
:where([data-hover-ready]) .ninja-lightbox-close:hover { background: #fcf4d8; border-color: #8f7c45; }

.reading-progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 10;
  height: 3px;
  background: var(--interaction-yellow);
  transform: scaleX(0);
  transform-origin: left;
  pointer-events: none;
}
@media print {
  .reading-progress { display: none; }
}
:where(html:not([data-motion="play"])) :is(a.work-card-content, .related-card, .figure-link)::after,
:where(html:not([data-motion="play"])) :is(a.work-card-content .work-card-title, .related-card strong)::after,
:where(html:not([data-motion="play"])) :is(a.work-card-content, .related-card, .page-footer a, .film-controls button, .ninja-lightbox-close) {
  transition: none;
}
:where(html:not([data-motion="play"])) :is(a.work-card-content .work-card-title, .related-card strong)::after { transform: none; }
