﻿:root {
  --bg: #ffffff;
  --text: #111111;
  --muted: #8a8a8a;
  --line: #dddddd;
  --sticky-surface: rgba(255, 255, 255, 0.94);
  --overlay: rgba(255, 255, 255, 0.98);
  --subtle-text: #555555;
  --nav-idle: #c6c6c6;
  --inverse-bg: #111111;
  --inverse-text: #ffffff;
  --field-bg: #ffffff;
  --dialog-backdrop: rgba(255, 255, 255, 0.96);
  --image-brightness: 1.06;
  --columns: 5;
  --gap-x: 92px;
  --gap-y: 96px;
  --art-max-height: 320px;
  --shell-right-pad: 24px;
}

:root[data-theme="dark"] {
  --bg: #242424;
  --text: #f2f2f2;
  --muted: #525252;
  --line: rgba(82, 82, 82, 0.34);
  --sticky-surface: rgba(36, 36, 36, 0.92);
  --overlay: rgba(36, 36, 36, 0.97);
  --subtle-text: #b3b3b3;
  --nav-idle: #525252;
  --inverse-bg: #525252;
  --inverse-text: #1f1f1f;
  --field-bg: #5c5c5c;
  --dialog-backdrop: rgba(36, 36, 36, 0.92);
  --image-brightness: 1.08;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background-color 220ms ease, color 220ms ease;
}

button {
  font: inherit;
}

.menu-screen {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-content: center;
  gap: 2.25rem;
  background: var(--overlay);
  transition: opacity 220ms ease, visibility 220ms ease;
}

.menu-screen.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.menu-link {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--text);
  font-size: clamp(1.9rem, 2.5vw, 3rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  cursor: pointer;
}

.menu-link:hover,
.menu-link:focus-visible,
.theme-toggle:hover,
.theme-toggle:focus-visible,
.topnav-link:hover,
.topnav-link:focus-visible,
.lightbox-close:hover,
.lightbox-close:focus-visible,
.lightbox-nav:hover,
.lightbox-nav:focus-visible,
.contact-button:hover,
.contact-button:focus-visible,
.art-action:hover,
.art-action:focus-visible,
.contact-submit:hover,
.contact-submit:focus-visible {
  opacity: 0.6;
}

.site-shell {
  width: min(100vw - 40px, 1880px);
  margin: 0 auto;
  padding: 8px var(--shell-right-pad) 60px 0;
}

.sticky-stack {
  position: sticky;
  top: 0;
  z-index: 24;
  display: grid;
  justify-items: center;
  background: var(--sticky-surface);
  backdrop-filter: blur(12px);
}

.topbar {
  display: grid;
  width: 100%;
  grid-template-columns: 220px 1fr 140px;
  align-items: center;
  padding: 10px 0 18px;
  overflow: hidden;
  max-height: 160px;
  transition: opacity 220ms ease, max-height 220ms ease, padding 220ms ease, transform 220ms ease;
}

.topbar.is-collapsed {
  opacity: 0;
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  transform: translateY(-14px);
  pointer-events: none;
}

.theme-toggle,
.topnav-link {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--text);
  cursor: pointer;
}

.theme-toggle {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 1rem;
  line-height: 1;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.theme-option,
.theme-divider {
  transition: color 180ms ease;
}

.theme-option {
  color: var(--nav-idle);
}

.theme-divider {
  color: var(--muted);
}

:root[data-theme="light"] .theme-option-light,
:root[data-theme="dark"] .theme-option-dark {
  color: var(--text);
}

.topnav {
  justify-self: center;
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 76px;
  max-width: none;
}

.topnav-link {
  font-size: 2.14rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--nav-idle);
  white-space: nowrap;
}

.topnav-link.is-active {
  color: var(--text);
}

.brand-mark {
  justify-self: end;
  margin: 0;
  padding-top: 6px;
  font-size: 1.18rem;
  font-weight: 600;
  letter-spacing: 0.18em;
}

.panel {
  display: none;
}

.panel.is-visible {
  display: block;
}

.panel:not(.panel-exhibitions) {
  padding-top: 116px;
  min-height: calc(100vh - 220px);
}

.panel-exhibitions {
  padding-top: 146px;
}

.gallery-controls {
  position: relative;
  display: grid;
  justify-items: center;
  width: 100%;
  padding: 6px 0 0;
  background: transparent;
}

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

.gallery-viewbar {
  display: flex;
  justify-content: center;
  width: 100%;
  padding: 0;
}

.gallery-toolbar-copy {
  position: absolute;
  top: calc(100% + 18px);
  left: 50%;
  display: grid;
  gap: 12px;
  justify-items: center;
  width: min(440px, calc(100% - 32px));
  text-align: center;
  transform: translateX(-50%);
  will-change: opacity, transform;
  transition: opacity 220ms ease, transform 220ms ease;
}

.gallery-controls.is-copy-collapsed .gallery-toolbar-copy {
  opacity: 0;
  transform: translate(-50%, -10px);
  pointer-events: none;
}

.toolbar-label,
.eyebrow,
.art-method span {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.toolbar-note,
.text-panel p,
.lightbox-description,
.art-method p {
  margin: 0;
  font-size: 1.18rem;
  line-height: 1.7;
  color: var(--subtle-text);
}

.zoom-controls {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  border: 1px solid rgba(17, 17, 17, 0.12);
  border-radius: 999px;
  padding: 8px 10px;
  background: var(--sticky-surface);
  backdrop-filter: blur(12px);
}

.zoom-button {
  position: relative;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: var(--inverse-bg);
  color: var(--inverse-text);
  font-size: 1.8rem;
  cursor: pointer;
}

.zoom-button::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease;
}

.zoom-button:hover::after,
.zoom-button:focus-visible::after {
  opacity: 1;
}

.zoom-value {
  min-width: 68px;
  text-align: center;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(var(--columns), minmax(0, 1fr));
  column-gap: var(--gap-x);
  row-gap: var(--gap-y);
  align-items: start;
}

.art-card {
  display: grid;
  justify-items: center;
  gap: 20px;
}

.art-image-wrap {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: calc(var(--art-max-height) + 28px);
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.art-image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: var(--art-max-height);
  filter: brightness(var(--image-brightness));
}

.art-meta {
  display: grid;
  gap: 8px;
  justify-items: center;
  text-align: center;
}

.art-head {
  display: grid;
  gap: 6px;
}

.art-details {
  display: none;
  gap: 14px;
  max-width: 640px;
}

.art-title,
.art-edition,
.lightbox-title,
.lightbox-counter {
  margin: 0;
}

.art-title {
  font-size: 0.98rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.art-edition {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.art-description {
  margin: 0;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--subtle-text);
}

.art-actions {
  display: flex;
  justify-content: center;
  gap: 18px;
}

.art-action {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--text);
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.gallery-grid.is-detail-view .art-card {
  max-width: 1040px;
  margin: 0 auto;
  gap: 26px;
}

.gallery-grid.is-detail-view .art-image-wrap {
  min-height: calc(var(--art-max-height) + 40px);
}

.gallery-grid.is-detail-view .art-details {
  display: grid;
}

.text-panel {
  max-width: 720px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

.text-panel h2 {
  margin: 0 0 12px;
  font-size: clamp(2.4rem, 5vw, 5rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.contact-panel {
  max-width: 860px;
  margin: 0 auto;
  text-align: center;
}

.contact-top-actions {
  display: flex;
  justify-content: center;
  margin-top: 22px;
}

.contact-form {
  display: grid;
  gap: 18px;
  margin-top: 26px;
  text-align: left;
}

.contact-field {
  display: grid;
  gap: 8px;
}

.contact-field span,
.contact-note {
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.contact-field input,
.contact-field textarea {
  width: 100%;
  border: 1px solid var(--line);
  padding: 14px 16px;
  font: inherit;
  color: var(--text);
  background: var(--field-bg);
}

.contact-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.contact-submit {
  border: 1px solid var(--text);
  background: var(--text);
  color: var(--bg);
  padding: 12px 18px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.contact-submit.is-secondary {
  background: transparent;
  color: var(--text);
}

.is-hidden {
  display: none;
}

.lightbox {
  width: min(1400px, calc(100vw - 40px));
  max-height: calc(100vh - 24px);
  border: 0;
  padding: 22px 26px 26px;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

.lightbox::backdrop {
  background: var(--dialog-backdrop);
}

.lightbox-close {
  display: inline-flex;
  margin-left: auto;
  margin-bottom: 14px;
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  cursor: pointer;
}

.lightbox-content {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) 70px;
  align-items: center;
}

.lightbox-nav {
  border: 0;
  background: transparent;
  padding: 0;
  font-size: clamp(2.8rem, 4vw, 4rem);
  line-height: 1;
  cursor: pointer;
}

.lightbox-stage {
  display: grid;
  justify-items: center;
  gap: 18px;
}

.lightbox-figure {
  display: grid;
  place-items: center;
  min-height: 0;
  width: 100%;
}

.lightbox-image {
  display: block;
  width: auto;
  height: auto;
  max-width: min(100%, 860px);
  max-height: 56vh;
  filter: brightness(var(--image-brightness));
}

.lightbox-meta {
  display: grid;
  justify-items: center;
  gap: 10px;
  max-width: 420px;
  text-align: center;
  max-height: calc(100vh - 120px);
}

.lightbox-counter {
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.lightbox-title {
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.lightbox-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.contact-button {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--text);
  cursor: pointer;
}

.contact-button {
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lightbox-details {
  display: grid;
  gap: 14px;
  padding-top: 10px;
}

.lightbox-method {
  display: grid;
  gap: 8px;
}

@media (max-width: 760px) {
  .topbar {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .topnav,
  .theme-toggle,
  .brand-mark {
    justify-self: start;
  }

  .gallery-toolbar-copy {
    justify-items: center;
    text-align: center;
  }

  .panel-exhibitions {
    padding-top: 164px;
  }

  .panel:not(.panel-exhibitions) {
    padding-top: 124px;
    min-height: calc(100vh - 180px);
  }

  .gallery-grid {
    grid-template-columns: 1fr;
    row-gap: 36px;
    column-gap: 0;
  }

  .art-image {
    max-height: 54vh;
  }

  .lightbox-content {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .lightbox-nav {
    justify-self: center;
  }

  .lightbox-stage {
    order: -1;
  }

  .contact-actions,
  .art-actions,
  .lightbox-actions {
    flex-direction: column;
  }
}
