.wrap {
  margin: 2rem 0;
  max-width: 1200px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 1.5rem;
  padding: 0 1rem;
  justify-items: center;
}

.tile {
  position: relative;
  background: rgba(0, 0, 0, 0.575)
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  width: 350px;
  height: 280px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.25,0.46,0.45,0.94);
  color: var(--ink);
  text-decoration: none;
  will-change: transform, box-shadow;
}

.tile img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  transition: opacity 0.4s cubic-bezier(0.25,0.46,0.45,0.94);
}

.tile .text {
  position: relative;
  z-index: 1;
  background: linear-gradient(to top, rgba(147, 191, 186, 0.95), rgba(191, 147, 151, 0.50), rgba(17,17,17,0.1));
  color: #ffffff;
  padding: 1.2rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.tile h1 {
  font-family: "karenfat", "Sigmar", cursive;
  font-size: clamp(1.1rem, 4vw, 1.3rem); 
  margin: 0 0 0.3rem 0;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  line-height: 1.2;
  flex-shrink: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2; 
  -webkit-box-orient: vertical;
  hyphens: auto;
  word-break: break-word;
}

.tile h2 {
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: clamp(0.85rem, 2.5vw, 0.95rem);
  font-weight: 500;
  margin: 0 0 0.4rem 0;
  opacity: 0;
  transform: translateY(15px);
  transition: all 0.4s cubic-bezier(0.25,0.46,0.45,0.94);
  color: #ffffff;
text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  flex-shrink: 0;
  white-space: nowrap; 
}

.tile p {
  font-family: "IBM Plex Serif", serif;
  font-size: clamp(0.7rem, 2vw, 0.85rem);
  font-style: italic;
  line-height: 1.4;
  margin: 0;
  opacity: 0;
  transform: translateY(15px);
  transition: all 0.5s cubic-bezier(0.25,0.46,0.45,0.94) 0.1s;
  flex: 1;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 5; 
  -webkit-box-orient: vertical;
  color: #000;
}


.tile ul {
  font-size: 0.85rem;
  line-height: 1.3;
  margin: 0.3rem 0 0 0;
  padding-left: 1.1rem;
  opacity: 0;
  transform: translateY(15px);
  transition: all 0.5s cubic-bezier(0.25,0.46,0.45,0.94) 0.2s;
}

.tile ul li {
  margin-bottom: 0.2rem;
  font-family: "IBM Plex Sans", sans-serif;
}

.tile:hover,
.tile:focus-within {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(0,0,0,0.2);
}

.tile:hover img,
.tile:focus-within img {
  opacity: 0.1;
}

.tile:hover h2,
.tile:focus-within h2,
.tile:hover p,
.tile:focus-within p,
.tile:hover ul,
.tile:focus-within ul {
  opacity: 1;
  transform: translateY(0);
}

/* Mobile */
@media (max-width: 768px) {
  .wrap { grid-template-columns: 1fr; gap: 1.2rem; padding: 0 0.5rem; }
  .tile { width: 100%; max-width: 400px; height: 250px; }
  .tile h1 { font-size: 1.2rem; }
}

@media (max-width: 480px) {
  .tile { height: 220px; }
  .tile .text { padding: 1rem; }
}
