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

html, body {
  height: 100%;
  background: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  overflow: hidden;
}

.grid-wrapper {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow-y: scroll;
  overflow-x: hidden;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

.grid {
  width: 100%;
  will-change: transform;
}

.masonry-loop {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  width: 100%;
  padding: 0 16px;
}

.masonry-col {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-width: 0;
}

.tile {
  width: 100%;
  margin-bottom: 40px;
}

.tile img {
  display: block;
  width: 100%;
  height: auto;
}

.tile .caption {
  display: block;
  margin-top: 8px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #999999;
  text-align: center;
}

.loading {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  transition: opacity 0.4s ease;
}

.loading.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #eeeeee;
  border-top-color: #1a1a1a;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 10;
  padding: 24px;
  isolation: isolate;
}

.overlay-box {
  pointer-events: auto;
  max-width: 640px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 12px;
  padding: 40px 48px;
  text-align: center;
  backdrop-filter: blur(32px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}

.overlay-box p {
  margin: 0;
  font-size: 18px;
  line-height: 1.4;
  font-weight: 500;
  color: #1a1a1a;
}

.overlay-box a {
  color: inherit;
  text-decoration: underline;
}

.overlay-box a:hover {
  color: #FF3C00;
}

@media (max-width: 899px) {
  .overlay-box {
    padding: 24px;
  }

  .overlay-box p {
    font-size: 16px;
  }
}
