:root {
  --paper: #f2f0ea;
  --ink: #171713;
  --soft-ink: #6e6c64;
  --line: rgba(23, 23, 19, .2);
  --acid: #d9ff52;
  --header: 6.25rem;
  --gutter: clamp(1.25rem, 3vw, 3.5rem);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body { min-height: 100%; margin: 0; background: var(--paper); }
::selection { background: var(--acid); color: var(--ink); }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .22em; }
button, input, textarea, select { font: inherit; }
button, .button { cursor: pointer; }

.site-header {
  height: var(--header);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 0 var(--gutter);
  position: relative;
  z-index: 20;
}
.wordmark { width: max-content; font-size: .77rem; font-weight: 600; line-height: .92; letter-spacing: -.035em; text-decoration: none; text-transform: uppercase; }
.wordmark span { display: block; }
nav { justify-self: end; display: flex; align-items: center; gap: clamp(1.2rem, 2.6vw, 2.8rem); }
nav a { position: relative; text-decoration: none; font-size: .64rem; letter-spacing: .13em; text-transform: uppercase; }
nav a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: -.45rem; height: 1px; background: var(--ink); transition: right .25s ease; }
nav a.active::after, nav a:hover::after { right: 0; }
.menu-button { display: none; border: 0; background: none; padding: .5rem 0; text-transform: uppercase; letter-spacing: .12em; font-size: .65rem; }

main { min-height: calc(100dvh - var(--header)); }
.page { min-height: calc(100dvh - var(--header)); padding: clamp(1.5rem, 4vw, 4.75rem) var(--gutter) 7rem; animation: reveal .45s cubic-bezier(.2,.7,.2,1) both; }
@keyframes reveal { from { opacity: 0; transform: translateY(12px); } }
@keyframes reveal-next { from { opacity: 0; transform: translateX(18px); } }
@keyframes reveal-previous { from { opacity: 0; transform: translateX(-18px); } }
main[data-direction="1"] .page { animation-name: reveal-next; }
main[data-direction="-1"] .page { animation-name: reveal-previous; }
.loading, .error { display: grid; min-height: calc(100dvh - var(--header)); place-items: center; color: var(--soft-ink); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, h3, h4 { font-weight: 400; }

/* Home: the image is an artwork, not wallpaper. */
.home { padding: 0 var(--gutter) var(--gutter); display: grid; grid-template-columns: minmax(15rem, .72fr) minmax(20rem, 1.55fr); grid-template-rows: minmax(24rem, 1fr) auto; gap: 0 clamp(2rem, 5vw, 7rem); overflow: hidden; }
.home-slides { grid-column: 2; grid-row: 1; position: relative; min-height: 58dvh; background: #dedbd3; overflow: hidden; }
.home-slide { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.025); transition: opacity 1.2s ease, transform 7s ease; }
.home-slide.active { opacity: 1; transform: scale(1); }
.home-slides::after { content: ""; position: absolute; inset: 0; border: 1px solid rgba(23,23,19,.08); pointer-events: none; }
.home-inner { display: contents; }
.eyebrow { display: flex; align-items: center; gap: .7rem; font-size: .6rem; letter-spacing: .18em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 1.6rem; height: 1px; background: currentColor; }
.home .eyebrow { grid-column: 1; grid-row: 1; align-self: start; margin-top: 3vh; }
.home h1 { grid-column: 1 / -1; grid-row: 2; display: flex; justify-content: space-between; align-items: baseline; width: 100%; margin: clamp(1rem, 2.8vh, 2.5rem) 0 0; font-size: clamp(5rem, 13.5vw, 14rem); line-height: .72; letter-spacing: -.085em; white-space: nowrap; transform: translateY(clamp(-13rem, -22vh, -8rem)); }
.announcements { grid-column: 1; grid-row: 1; align-self: end; max-width: 29rem; margin-bottom: clamp(9rem, 22vh, 13rem); border-top: 1px solid var(--ink); padding-top: 1rem; }
.announcement { display: grid; grid-template-columns: 5rem 1fr; gap: 1rem; font-family: Iowan Old Style, Baskerville, Georgia, serif; font-size: clamp(.98rem, 1.25vw, 1.18rem); line-height: 1.35; }
.announcement-label { padding-top: .18rem; font-family: "Helvetica Neue", Arial, sans-serif; font-size: .55rem; letter-spacing: .15em; text-transform: uppercase; }
.announcement + .announcement { margin-top: .85rem; }
.home:not(.has-slides) { grid-template-columns: 1fr; }
.home:not(.has-slides) .announcements { justify-self: end; }

/* Programme */
.page-heading { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 2rem; margin-bottom: clamp(4rem, 9vw, 9rem); }
.page-heading h2 { margin: 0; font-size: clamp(4rem, 10.5vw, 12rem); line-height: .72; letter-spacing: -.08em; }
.page-heading p { margin: 0; font-size: .58rem; text-transform: uppercase; letter-spacing: .17em; color: var(--soft-ink); }
.exhibition-group { margin: 0 0 clamp(5rem, 10vw, 10rem); }
.exhibition-group > h3 { margin: 0 0 1.4rem; font-size: .58rem; letter-spacing: .18em; text-transform: uppercase; color: var(--soft-ink); }
.exhibition-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(2rem, 5vw, 6rem) clamp(1rem, 2vw, 2.4rem); }
.exhibition-card { grid-column: 1 / span 10; display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(13rem, .55fr); gap: clamp(1.25rem, 2.5vw, 3rem); text-decoration: none; min-width: 0; }
.exhibition-card:nth-child(3n + 2) { grid-column: 3 / span 10; }
.exhibition-card:nth-child(3n) { grid-column: 2 / span 9; }
.exhibition-image { position: relative; aspect-ratio: 5 / 4; overflow: hidden; background: #dedbd3; }
.exhibition-image img { width: 100%; height: 100%; display: block; object-fit: cover; filter: saturate(.82); transition: transform .7s cubic-bezier(.2,.7,.2,1), filter .3s ease; }
.exhibition-card:hover .exhibition-image img { transform: scale(1.025); filter: saturate(1); }
.exhibition-placeholder { height: 100%; display: grid; place-items: center; color: var(--soft-ink); font-family: Iowan Old Style, Baskerville, Georgia, serif; font-style: italic; font-size: 1.15rem; }
.exhibition-number { position: absolute; top: .8rem; left: .8rem; width: 2rem; height: 2rem; display: grid; place-items: center; background: var(--paper); border-radius: 50%; font-size: .55rem; }
.exhibition-info { display: flex; flex-direction: column; align-self: stretch; gap: .75rem; padding-top: .9rem; border-top: 1px solid var(--ink); }
.exhibition-info h4 { margin: 0; font-family: Iowan Old Style, Baskerville, Georgia, serif; font-size: clamp(1.55rem, 2.5vw, 2.7rem); line-height: .95; letter-spacing: -.035em; }
.exhibition-info small { order: 3; margin-top: auto; color: var(--soft-ink); font-size: .6rem; line-height: 1.5; text-transform: uppercase; letter-spacing: .08em; }
.exhibition-artists { font-family: Iowan Old Style, Baskerville, Georgia, serif; font-size: .95rem; font-style: italic; color: var(--soft-ink); }
.empty { grid-column: 1 / -1; padding: 2rem 0; border-top: 1px solid var(--line); color: var(--soft-ink); font-family: Iowan Old Style, Baskerville, Georgia, serif; font-size: 1.3rem; }

/* Exhibition detail */
.detail { padding: 0 var(--gutter) 8rem; display: grid; grid-template-columns: minmax(18rem, 1.15fr) minmax(20rem, .85fr); gap: clamp(2rem, 6vw, 8rem); }
.detail-media { min-width: 0; }
.detail-media figure { margin: 0 0 clamp(1rem, 3vw, 3.5rem); }
.detail-media img { width: 100%; display: block; }
.detail-media figcaption { max-width: 36rem; margin-top: .55rem; font-size: .58rem; line-height: 1.5; letter-spacing: .07em; color: var(--soft-ink); }
.detail-media .image-placeholder { height: 70vh; display: grid; place-items: center; background: #dedbd3; color: var(--soft-ink); font-family: Iowan Old Style, Baskerville, Georgia, serif; font-style: italic; }
.detail-copy { position: sticky; top: 0; align-self: start; min-height: calc(100dvh - var(--header)); padding: clamp(2rem, 6vh, 5rem) 0; }
.back { display: inline-block; margin-bottom: clamp(4rem, 10vh, 8rem); text-decoration: none; font-size: .57rem; text-transform: uppercase; letter-spacing: .16em; }
.detail h2 { margin-bottom: 1.1rem; font-family: Iowan Old Style, Baskerville, Georgia, serif; font-size: clamp(3.4rem, 6.5vw, 7.6rem); line-height: .83; letter-spacing: -.065em; }
.artists { font-family: Iowan Old Style, Baskerville, Georgia, serif; font-size: clamp(1.1rem, 1.8vw, 1.5rem); font-style: italic; color: var(--soft-ink); }
.metadata { margin: clamp(2rem, 5vw, 4rem) 0; padding: .85rem 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 1.5rem; font-size: .58rem; line-height: 1.5; text-transform: uppercase; letter-spacing: .12em; }
.description, .about-copy { white-space: pre-line; font-family: Iowan Old Style, Baskerville, Georgia, serif; font-size: clamp(1.15rem, 1.65vw, 1.45rem); line-height: 1.55; }
.button { display: inline-block; border: 1px solid var(--ink); background: transparent; color: var(--ink); padding: 1rem 1.35rem; text-decoration: none; font-size: .57rem; letter-spacing: .14em; text-transform: uppercase; transition: background .2s, color .2s; }
.button:hover { background: var(--ink); color: var(--paper); }

/* Text and forms */
.text-page { display: grid; grid-template-columns: minmax(12rem, .7fr) minmax(18rem, 1fr); gap: 10vw; align-content: center; max-width: 92rem; margin: auto; }
.text-page h2 { margin: 0; font-size: clamp(5rem, 13vw, 13rem); line-height: .72; letter-spacing: -.09em; }
.about-copy { max-width: 38rem; align-self: center; }
.social-link { display: inline-flex; align-items: center; gap: 1.5rem; margin-top: 2.4rem; font-family: "Helvetica Neue", Arial, sans-serif; font-size: .58rem; letter-spacing: .16em; text-transform: uppercase; text-decoration: none; }
.social-link::after { content: "↗"; font-size: 1rem; transition: transform .2s; }
.social-link:hover::after { transform: translate(.2rem, -.2rem); }
.contact-page { max-width: 92rem; margin: auto; }
.contact-meta { display: flex; justify-content: flex-end; gap: 2.5rem; margin: -5rem 0 4rem; font-size: .6rem; letter-spacing: .12em; text-transform: uppercase; }
.contact-meta .social-link { margin-top: 0; }
.contact-form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem 4rem; margin-left: 26%; }
.contact-form > label:nth-of-type(n+3), .contact-form > .form-actions { grid-column: 1 / -1; }
.contact-form textarea { min-height: 9rem; }
.honeypot { position: fixed !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }
.submit-page { max-width: 80rem; margin: auto; }
.submit-intro { max-width: 45rem; margin: -5rem 0 4rem auto; font-family: Iowan Old Style, Baskerville, Georgia, serif; font-size: 1.2rem; }
.submission-form { display: grid; gap: 3rem; padding-bottom: 4rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem 3rem; }
label { display: grid; gap: .55rem; font-size: .56rem; text-transform: uppercase; letter-spacing: .15em; }
input, textarea, select { width: 100%; padding: .8rem 0; border: 0; border-bottom: 1px solid var(--ink); background: transparent; border-radius: 0; color: var(--ink); outline: none; }
input:focus, textarea:focus, select:focus { border-bottom-width: 2px; }
textarea { resize: vertical; min-height: 6rem; }
.work-card { border-top: 1px solid var(--ink); padding-top: 1.2rem; display: grid; gap: 1.5rem; }
.work-card header { display: flex; justify-content: space-between; }
.work-card h3 { margin: 0; font-family: Iowan Old Style, Baskerville, Georgia, serif; font-size: 1.7rem; }
.remove-work { border: 0; background: transparent; text-decoration: underline; font-size: .65rem; }
.form-actions { display: flex; gap: 1rem; align-items: center; }
.form-message { font-size: .7rem; }
.success { font-family: Iowan Old Style, Baskerville, Georgia, serif; font-size: 1.5rem; border-top: 1px solid; padding-top: 1.5rem; }

footer { min-height: 5rem; padding: 0 var(--gutter); display: flex; justify-content: space-between; align-items: center; font-size: .55rem; text-transform: uppercase; letter-spacing: .15em; border-top: 1px solid var(--line); }

@media (max-width: 760px) {
  :root { --header: 4.8rem; }
  .site-header { grid-template-columns: 1fr auto; }
  .menu-button { display: block; }
  nav { position: absolute; top: 100%; left: 0; right: 0; display: none; background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--ink); padding: 1.2rem var(--gutter) 1.5rem; flex-direction: column; align-items: flex-start; gap: 1.1rem; }
  nav.open { display: flex; }
  nav a { font-size: .72rem; }
  .home { min-height: calc(100svh - var(--header)); display: grid; grid-template-columns: 1fr; grid-template-rows: auto minmax(42svh, 1fr) auto auto; gap: 0; padding-bottom: 1.2rem; }
  .home-slides { grid-column: 1; grid-row: 2; min-height: 42svh; margin: 1.5rem 0; }
  .home .eyebrow { grid-column: 1; grid-row: 1; margin-top: 1rem; }
  .home h1 { grid-column: 1; grid-row: 3; margin: 0; font-size: clamp(3.5rem, 18vw, 6rem); line-height: .78; transform: translateY(-12vh); }
  .announcements { grid-column: 1; grid-row: 4; margin-top: 2rem; margin-bottom: 0; }
  .announcement { grid-template-columns: 4.2rem 1fr; }
  .home:not(.has-slides) { grid-template-rows: auto 1fr auto; }
  .home:not(.has-slides) h1 { grid-row: 2; align-self: end; margin-bottom: 2rem; }
  .home:not(.has-slides) .announcements { grid-row: 3; justify-self: stretch; }
  .page { padding-top: 2rem; }
  .page-heading { display: block; margin-bottom: 4.5rem; }
  .page-heading h2 { font-size: clamp(4rem, 20vw, 7rem); margin-bottom: 1.5rem; }
  .exhibition-grid { display: block; }
  .exhibition-card, .exhibition-card:nth-child(n) { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(7.5rem, .65fr); gap: 1rem; margin: 0 0 4.5rem; }
  .exhibition-image { aspect-ratio: 3 / 4; }
  .exhibition-info { padding-top: .65rem; }
  .exhibition-info h4 { font-size: clamp(1.3rem, 6vw, 1.65rem); }
  .exhibition-artists { font-size: .85rem; }
  .exhibition-info small { font-size: .5rem; }
  .detail { display: flex; flex-direction: column; gap: 0; }
  .detail-copy { position: static; order: -1; min-height: auto; padding: 1.5rem 0 4rem; }
  .back { margin-bottom: 4rem; }
  .detail h2 { font-size: clamp(3.7rem, 16vw, 6rem); }
  .detail-media .image-placeholder { height: 50vh; }
  .text-page { display: block; padding-top: 10vh; }
  .text-page h2 { margin-bottom: 4rem; }
  .contact-meta { justify-content: flex-start; margin: -2rem 0 3rem; }
  .contact-form { display: grid; grid-template-columns: 1fr; margin-left: 0; }
  .contact-form > * { grid-column: 1 !important; }
  .form-grid { grid-template-columns: 1fr; }
  .submit-intro { margin: -2rem 0 3rem; }
  footer { align-items: flex-start; flex-direction: column; justify-content: center; gap: .5rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
