/* ════════════════════════════════════════════════════════════════════════
   Writing & Art.

   Writing comes first and behaves itself: a measure you can read, staggered
   so it isn't a card grid. Then the room opens up. The art is *hung*, not
   listed — staggered across the full width of the window at five different
   scales, each work with its label beneath it. Nothing leans and nothing
   overlaps; the dimensions wait for you to come closer.
   ═══════════════════════════════════════════════════════════════════════ */

.work { --paper: #fcfcfc; }
html.dark-mode .work { --paper: #101011; }

/* ── Title lockup: deliberately off-balance ─────────────────────────── */
.work-head { padding: clamp(3.5rem, 9vw, 7rem) 0 clamp(1.5rem, 4vw, 2.5rem); }

.work-title {
  display: grid;
  font-family: var(--display);
  line-height: 0.84;
  letter-spacing: -0.02em;
}
.wt-a { justify-self: start; font-size: clamp(2.8rem, 12vw, 8.5rem); transform-origin: left center; }
.wt-b { justify-self: end; font-size: clamp(3.4rem, 15vw, 10.5rem); transform-origin: right center; }

/* Each word is a doorway down the page to its hall. */
.work-title a {
  color: var(--ink);
  text-decoration: none;
  transition: transform var(--slow) var(--ease), color var(--dur) var(--ease);
}
.work-title a:hover,
.work-title a:focus-visible { color: var(--accent); transform: scale(1.12); }
.wt-and {
  justify-self: center;
  margin: 0.35em 0 0.25em;
  font-size: clamp(0.95rem, 2.6vw, 1.9rem);
  font-style: italic;
  letter-spacing: 0.04em;
  color: var(--ink-dim);
  transform: rotate(-4deg);
}

/* ── Wall text ──────────────────────────────────────────────────────── */
.statement {
  max-width: 42rem;
  margin: 0 0 0 auto;
  padding: clamp(2rem, 5vw, 3.5rem) 0 clamp(3rem, 8vw, 5rem);
}
.statement p {
  margin: 0;
  font-size: clamp(1.15rem, 2.3vw, 1.5rem);
  line-height: 1.55;
  font-style: italic;
  color: var(--ink-mid);
}
.statement p + p { margin-top: 1em; font-size: 1.02rem; }

/* ── Halls ──────────────────────────────────────────────────────────── */
.hall { padding: clamp(3rem, 8vw, 6rem) 0; }
.hall + .hall { border-top: 1px solid var(--rule-soft); }
/* The gallery opens straight off the writing — no line across the doorway. */
.hall + .hall--gallery { border-top: none; padding-top: clamp(4rem, 12vw, 9rem); }

.hall-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: clamp(2.5rem, 7vw, 4.5rem);
  color: var(--ink-dim);
}
.hall-head h2 { font: inherit; letter-spacing: inherit; text-transform: inherit; color: var(--ink); }

/* ── Vitrines: the writing that gets shown, not just listed ─────────── */
.vitrines {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
  margin-bottom: clamp(3.5rem, 9vw, 6.5rem);
}
/* Stepped down the page rather than ruled across it. */
.vitrines > :nth-child(3n + 2) { margin-top: clamp(1.5rem, 4vw, 3.5rem); }
.vitrines > :nth-child(3n) { margin-top: clamp(3rem, 8vw, 7rem); }

.vitrine { margin: 0; display: flex; flex-direction: column; }
.vitrine figcaption { display: flex; flex-direction: column; flex: 1; }
.vitrine-img { display: block; overflow: hidden; background: var(--wall); }
.vitrine-img img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  transition: transform 1.1s var(--ease);
}
.vitrine:hover .vitrine-img img { transform: scale(1.03); }

.vitrine-pub { margin-top: 1.1rem; color: var(--accent); }
.vitrine h3 {
  margin: 0.55rem 0 0.5rem;
  font-family: var(--display);
  font-size: 1.65rem;
  line-height: 1.12;
}
.vitrine h3 a { color: var(--ink); text-decoration: none; }
.vitrine h3 a:hover { color: var(--accent); }
.vitrine-excerpt {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--ink-mid);
  font-style: italic;
}
.vitrine-more { margin-top: auto; padding-top: 1rem; }
.vitrine-more a { color: var(--ink-dim); text-decoration: none; }
.vitrine-more a:hover { color: var(--accent); }
.vitrine-more a::after { content: " \2192"; }

/* ── Checklist of writing ───────────────────────────────────────────── */
.checklist-group { max-width: 46rem; }
.checklist-group + .checklist-group { margin-top: clamp(2.5rem, 6vw, 4rem); }
.checklist-group > .label {
  display: block;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--ink);
  color: var(--ink);
}

.checklist { margin: 0; padding: 0; list-style: none; }
.checklist li[hidden] { display: none; }
.checklist li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.2rem 1.5rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--rule-soft);
}
.checklist-title { font-size: 1.12rem; line-height: 1.35; color: var(--ink); text-decoration: none; }
a.checklist-title:hover { color: var(--accent); text-decoration: underline; }
.checklist-year {
  grid-column: 2;
  grid-row: 1;
  align-self: baseline;
  color: var(--ink-dim);
  font-family: var(--label);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  font-variant-numeric: oldstyle-nums;
}
.checklist-pub { grid-column: 1; color: var(--ink-mid); font-style: italic; font-size: 0.92rem; }
.checklist-award { margin-left: 0.6em; color: var(--accent); font-style: normal; }
.checklist-empty { padding: 1rem 0; color: var(--ink-dim); font-style: italic; }

.checklist-more {
  margin-top: 1rem;
  padding: 0.3rem 0;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-mid);
  cursor: pointer;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.checklist-more::after { content: " \2193"; }
.checklist-more:hover { color: var(--accent); border-color: var(--accent); }
.checklist-more[hidden] { display: none; }

/* ════════════════════════════════════════════════════════════════════
   THE HANG
   A 24-column grid across the full width of the window. Each work takes a
   different span and starts on a different line, so the wall reads as
   hung rather than tiled — but every work (and its label) owns its cells,
   so nothing can overlap. The five-beat rhythm below is the composition:
   two side by side, one alone, two side by side.
   ══════════════════════════════════════════════════════════════════════ */
.hang {
  display: grid;
  grid-template-columns: repeat(24, minmax(0, 1fr));
  align-items: start;
  row-gap: clamp(3rem, 7vw, 6rem);
  padding: clamp(2.75rem, 5vw, 4rem) clamp(1.25rem, 5vw, 4.5rem) clamp(3rem, 9vw, 7rem);
}

.plate {
  margin: 0;
  margin-top: var(--top, 0);
  grid-column: var(--col);
  transition: opacity var(--dur) var(--ease);
}

.plate:nth-child(5n + 1) { --col: 2 / span 10; }
.plate:nth-child(5n + 2) { --col: 16 / span 7;  --top: clamp(2rem, 8vw, 7rem); }
.plate:nth-child(5n + 3) { --col: 6 / span 12; }
.plate:nth-child(5n + 4) { --col: 2 / span 7;   --top: clamp(1rem, 4vw, 3rem); }
.plate:nth-child(5n + 5) { --col: 13 / span 9; }

/* Step toward one work and the rest of the wall recedes. */
.hang:has(.plate:hover) .plate:not(:hover),
.hang:has(.plate:focus-within) .plate:not(:focus-within) {
  opacity: 0.4;
}

.plate-zoom {
  all: unset;
  display: block;
  width: 100%;
  cursor: zoom-in;
}
.plate-zoom img,
.plate-placeholder {
  display: block;
  width: 100%;
  height: auto;
  box-shadow: 0 2.5rem 5rem -2.5rem rgba(0, 0, 0, 0.55),
              0 0.4rem 1.2rem -0.9rem rgba(0, 0, 0, 0.3);
  transition: transform var(--slow) var(--ease), box-shadow var(--slow) var(--ease);
}
.plate-zoom:hover img,
.plate-zoom:focus-visible img {
  transform: translateY(-6px);
  box-shadow: 0 4rem 7rem -3rem rgba(0, 0, 0, 0.6);
}

.plate-placeholder {
  aspect-ratio: var(--ratio, 4 / 3);
  display: grid;
  place-items: center;
  background: var(--wall);
  color: var(--ink-dim);
  font-style: italic;
  box-shadow: none;
  outline: 1px solid var(--rule-soft);
}

/* The label sits in flow under the work, so it takes up its own room. */
.plate-label { margin-top: 1rem; }
.plate-title {
  display: block;
  font-family: var(--display);
  font-size: 1.35rem;
  line-height: 1.15;
  font-style: italic;
}
.plate-meta,
.plate-size { display: block; color: var(--ink-dim); font-size: 0.82rem; line-height: 1.6; }

/* Dimensions wait until you're close. */
.plate-size {
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.plate:hover .plate-size,
.plate:focus-within .plate-size { opacity: 1; transform: none; }
@media (hover: none) {
  .plate-size { opacity: 1; transform: none; }
}

/* ── Lightbox ───────────────────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  /* Both tracks capped: an auto column takes the image's intrinsic width —
     2000-odd pixels — and max-width: 100% on the image then resolves against
     that, so the enlarged art ran off the right of a phone screen. */
  grid-template-rows: minmax(0, 1fr) auto;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
  padding: clamp(1.5rem, 5vw, 4rem);
  background: color-mix(in srgb, var(--paper) 96%, transparent);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur) var(--ease), visibility var(--dur);
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox img {
  place-self: center;
  width: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: 0 3rem 6rem -3rem rgba(0, 0, 0, 0.6);
}
.lightbox-label { text-align: center; color: var(--ink-mid); }
.lightbox-label .plate-title { display: inline; margin-right: 0.6rem; font-size: 1.2rem; }
.lightbox-label .plate-meta { display: inline; }
.lightbox-close {
  position: absolute;
  top: clamp(1rem, 3vw, 2rem);
  right: clamp(1rem, 3vw, 2rem);
  padding: 0.5rem 0.9rem;
  background: none;
  border: 1px solid var(--rule);
  color: var(--ink-mid);
  font-family: var(--label);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
}
.lightbox-close:hover { color: var(--accent); border-color: var(--accent); }

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .vitrines { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vitrines > :nth-child(3n + 2),
  .vitrines > :nth-child(3n) { margin-top: 0; }
  .vitrines > :nth-child(even) { margin-top: clamp(1.5rem, 5vw, 3rem); }
}

/* On a phone each work gets a row to itself, still staggered by width
   and margin. */
@media (max-width: 760px) {
  .hang { padding-inline: 1.25rem; }
  .hang .plate:nth-child(n) { --top: 0; }
  .plate:nth-child(5n + 1) { --col: 1 / span 20; }
  .plate:nth-child(5n + 2) { --col: 10 / span 15; }
  .plate:nth-child(5n + 3) { --col: 1 / span 24; }
  .plate:nth-child(5n + 4) { --col: 1 / span 15; }
  .plate:nth-child(5n + 5) { --col: 7 / span 18; }
}

@media (max-width: 620px) {
  .vitrines { grid-template-columns: minmax(0, 1fr); }
  .vitrines > :nth-child(even) { margin-top: 0; }
  .checklist li { grid-template-columns: minmax(0, 1fr); }
  .checklist-year { grid-column: 1; grid-row: auto; }
  .statement { margin-left: 0; }
}
