:root {
  --bg-top: #ffffff;
  --bg-bottom: #ffffff;
  --text: #000000;
  --muted: rgba(0, 0, 0, 0.62);
  --line: rgba(0, 0, 0, 0.12);
  --shadow: 0 24px 48px rgba(0, 0, 0, 0.08);
  --title-font: "Aptos Display", "Aptos", "Helvetica Neue", "Segoe UI", "Noto Sans KR", sans-serif;
  --meta-font: "Aptos", "Helvetica Neue", "Segoe UI", "Noto Sans KR", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable both-edges;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: #ffffff;
  font-family: var(--meta-font);
}

body.is-lightbox-open,
body.is-history-open,
body.is-intro-active {
  overflow: hidden;
}

img {
  max-width: 100%;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-shell {
  padding: 0.95rem clamp(0.75rem, 2vw, 1.5rem) 2.5rem;
}

.site-topbar {
  position: sticky;
  top: 0.9rem;
  z-index: 18;
  width: min(100%, 1560px);
  margin: 0 auto 2rem;
}

.site-nav-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.2rem 0.9rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 1.35rem;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(16px);
  transition: padding 260ms ease, box-shadow 260ms ease, border-color 260ms ease;
}

.site-topbar.is-compact .site-nav-card {
  padding-top: 0.82rem;
  padding-bottom: 0.8rem;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.06);
}

.history-trigger,
.audio-toggle,
.visit-counter {
  margin: 0;
  padding: 0.34rem 0.62rem;
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #000000;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, opacity 180ms ease;
}

.history-trigger {
  justify-self: start;
}

.audio-toggle {
  justify-self: end;
}

.site-actions {
  display: inline-flex;
  align-items: center;
  justify-self: end;
  gap: 0.48rem;
}

.visit-counter {
  justify-self: end;
  white-space: nowrap;
  cursor: default;
}

.history-trigger:hover,
.history-trigger:focus-visible,
.audio-toggle:hover,
.audio-toggle:focus-visible {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.28);
}

.history-trigger:focus-visible,
.audio-toggle:focus-visible,
.exhibition-logo:focus-visible {
  outline: none;
}

.site-brand {
  display: grid;
  justify-items: center;
  text-align: center;
  min-width: 0;
}

.exhibition-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--title-font);
  font-size: clamp(1.48rem, 2.6vw, 2.18rem);
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #000000;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  text-shadow: 0.012em 0 currentColor, -0.012em 0 currentColor;
}

.exhibition-logo:hover,
.exhibition-logo:focus-visible {
  opacity: 0.78;
}

.site-credit {
  margin: 0.34rem 0 0;
  max-height: 2rem;
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  color: rgba(0, 0, 0, 0.68);
  pointer-events: none;
  user-select: none;
  transition: opacity 260ms ease, transform 260ms ease, max-height 260ms ease, margin 260ms ease;
}

.site-topbar.is-compact .site-credit {
  opacity: 0;
  max-height: 0;
  margin-top: 0;
  transform: translateY(-0.3rem);
  overflow: hidden;
}

.intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: #ffffff;
  transition: opacity 900ms ease, visibility 900ms ease;
}

.intro-overlay.is-fading {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.intro-shell {
  position: relative;
  width: min(100%, 1560px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0.95rem clamp(0.75rem, 2vw, 1.5rem) 2.5rem;
}

.intro-copy {
  position: absolute;
  left: var(--intro-left, 50%);
  top: var(--intro-top, 50%);
  transform: translate(-50%, -50%);
  display: grid;
  justify-items: center;
  text-align: center;
  padding: 2rem;
  width: max-content;
  max-width: calc(100vw - 4rem);
  margin: 0 auto;
}

.intro-title {
  font-family: var(--title-font);
  font-size: clamp(3.6rem, 8.2vw, 5.9rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  text-shadow: 0.014em 0 currentColor, -0.014em 0 currentColor;
  width: auto;
  margin: 0;
}

.intro-subtitle {
  margin: 0 0 0.04rem;
  font-family: var(--meta-font);
  font-size: clamp(0.88rem, 1.45vw, 1.02rem);
  font-weight: 500;
  line-height: 1.55;
  color: rgba(0, 0, 0, 0.72);
  letter-spacing: 0.08em;
  text-align: center;
  width: auto;
  white-space: nowrap;
}

.intro-lead {
  margin-top: 1.08rem;
  font-family: var(--meta-font);
  font-size: clamp(0.88rem, 1.45vw, 1.02rem);
  font-weight: 500;
  line-height: 1.5;
  color: rgba(0, 0, 0, 0.72);
  letter-spacing: 0.08em;
  text-align: center;
  width: auto;
}

.history-overlay {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: grid;
  place-items: center;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.9);
  opacity: 0;
  visibility: hidden;
  transition: opacity 320ms ease, visibility 320ms ease;
}

.history-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

.history-panel {
  width: min(100%, 560px);
  padding: 2.2rem 1.5rem;
}

.history-lines {
  display: grid;
  gap: 0.9rem;
  text-align: center;
}

.history-heading {
  margin: 0 0 0.35rem;
  font-family: var(--title-font);
  font-size: clamp(1.08rem, 2.15vw, 1.34rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.55;
}

.history-line {
  margin: 0;
  font-family: var(--title-font);
  font-size: clamp(1rem, 2vw, 1.22rem);
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.7;
}

.exhibition-stream {
  width: min(100%, 1560px);
  margin: 0 auto;
  column-count: 4;
  column-gap: 1rem;
}

.photo-item {
  position: relative;
  display: block;
  width: 100%;
  margin: 0 auto 1rem;
  break-inside: avoid;
  transition: opacity 280ms ease, filter 280ms ease, transform 280ms ease;
}

.exhibition-stream.is-hovering .photo-item:not(.is-active) {
  opacity: 0.58;
  filter: saturate(0.88);
}

.photo-item.is-active {
  transform: translateY(-2px);
}

.photo-frame {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  position: relative;
}

.photo-image {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: none;
  border-radius: 1.35rem;
  box-shadow: var(--shadow);
}

.photo-meta {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  margin: 0;
  padding: 1.45rem 0.95rem 0.95rem;
  max-height: none;
  opacity: 0;
  transform: translateY(0.45rem);
  pointer-events: none;
  border-radius: 0 0 1.35rem 1.35rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.32) 12%, rgba(255, 255, 255, 0.78) 32%, rgba(255, 255, 255, 0.94) 56%);
  transition: opacity 220ms ease, transform 220ms ease;
}

.photo-item.is-active .photo-meta,
.photo-item.is-focused .photo-meta {
  opacity: 1;
  transform: translateY(0);
}

.meta-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem 0.9rem;
  margin: 0;
}

.meta-block {
  min-width: 0;
}

.meta-term {
  margin: 0;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.meta-value {
  margin: 0.22rem 0 0;
  font-family: var(--title-font);
  font-size: 0.8rem;
  line-height: 1.32;
  word-break: keep-all;
}

.empty-state {
  width: min(100%, 1480px);
  margin: 20vh auto 18vh;
  text-align: center;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.96);
  opacity: 0;
  transition: opacity 320ms ease;
}

.lightbox.is-visible {
  opacity: 1;
}

.lightbox-content {
  width: fit-content;
  max-width: min(92vw, 1280px);
  max-height: calc(100vh - 4rem);
  display: grid;
  gap: 1rem;
  justify-items: stretch;
  opacity: 0;
  transform: translateY(0.45rem);
  transition: opacity 220ms ease, transform 220ms ease;
}

.lightbox.is-visible .lightbox-content {
  opacity: 1;
  transform: translateY(0);
}

.lightbox.is-opening .lightbox-content {
  opacity: 0;
  transform: translateY(0.45rem);
}

.lightbox.is-closing .lightbox-content {
  opacity: 0;
  transform: translateY(0.2rem);
}

.lightbox-image {
  display: block;
  justify-self: start;
  width: auto;
  max-width: 100%;
  max-height: calc(100vh - 11rem);
  box-shadow: 0 32px 64px rgba(0, 0, 0, 0.12);
}

.lightbox-ghost {
  position: fixed;
  z-index: 41;
  display: block;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
  transform-origin: top left;
  will-change: transform;
}

.lightbox-meta {
  width: 100%;
  align-self: start;
  border-top: 1px solid var(--line);
  padding-top: 0.9rem;
}

.lightbox-meta-list {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin: 0;
  overflow-x: auto;
  white-space: nowrap;
}

.lightbox-meta-item {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
}

.lightbox-meta-term {
  margin: 0;
  color: var(--muted);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.lightbox-meta-value {
  margin: 0;
  font-family: var(--title-font);
  font-size: 0.96rem;
}

@media (max-width: 720px) {
  .site-shell {
    padding-top: 0.8rem;
  }

  .site-topbar {
    top: 0.65rem;
    margin-bottom: 1.4rem;
  }

  .site-nav-card {
    gap: 0.55rem;
    padding: 0.82rem 0.82rem 0.75rem;
    border-radius: 1.05rem;
  }

  .history-trigger,
  .audio-toggle,
  .visit-counter {
    padding: 0.28rem 0.48rem;
    font-size: 0.56rem;
  }

  .site-actions {
    gap: 0.32rem;
  }

  .exhibition-logo {
    font-size: clamp(1.12rem, 5vw, 1.48rem);
    letter-spacing: 0.1em;
  }

  .site-credit {
    font-size: 0.58rem;
    letter-spacing: 0.11em;
  }

  .history-overlay {
    padding: 1.25rem;
  }

  .intro-copy {
    padding: 1.4rem 1.2rem;
    max-width: calc(100vw - 2rem);
  }

  .intro-subtitle {
    white-space: normal;
  }

  .history-panel {
    padding: 1.5rem 1rem;
  }

  .history-lines {
    gap: 0.72rem;
  }

  .exhibition-stream {
    column-count: 2;
    column-gap: 0.75rem;
  }

  .photo-image {
    border-radius: 1rem;
  }

  .photo-item {
    width: 100%;
    margin-bottom: 0.75rem;
  }

  .photo-meta {
    border-radius: 0 0 1rem 1rem;
    padding: 1.15rem 0.8rem 0.8rem;
  }

  .meta-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.38rem 0.75rem;
  }

  .lightbox {
    padding: 1rem;
  }

  .lightbox-content {
    width: fit-content;
    max-width: 92vw;
    max-height: calc(100vh - 2rem);
    gap: 0.8rem;
  }

  .lightbox-image {
    max-height: calc(100vh - 9.5rem);
  }

  .lightbox-meta-value {
    font-size: 0.88rem;
  }
}

@media (max-width: 430px) {
  .site-nav-card {
    grid-template-columns: 1fr auto 1fr;
  }

  .exhibition-stream {
    column-count: 1;
  }

  .meta-list {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 721px) and (max-width: 1120px) {
  .exhibition-stream {
    column-count: 3;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition-duration: 0ms !important;
    animation-duration: 0ms !important;
  }
}
