:root {
  --ink: #111;
  --muted: #6b6b6b;
  --paper: #fff;
  --rule: #ececec;
  --max: 1320px;
  --gutter: clamp(1.25rem, 3vw, 2.5rem);
  --type-sans: ui-sans-serif, system-ui, -apple-system, "Helvetica Neue",
    Helvetica, Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--type-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  opacity: 0.55;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ---------- Header ---------- */

.site-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  padding: 2rem var(--gutter) 1.5rem;
  max-width: var(--max);
  margin: 0 auto;
}

.site-title {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.site-title__name {
  font-weight: 600;
  letter-spacing: 0.02em;
  font-size: 1rem;
}

.site-title__role {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.25rem;
  font-weight: 400;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.75rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.site-nav a {
  font-size: 0.9rem;
}

.site-nav a[aria-current="page"] {
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}

/* ---------- Main ---------- */

.site-main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem var(--gutter) 5rem;
}

.page-title {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 2.5rem;
  text-align: center;
}

/* ---------- Homepage slideshow ---------- */

.page--home .site-main {
  padding-top: 2rem;
  padding-bottom: 3rem;
}

.slideshow {
  position: relative;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  aspect-ratio: 4 / 3;
}

.slideshow__slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 1.2s ease-in-out;
  pointer-events: none;
}

.slideshow__slide.is-active {
  opacity: 1;
  pointer-events: auto;
}

.slideshow__slide a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.slideshow__slide img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* ---------- Section nav ---------- */

.section-nav {
  margin-bottom: 2.5rem;
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg, #fff);
  padding: 0.75rem 0;
}

.section-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.5rem;
}

.section-nav a {
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--muted);
  transition: color 0.15s;
}

.section-nav a:hover {
  color: var(--ink);
}

.section-nav a.is-active {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ---------- Projects gallery ---------- */

.gallery-section {
  display: grid;
  grid-template-columns: 1fr 3fr;
  gap: 2rem;
  margin-bottom: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--rule);
  scroll-margin-top: 3.5rem;
}

.gallery-section:last-of-type {
  border-bottom: 0;
}

.gallery-section__info {
  position: sticky;
  top: 4rem;
  align-self: start;
}

.gallery__heading {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin: 0 0 0.75rem;
}

.gallery-section__desc {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--muted);
}

.gallery-section__venue {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 0.3rem;
}

.gallery-section__desc p {
  margin: 0 0 0.8rem;
}

@media (max-width: 760px) {
  .gallery-section {
    grid-template-columns: 1fr;
  }
  .gallery-section__info {
    position: static;
  }
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(275px, 1fr));
  gap: 3rem 2rem;
}

.gallery--video {
  grid-template-columns: 1fr;
}

.gallery--video .gallery__frame {
  aspect-ratio: 16 / 9;
}

.gallery--video .gallery__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery__item {
  display: flex;
  flex-direction: column;
}

.gallery__frame {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: zoom-in;
  background: transparent;
}

.gallery__frame img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.gallery__play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: #fff;
  background: rgba(0, 0, 0, 0.25);
  transition: background 0.2s;
  pointer-events: none;
}

.gallery__frame:hover .gallery__play {
  background: rgba(0, 0, 0, 0.4);
}

.gallery__caption {
  margin-top: 0.85rem;
  font-size: 0.82rem;
  line-height: 1.45;
}

.gallery__title {
  font-weight: 500;
  font-style: italic;
}

.gallery__meta {
  color: var(--muted);
  margin-top: 0.15rem;
}

.gallery__frame:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.gallery__item--hidden {
  display: none;
}

.gallery-more {
  grid-column: -2 / -1;
  justify-self: center;
  border: 0;
  padding: 0.25rem 0;
  background: transparent;
  font: inherit;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s;
}

.gallery-more:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.gallery-more[hidden] {
  display: none;
}

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.97);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(2rem, 5vw, 4rem);
}

.lightbox[hidden] {
  display: none;
}

.lightbox__figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  max-width: 100%;
  max-height: 100%;
}

.lightbox__image,
.lightbox__video {
  max-width: 100%;
  max-height: calc(100vh - 12rem);
  width: auto;
  height: auto;
  object-fit: contain;
}

.lightbox__caption {
  text-align: center;
  font-size: 0.85rem;
  line-height: 1.5;
  max-width: 36rem;
}

.lightbox__title {
  font-style: italic;
}

.lightbox__meta {
  color: var(--muted);
  margin-top: 0.2rem;
}

.lightbox__close,
.lightbox__nav {
  position: absolute;
  background: transparent;
  border: 0;
  color: var(--ink);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  font-family: inherit;
}

.lightbox__close:hover,
.lightbox__nav:hover {
  opacity: 0.55;
}

.lightbox__close {
  top: 1rem;
  right: 1rem;
  font-size: 1.9rem;
}

.lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
}

.lightbox__nav--prev { left: 1rem; }
.lightbox__nav--next { right: 1rem; }

@media (max-width: 600px) {
  .lightbox__nav { top: auto; bottom: 1rem; transform: none; }
  .lightbox__nav--prev { left: 1rem; }
  .lightbox__nav--next { right: 1rem; }
  .lightbox__image { max-height: calc(100vh - 14rem); }
}

/* ---------- Prose (about, news, exhibitions) ---------- */

.prose {
  max-width: 38rem;
  font-size: 1rem;
  line-height: 1.7;
}

.prose p {
  margin: 0 0 1.2rem;
}

.prose h2 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 2rem 0 0.6rem;
}

.about {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: start;
}

@media (min-width: 760px) {
  .about {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr);
    gap: 4rem;
  }
}

.about__portrait {
  width: 100%;
  max-width: 380px;
  justify-self: end;
}

.about__portrait .placeholder {
  width: 100%;
  aspect-ratio: 4 / 5;
  background: #f1f1f1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---------- Listings ---------- */

.entry-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-width: 42rem;
}

.entry {
  padding: 1.5rem 0;
  border-top: 1px solid var(--rule);
}

.entry:last-child {
  border-bottom: 1px solid var(--rule);
}

.entry__date {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.4rem;
}

.entry__title {
  font-size: 1.1rem;
  font-weight: 500;
  margin: 0 0 0.6rem;
}

.entry__body {
  font-size: 0.95rem;
  line-height: 1.6;
}

.entry__body p {
  margin: 0 0 0.8rem;
}

.entry__body p:last-child {
  margin-bottom: 0;
}

.entry__body a {
  text-decoration: underline;
  text-decoration-color: var(--muted);
  text-underline-offset: 3px;
}

/* ---------- Exhibition listing ---------- */

.exhibition-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 3rem 2rem;
}

.exhibition-card__link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.exhibition-card__link:hover .exhibition-card__thumb img {
  opacity: 0.85;
}

.exhibition-card__thumb {
  aspect-ratio: 3 / 2;
  background: #fafafa;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.exhibition-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.2s;
}

.exhibition-card__title {
  font-size: 1.1rem;
  font-weight: 500;
  margin: 0.85rem 0 0.2rem;
}

.exhibition-card__meta {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0;
}

.exhibition-venue {
  color: var(--muted);
  font-size: 0.9rem;
  margin: -0.5rem 0 2rem;
}

/* ---------- Footer ---------- */

.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem var(--gutter) 3rem;
  color: var(--muted);
  font-size: 0.78rem;
  border-top: 1px solid var(--rule);
}

@media (max-width: 600px) {
  .site-header {
    flex-direction: column;
    gap: 1rem;
  }
  .site-nav ul {
    justify-content: flex-start;
    gap: 1.25rem;
  }
}

/* ---------- Thumbnails ---------- */

.thumb-section {
  margin-bottom: 3rem;
}

.thumb-section__heading {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0 0 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--rule);
}

.thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1.75rem 1.25rem;
}

.thumb-grid__item {
  display: flex;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
}

.thumb-grid__image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--rule);
}

.thumb-grid__name {
  margin-top: 0.5rem;
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--muted);
  word-break: break-word;
}

.thumb-grid__item:hover .thumb-grid__name {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}
