/* ==========================================================================
   Mush
   --------------------------------------------------------------------------
   Two rules govern this file.

   1. The chrome has no colour. Every colour on the page comes out of a
      painting. There is one exception, declared below, and it is his.
   2. The type is small and the paintings are large. Big display type on an
      artist's site competes with the work; small, precise type says look at
      the painting.

   A third rule governs the typefaces: the sans is the site speaking (labels,
   navigation, metadata, captions). The serif is Mush speaking (catalogue
   notes, statement). A reader feels the difference without being told.
   ========================================================================== */

/* --- tokens ------------------------------------------------------------- */
:root {
  /* ground — tuned to the black in the canvases so the paintings bleed out */
  --ground:  #0a0908;
  --deep:    #050404;

  /* ink: warm greys only */
  --bone:  #efe8dc;  /* his words, titles */
  --body:  #c9bfb3;  /* paragraphs — 10.7:1 */
  --muted: #a19487;  /* metadata — 6.9:1 */
  --faint: #8a7f70;  /* notes, disclaimers — 5.1:1 */

  /* the one exception: the gold he actually signs in. Used for the
     current-page hairline and nothing else. */
  --signature: #c9a063;

  --rule:  rgba(239, 232, 220, 0.13);
  --rule-faint: rgba(239, 232, 220, 0.07);

  --serif: "EB Garamond", "Iowan Old Style", Georgia, serif;
  --sans:  "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --gutter: clamp(1.25rem, 5vw, 5rem);
  --shell: 88rem;
  --measure: 33rem;

  /* the space between paintings is part of the hang */
  --breath: clamp(7rem, 17vh, 15rem);
  --breath-half: clamp(4rem, 9vh, 8rem);

  --ease: cubic-bezier(0.22, 0, 0.12, 1);
}

/* --- reset -------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--body);
  font-family: var(--serif);
  font-size: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  line-height: 1.66;
  font-feature-settings: "kern" 1, "liga" 1, "onum" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { margin: 0; font-weight: 400; color: var(--bone); line-height: 1.15; }
p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }
a { color: inherit; }
ul { margin: 0; padding: 0; list-style: none; }
figure { margin: 0; }

::selection { background: #4a2e1c; color: var(--bone); }

:focus-visible { outline: 2px solid var(--bone); outline-offset: 4px; }

.skip-link {
  position: absolute; left: var(--gutter); top: 0;
  transform: translateY(-130%); z-index: 100;
  background: var(--deep); color: var(--bone);
  padding: 0.8rem 1.25rem; border: 1px solid var(--rule);
  font-family: var(--sans); font-size: 0.75rem;
  letter-spacing: 0.14em; text-transform: uppercase; text-decoration: none;
}
.skip-link:focus-visible { transform: translateY(0.75rem); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* --- type --------------------------------------------------------------- */

/* the site speaking */
.label {
  font-family: var(--sans);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--faint);
}

.wall-label {
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--bone);
  line-height: 1.4;
}

.meta {
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  line-height: 1.65;
}

.note {
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.015em;
  line-height: 1.7;
  color: var(--faint);
  max-width: 38rem;
}

/* Mush speaking */
.words {
  font-family: var(--serif);
  font-size: clamp(1.1875rem, 1.05rem + 0.6vw, 1.5rem);
  line-height: 1.58;
  color: var(--bone);
  max-width: 36rem;
}

.pull {
  font-family: var(--serif);
  font-size: clamp(1.125rem, 1rem + 0.55vw, 1.4375rem);
  line-height: 1.55;
  color: var(--bone);
  max-width: 32rem;
  text-wrap: pretty;
}

/* page titles stay small on purpose */
.page-title {
  font-family: var(--serif);
  font-size: clamp(1.75rem, 1.4rem + 1.3vw, 2.5rem);
  letter-spacing: -0.005em;
  color: var(--bone);
}

.prose { max-width: var(--measure); }
.prose--wide { max-width: 40rem; }

/* --- layout ------------------------------------------------------------- */
.shell { width: 100%; max-width: var(--shell); margin-inline: auto; padding-inline: var(--gutter); }
.shell--narrow { max-width: 62rem; }

.band { padding-block: var(--breath); }
.band--half { padding-block: var(--breath-half); }
.ruled { border-top: 1px solid var(--rule-faint); }

/* --- links -------------------------------------------------------------- */
.link {
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--bone);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.85em;
  padding-block: 0.45em;
  border-bottom: 1px solid var(--rule);
  transition: border-color 0.4s var(--ease);
}
.link::after {
  content: ""; width: 1.4em; height: 1px;
  background: currentColor; opacity: 0.55;
  transition: width 0.4s var(--ease), opacity 0.4s var(--ease);
}
.link:hover, .link:focus-visible { border-bottom-color: var(--bone); }
.link:hover::after { width: 2.2em; opacity: 1; }

a.inline { color: var(--bone); text-decoration: none; border-bottom: 1px solid var(--rule); }
a.inline:hover { border-bottom-color: var(--bone); }

/* --- header ------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--ground) 90%, transparent);
  backdrop-filter: blur(16px);
}

.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 2rem; min-height: 4.5rem;
}

.wordmark {
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--bone);
  text-decoration: none;
  white-space: nowrap;
}

.site-nav ul { display: flex; gap: clamp(1.5rem, 3vw, 2.75rem); align-items: center; }

.site-nav a {
  font-family: var(--sans);
  font-size: 0.6875rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  padding-block: 0.45rem;
  border-bottom: 1px solid transparent;
  transition: color 0.3s var(--ease);
}
.site-nav a:hover { color: var(--bone); }
/* the only colour in the chrome, and it is the gold he signs in */
.site-nav a[aria-current="page"] { color: var(--bone); border-bottom-color: var(--signature); }

.nav-toggle {
  display: none; background: none; border: 0; color: var(--bone);
  font-family: var(--sans); font-size: 0.6875rem;
  letter-spacing: 0.18em; text-transform: uppercase;
  padding: 0.75rem 0; cursor: pointer;
}

@media (max-width: 42rem) {
  .js .nav-toggle { display: block; }
  .js .site-nav {
    display: none; position: absolute; inset: 100% 0 auto 0;
    background: var(--deep); padding: 0.5rem var(--gutter) 2rem;
    border-bottom: 1px solid var(--rule-faint);
  }
  .js .site-nav[data-open="true"] { display: block; }
  .site-nav ul { flex-direction: column; align-items: flex-start; gap: 0; }
  .site-nav li { width: 100%; border-bottom: 1px solid var(--rule-faint); }
  .site-nav a { display: block; padding: 1.1rem 0; font-size: 0.8125rem; }
  .site-nav a[aria-current="page"] { border-bottom-color: transparent; }
}

/* --- the home procession ------------------------------------------------ */
/* One painting at a time, with room around it. The canvases are photographed
   on black, so no border or container is drawn: the paint meets the page. */

.opening { padding-block: clamp(4rem, 12vh, 9rem) var(--breath); }
.opening .label { display: block; margin-bottom: 2.25rem; }
.opening .words { max-width: 38rem; }

.hang { display: grid; gap: var(--breath); }

.hang__item {
  display: grid;
  gap: clamp(1.75rem, 3.5vw, 3rem);
  justify-items: center;
}

.hang__figure { width: 100%; display: flex; justify-content: center; }

.hang__figure img {
  width: auto;
  max-width: 100%;
  max-height: min(74vh, 45rem);
}

/* intimate canvases are shown smaller — a 16 x 20 should not read like a
   48 x 36. The relative sizes on screen follow the real ones. */
.hang__figure img { max-height: calc(min(84vh, 54rem) * var(--scale, 1)); }

.hang__caption {
  width: 100%;
  max-width: 44rem;
  margin-inline: auto;
  display: grid;
  gap: clamp(1.5rem, 3vw, 2.25rem);
  justify-items: center;
  text-align: center;
}

.hang__label .meta { margin-top: 0.55rem; }
.hang__caption .pull { max-width: 34rem; }

.hang__caption a { text-decoration: none; }
.hang__caption a:hover .wall-label { border-bottom-color: var(--bone); }
.hang__caption .wall-label {
  display: inline-block;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease);
}
.hang__caption .meta { margin-top: 0.55rem; }

/* the diptych: two canvases that belong together */
.diptych {
  display: grid;
  gap: clamp(1.5rem, 3vw, 2.75rem);
  width: 100%;
  justify-items: center;
}

@media (min-width: 34rem) {
  .diptych { grid-template-columns: 1fr 1fr; align-items: end; }
  .diptych > :first-child { justify-self: end; }
  .diptych > :last-child { justify-self: start; }
}

.diptych img { max-height: min(66vh, 40rem); width: auto; }

/* the framed installation photograph is a photograph of a room, so unlike the
   canvases it is allowed an edge */
.installation img { width: auto; max-width: 100%; max-height: min(66vh, 42rem); }

/* --- catalogue index ---------------------------------------------------- */
/* Twelve columns. A painting's span follows its real size, so the index
   teaches you the scale of the work as you scroll it. */

.index {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(3.5rem, 6vw, 6rem) clamp(1.5rem, 3vw, 3rem);
  align-items: start;
}

.index-item { grid-column: span 12; }

@media (min-width: 46rem) {
  .index-item { grid-column: span 6; }
  .index-item[data-scale="small"] { grid-column: span 4; }
}

@media (min-width: 70rem) {
  .index-item[data-scale="small"]  { grid-column: span 4; }
  .index-item[data-scale="medium"] { grid-column: span 5; }
  .index-item[data-scale="large"]  { grid-column: span 6; }
  .index-item[data-scale="xl"]     { grid-column: span 7; }
}

.index-item a { display: block; text-decoration: none; color: inherit; }

.index-item__frame { overflow: hidden; }
.index-item__frame img {
  width: 100%;
  transition: transform 0.9s var(--ease);
}
.index-item a:hover .index-item__frame img,
.index-item a:focus-visible .index-item__frame img { transform: scale(1.015); }

.index-item__empty {
  aspect-ratio: 4 / 3;
  display: grid; place-items: center;
  border: 1px solid var(--rule-faint);
}
.index-item__empty span {
  font-family: var(--sans); font-size: 0.6875rem;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--faint); text-align: center; padding: 1rem;
}

.index-item__body { margin-top: 1.25rem; }
.index-item__body .meta { margin-top: 0.5rem; }
.index-item a:hover .wall-label { color: #fff; }

.stage {
  display: inline-block;
  margin-top: 0.9rem;
  font-family: var(--sans);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--faint);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.25rem;
}

/* --- filters ------------------------------------------------------------ */
.filters {
  display: grid; gap: 1.5rem;
  margin-bottom: var(--breath-half);
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--rule-faint);
}

.filter-group { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.6rem 1.5rem; }
.filter-group__legend { width: 100%; }

@media (min-width: 48rem) {
  .filter-group__legend { width: 6.5rem; flex: 0 0 6.5rem; }
}

.filter {
  background: none; border: 0;
  border-bottom: 1px solid transparent;
  padding: 0.3rem 0;
  font-family: var(--sans); font-size: 0.8125rem;
  letter-spacing: 0.06em; color: var(--muted);
  cursor: pointer;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.filter:hover { color: var(--bone); }
.filter[aria-pressed="true"] { color: var(--bone); border-bottom-color: var(--bone); }

.index-empty { padding: 4rem 0; color: var(--muted); }

/* --- painting page ------------------------------------------------------ */
.crumb { font-family: var(--sans); font-size: 0.6875rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--faint); margin-bottom: 2.5rem; }
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--bone); }
.crumb span { margin: 0 0.55rem; }

.painting__figure { display: flex; justify-content: center; }
.painting__figure img { width: auto; max-width: 100%; max-height: min(84vh, 58rem); }
.zoomable { cursor: zoom-in; }

.painting__under {
  display: grid;
  gap: clamp(2.5rem, 5vw, 4.5rem);
  margin-top: clamp(2.5rem, 5vw, 4rem);
}

@media (min-width: 58rem) {
  .painting__under { grid-template-columns: minmax(0, 1fr) minmax(0, 19rem); }
}

.spec { margin: 0; border-top: 1px solid var(--rule-faint); }
.spec div {
  display: grid; grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: 1rem; padding: 0.7rem 0;
  border-bottom: 1px solid var(--rule-faint);
}
.spec dt { font-family: var(--sans); font-size: 0.6875rem; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--faint); padding-top: 0.25em; }
.spec dd { margin: 0; font-family: var(--sans); font-size: 0.8125rem;
  line-height: 1.6; color: var(--body); }
.spec dd.pending { color: var(--faint); }

.painting-nav {
  display: flex; flex-wrap: wrap; justify-content: space-between;
  gap: 1.5rem 3rem; margin-top: var(--breath-half);
  padding-top: 2.5rem; border-top: 1px solid var(--rule-faint);
}
.painting-nav a { text-decoration: none; }
.painting-nav__dir { display: block; font-family: var(--sans); font-size: 0.625rem;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--faint); margin-bottom: 0.55rem; }
.painting-nav__title { font-family: var(--sans); font-size: 0.8125rem;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
  transition: color 0.3s var(--ease); }
.painting-nav a:hover .painting-nav__title { color: var(--bone); }
.painting-nav__next { text-align: right; margin-left: auto; }

/* --- about -------------------------------------------------------------- */
.column {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
}

@media (min-width: 56rem) {
  .column { grid-template-columns: minmax(0, 13rem) minmax(0, 1fr); }
}

.column__body { max-width: 40rem; }

.concerns { border-top: 1px solid var(--rule-faint); margin-top: 2.5rem; }
.concerns a, .concerns li > div {
  display: grid; gap: 0.5rem 2.5rem;
  padding: 1.5rem 0; border-bottom: 1px solid var(--rule-faint);
  text-decoration: none; align-items: baseline;
}
@media (min-width: 42rem) {
  .concerns a, .concerns li > div { grid-template-columns: minmax(0, 12rem) minmax(0, 1fr); }
}
.concerns a:hover .wall-label { color: #fff; }

.method { display: grid; gap: clamp(2rem, 4vw, 3rem); margin-top: 2.5rem; }
@media (min-width: 56rem) { .method { grid-template-columns: repeat(3, 1fr); } }
.method h3 { font-family: var(--sans); font-size: 0.75rem; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--bone); margin-bottom: 1rem; }
.method p { font-size: 1rem; line-height: 1.6; }

/* --- contact ------------------------------------------------------------ */
.contact-box {
  border: 1px solid var(--rule-faint);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  margin-top: 2.5rem; max-width: 42rem;
}
.contact-box h2 { font-family: var(--sans); font-size: 0.6875rem;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); margin-bottom: 1.25rem; }
.contact-box p { font-family: var(--sans); font-size: 0.8125rem; line-height: 1.75; color: var(--body); }
.contact-box code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85em; color: var(--bone); background: rgba(239,232,220,0.06); padding: 0.1em 0.4em; }

.contact-email {
  font-family: var(--serif);
  font-size: clamp(1.375rem, 1.1rem + 1.2vw, 2rem);
  color: var(--bone); text-decoration: none;
  border-bottom: 1px solid var(--rule);
}
.contact-email:hover { border-bottom-color: var(--bone); }

/* --- footer ------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--rule-faint); padding-block: var(--breath-half) 3rem; margin-top: var(--breath); }

.site-footer__grid { display: grid; gap: clamp(2.5rem, 5vw, 4rem); align-items: start; }
@media (min-width: 46rem) { .site-footer__grid { grid-template-columns: minmax(0,1fr) auto; } }

/* his actual signature, in his actual paint. `lighten` drops the canvas
   ground and keeps only the gold. */
.signature {
  width: 11rem; height: auto;
  /* crush the canvas ground to black first, then `lighten` drops it entirely
     and only the gold paint survives onto the page */
  filter: contrast(2.1) brightness(1.1);
  mix-blend-mode: lighten;
  opacity: 0.9;
}

.site-footer ul { display: flex; flex-wrap: wrap; gap: 1.25rem 2rem; margin-top: 1.5rem; }
.site-footer li a { font-family: var(--sans); font-size: 0.75rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted); text-decoration: none; }
.site-footer li a:hover { color: var(--bone); }

.colophon { margin-top: 3rem; padding-top: 1.75rem; border-top: 1px solid var(--rule-faint);
  display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; justify-content: space-between; }

/* --- lightbox ----------------------------------------------------------- */
.lightbox { display: none; }
.lightbox[open] {
  position: fixed; inset: 0; z-index: 80;
  background: var(--deep);
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 1rem; padding: clamp(1rem, 3vw, 2rem);
  border: 0; max-width: 100vw; max-height: 100vh;
}
.lightbox::backdrop { background: rgba(5, 4, 4, 0.97); }
.lightbox__bar { display: flex; justify-content: flex-end; }
.lightbox__close {
  background: none; border: 1px solid var(--rule); color: var(--bone);
  font-family: var(--sans); font-size: 0.6875rem; letter-spacing: 0.16em;
  text-transform: uppercase; padding: 0.6rem 1.1rem; cursor: pointer;
}
.lightbox__close:hover { border-color: var(--bone); }
.lightbox__stage { display: flex; align-items: center; justify-content: center;
  min-height: 0; overflow: hidden; }
.lightbox__stage img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.lightbox__caption { text-align: center; }

/* --- motion ------------------------------------------------------------- */
.js .reveal { opacity: 0; transform: translateY(1.5rem); }
.js .reveal.is-visible {
  opacity: 1; transform: none;
  transition: opacity 1.2s var(--ease), transform 1.2s var(--ease);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
  .index-item a:hover .index-item__frame img { transform: none; }
}

@media print {
  .site-header, .site-footer, .filters, .painting-nav { display: none; }
  body { background: #fff; color: #000; }
}

/* --- framed presentation view (painting page) --------------------------- */
.presentation {
  margin-top: var(--breath-half);
  padding-top: clamp(2.5rem, 5vw, 4rem);
  border-top: 1px solid var(--rule-faint);
  display: grid;
  justify-items: center;
  gap: 1.5rem;
}
.presentation img { width: auto; max-width: 100%; max-height: min(60vh, 38rem); }
.presentation figcaption {
  width: 100%; max-width: 68rem;
  display: grid; gap: 0.4rem 3rem;
}
@media (min-width: 54rem) {
  .presentation figcaption { grid-template-columns: minmax(0, 17rem) minmax(0, 1fr); align-items: baseline; }
}

/* a plate cropped out of a presentation view is low resolution: never show it
   larger than it really is */
.painting__figure[data-lowres] img { max-width: 38rem; }

/* a pair the artist made stays side by side, in the catalogue as on the home page */
.index-pair {
  grid-column: span 12;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 3vw, 3rem);
  align-items: start;
}
@media (min-width: 70rem) { .index-pair { grid-column: span 8; } }
.index-pair .index-item { grid-column: auto !important; }

/* a painting whose only image is low resolution is never shown larger than it is */

/* the opening block of writing, now sitting inside the hang */
.hang__text { width: 100%; }
.hang__text > div { max-width: 38rem; margin-inline: auto; }
.band--open { padding-top: clamp(2rem, 5vh, 4rem); }

/* the opening painting is given the whole first screen */
.hang__item:first-child .hang__figure img { max-height: calc(min(92vh, 64rem) * var(--scale, 1)); }


/* --- centred wall labels ------------------------------------------------ */
.hang__label { text-align: center; }

.diptych__panel {
  display: grid;
  justify-items: center;
  gap: clamp(1.25rem, 2.5vw, 1.75rem);
  align-content: end;
}
.diptych__panel img { width: auto; max-width: 100%; }

/* painting page: title and information sit centred under the canvas */
.painting__title {
  text-align: center;
  margin-top: clamp(1.75rem, 3.5vw, 2.5rem);
}
.painting__title .meta { margin-top: 0.5rem; }
.painting__title .stage { margin-top: 1rem; }

/* painting pages suggest relative canvas size too, gently */
.painting__figure img { max-height: calc(min(86vh, 58rem) * var(--scale, 1)); }


/* a mid-size canvas sits between the intimate ones and the large ones */
@media (min-width: 70rem) {
  .index-item[data-scale="mid"] { grid-column: span 5; }
}

/* painting page: the note and the enquiry sit centred under the canvas */
.painting__body {
  max-width: 42rem;
  margin: clamp(2.5rem, 5vw, 4rem) auto 0;
  text-align: center;
}
.painting__body .words { max-width: none; }
