:root {
  --wall: #2a2420;
  --wall-deep: #1a1613;
  --plaster: #c4b5a2;
  --gold: #b8954a;
  --gold-soft: #d4b56a;
  --ink: #f3ebe0;
  --muted: rgba(243, 235, 224, 0.72);
  --frame-outer: #3d2a18;
  --frame-mid: #8b6914;
  --shadow: rgba(0, 0, 0, 0.55);
  --danger: #c45c4a;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Outfit", sans-serif;
  color: var(--ink);
  background: var(--wall-deep);
  overflow-x: hidden;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(184, 149, 74, 0.18), transparent 55%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(90, 60, 30, 0.35), transparent 50%),
    linear-gradient(180deg, #3a322b 0%, var(--wall) 35%, var(--wall-deep) 100%);
}

.atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  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.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
}

.site-header {
  max-width: 42rem;
  margin: 0 auto;
  padding: clamp(2.5rem, 8vw, 5rem) 1.5rem 2rem;
  text-align: center;
  animation: rise 0.9s ease-out both;
}

.brand {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(2.75rem, 9vw, 4.75rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1;
  color: var(--gold-soft);
  text-shadow: 0 2px 24px rgba(184, 149, 74, 0.25);
}

.headline {
  margin: 0.35rem 0 0;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(1.35rem, 3.5vw, 1.85rem);
  font-weight: 500;
  font-style: italic;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--plaster);
}

.lede {
  margin: 1.1rem auto 0;
  max-width: 28rem;
  font-weight: 300;
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--muted);
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.75rem;
}

.btn {
  appearance: none;
  border: 1px solid rgba(212, 181, 106, 0.55);
  background: linear-gradient(160deg, rgba(184, 149, 74, 0.22), rgba(61, 42, 24, 0.55));
  color: var(--ink);
  font-family: "Outfit", sans-serif;
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  padding: 0.85rem 1.5rem;
  cursor: pointer;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
}

.btn:hover,
.btn:focus-visible {
  border-color: var(--gold-soft);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(184, 149, 74, 0.2);
  outline: none;
}

.btn--ghost {
  background: transparent;
  box-shadow: none;
}

.status {
  min-height: 1.4rem;
  margin: 0.85rem 0 0;
  font-size: 0.9rem;
  color: var(--gold-soft);
}

.upload-progress {
  width: min(100%, 280px);
  margin: 0.75rem auto 0;
}

.upload-progress__track {
  height: 8px;
  border: 1px solid rgba(212, 181, 106, 0.4);
  background: rgba(10, 8, 6, 0.45);
  overflow: hidden;
}

.upload-progress__bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #8b6914, var(--gold-soft));
  transition: width 0.15s ease-out;
}

.upload-progress__label {
  margin: 0.4rem 0 0;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.admin-badge {
  margin: 0.4rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.linkish {
  appearance: none;
  border: 0;
  background: none;
  color: var(--gold-soft);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

.categories {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: center;
  padding: 0 1.25rem 0.5rem;
}

.cat-btn {
  appearance: none;
  border: 1px solid rgba(212, 181, 106, 0.35);
  background: rgba(26, 22, 19, 0.45);
  color: var(--muted);
  font-family: "Outfit", sans-serif;
  font-size: 0.88rem;
  letter-spacing: 0.06em;
  padding: 0.55rem 1rem;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.cat-btn:hover,
.cat-btn:focus-visible {
  border-color: var(--gold-soft);
  color: var(--ink);
  outline: none;
}

.cat-btn.is-active {
  border-color: rgba(212, 181, 106, 0.75);
  color: var(--gold-soft);
  background: rgba(184, 149, 74, 0.16);
}

.gallery {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.25rem 4rem;
}

.gallery__wall {
  column-count: 3;
  column-gap: 1rem;
}

.gallery__wall > .painting {
  break-inside: avoid;
  page-break-inside: avoid;
  -webkit-column-break-inside: avoid;
  display: inline-block;
  width: 100%;
  margin: 0 0 1rem;
  vertical-align: top;
}

.empty {
  text-align: center;
  color: var(--muted);
  font-weight: 300;
  padding: 2rem 1rem 4rem;
}

.hidden {
  display: none !important;
}

.painting {
  animation: hang 0.7s ease-out both;
  transition: transform 0.35s ease;
}

.painting:nth-child(1) { animation-delay: 0.05s; }
.painting:nth-child(2) { animation-delay: 0.12s; }
.painting:nth-child(3) { animation-delay: 0.19s; }
.painting:nth-child(4) { animation-delay: 0.26s; }
.painting:nth-child(5) { animation-delay: 0.33s; }
.painting:nth-child(6) { animation-delay: 0.4s; }

.painting:hover {
  transform: translateY(-4px);
}

.painting__frame {
  position: relative;
  padding: 14px;
  background:
    linear-gradient(145deg, #5c4324 0%, var(--frame-outer) 35%, #2a1c10 70%, #6e5230 100%);
  box-shadow:
    0 18px 40px var(--shadow),
    inset 0 0 0 1px rgba(212, 181, 106, 0.35),
    inset 0 0 0 4px rgba(26, 18, 10, 0.65),
    inset 0 0 18px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

.painting__frame--audio {
  cursor: default;
}

.painting__frame--media {
  cursor: default;
}

.painting__frame::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(212, 181, 106, 0.45);
  box-shadow:
    inset 0 0 0 3px var(--frame-mid),
    inset 0 0 0 5px rgba(31, 24, 18, 0.9);
  pointer-events: none;
}

.painting__mat {
  position: relative;
  background: #ebe2d4;
  padding: 12px;
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.12);
}

.painting--audio .painting__mat {
  display: grid;
  gap: 0.85rem;
  justify-items: center;
  padding: 1.1rem 0.9rem 0.95rem;
  background:
    radial-gradient(circle at 50% 35%, rgba(212, 181, 106, 0.18), transparent 55%),
    #ebe2d4;
}

.painting__mat img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: contain;
  object-position: center;
  background: #ebe2d4;
}

.audio-disc {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #1a1613 0 14%, transparent 15%),
    repeating-radial-gradient(circle at center, #2a2420 0 2px, #1f1a16 2px 4px);
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.35),
    inset 0 0 0 2px rgba(212, 181, 106, 0.45);
  display: grid;
  place-items: center;
}

.audio-disc__label {
  color: var(--gold-soft);
  font-size: 1.6rem;
  line-height: 1;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}

.audio-player {
  width: 100%;
  max-width: 240px;
  height: 36px;
}

.video-player {
  display: block;
  width: 100%;
  height: auto;
  max-height: 320px;
  background: #1a1613;
  vertical-align: middle;
}

.painting--video .painting__mat {
  padding: 8px;
  background: #1f1812;
}

.painting figcaption {
  margin-top: 0.7rem;
  text-align: center;
  font-family: "Cormorant Garamond", serif;
  font-size: 1.05rem;
  font-style: italic;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.painting__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
  margin-top: 0.65rem;
}

.vote-group {
  display: inline-flex;
  gap: 0.35rem;
}

.vote-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid rgba(212, 181, 106, 0.4);
  background: rgba(26, 22, 19, 0.55);
  color: var(--ink);
  font-family: "Outfit", sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.vote-btn:hover,
.vote-btn:focus-visible {
  border-color: var(--gold-soft);
  color: var(--gold-soft);
  outline: none;
}

.vote-btn--like.is-active {
  border-color: rgba(120, 180, 110, 0.75);
  color: #b7d9a8;
  background: rgba(70, 110, 60, 0.28);
}

.vote-btn--dislike.is-active {
  border-color: rgba(196, 92, 74, 0.7);
  color: #f0b0a4;
  background: rgba(120, 50, 40, 0.28);
}

.vote-btn__count {
  min-width: 1ch;
}

.action-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(212, 181, 106, 0.4);
  background: rgba(26, 22, 19, 0.55);
  color: var(--ink);
  text-decoration: none;
  font-family: "Outfit", sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.action-btn:hover,
.action-btn:focus-visible {
  border-color: var(--gold-soft);
  color: var(--gold-soft);
  outline: none;
}

.action-btn--danger {
  border-color: rgba(196, 92, 74, 0.55);
}

.action-btn--danger:hover,
.action-btn--danger:focus-visible {
  border-color: var(--danger);
  color: #f0b0a4;
}

.panel {
  border: 1px solid rgba(212, 181, 106, 0.4);
  background: linear-gradient(180deg, #2f2924, #1f1a16);
  color: var(--ink);
  padding: 1.4rem 1.5rem 1.25rem;
  width: min(92vw, 420px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

.panel::backdrop {
  background: rgba(8, 6, 4, 0.72);
  backdrop-filter: blur(4px);
}

.panel h2 {
  margin: 0 0 0.85rem;
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
  font-size: 1.7rem;
  color: var(--gold-soft);
}

.panel__hint {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.field {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 0.95rem;
  text-align: left;
  font-size: 0.88rem;
  color: var(--muted);
}

.field input[type="text"],
.field input[type="password"],
.field input[type="file"] {
  width: 100%;
  border: 1px solid rgba(212, 181, 106, 0.35);
  background: rgba(10, 8, 6, 0.45);
  color: var(--ink);
  font: inherit;
  padding: 0.7rem 0.8rem;
}

.field input[type="file"] {
  padding: 0.55rem;
}

.panel__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: rgba(10, 8, 6, 0.88);
  backdrop-filter: blur(6px);
  animation: fade 0.25s ease;
}

.lightbox[hidden] {
  display: none;
}

.lightbox img,
.lightbox video {
  max-width: min(92vw, 960px);
  max-height: 88vh;
  object-fit: contain;
  box-shadow:
    0 0 0 10px #3d2a18,
    0 0 0 12px rgba(212, 181, 106, 0.5),
    0 24px 60px rgba(0, 0, 0, 0.6);
}

.lightbox video {
  background: #0a0806;
  width: min(92vw, 960px);
}

.lightbox__close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes hang {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 900px) {
  .gallery__wall {
    column-count: 2;
  }
}

@media (max-width: 560px) {
  .gallery__wall {
    column-count: 1;
    max-width: 420px;
    margin-inline: auto;
  }
}
