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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Cormorant Garamond", "Georgia", serif;
  color: #2d1b2e;
  overflow-x: hidden;
}

#canvas-container {
  position: fixed;
  inset: 0;
  z-index: 0;
}

#canvas-container canvas {
  display: block;
  width: 100%;
  height: 100%;
}

#sections {
  position: relative;
  z-index: 1;
}

.panel {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.panel-content {
  max-width: 42rem;
  text-align: center;
}

/* Hero */
.hero-title {
  margin: 0;
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #fff;
  text-shadow: 0 0 24px rgba(255, 255, 255, 0.12);
}

.hero-subtitle {
  margin: 1.5rem 0 0;
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-shadow: 0 0 16px rgba(255, 255, 255, 0.08);
}

/* Wish */
.wish-content h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 600;
  color: #fff;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.wish-text {
  margin: 0;
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 0 14px rgba(255, 255, 255, 0.06);
}

/* Gallery */
.gallery-content h2 {
  margin: 0 0 1.5rem;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 600;
  color: #fff;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

/* Gallery: bento + polaroid style – tiles fit together by span, images keep aspect ratio */
.gallery-collage {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 140px;
  grid-auto-flow: dense;
  gap: 1rem;
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
}

.collage-item.span-2col { grid-column: span 2; }
.collage-item.span-2row { grid-row: span 2; }

.collage-item.polaroid {
  padding: 0.5rem 0.5rem 1.75rem 0.5rem;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35), 0 1px 3px rgba(0, 0, 0, 0.2);
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, z-index 0s;
}

.collage-item.polaroid:nth-child(3n) { transform: rotate(-1.5deg); }
.collage-item.polaroid:nth-child(3n + 1) { transform: rotate(1deg); }
.collage-item.polaroid:nth-child(3n + 2) { transform: rotate(0.8deg); }
.collage-item.polaroid.span-2col.span-2row { transform: rotate(-0.8deg); }

.collage-item.polaroid:hover {
  transform: rotate(0deg) scale(1.03);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.25);
  z-index: 2;
}

.collage-item.polaroid {
  cursor: pointer;
}

.collage-item.polaroid img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  pointer-events: none;
}

@media (max-width: 640px) {
  .gallery-collage {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 120px;
  }
  .collage-item.span-2col { grid-column: span 1; }
  .collage-item.span-2row { grid-row: span 2; }
}

/* Lightbox: click to fullscreen */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  cursor: pointer;
}

.lightbox-img {
  position: relative;
  z-index: 1;
  max-width: 90vw;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  font-size: 1.75rem;
  line-height: 1;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s ease;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.gallery-hint {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
}

.gallery-hint code {
  background: rgba(255, 255, 255, 0.2);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

/* Heart section */
.heart-content h2 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 600;
  color: #fff;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.heart-message {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 0 14px rgba(255, 255, 255, 0.06);
}
