/*
  Artist page only.

  "Process of Punk" has two states. By default (no JavaScript, reduced motion, or
  a very short screen) the title and the three prints simply stack down the page.
  When artist.js adds .is-pinned, vertical scrolling slides the prints past,
  right to left, one at a time, while the section holds still on screen with a
  bar under it and the Photography header peeking in below; then the page
  carries on. On wide screens they slide under the title, fading into a
  soft gradient (Paper boards "photo-scroller A/B"). On narrow screens
  the title sits across the top (board "mobile-header").

  Keep scrolling smooth: the only thing JavaScript may move during scrolling is
  .punk__reel.
*/

/* ---------- Poster: shared ---------- */

.punk__title {
  display: flex;
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
}
.punk__strip {
  display: block;
  white-space: nowrap;
  box-shadow: var(--shadow-strip);
}
.punk__strip--paper {
  position: relative;
  z-index: 1; /* sits over the red strip where they overlap */
  background: var(--color-white);
  color: var(--color-ink);
  rotate: -3deg;
}
.punk__strip--red {
  background: var(--color-safelight);
  color: var(--color-paper);
  rotate: 2deg;
}

/* A torn sheet: the paper is drawn behind the picture, so tape isn't clipped.
   The shadow is a filter so that it follows the torn edge. */
.sheet {
  position: relative;
  isolation: isolate;
  margin: 0;
  padding: 12px;
  filter: var(--shadow-print);
}
.sheet::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: #e9e5dc;
}
.sheet--horse::before,
.sheet--shore::before { clip-path: polygon(0.3% 1.0%, 4.7% 0.3%, 8.4% 0.4%, 11.6% 1.0%, 15.1% 0.6%, 18.3% 1.0%, 21.8% 1.1%, 25.4% 0.8%, 28.3% 1.1%, 32.5% 0.6%, 36.3% 1.3%, 39.4% 0.5%, 43.0% 0.4%, 46.0% 0.8%, 49.5% 0.8%, 53.5% 0.3%, 57.2% 0.4%, 60.8% 1.3%, 64.0% 0.3%, 67.5% 0.7%, 71.6% 0.4%, 75.0% 1.5%, 78.4% 1.3%, 81.2% 1.5%, 85.1% 1.5%, 89.1% 0.5%, 92.5% 1.5%, 95.0% 0.7%, 99.4% 0.5%, 99.6% 4.1%, 99.5% 7.5%, 99.1% 12.0%, 98.7% 14.6%, 99.1% 18.2%, 98.5% 21.5%, 98.7% 26.0%, 99.3% 29.5%, 98.7% 32.8%, 98.6% 36.0%, 99.3% 39.3%, 99.6% 43.1%, 99.2% 47.0%, 98.6% 50.6%, 99.3% 53.4%, 99.5% 56.7%, 99.7% 60.6%, 98.9% 64.4%, 99.0% 67.1%, 99.4% 70.5%, 99.5% 74.2%, 99.3% 78.7%, 99.2% 81.8%, 98.9% 84.4%, 98.5% 88.1%, 99.3% 92.0%, 99.1% 96.1%, 98.6% 98.7%, 95.8% 98.5%, 91.4% 98.9%, 88.1% 98.9%, 84.7% 99.2%, 81.7% 98.7%, 78.2% 99.1%, 74.1% 99.7%, 70.7% 98.6%, 67.0% 99.3%, 64.5% 99.5%, 60.4% 98.8%, 56.4% 99.3%, 53.6% 98.9%, 50.2% 99.0%, 47.1% 99.4%, 42.7% 99.6%, 38.9% 99.1%, 35.8% 98.8%, 31.9% 99.5%, 28.3% 99.2%, 26.0% 98.6%, 21.6% 99.2%, 18.4% 99.3%, 15.3% 98.7%, 11.2% 98.8%, 7.3% 99.6%, 4.8% 99.4%, 0.3% 99.5%, 1.2% 95.5%, 1.2% 92.0%, 0.5% 88.1%, 0.6% 84.5%, 0.7% 81.9%, 1.2% 78.5%, 1.2% 74.2%, 1.0% 71.0%, 1.3% 67.6%, 0.6% 64.2%, 1.5% 60.2%, 1.4% 56.4%, 0.6% 53.2%, 1.2% 50.6%, 1.2% 46.3%, 1.4% 42.8%, 0.6% 40.0%, 1.1% 36.2%, 1.1% 33.1%, 0.9% 29.4%, 1.2% 25.9%, 0.8% 22.2%, 1.0% 18.2%, 0.5% 15.1%, 0.4% 12.0%, 0.4% 7.3%, 0.4% 5.0%); }
.sheet--rose::before { clip-path: polygon(0.7% 0.4%, 3.8% 0.3%, 8.2% 1.1%, 11.7% 1.2%, 14.4% 1.0%, 18.3% 1.3%, 22.4% 1.4%, 24.9% 1.4%, 29.5% 1.5%, 32.0% 0.5%, 35.5% 0.3%, 39.9% 1.3%, 43.2% 1.3%, 46.7% 0.6%, 49.5% 0.4%, 53.8% 0.5%, 56.8% 0.8%, 59.9% 0.6%, 63.7% 1.2%, 67.4% 0.7%, 71.6% 0.9%, 75.0% 1.1%, 77.4% 0.8%, 81.5% 1.3%, 84.9% 1.2%, 88.6% 0.5%, 92.6% 0.4%, 96.0% 0.5%, 98.5% 0.5%, 99.4% 5.0%, 98.5% 7.9%, 99.1% 11.8%, 98.7% 14.9%, 98.9% 18.9%, 98.8% 22.5%, 98.8% 25.1%, 99.4% 29.0%, 98.6% 32.6%, 98.6% 36.3%, 99.4% 39.9%, 99.3% 42.8%, 99.0% 46.4%, 99.6% 49.5%, 99.6% 52.9%, 98.7% 56.7%, 99.6% 60.5%, 98.9% 64.5%, 98.8% 67.5%, 99.1% 71.4%, 99.4% 74.7%, 98.9% 77.8%, 98.7% 82.0%, 99.3% 85.4%, 98.7% 88.5%, 99.5% 92.2%, 98.6% 95.5%, 99.6% 98.8%, 95.2% 98.8%, 92.3% 99.5%, 88.1% 98.7%, 84.7% 98.9%, 81.6% 98.7%, 77.8% 98.7%, 75.2% 99.4%, 70.5% 99.7%, 67.0% 98.9%, 64.7% 99.5%, 60.8% 99.0%, 56.6% 99.3%, 53.0% 98.7%, 49.9% 98.5%, 46.4% 99.5%, 43.2% 99.1%, 39.7% 99.1%, 35.5% 99.2%, 32.3% 99.4%, 29.5% 99.0%, 25.5% 99.4%, 21.8% 98.7%, 18.7% 99.6%, 15.3% 99.4%, 11.9% 99.3%, 8.1% 99.0%, 4.2% 99.3%, 0.4% 99.0%, 1.3% 95.9%, 1.1% 91.8%, 0.8% 88.5%, 1.1% 85.0%, 1.1% 82.1%, 0.5% 78.3%, 1.3% 74.4%, 0.9% 71.7%, 0.3% 67.6%, 0.5% 64.4%, 1.5% 60.5%, 0.4% 57.1%, 1.0% 53.8%, 0.9% 50.2%, 1.3% 46.5%, 0.8% 43.6%, 0.5% 39.7%, 0.8% 36.3%, 0.4% 33.1%, 0.7% 28.4%, 0.6% 25.3%, 0.3% 21.8%, 0.8% 18.7%, 0.7% 14.6%, 0.5% 11.7%, 1.5% 7.9%, 0.5% 4.8%); }

.sheet img {
  width: 100%;
  height: auto;
}
/* Clear layer over each picture, as elsewhere on the site, so "Save Image" isn't offered */
.sheet::after {
  content: "";
  position: absolute;
  inset: 0;
}

.tape {
  position: absolute;
  z-index: 1;
  top: -14px;
  left: calc(50% - 60px);
  width: 120px;
  height: 32px;
  background: rgba(226, 208, 168, 0.72);
  box-shadow: 0 1px 2px rgba(23, 20, 26, 0.12);
  rotate: -3deg;
}
.sheet--rose .tape { top: -8px; width: 90px; height: 26px; }
.sheet--rose .tape--left { left: -26px; rotate: -38deg; }
.sheet--rose .tape--right { left: auto; right: -26px; rotate: 36deg; }
.sheet--shore .tape { rotate: 2deg; }

/* ---------- Poster: stacked (default) ---------- */

.punk__stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-6);
  padding: var(--space-5) var(--space-3) var(--space-4);
}
.punk__title {
  align-items: flex-start;
  font-size: clamp(40px, 15vw, 96px);
  line-height: 1.2;
}
.punk__strip { padding: 0 0.14em; }
.punk__strip--red { margin: 0.45em 0 0 -0.12em; }
.punk__bar { display: none; }
.punk__fade { width: 100%; }
.punk__reel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-6);
  width: 100%;
}
.sheet--horse { width: min(100%, 560px); rotate: 1.5deg; }
.sheet--rose { width: min(100%, 640px); rotate: -1.5deg; }
.sheet--shore { width: min(100%, 880px); rotate: 0.8deg; }

@media (min-width: 760px) {
  .punk__title { flex-direction: column; font-size: clamp(100px, 13.5vw, 160px); }
  .punk__strip--red { margin: 0.08em 0 0 0.24em; }
}

/* ---------- Poster: pinned, scrolling sideways ---------- */

/* artist.js sets --u (one design pixel), --x0 (left edge of the design on very
   wide screens), the section's height, where each print sits, and how far up the
   screen the bar and the Photography header stick */
.punk.is-pinned .punk__stage {
  display: block;
  position: sticky;
  overflow-x: clip; /* sideways only, so shadows aren't cut off top and bottom */
  padding: 0;
}
.punk.is-pinned .punk__title { display: contents; }
.punk.is-pinned .punk__strip {
  position: absolute;
  z-index: 3;
  margin: 0;
}
.punk.is-pinned .punk__strip--paper { z-index: 4; }
.punk.is-pinned .punk__bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  z-index: 5;
  height: 48px;
  padding-inline: var(--gutter);
  background: var(--color-paper);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}
.punk__skip {
  color: var(--color-safelight);
  text-decoration: none;
  padding-block: var(--space-2);
}
.punk__skip:hover { text-decoration: underline; }
.punk__skip.is-done { visibility: hidden; }
/* Reaches past the stage top and bottom so shadows aren't cut off */
.punk.is-pinned .punk__fade {
  position: absolute;
  inset: -60px 0;
  z-index: 1;
  pointer-events: none; /* it overlaps the header */
}
.punk.is-pinned .punk__reel {
  display: block;
  position: absolute;
  inset: 60px 0;
  will-change: transform;
}
.punk.is-pinned .sheet {
  position: absolute;
  margin: 0;
  padding: 0;
}
.punk.is-pinned .sheet img {
  position: absolute;
  max-width: none;
  object-fit: cover;
}

/* Print sizes in their own pixels; artist.js scales each sheet to fit */
.punk.is-pinned .sheet--horse { width: 652px; height: 782px; rotate: 2.5deg; }
.punk.is-pinned .sheet--horse img { left: 16px; top: 17px; width: 620px; height: 748px; }
.punk.is-pinned .sheet--horse .tape { left: 250px; top: -18px; width: 150px; height: 40px; rotate: -4deg; }
.punk.is-pinned .sheet--rose { width: 752px; height: 762px; rotate: -2deg; }
.punk.is-pinned .sheet--rose img { left: 16px; top: 15px; width: 720px; height: 731px; }
.punk.is-pinned .sheet--rose .tape { top: 14px; width: 150px; height: 40px; }
.punk.is-pinned .sheet--rose .tape--left { left: -44px; }
.punk.is-pinned .sheet--rose .tape--right { right: -44px; top: 6px; }
.punk.is-pinned .sheet--shore { width: 1212px; height: 820px; rotate: 1.2deg; }
.punk.is-pinned .sheet--shore img { left: 16px; top: 16px; width: 1180px; height: 787px; }
.punk.is-pinned .sheet--shore .tape { left: 540px; top: -16px; width: 160px; height: 40px; }

/* Wide: title upper left, prints on the right */
.punk.is-wide .punk__strip {
  font-size: calc(160 * var(--u));
  line-height: calc(178 * var(--u));
  padding: 0 calc(23 * var(--u)) calc(5 * var(--u));
}
.punk.is-wide .punk__strip--paper {
  left: calc(var(--x0) + 74 * var(--u));
  top: calc(36 * var(--u));
}
.punk.is-wide .punk__strip--red {
  left: calc(var(--x0) + 112 * var(--u));
  top: calc(252 * var(--u));
}
/* The prints fade out as they slide under the title. It is a mask on a still
   wrapper, not a paper-colored overlay, so there is no edge to see. Eased
   stops keep both ends of the fade soft. */
.punk.is-wide .punk__fade {
  --fade: calc(var(--x0) + 500 * var(--u));
  --step: calc(26 * var(--u));
  -webkit-mask-image: linear-gradient(92.65deg,
    transparent var(--fade),
    rgb(0 0 0 / 0.03) calc(var(--fade) + var(--step)),
    rgb(0 0 0 / 0.1) calc(var(--fade) + 2 * var(--step)),
    rgb(0 0 0 / 0.26) calc(var(--fade) + 3 * var(--step)),
    rgb(0 0 0 / 0.5) calc(var(--fade) + 4 * var(--step)),
    rgb(0 0 0 / 0.74) calc(var(--fade) + 5 * var(--step)),
    rgb(0 0 0 / 0.9) calc(var(--fade) + 6 * var(--step)),
    rgb(0 0 0 / 0.97) calc(var(--fade) + 7 * var(--step)),
    #000 calc(var(--fade) + 8 * var(--step)));
          mask-image: linear-gradient(92.65deg,
    transparent var(--fade),
    rgb(0 0 0 / 0.03) calc(var(--fade) + var(--step)),
    rgb(0 0 0 / 0.1) calc(var(--fade) + 2 * var(--step)),
    rgb(0 0 0 / 0.26) calc(var(--fade) + 3 * var(--step)),
    rgb(0 0 0 / 0.5) calc(var(--fade) + 4 * var(--step)),
    rgb(0 0 0 / 0.74) calc(var(--fade) + 5 * var(--step)),
    rgb(0 0 0 / 0.9) calc(var(--fade) + 6 * var(--step)),
    rgb(0 0 0 / 0.97) calc(var(--fade) + 7 * var(--step)),
    #000 calc(var(--fade) + 8 * var(--step)));
}

/* Narrow: title across the top, prints below */
.punk.is-narrow .punk__strip {
  font-size: calc(54 * var(--u));
  line-height: calc(70 * var(--u));
  padding: 0 calc(8 * var(--u)) calc(3 * var(--u));
}
.punk.is-narrow .punk__strip--paper {
  left: calc(var(--x0) + 13 * var(--u));
  top: calc(14 * var(--u));
}
.punk.is-narrow .punk__strip--red {
  right: calc(var(--x0) + 12 * var(--u));
  top: calc(44 * var(--u));
}

/* ---------- Angled section headers ---------- */

/* The headers stick to the top of the screen while their galleries scroll
   under them. --strip and --band are the pink strip's and the header's heights. */
#main {
  --strip: clamp(92px, 12.5vw, 180px);
  --band: calc(90px + 11vw);
}

.gallery {
  padding-bottom: var(--space-6);
  scroll-margin-top: 0;
}
.band {
  --tilt: -5deg;
  position: sticky;
  /* Stuck, the space above the strip is tucked off the top of the screen */
  top: calc((var(--strip) - var(--band)) / 2);
  z-index: 5;
  height: var(--band);
  /* Trims the strip at the sides and top, but leaves room below for its shadow */
  overflow-x: clip;
  clip-path: inset(0 0 -80px 0);
  pointer-events: none; /* the clear part below the strip mustn't block the works */
}
.band__inner {
  /* Keeps the word in line with the page content on very wide screens */
  --edge: max(var(--gutter), calc((100% - var(--page-max)) / 2 + var(--gutter)));
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
}
.band__inner::before,
.band__title {
  rotate: var(--tilt);
}
.band__inner::before {
  content: "";
  position: absolute;
  left: -8vw;
  right: -8vw;
  top: 50%;
  height: var(--strip);
  translate: 0 -50%;
  background: var(--color-highlighter);
  /* Paper filling everything above the strip, at the same angle, so works
     disappear along its lower edge; then a soft shadow onto them */
  box-shadow: 0 calc(1px - var(--strip)) 0 var(--color-paper), var(--shadow-band);
}
.band--right { --tilt: 4.5deg; }
.band--right .band__inner { justify-content: flex-end; }
.band__title {
  position: relative;
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: clamp(54px, 15.4vw, 136px);
  line-height: 1.18;
  text-transform: uppercase;
  white-space: nowrap;
  margin-inline: var(--edge);
}
@media (max-height: 500px) {
  .band { position: relative; top: auto; } /* too short to give up the room */
}
@media (min-width: 960px) {
  #main { --band: calc(130px + 9vw); }
  .band--left { --tilt: -3.5deg; }
  .band--right { --tilt: 3deg; }
  .gallery { padding-bottom: var(--space-7); }

  /* Once stuck (artist.js adds .is-stuck), strip and word shrink together
     toward the top of the screen, holding the word's outer edge in place */
  .band__inner {
    transform-origin: var(--edge) calc((var(--band) - var(--strip)) / 2);
    transition: scale 0.25s ease;
  }
  .band--right .band__inner {
    transform-origin: calc(100% - var(--edge)) calc((var(--band) - var(--strip)) / 2);
  }
  .band__inner::before { left: -60vw; right: -60vw; } /* still full width when shrunk */
  .band.is-stuck .band__inner { scale: 0.62; }
}

/* ---------- Galleries ---------- */

.works {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px var(--space-3);
}
.work {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
/* The mount: the whole work shows, never cropped */
.work__open {
  scroll-margin-top: calc(var(--strip) + 64px); /* clear of the stuck header */
  appearance: none;
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 410 / 440;
  padding: 0;
  border: 0;
  background: #fcfbf9;
  cursor: zoom-in;
}
.work__open img {
  position: absolute;
  inset: 5.5%;
  width: 89%;
  height: 89%;
  object-fit: contain;
}
.work figcaption {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  line-height: 1.45;
  color: var(--color-ink-soft);
}
html:not(.js) .work__open { cursor: default; }

@media (min-width: 960px) {
  .works { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-5) var(--space-4); }
  .work { gap: 12px; }
  .work figcaption { font-size: var(--text-sm); }
}
/* Wide screens: four across keeps the long galleries shorter */
@media (min-width: 1280px) {
  .works { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------- Viewer ---------- */

.viewer {
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0;
  padding: var(--space-3) 20px var(--space-4);
  border: 0;
  background: var(--color-ink);
  color: var(--color-paper);
}
.viewer[open] {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.viewer::backdrop { background: var(--color-ink); }
html:has(.viewer[open]) { overflow: hidden; }
.viewer__top,
.viewer__nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
}
.viewer__nav { border-top: 1px solid #4a454f; padding-top: var(--space-2); }
.viewer__btn {
  appearance: none;
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: uppercase;
  cursor: pointer;
}
.viewer__btn:hover { color: var(--color-blush); }
.viewer :focus-visible { outline-color: var(--color-paper); outline-offset: 0; }
.viewer__figure {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  margin: 0;
}
.viewer__frame {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
}
.viewer__frame::after {
  content: "";
  position: absolute;
  inset: 0;
}
.viewer__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: scale-down; /* never enlarged past the web copy */
}
.viewer__caption {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1.45;
  text-align: center;
  max-width: 44em;
}
