body {
  background: #f6f5f0;
}

/* ── Grid cells ── */
.grid-cell {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.grid-cell img {
  display: block;
  max-width: 65%;
  max-height: 75%;
  object-fit: contain;
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.18),
    0 1px 4px rgba(0, 0, 0, 0.1);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.grid-cell img.loaded {
  opacity: 1;
}

/* ── Title tile ── */
.title-tile {
  cursor: default;
  flex-direction: column;
  gap: 0;
  text-align: center;
  border-radius: 16px;
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.12),
    0 1px 6px rgba(0, 0, 0, 0.06);
  transform: scale(1.1);
  z-index: 2;
}

.title-tile .subtitle {
  font-family: "Instrument Serif", serif;
  font-style: italic;
  font-size: 1.8rem;
  color: #1a1a18;
  line-height: 1.3;
  padding: 0 1rem;
}

/* ── Search ── */
.search-fab {
  position: fixed;
  top: 1.25rem;
  right: 1.5rem;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 0;
}

.search-fab-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: #fff;
  color: #1a1a18;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.search-fab-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
}

.search-fab-btn svg {
  width: 24px;
  height: 24px;
}

/* Expanded search bar */
.search-bar {
  display: none;
  align-items: center;
  background: #fff;
  border-radius: 28px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  height: 48px;
}

.search-bar.open {
  display: flex;
}

.search-bar input {
  border: none;
  outline: none;
  font-size: 0.9rem;
  padding: 0 1rem;
  width: 220px;
  height: 100%;
  background: transparent;
  color: #1a1a18;
  font-family: inherit;
}

.search-bar input::placeholder {
  color: #b5b0a8;
}

.search-bar button {
  height: 100%;
  padding: 0 1.2rem;
  border: none;
  border-left: 1px solid #eee9e0;
  background: transparent;
  color: #8a8880;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  transition: color 0.15s ease;
}

.search-bar button:hover {
  color: #1a1a18;
}

@media (max-width: 600px) {
  .title-tile .subtitle {
    font-size: 1.3rem;
  }
  .search-fab {
    top: 1rem;
    right: 1rem;
  }
  .search-bar {
    height: 44px;
  }
  .search-bar input {
    width: 170px;
    font-size: 0.85rem;
  }
}

/* ── Desktop enhancements ── */
@media (min-width: 601px) {
  .grid-cell:not(.title-tile)::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0);
    transition: background 0.25s ease;
    pointer-events: none;
  }
  .grid-cell:not(.title-tile):hover::after {
    background: rgba(0,0,0,0.2);
  }
  .grid-cell:not(.title-tile) img {
    position: relative;
    z-index: 1;
  }
  .search-bar input {
    width: 280px;
  }
  .title-tile .subtitle {
    font-size: 1.6rem;
  }
}
