@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@300;600;900&display=swap");

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

body {
  overflow: hidden;
  background: #f5f5f0;
}

#gallery {
  width: 100vw;
  height: 100vh;

  display: grid;
  grid-template-columns: repeat(13, 1fr);
  grid-template-rows: repeat(8, 1fr);

  gap: 2px;
}

/* ── Text Block (grid item, bukan overlay) ──────────── */

.text-block {
  grid-column: 5 / 10;
  grid-row: 4 / 6;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  background: #f5f5f0;
  text-align: center;
  font-family: "Outfit", sans-serif;
  color: #1a1a1a;
  padding: 1vw;

  animation: fadeIn 0.6s ease-out both;
}

.text-block .line1 {
  font-size: clamp(0.8rem, 1.6vw, 1.4rem);
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  line-height: 1.3;
  color: #444;
}

.text-block .line2 {
  font-size: clamp(1.1rem, 3vw, 3rem);
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.1;
  margin-top: 0.1em;
  color: #1a1a1a;
}

/* ── Photo Cells ────────────────────────────────────── */

.photo {
  overflow: hidden;
  animation: photoIn 0.5s ease-out both;
}

.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* geser gambar sedikit ke bawah */
  object-position: center 35%;

  filter: grayscale(100%);
  transition: 0.3s;
}

.photo img:hover {
  filter: grayscale(0%);
}

/* ── Animations ─────────────────────────────────────── */

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes photoIn {
  from {
    opacity: 0;
    transform: scale(0.7);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ── Mobile ─────────────────────────────────────────── */

@media (max-width: 769px) {
  body {
    overflow: auto;
  }

  #gallery {
    display: flex;
    flex-wrap: wrap;
    width: 100vw;
    height: auto;
    gap: 2px;
  }

  /* Text block: full width, centered at the top */
  .text-block {
    width: 100%;
    order: -1;           /* always first */
    padding: 6vw 4vw;
    background: #1a1a1a;
  }

  .text-block .line1 {
    font-size: clamp(0.7rem, 3vw, 1.1rem);
    color: #ccc;
  }

  .text-block .line2 {
    font-size: clamp(1.2rem, 6vw, 2rem);
    color: #fff;
  }

  /* Photos: equal-sized tiles, 4 per row */
  .photo {
    flex: 0 0 calc((100% - 6px) / 4);  /* 4 columns with 2px gaps */
    aspect-ratio: 1 / 1;
    /* Reset any explicit grid positions set by JS */
    grid-column: unset !important;
    grid-row: unset !important;
  }
}

/* ── Floating Action Button ────────────────────────── */

.fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 900;

  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  background: rgba(26, 26, 26, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;

  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset;

  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
  animation: fabPulse 2.5s ease-in-out infinite;
}

.fab:hover {
  transform: scale(1.1);
  box-shadow:
    0 6px 28px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.12) inset;
  animation: none;
}

.fab:active {
  transform: scale(0.95);
}

@keyframes fabPulse {
  0%,
  100% {
    box-shadow:
      0 4px 20px rgba(0, 0, 0, 0.25),
      0 0 0 0 rgba(26, 26, 26, 0.3);
  }
  50% {
    box-shadow:
      0 4px 20px rgba(0, 0, 0, 0.25),
      0 0 0 8px rgba(26, 26, 26, 0);
  }
}

/* ── Modal Overlay ─────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;

  display: flex;
  align-items: center;
  justify-content: center;

  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);

  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* ── Modal Card ────────────────────────────────────── */

.modal-card {
  position: relative;
  width: 90%;
  max-width: 380px;

  background: #fff;
  border-radius: 20px;
  padding: 40px 32px 32px;

  text-align: center;
  font-family: "Outfit", sans-serif;

  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.18),
    0 0 0 1px rgba(0, 0, 0, 0.04);

  transform: translateY(24px) scale(0.96);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.open .modal-card {
  transform: translateY(0) scale(1);
}

/* Close button */
.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  border: none;
  background: none;
  font-size: 1.6rem;
  color: #999;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}

.modal-close:hover {
  color: #333;
}

/* Upload icon */
.modal-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e8f0fe, #d2e3fc);
  color: #4285f4;
  margin-bottom: 20px;
}

/* Message */
.modal-text {
  font-size: 1.05rem;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 24px;
  line-height: 1.5;
}

/* CTA button */
.modal-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;

  padding: 14px 28px;
  border: none;
  border-radius: 12px;

  font-family: "Outfit", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  color: #fff;

  background: linear-gradient(135deg, #4285f4, #1a73e8);
  box-shadow: 0 4px 16px rgba(66, 133, 244, 0.35);

  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.modal-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(66, 133, 244, 0.45);
}

.modal-btn:active {
  transform: translateY(0);
}
