* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(to top right, #1f1c2c, #928dab);
  color: #fff;
  min-height: 100vh;
}

/* Container */
.container {
  width: 90%;
  max-width: 1200px;
  margin: auto;
  padding: 2rem 1rem;
}

/* Header */
header {
  text-align: center;
  margin-bottom: 2.5rem;
}
.gradient-text {
  font-size: 3rem;
  font-weight: bold;
  background: linear-gradient(90deg, #f093fb, #f5576c);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.subtitle {
  font-size: 1.2rem;
  color: #ddd;
  margin-top: 0.5rem;
}

/* Dynamic Memories Grid */
.memories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  grid-auto-rows: 150px;
  gap: 15px;
}

/* Memory Cards */
.memory-card {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.2);
  transition: transform 0.3s ease-in-out, box-shadow 0.2s;
}
.memory-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
  display: block;
}

/* Hover Effect */
.memory-card:hover {
  transform: translateY(-8px) scale(1.03);
  box-shadow: 0 15px 30px rgba(0,0,0,0.4);
}
.memory-card:hover img {
  transform: scale(1.1);
}

/* UNIQUE Photo Placement */
.memory-card:nth-child(3n) {
  grid-row: span 2;
}
.memory-card:nth-child(4n) {
  grid-column: span 2;
}
.memory-card:nth-child(5n) {
  grid-row: span 2;
  grid-column: span 2;
}
.memory-card:nth-child(6n) {
  grid-row: span 1;
  grid-column: span 1;
}
.memory-card:nth-child(7n) {
  grid-row: span 2;
}
.memory-card:nth-child(8n) {
  grid-row: span 1;
  grid-column: span 2;
}

/* Responsive Tweak */
@media (max-width: 768px) {
  .gradient-text {
    font-size: 2.5rem;
  }
  .memories-grid {
    grid-auto-rows: 120px;
  }
}
@media (max-width: 480px) {
  .gradient-text {
    font-size: 2rem;
  }
  .memories-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    grid-auto-rows: 100px;
  }
}
@keyframes gradientMove {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
body {
  background: linear-gradient(270deg, #1f1c2c, #928dab, #f093fb, #f5576c);
  background-size: 800% 800%;
  animation: gradientMove 15s ease infinite;
}

/* Back to Home Button */
.back-home-btn {
  position: bottom;
  top: 20px;
  left: 20px;
  background: linear-gradient(135deg, #f093fb, #f5576c);
  color: white;
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 30px;
  font-weight: bold;
  box-shadow: 0 6px 12px rgba(0,0,0,0.2);
  transition: background 0.3s ease, transform 0.2s;
  z-index: 999;
}
.back-home-btn:hover {
  background: linear-gradient(135deg, #d76d77, #ffaf7b);
  transform: scale(1.05);
}
