/* Reset and Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: "Arial Narrow", Arial, sans-serif;
  background: #0a0a0a;
}

/* Main Art Canvas */
.art-canvas {
  position: relative;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(ellipse at center, #1a1520 0%, #0a0508 100%);
  overflow: hidden;
}

/* Painting Layers with Transitions */
.painting-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 3s ease-in-out;
  will-change: transform, opacity;
}

.painting-layer.active {
  opacity: 1;
}

/* Zoom animation for rubens and charite only */
.painting-layer[data-painting="rubens"],
.painting-layer[data-painting="charite"] {
  animation: slowZoom 30s ease-in-out infinite alternate;
}

/* No zoom for raphael - show top and fit whole picture */
.painting-layer[data-painting="raphael"] {
  animation: none;
  transform: scale(1);
  background-size: contain;
  background-position: center top;
}

@keyframes slowZoom {
  0% {
    transform: scale(1);
  }
  100% {
    transform: scale(1.05);
  }
}

.painting-layer::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    ellipse at center,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0) 20%,
    rgba(0, 0, 0, 0.6) 60%,
    rgba(0, 0, 0, 0.9) 100%
  );
  pointer-events: none;
}

/* Atmospheric Dark Overlay */
.atmosphere-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    ellipse at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(0, 0, 0, 0.1) 0%,
    rgba(0, 0, 0, 0.6) 40%,
    rgba(0, 0, 0, 0.85) 100%
  );
  z-index: 1;
  pointer-events: none;
  transition: background 0.3s ease;
}

/* Painting Title Overlay */
.painting-title {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 8rem;
  font-weight: 300;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-shadow:
    0 0 20px rgba(0, 0, 0, 0.8),
    0 0 40px rgba(0, 0, 0, 0.6),
    0 4px 8px rgba(0, 0, 0, 0.9);
  z-index: 5;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
}

.painting-title.show {
  opacity: 1;
}

/* Canvas Layers */
#organic-canvas,
#ripple-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#organic-canvas {
  z-index: 2;
}

#ripple-canvas {
  z-index: 3;
  mix-blend-mode: screen;
  opacity: 0.4;
}

/* UI Layer */
.ui-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
}

.ui-layer > * {
  pointer-events: auto;
}

/* Control Buttons */
.control-button {
  position: absolute;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.7);
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.control-button:hover {
  background: rgba(0, 0, 0, 0.5);
  color: rgba(255, 255, 255, 1);
  border-color: rgba(255, 255, 255, 0.4);
}

.control-button.top-left {
  top: 2rem;
}

.sound-button {
  left: 2rem;
}

.carousel-button {
  left: 6rem;
}

.carousel-button.paused svg {
  display: none;
}

.carousel-button.paused::after {
  content: '';
  width: 0;
  height: 0;
  border-left: 10px solid currentColor;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  margin-left: 2px;
}

/* Imprint Link */
.imprint-link {
  position: absolute;
}

.imprint-link.top-right {
  top: 2rem;
  right: 2rem;
}

.imprint-link a {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: 0.03em;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.7);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  transition: color 0.3s ease;
}

.imprint-link a:hover {
  color: rgba(255, 255, 255, 1);
}

/* Corner Logo */
.corner-logo {
  position: absolute;
  transition: filter 0.3s ease, opacity 0.3s ease;
}

.corner-logo img {
  display: block;
  width: auto;
  height: 80px;
  filter: brightness(0.75) drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5));
  transition: filter 0.3s ease;
}

.corner-logo:hover img {
  filter: brightness(1.1) drop-shadow(0 2px 6px rgba(255, 255, 255, 0.3));
}

.corner-logo.bottom-left {
  bottom: 6rem;
  left: 2rem;
}

/* Artwork Attribution */
.artwork-attribution {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.4);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  line-height: 1.4;
}

.artwork-attribution.bottom-left {
  bottom: 2rem;
  left: 2rem;
}

.artwork-attribution span {
  display: block;
}

/* Corner Navigation */
.corner-nav {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: flex-end;
}

.corner-nav.bottom-right {
  bottom: 6rem;
  right: 2rem;
}

.corner-nav a {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: 0.03em;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.7);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  transition: color 0.3s ease;
  position: relative;
  padding: 0.2rem 0;
}

.corner-nav a:hover {
  color: rgba(255, 255, 255, 1);
}

/* Music Attribution */
.music-attribution {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  align-items: flex-end;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.4);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  line-height: 1.4;
}

.music-attribution.bottom-right {
  bottom: 2rem;
  right: 2rem;
}

.music-attribution span {
  display: block;
  text-align: right;
}

.music-attribution a {
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  transition: color 0.3s ease;
}

.music-attribution a:hover {
  color: rgba(255, 255, 255, 0.8);
}

/* Content Modal */
.content-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
}

.content-modal.active {
  display: block;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
}

.modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 800px;
  max-height: 85vh;
  width: 90%;
  background: rgba(15, 15, 15, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  overflow-y: auto;
  padding: 3rem;
}

/* Modal with background animation */
.modal-with-bg {
  position: relative;
}

.modal-bg-animation {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.4;
  pointer-events: none;
  border-radius: 4px;
  filter: brightness(0.8);
  overflow: hidden;
}

.modal-bg-animation video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.modal-bg-static img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.modal-with-bg .modal-body {
  position: relative;
  z-index: 1;
}

/* Residence Images */
.residence-images {
  margin: 2rem 0;
}

.main-image {
  width: 100%;
  margin-bottom: 1.5rem;
}

.main-image img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.thumbnail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  width: 100%;
}

.thumbnail-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.thumbnail {
  overflow: hidden;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.thumbnail:hover img {
  transform: scale(1.05);
}

.thumbnail.landscape {
  aspect-ratio: 4 / 3;
}

.thumbnail.portrait {
  aspect-ratio: 3 / 4;
}

/* Contact Map */
.contact-map {
  margin: 1.5rem 0;
}

.contact-map iframe {
  filter: brightness(0.85) saturate(0.8);
  transition: filter 0.3s ease;
}

.contact-map iframe:hover {
  filter: brightness(1) saturate(1);
}

/* Restoration Images */
.restoration-images {
  margin: 1.5rem 0;
}

.restoration-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.restoration-thumbnail {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.restoration-thumbnail img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.restoration-thumbnail:hover img {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
}

.restoration-caption {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  font-style: italic;
}

/* Thumbnail Carousel */
.thumbnail-carousel {
  position: relative;
}

.carousel-images {
  position: relative;
  width: 100%;
}

.carousel-slide {
  display: none;
  flex-direction: column;
  gap: 0.5rem;
}

.carousel-slide.active {
  display: flex;
}

.carousel-slide img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.carousel-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: all 0.3s ease;
}

.carousel-dots .dot:hover {
  background: rgba(255, 255, 255, 0.5);
  transform: scale(1.2);
}

.carousel-dots .dot.active {
  background: rgba(255, 255, 255, 0.9);
  width: 10px;
  height: 10px;
}

/* Custom scrollbar for modal */
.modal-content::-webkit-scrollbar {
  width: 6px;
}

.modal-content::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
  transition: background 0.3s ease;
}

.modal-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
}

/* Firefox scrollbar */
.modal-content {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.3) rgba(0, 0, 0, 0.2);
}

.modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 2rem;
  font-weight: 200;
  line-height: 1;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.modal-close:hover {
  color: rgba(255, 255, 255, 1);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
}

.modal-body {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.8;
}

.modal-body h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.5rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 1.5rem;
  letter-spacing: 0.02em;
}

.modal-body h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.5rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.9);
  margin-top: 2rem;
  margin-bottom: 1rem;
  letter-spacing: 0.02em;
}

.modal-body p {
  margin-bottom: 1.2rem;
  font-size: 1rem;
}

.modal-body strong {
  color: rgba(255, 255, 255, 0.95);
  font-weight: 500;
}

.modal-cta {
  margin-top: 2rem;
  font-style: italic;
  color: rgba(255, 255, 255, 0.7);
  border-left: 3px solid rgba(255, 255, 255, 0.3);
  padding-left: 1.5rem;
}

/* Responsive */
@media (max-width: 768px) {
  .modal-content {
    padding: 2rem;
    max-height: 90vh;
  }

  .modal-body h2 {
    font-size: 2rem;
  }

  .modal-body h3 {
    font-size: 1.25rem;
  }

  .modal-body p {
    font-size: 0.95rem;
  }

  .modal-close {
    top: 1rem;
    right: 1rem;
  }

  .thumbnail-grid {
    grid-template-columns: 1fr;
  }

  .thumbnail-column {
    flex-direction: row;
  }
}
  .imprint-link.top-right {
    top: 1.5rem;
    right: 1.5rem;
  }

  .imprint-link a {
    font-size: 0.75rem;
  }

  .corner-logo {
    font-size: 0.85rem;
  }

  .corner-logo.bottom-left {
    bottom: 5rem;
    left: 1.5rem;
  }

  .artwork-attribution.bottom-left {
    bottom: 1.5rem;
    left: 1.5rem;
  }

  .artwork-attribution {
    font-size: 0.55rem;
  }

  .corner-nav.bottom-right {
    bottom: 5rem;
    right: 1.5rem;
  }

  .corner-nav a {
    font-size: 0.75rem;
  }

  .music-attribution.bottom-right {
    bottom: 1.5rem;
    right: 1.5rem;
  }

  .music-attribution {
    font-size: 0.55rem;
  }

  .painting-title {
    font-size: 4rem;
  }
}

@media (max-width: 480px) {
  .painting-title {
    font-size: 2.5rem;
  }
}
