:root {
  --bg: #070807;
  --bg-elev: #101411;
  --ink: #f2f5f1;
  --muted: #9dab8d;
  --green: #3f8f52;
  --green-deep: #2a4f35;
  --red: #b4232a;
  --red-soft: #c45a4a;
  --flesh: #ac876c;
  --line: rgba(242, 245, 241, 0.14);
  --panel: rgba(10, 14, 11, 0.72);
  --font-display: "Comfortaa", sans-serif;
  --font-body: "Syne", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --hud-h: 5rem;
  --top-h: 4.25rem;
  --safe-bottom: 5.75rem;
}

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

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

body {
  cursor: grab;
}

body.is-dragging {
  cursor: grabbing;
}

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 40;
  opacity: 0.08;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  height: var(--top-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 1.25rem;
  background: linear-gradient(180deg, rgba(7, 8, 7, 0.92), rgba(7, 8, 7, 0));
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  justify-self: start;
}

.brand__logo {
  display: block;
  height: clamp(1.35rem, 2.8vw, 1.75rem);
  width: auto;
  max-width: min(11rem, 42vw);
  object-fit: contain;
  object-position: left center;
}

.brand__artist {
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.topbar__meta {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.topbar__period {
  color: var(--ink);
  font-weight: 600;
  letter-spacing: 0.06em;
  font-size: 0.78rem;
}

.topbar__meta .dot {
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(63, 143, 82, 0.18);
}

.topbar__actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.topbar__btns {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.maps-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  transition: border-color 0.25s ease, color 0.25s ease, background 0.25s ease;
}

.maps-btn:hover {
  color: var(--ink);
  border-color: var(--green);
  background: rgba(63, 143, 82, 0.12);
}

.nav-toggle {
  width: 2.4rem;
  height: 2.4rem;
  display: grid;
  place-content: center;
  gap: 0.28rem;
}

.nav-toggle span {
  display: block;
  width: 1.2rem;
  height: 1.5px;
  background: var(--ink);
}

.index-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(22rem, 92vw);
  z-index: 35;
  background: rgba(8, 11, 9, 0.96);
  border-left: 1px solid var(--line);
  padding: 1.25rem 1.25rem 2rem;
  overflow: auto;
  backdrop-filter: blur(12px);
  transform: translateX(0);
  transition: transform 0.45s var(--ease);
}

.index-panel[hidden] {
  display: block;
  transform: translateX(105%);
  pointer-events: none;
}

.index-panel__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-family: var(--font-display);
}

.index-panel__head button {
  font-size: 1.6rem;
  line-height: 1;
  color: var(--muted);
}

#index-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

#index-list li button {
  width: 100%;
  text-align: left;
  padding: 0.7rem 0.2rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.92rem;
}

#index-list li button:hover,
#index-list li button.is-active {
  color: var(--green);
}

#index-list .sold-mark {
  color: var(--red);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.room {
  position: relative;
  height: 100%;
  overflow: hidden;
  perspective: 1400px;
  perspective-origin: 50% 45%;
}

.room__track {
  height: 100%;
  display: flex;
  align-items: stretch;
  width: max-content;
  will-change: transform;
  transform-style: preserve-3d;
  padding: var(--top-h) 0 var(--safe-bottom);
}

.panel {
  position: relative;
  flex: 0 0 100vw;
  width: 100vw;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 0.75rem 4vw;
  transform-style: preserve-3d;
}

.panel__inner {
  width: min(1100px, 94vw);
  height: min(calc(100vh - var(--top-h) - var(--safe-bottom) - 0.5rem), 820px);
  max-height: calc(100vh - var(--top-h) - var(--safe-bottom) - 0.5rem);
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(1rem, 3vw, 2.5rem);
  align-items: center;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  transform: translateZ(0) rotateY(var(--tilt, 0deg)) scale(var(--scale, 0.92));
  opacity: var(--fade, 0.35);
  filter: saturate(var(--sat, 0.55));
  transition:
    transform 0.55s var(--ease),
    opacity 0.55s var(--ease),
    filter 0.55s var(--ease);
}

.panel.is-active .panel__inner {
  --tilt: 0deg;
  --scale: 1;
  --fade: 1;
  --sat: 1;
}

.panel.is-prev .panel__inner {
  --tilt: 18deg;
  --scale: 0.88;
  --fade: 0.4;
  --sat: 0.65;
}

.panel.is-next .panel__inner {
  --tilt: -18deg;
  --scale: 0.88;
  --fade: 0.4;
  --sat: 0.65;
}

.panel--intro .panel__inner,
.panel--outro .panel__inner {
  grid-template-columns: 1fr 1fr;
}

.visual {
  position: relative;
  height: 100%;
  min-height: 280px;
  display: grid;
  place-items: center;
}

.visual__frame {
  position: relative;
  max-height: 100%;
  max-width: 100%;
  display: grid;
  place-items: center;
}

.visual__frame--hit {
  cursor: zoom-in;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
}

.visual__frame--hit:focus-visible {
  outline: 1px solid var(--green);
  outline-offset: 4px;
}

.visual__frame--diptych {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  max-width: min(56vw, 680px);
}

.visual__frame img {
  display: block;
  max-height: min(68vh, 720px);
  max-width: min(48vw, 560px);
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.04);
  background: #111;
}

.visual__frame--diptych img {
  flex: 1 1 0;
  width: 0;
  min-width: 0;
  max-width: none;
  max-height: min(64vh, 680px);
  height: auto;
  object-fit: contain;
}

.panel--intro .visual__frame img,
.panel--outro .visual__frame img {
  max-width: min(42vw, 420px);
  border-radius: 0;
}

.sold-seal {
  position: absolute;
  top: -0.4rem;
  right: -0.4rem;
  width: 4.6rem;
  height: 4.6rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 35% 30%, #e24a45, var(--red) 55%, #6e1014 100%);
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transform: rotate(12deg);
  box-shadow:
    0 10px 24px rgba(180, 35, 42, 0.45),
    inset 0 0 0 2px rgba(255, 255, 255, 0.18);
  animation: seal-in 0.7s var(--ease) both;
}

.sold-seal::after {
  content: "";
  position: absolute;
  inset: 0.35rem;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.45);
}

@keyframes seal-in {
  from {
    opacity: 0;
    transform: rotate(12deg) scale(0.6);
  }
  to {
    opacity: 1;
    transform: rotate(12deg) scale(1);
  }
}

.copy {
  align-self: center;
  padding: 0.5rem 0;
}

.kicker {
  margin: 0 0 0.75rem;
  color: var(--green);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.8rem, 4.5vw, 3.4rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.etym {
  margin: 0.85rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.desc {
  margin: 1rem 0 0;
  font-size: 1.05rem;
  line-height: 1.55;
  max-width: 34ch;
}

.specs {
  margin: 1.4rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.35rem;
  font-size: 0.86rem;
  color: var(--muted);
}

.specs li span {
  color: var(--ink);
}

.intro-logo {
  margin: 0;
  line-height: 0;
}

.intro-logo img {
  display: block;
  width: min(100%, 22rem);
  height: auto;
  max-height: 4.5rem;
  object-fit: contain;
  object-position: left center;
}

.period-banner {
  margin: 1.1rem 0 0;
  padding: 0.85rem 0 0.9rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 0.35rem;
}

.period-banner__dates {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.15rem, 2.8vw, 1.55rem);
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.2;
}

.period-banner__detail {
  font-size: 0.86rem;
  color: var(--green);
  letter-spacing: 0.02em;
}

.period-banner--compact {
  margin-top: 0.9rem;
  padding: 0.7rem 0;
}

.tagline {
  margin: 1rem 0 0;
  max-width: 34ch;
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  line-height: 1.45;
  color: var(--ink);
  font-weight: 500;
}

.lead {
  margin: 1.1rem 0 0;
  max-width: 40ch;
  color: rgba(242, 245, 241, 0.84);
  line-height: 1.6;
  font-size: 0.98rem;
}

.lead--soft {
  color: var(--muted);
}

.quote {
  margin: 1rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2.4vw, 1.35rem);
  line-height: 1.4;
  color: var(--green);
  font-weight: 600;
}

.closing {
  margin: 1.4rem 0 0;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.meta-block .sep {
  margin: 0 0.35rem;
  opacity: 0.45;
}

.meta-block .collab {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.45rem;
  align-items: baseline;
}

.meta-block .collab strong {
  margin-right: 0.15rem;
}

.meta-block a:hover {
  color: var(--green);
}

.meta-block {
  margin-top: 1.6rem;
  display: grid;
  gap: 0.55rem;
  font-size: 0.9rem;
}

.meta-block strong {
  color: var(--green);
  font-weight: 600;
}

.panel--intro .tagline,
.panel--intro .lead,
.panel--intro .etym,
.panel--intro .meta-block,
.panel--outro .quote,
.panel--outro .lead,
.panel--outro .etym,
.panel--outro .meta-block,
.panel--outro .period-banner,
.panel--outro .closing {
  max-width: none;
  width: 100%;
}

.panel--intro .lead,
.panel--outro .lead {
  font-size: 0.92rem;
  margin-top: 0.75rem;
}

.panel--intro .tagline {
  margin-top: 0.75rem;
}

.panel--intro .meta-block,
.panel--outro .meta-block {
  margin-top: 1rem;
}

.panel--outro .quote {
  max-width: none;
}

.date-inline {
  margin: 1.15rem 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.55rem 0.75rem;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  width: 100%;
}

.date-inline span:nth-child(2) {
  font-size: 1.85rem;
  color: var(--red-soft);
}

.date-inline span:not(:nth-child(2)) {
  font-size: 0.95rem;
  color: var(--ink);
}

.cta-row {
  margin-top: 1.25rem;
  margin-bottom: 0.35rem;
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.cta {
  border: 1px solid var(--line);
  padding: 0.7rem 1.1rem;
  border-radius: 999px;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
  display: inline-flex;
  align-items: center;
}

.cta:hover {
  border-color: var(--green);
  background: rgba(63, 143, 82, 0.12);
}

.cta--solid {
  background: var(--green);
  border-color: var(--green);
  color: #061008;
}

.cta--solid:hover {
  background: #4ea562;
}

.cta--ghost {
  border-color: rgba(157, 171, 141, 0.45);
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 0.9rem;
  padding: 0.55rem 1rem;
}

.cta--ghost:hover {
  color: var(--ink);
  border-color: var(--green);
  background: rgba(63, 143, 82, 0.1);
}

.hud {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  height: var(--hud-h);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 0 1.25rem 0.55rem;
  background: linear-gradient(0deg, rgba(7, 8, 7, 0.98) 35%, rgba(7, 8, 7, 0));
  pointer-events: none;
}

.hud__btn,
.hud__center {
  pointer-events: auto;
}

.hud__btn {
  width: 3.4rem;
  height: 3.4rem;
  border: 1.5px solid rgba(63, 143, 82, 0.85);
  border-radius: 50%;
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
  background: rgba(63, 143, 82, 0.28);
  box-shadow:
    0 0 0 4px rgba(63, 143, 82, 0.12),
    0 8px 22px rgba(0, 0, 0, 0.45);
  transition:
    border-color 0.25s ease,
    background 0.25s ease,
    transform 0.2s ease,
    box-shadow 0.25s ease;
}

.hud__btn:hover {
  border-color: var(--green);
  background: rgba(63, 143, 82, 0.5);
  color: #fff;
  transform: scale(1.06);
  box-shadow:
    0 0 0 5px rgba(63, 143, 82, 0.18),
    0 10px 26px rgba(0, 0, 0, 0.5);
}

.hud__btn:active {
  transform: scale(0.97);
}

.hud__center {
  text-align: center;
}

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

.hud__progress {
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
  max-width: 320px;
  margin: 0 auto;
}

.hud__bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--green-deep), var(--green));
  transition: width 0.35s var(--ease);
}

.hud__counter {
  margin: 0.45rem 0 0;
  font-size: 0.78rem;
  color: var(--ink);
}

.compass {
  position: fixed;
  right: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 25;
  width: 4.4rem;
  height: 4.4rem;
  color: var(--muted);
  pointer-events: none;
  opacity: 0.85;
}

.compass__ring {
  width: 100%;
  height: 100%;
}

.compass__needle {
  fill: var(--green);
  transform-origin: 40px 40px;
  transition: transform 0.45s var(--ease);
}

.wall-glow {
  position: absolute;
  inset: 10% 8%;
  border-radius: 40% 60% 55% 45%;
  background: radial-gradient(circle, rgba(63, 143, 82, 0.16), transparent 70%);
  filter: blur(30px);
  z-index: -1;
  opacity: 0.7;
}

@media (max-width: 900px) {
  .topbar {
    grid-template-columns: 1fr auto;
    height: var(--top-h);
    padding-top: 0;
    padding-bottom: 0;
    align-items: center;
  }

  .topbar__meta {
    display: none;
  }

  .maps-btn span {
    display: none;
  }

  .maps-btn {
    padding: 0.5rem;
  }

  .topbar__actions {
    flex-direction: row;
    align-items: center;
    gap: 0.45rem;
  }

  .compass {
    position: static;
    transform: none;
    width: 2.35rem;
    height: 2.35rem;
    opacity: 0.95;
    flex-shrink: 0;
  }

  .panel__inner,
  .panel--intro .panel__inner,
  .panel--outro .panel__inner {
    grid-template-columns: 1fr;
    height: auto;
    gap: 1rem;
    align-content: center;
  }

  .visual__frame img {
    max-height: min(42vh, 420px);
    max-width: min(86vw, 420px);
  }

  .visual__frame--diptych {
    max-width: min(92vw, 520px);
  }

  .visual__frame--diptych img {
    max-height: min(38vh, 360px);
  }

  .copy {
    text-align: center;
  }

  .desc,
  .etym,
  .lead {
    margin-left: auto;
    margin-right: auto;
  }

  .panel--intro .desc,
  .panel--intro .etym,
  .panel--intro .lead,
  .panel--intro .tagline,
  .panel--outro .desc,
  .panel--outro .etym,
  .panel--outro .lead,
  .panel--outro .quote {
    margin-left: 0;
    margin-right: 0;
    text-align: left;
  }

  .specs {
    justify-items: center;
  }

  .date-inline {
    justify-content: center;
  }

  .panel--intro .date-inline {
    justify-content: flex-start;
  }

  .cta-row {
    justify-content: center;
  }

  .panel.is-prev .panel__inner,
  .panel.is-next .panel__inner {
    --tilt: 0deg;
  }
}

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

body.overlay-open {
  cursor: default;
  overflow: hidden;
}

body.overlay-open .room,
body.overlay-open .hud,
body.overlay-open .compass,
body.overlay-open .index-panel {
  visibility: hidden;
  pointer-events: none;
}

.cta-row--prefazioni {
  margin-top: 0.55rem;
  justify-content: center;
}

.prefazioni-under {
  margin-top: 1rem;
  width: min(100%, 420px);
  text-align: center;
}

.prefazioni-under__label {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.panel--intro .visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.cta--prefaz {
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
}

.essay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--bg);
  color: var(--ink);
  overflow: hidden;
}

.essay[hidden] {
  display: none !important;
}

.essay__close {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 70;
  width: 3rem;
  height: 3rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--ink);
  background: rgba(7, 8, 7, 0.7);
  backdrop-filter: blur(8px);
  transition: border-color 0.25s ease, background 0.25s ease;
}

.essay__close:hover {
  border-color: var(--green);
  background: rgba(63, 143, 82, 0.15);
}

.essay__layout {
  display: grid;
  grid-template-columns: minmax(240px, 0.9fr) 1.2fr;
  height: 100%;
  min-height: 100dvh;
}

.essay__visual {
  display: grid;
  place-items: center;
  padding: 3rem 1.5rem;
  background:
    radial-gradient(circle at 40% 55%, rgba(63, 143, 82, 0.14), transparent 55%),
    linear-gradient(180deg, #0b0e0c, #070807);
}

.essay__visual img {
  display: block;
  width: min(100%, 460px);
  height: auto;
  max-height: min(82vh, 760px);
  object-fit: contain;
  filter: drop-shadow(0 24px 40px rgba(0, 0, 0, 0.45));
}

.essay__content {
  overflow: auto;
  overscroll-behavior: contain;
  padding: clamp(4rem, 10vh, 6rem) clamp(1.4rem, 4vw, 3.5rem) 3rem;
  border-left: 1px solid var(--line);
}

.essay__kicker {
  margin: 0 0 0.7rem;
  color: var(--green);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.essay__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.5rem, 3.4vw, 2.4rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  max-width: 22ch;
}

.essay__author {
  margin: 0.9rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.essay__body {
  margin-top: 1.8rem;
  max-width: 62ch;
}

.essay__body p {
  margin: 0 0 1.15rem;
  line-height: 1.7;
  font-size: 1rem;
  color: rgba(242, 245, 241, 0.9);
}

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

@media (max-width: 900px) {
  .essay__layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    overflow: auto;
  }

  .essay__visual {
    padding: 4.5rem 1.25rem 1rem;
    min-height: 34vh;
  }

  .essay__visual img {
    max-height: 32vh;
    width: min(100%, 280px);
  }

  .essay__content {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-top: 1.5rem;
    overflow: visible;
  }
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 65;
  display: grid;
  grid-template-rows: 1fr auto;
  background: rgba(4, 5, 4, 0.97);
  color: var(--ink);
}

.lightbox[hidden] {
  display: none !important;
}

.lightbox__close {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 70;
  width: 3rem;
  height: 3rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--ink);
  background: rgba(7, 8, 7, 0.7);
  backdrop-filter: blur(8px);
  transition: border-color 0.25s ease, background 0.25s ease;
}

.lightbox__close:hover {
  border-color: var(--green);
  background: rgba(63, 143, 82, 0.15);
}

.lightbox__stage {
  display: grid;
  place-items: center;
  padding: 4.5rem 1.25rem 1rem;
  min-height: 0;
}

.lightbox__stage img {
  display: block;
  max-width: min(96vw, 1200px);
  max-height: calc(100dvh - 7.5rem);
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

.lightbox__stage--diptych {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
}

.lightbox__stage--diptych img {
  flex: 1 1 0;
  width: 0;
  min-width: 0;
  max-width: none;
  max-height: calc(100dvh - 7.5rem);
}

.lightbox__caption {
  margin: 0;
  padding: 0.85rem 1.25rem 1.35rem;
  text-align: center;
  font-size: 0.86rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}
