* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: #cacaca;
  padding: 40px 20px;
  font-family: Arial, sans-serif;
}

.container {
  max-width: 800px;
  margin: 0 auto;
}

.intro {
  max-width: 360px;
  margin-bottom: 32px;
}

.intro p {
  font-family: Georgia, serif;
  font-size: 18px;
  color: #000;
  line-height: 1.3;
  margin-bottom: 8px;
}

.intro a {
  color: #000;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.drag-indicator {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 48px;
  height: 48px;
  opacity: 0.8;
  pointer-events: none;
  z-index: 10;
}

.drag-light {
  opacity: 0.5;
}

.drag-light path[fill="currentColor"],
.drag-light path[fill="#FFFFFF"] {
  fill: #ffffff !important;
}

.drag-light path[stroke="#000000"] {
  stroke: #ffffff !important;
}

.drag-dark path[fill="currentColor"],
.drag-dark path[fill="#FFFFFF"] {
  fill: none !important;
}

.drag-dark path[stroke="#000000"] {
  stroke: #3d3d3d !important;
}

.hand-open {
  opacity: 0;
  animation: openHand 2.5s ease-in-out infinite;
}

.hand-closed {
  opacity: 0;
  animation: closeHand 2.5s ease-in-out infinite;
}

@keyframes openHand {
  0%,
  10% {
    opacity: 0;
    transform: translateX(-6px) translateY(-6px);
  }
  15%,
  35% {
    opacity: 1;
    transform: translateX(-6px) translateY(-6px);
  }
  40%,
  100% {
    opacity: 0;
    transform: translateX(-6px) translateY(-6px);
  }
}

@keyframes closeHand {
  0%,
  35% {
    opacity: 0;
    transform: translateX(-6px) translateY(-6px);
  }
  40% {
    opacity: 1;
    transform: translateX(-6px) translateY(-6px);
  }
  50%,
  85% {
    opacity: 1;
    transform: translateX(6px) translateY(6px);
  }
  90%,
  100% {
    opacity: 0;
    transform: translateX(6px) translateY(6px);
  }
}

.site-footer {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid #a0a0a0;
}

.site-todos {
  max-width: 360px;
  margin-bottom: 0;
}

.todos-toggle {
  background: none;
  border: none;
  padding: 0;
  font-family: Arial, sans-serif;
  font-size: 14px;
  color: #525252;
  font-style: italic;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.4;
}

.todos-toggle:hover {
  color: #000;
}

.chevron {
  transition: transform 0.3s ease;
}

.todos-toggle[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}

.todos-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.todos-content.expanded {
  max-height: 200px;
}

.todos-list {
  list-style: none;
  margin-top: 8px;
  padding-left: 0;
}

.todos-list li {
  font-family: Arial, sans-serif;
  font-size: 14px;
  color: #525252;
  font-style: normal;
  line-height: 1.4;
  margin-bottom: 4px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  overflow: visible;
}

.artwork {
  display: flex;
  flex-direction: column;
  overflow: visible;
}

.artwork-image {
  width: 100%;
  height: auto;
  display: block;
}

#model-viewer {
  width: 100%;
  height: 400px;
  cursor: grab;
  background-color: #000;
  display: block;
  overflow: visible;
  position: relative;
  isolation: isolate;
}

#model-viewer:active {
  cursor: grabbing;
}

#model-viewer canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  pointer-events: auto;
}

.model-viewer {
  width: 100%;
  height: 400px;
  cursor: grab;
  background-color: #aca78e;
  display: block;
  overflow: visible;
  position: relative;
  isolation: isolate;
}

.model-viewer:active {
  cursor: grabbing;
}

.model-viewer canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  pointer-events: auto;
}

.model-container {
  position: relative;
  overflow: visible;
}

.model-preview {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 100px;
  height: 100px;
  object-fit: contain;
  pointer-events: none;
  z-index: 10;
  opacity: 0.9;
}

.artwork-caption {
  font-size: 14px;
  margin-top: 12px;
}

.artwork-title {
  font-family: Arial, sans-serif;
  line-height: 1.3; 
  font-size: 16px;
  color: #000;
  margin-bottom: 4px;
}

.artwork-medium {
  font-family: Arial, sans-serif;
  color: #525252;
  margin-bottom: 4px;
}

.artwork-description {
  font-family: Arial, sans-serif;
  font-size: 14px;
  color: #525252;
  font-style: italic;
  line-height: 1.4;
  margin-top: 4px;
}

/* Desktop grid layout - Bento style with equal spacing */
@media (min-width: 768px) {
  .gallery {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-auto-rows: 1fr;
    gap: 20px;
    overflow: visible;
  }

  /* 3D models take up larger space */
  .artwork-large {
    grid-column: span 4;
    grid-row: span 2;
    overflow: visible;
  }

  .artwork-large #model-viewer,
  .artwork-large .model-viewer {
    height: 100%;
    min-height: 500px;
  }

  /* PNG images are smaller and fit in remaining spaces */
  .artwork-medium {
    grid-column: span 2;
    grid-row: span 1;
    display: flex;
    flex-direction: column;
  }

  .artwork-medium .artwork-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 280px;
    display: block;
    object-fit: contain;
  }

  .artwork-medium .artwork-caption {
    max-width: 100%;
  }
}

@media (max-width: 767px) {
  .gallery {
    display: flex;
    flex-direction: column;
    gap: 30px;
  }

  .artwork {
    width: 100%;
  }

  #model-viewer,
  .model-viewer {
    height: 350px;
  }

  /* Scale down model previews on mobile */
  .model-preview {
    width: 60px;
    height: 60px;
    top: 8px;
    right: 8px;
  }

  .artwork-medium {
    width: 70%;
  }

  .artwork-medium:nth-child(2) {
    align-self: flex-start;
  }

  .artwork-medium:nth-child(3) {
    align-self: center;
    margin-left: 10%;
  }

  .artwork-medium:nth-child(5) {
    align-self: flex-end;
  }
}
