:root {
  --ink: #1a1510;
  --paper: #efe6d4;
  --paper-dim: #d9ccb4;
  --brass: #c4a35a;
  --brass-deep: #8a6a2e;
  --glow: rgba(196, 163, 90, 0.4);
  --panel: rgba(18, 14, 10, 0.94);
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body: "Manrope", "Segoe UI", sans-serif;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--paper);
  font-family: var(--font-body);
  background: #0c0a08;
  overflow-x: hidden;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(120, 80, 30, 0.35), transparent 55%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(40, 55, 70, 0.25), transparent 50%),
    linear-gradient(165deg, #14100c 0%, #0c0a08 45%, #15120e 100%);
}

.site-header {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 0.5rem;
  text-align: center;
}

.brand {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--brass);
  line-height: 1.1;
}

.site-header h1 {
  margin: 0.3rem 0 0.4rem;
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2.4vw, 1.5rem);
  font-weight: 500;
  font-style: italic;
  color: var(--paper-dim);
}

.lede {
  margin: 0 auto;
  max-width: 36rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: rgba(239, 230, 212, 0.72);
}

.toolbar {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  align-items: center;
  margin-top: 0.85rem;
  flex-wrap: wrap;
}

.toolbar-btn {
  border: 1px solid rgba(196, 163, 90, 0.45);
  background: rgba(18, 14, 10, 0.7);
  color: var(--brass);
  border-radius: 3px;
  padding: 0.45rem 0.8rem;
  font-family: var(--font-body);
  font-size: 0.82rem;
  cursor: pointer;
}

.toolbar-btn:hover {
  background: rgba(196, 163, 90, 0.2);
}

.toolbar-link {
  color: rgba(239, 230, 212, 0.55);
  font-size: 0.78rem;
}

.edit-bar {
  margin: 0.75rem auto 0;
  max-width: 36rem;
  padding: 0.65rem 0.8rem;
  border: 1px dashed rgba(196, 163, 90, 0.45);
  border-radius: 3px;
  font-size: 0.82rem;
  color: rgba(239, 230, 212, 0.8);
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

body.is-editing .hotspot {
  cursor: grab;
}

body.is-editing .hotspot.is-dragging {
  cursor: grabbing;
  transform: scale(1.4);
  z-index: 5;
}

.stage {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.5rem 1rem 2rem;
}

@media (min-width: 960px) {
  .stage {
    grid-template-columns: 1fr minmax(260px, 320px);
    align-items: start;
  }

  .stage:has(#panel[hidden]) {
    grid-template-columns: 1fr;
  }
}

.painting-shell {
  overflow: auto;
  border-radius: 2px;
  box-shadow:
    0 0 0 1px rgba(196, 163, 90, 0.25),
    0 24px 60px rgba(0, 0, 0, 0.55);
}

.painting-frame {
  position: relative;
  width: 100%;
  min-width: 900px;
  line-height: 0;
  background: #1a1510;
}

.painting {
  width: 100%;
  height: auto;
  display: block;
  user-select: none;
}

.hotspots {
  position: absolute;
  inset: 0;
}

.hotspot {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 1.35rem;
  height: 1.35rem;
  margin: -0.67rem 0 0 -0.67rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(18, 14, 10, 0.78);
  box-shadow:
    0 0 0 1.5px var(--brass),
    0 0 10px var(--glow);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  z-index: 1;
}

.hotspot-emoji {
  font-size: 0.55rem;
  line-height: 1;
  transform: translateY(1px);
}

.hotspot-num {
  font-family: var(--font-body);
  font-size: 0.42rem;
  font-weight: 600;
  color: var(--brass);
  line-height: 1;
  margin-top: -1px;
}

.hotspot:hover,
.hotspot:focus-visible,
.hotspot.is-active {
  z-index: 3;
  transform: scale(1.35);
  background: rgba(196, 163, 90, 0.95);
  outline: none;
  box-shadow:
    0 0 0 2px #1a1510,
    0 0 16px rgba(196, 163, 90, 0.85);
}

.hotspot:hover .hotspot-num,
.hotspot:focus-visible .hotspot-num,
.hotspot.is-active .hotspot-num {
  color: var(--ink);
}

.hotspot[data-id="24"],
.hotspot[data-id="56"],
.hotspot[data-id="95"] {
  width: 1.5rem;
  height: 1.5rem;
  margin: -0.75rem 0 0 -0.75rem;
  background: rgba(196, 163, 90, 0.92);
  animation: pulse 2.4s ease-in-out infinite;
}

.hotspot[data-id="24"] .hotspot-num,
.hotspot[data-id="56"] .hotspot-num,
.hotspot[data-id="95"] .hotspot-num {
  color: var(--ink);
  font-size: 0.5rem;
}

@keyframes pulse {
  0%,
  100% {
    box-shadow:
      0 0 0 1.5px var(--brass),
      0 0 8px var(--glow);
  }
  50% {
    box-shadow:
      0 0 0 2px #efe6d4,
      0 0 18px rgba(196, 163, 90, 0.9);
  }
}

.panel {
  position: relative;
  background: var(--panel);
  border: 1px solid rgba(196, 163, 90, 0.35);
  border-radius: 4px;
  padding: 1rem;
  backdrop-filter: blur(8px);
  animation: rise 0.3s ease;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.panel-close {
  position: absolute;
  top: 0.35rem;
  right: 0.45rem;
  z-index: 2;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--paper-dim);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.panel-close:hover {
  color: var(--brass);
}

.panel-crop-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 2px;
  aspect-ratio: 4 / 3;
  background: #000;
  margin-bottom: 0.85rem;
}

.panel-crop-img {
  position: absolute;
  left: 0;
  top: 0;
  max-width: none;
  pointer-events: none;
  user-select: none;
}

.panel-badge {
  position: absolute;
  left: 0.5rem;
  top: 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: rgba(18, 14, 10, 0.82);
  color: var(--brass);
  font-size: 0.72rem;
  font-weight: 600;
}

.panel-kicker {
  margin: 0;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brass);
}

.panel-copy h2 {
  margin: 0.3rem 0 0.45rem;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--paper);
}

.panel-german {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-style: italic;
  line-height: 1.35;
  color: rgba(196, 163, 90, 0.95);
}

.panel-meaning {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
  color: rgba(239, 230, 212, 0.88);
}

@media (max-width: 959px) {
  .panel:not([hidden]) {
    position: fixed;
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
    z-index: 20;
    max-height: min(55vh, 420px);
    overflow: auto;
  }
}

.glossary {
  max-width: 900px;
  margin: 0 auto 3rem;
  padding: 0 1.25rem;
}

.glossary-inner {
  border-top: 1px solid rgba(196, 163, 90, 0.28);
  padding-top: 1.75rem;
}

.glossary h2 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 700;
  color: var(--brass);
}

.glossary-lede {
  margin: 0 0 1rem;
  font-size: 0.92rem;
  line-height: 1.5;
  color: rgba(239, 230, 212, 0.72);
}

.glossary-search input {
  width: 100%;
  max-width: 28rem;
  margin-bottom: 1rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid rgba(196, 163, 90, 0.35);
  border-radius: 3px;
  background: rgba(18, 14, 10, 0.75);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 0.92rem;
}

.glossary-search input::placeholder {
  color: rgba(239, 230, 212, 0.4);
}

.glossary-search input:focus {
  outline: 1px solid var(--brass);
}

.glossary-list {
  display: grid;
  gap: 0.65rem;
}

.glossary-item {
  padding: 0.75rem 0.85rem;
  border: 1px solid rgba(196, 163, 90, 0.18);
  border-radius: 3px;
  background: rgba(18, 14, 10, 0.55);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.glossary-item:hover,
.glossary-item.is-active {
  border-color: rgba(196, 163, 90, 0.65);
  background: rgba(40, 32, 20, 0.75);
}

.glossary-item.is-highlight {
  border-color: rgba(196, 163, 90, 0.55);
  box-shadow: inset 0 0 0 1px rgba(196, 163, 90, 0.2);
}

.glossary-ids {
  margin-bottom: 0.25rem;
}

.glossary-de-id {
  display: inline-block;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brass);
}

.glossary-de {
  margin: 0 0 0.3rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-style: italic;
  color: var(--paper);
}

.glossary-ru {
  margin: 0 0 0.25rem;
  font-size: 0.92rem;
  color: rgba(239, 230, 212, 0.9);
}

.glossary-label {
  color: rgba(196, 163, 90, 0.85);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-right: 0.35rem;
}

.glossary-meaning {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.4;
  color: rgba(239, 230, 212, 0.65);
}

.glossary-empty {
  color: rgba(239, 230, 212, 0.55);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.nav-row {
  margin: 0 0 0.35rem;
}

.nav-back {
  color: rgba(196, 163, 90, 0.9);
  text-decoration: none;
  font-size: 0.88rem;
}

.nav-back:hover {
  color: var(--paper);
}

.site-header--gallery {
  padding-bottom: 0.25rem;
}

.gallery {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.25rem 3rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.1rem;
}

.gallery-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  border: 1px solid rgba(196, 163, 90, 0.28);
  background: rgba(18, 14, 10, 0.55);
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.25s ease;
}

.gallery-card:hover {
  border-color: var(--card-accent, var(--brass));
  transform: translateY(-3px);
}

.gallery-card__media {
  aspect-ratio: 4 / 3;
  background-size: cover;
  background-position: center;
  filter: saturate(0.92) contrast(1.05);
}

.gallery-card__body {
  padding: 0.9rem 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.gallery-card__artist {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(239, 230, 212, 0.55);
}

.gallery-card__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--paper);
  line-height: 1.2;
}

.gallery-card__blurb {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.45;
  color: rgba(239, 230, 212, 0.7);
  flex: 1;
}

.gallery-card__cta {
  margin-top: 0.4rem;
  color: var(--card-accent, var(--brass));
  font-size: 0.86rem;
  font-weight: 600;
}

.site-foot {
  text-align: center;
  padding: 0 1rem 2.5rem;
  font-size: 0.85rem;
}

.site-foot a {
  color: rgba(196, 163, 90, 0.85);
  text-decoration: none;
}

.site-foot a:hover {
  color: var(--paper);
}
