:root {
  --bg-1: #220414;
  --bg-2: #3a0924;
  --bg-3: #6d1036;
  --text: #fff7fb;
  --muted: rgba(255, 241, 246, 0.82);
  --panel: rgba(255, 255, 255, 0.1);
  --panel-strong: rgba(255, 255, 255, 0.16);
  --border: rgba(255, 255, 255, 0.18);
  --accent: #ff7bb1;
  --accent-2: #ffd0e2;
  --shadow: 0 30px 80px rgba(12, 0, 10, 0.45);
  --max-width: 1320px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 131, 173, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(255, 198, 221, 0.14), transparent 30%),
    linear-gradient(140deg, var(--bg-1) 0%, var(--bg-2) 45%, var(--bg-3) 100%);
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

code {
  padding: 0.16rem 0.42rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-family: inherit;
  font-size: 0.95em;
}

img,
video {
  display: block;
  width: 100%;
}

.page-shell {
  position: relative;
  isolation: isolate;
}

.ambient,
.sparkles {
  position: fixed;
  inset: auto;
  pointer-events: none;
  z-index: -1;
}

.ambient {
  width: 34rem;
  height: 34rem;
  border-radius: 999px;
  filter: blur(24px);
  opacity: 0.5;
  animation: driftOrb 18s ease-in-out infinite alternate;
}

.ambient-one {
  top: -10rem;
  left: -8rem;
  background: rgba(255, 134, 181, 0.24);
}

.ambient-two {
  top: 28%;
  right: -10rem;
  background: rgba(255, 231, 240, 0.16);
  animation-duration: 22s;
}

.ambient-three {
  bottom: -12rem;
  left: 18%;
  background: rgba(255, 95, 140, 0.22);
  animation-duration: 20s;
}

.sparkles {
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 18%, rgba(255, 255, 255, 0.8) 0 1px, transparent 1.4px),
    radial-gradient(circle at 74% 12%, rgba(255, 215, 229, 0.7) 0 1px, transparent 1.4px),
    radial-gradient(circle at 60% 44%, rgba(255, 255, 255, 0.7) 0 1px, transparent 1.4px),
    radial-gradient(circle at 34% 72%, rgba(255, 240, 246, 0.7) 0 1px, transparent 1.4px),
    radial-gradient(circle at 82% 84%, rgba(255, 225, 235, 0.65) 0 1px, transparent 1.4px);
  animation: twinkle 10s linear infinite alternate;
  opacity: 0.6;
}

.hero,
.gallery-intro,
.gallery {
  width: min(calc(100% - 2rem), var(--max-width));
  margin-inline: auto;
}

.hero {
  min-height: 0;
  display: block;
  padding: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: fixed;
  top: 1rem;
  left: 50%;
  width: min(calc(100% - 2rem), var(--max-width));
  padding: 0;
  transform: translateX(-50%);
  z-index: 20;
}

.topbar__brand,
.topbar__link {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
}

.eyebrow {
  margin: 0 0 1rem;
  font-size: 0.82rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent-2);
}

.section-heading {
  display: grid;
  gap: 0.4rem;
  justify-items: center;
}

.gallery-intro {
  position: relative;
  z-index: 5;
  margin-top: 5.3rem;
  margin-bottom: -4.8rem;
  padding: 0;
  text-align: center;
  pointer-events: none;
}

.scroll-cue {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.05rem;
  margin-top: 0.15rem;
  color: rgba(255, 224, 235, 0.82);
  font-size: 1.1rem;
  line-height: 1;
}

.scroll-cue span {
  animation: bounceArrow 2.2s ease-in-out infinite;
}

.scroll-cue span:last-child {
  animation-delay: 0.18s;
}

.gallery {
  position: relative;
  z-index: 1;
  margin-top: 0;
  padding-top: 7rem;
  padding-bottom: 5rem;
}

.gallery__grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 0.8rem;
  grid-auto-flow: dense;
}

.memory-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 14rem;
  aspect-ratio: 5 / 4;
  border-radius: 1.75rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.08));
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: var(--shadow);
  transform: translate3d(0, 0, 0) rotate(var(--tilt, 0deg));
  animation: floatCard var(--float-duration, 14s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
  transition: transform 220ms ease, border-color 220ms ease;
}

.memory-card--loading .memory-card__media::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(110deg, rgba(255, 255, 255, 0.08) 8%, rgba(255, 255, 255, 0.2) 18%, rgba(255, 255, 255, 0.08) 33%),
    linear-gradient(145deg, rgba(255, 179, 209, 0.16), rgba(77, 8, 39, 0.35));
  background-size: 200% 100%, 100% 100%;
  animation: shimmerCard 2s linear infinite;
}

.memory-card--loading .memory-card__media > * {
  opacity: 0;
}

.memory-card--loaded .memory-card__media::before {
  opacity: 0;
  transition: opacity 220ms ease;
}

.memory-card--loaded .memory-card__media > * {
  opacity: 1;
  transition: opacity 220ms ease;
}

.memory-card:hover {
  transform: translateY(-6px) scale(1.01) rotate(var(--tilt, 0deg));
  border-color: rgba(255, 236, 243, 0.42);
}

.memory-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.16), transparent 24%),
    linear-gradient(180deg, transparent 48%, rgba(25, 4, 16, 0.32) 100%);
  pointer-events: none;
}

.memory-card__media {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  border-radius: inherit;
  isolation: isolate;
  transform: translateZ(0);
  background: #140510;
}

.memory-card__media img,
.memory-card__media video,
.memory-card__placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.memory-card__media video {
  border-radius: inherit;
  background: #140510;
  clip-path: inset(0 round 1.75rem);
  transform: translateZ(0);
}

.memory-card--video .memory-card__media {
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  cursor: pointer;
}

.memory-card__placeholder {
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.memory-card__placeholder span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.24);
  font-size: 2rem;
  box-shadow: 0 18px 34px rgba(22, 4, 15, 0.22);
}

.memory-card__badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.6rem;
  height: 2.6rem;
  padding: 0 0.8rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  backdrop-filter: blur(12px);
  pointer-events: none;
}

.memory-card--wide {
  grid-column: span 7;
  aspect-ratio: 16 / 10;
}

.memory-card--tall {
  grid-column: span 5;
  min-height: 20rem;
  aspect-ratio: 4 / 5;
}

.memory-card--square {
  grid-column: span 4;
  aspect-ratio: 1 / 1;
}

.memory-card--feature {
  grid-column: span 8;
  min-height: 18rem;
  aspect-ratio: 16 / 10;
}

@keyframes floatCard {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(var(--tilt, 0deg));
  }
  50% {
    transform: translate3d(0, var(--float-distance, -10px), 0) rotate(calc(var(--tilt, 0deg) * -1));
  }
}

@keyframes driftOrb {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(2rem, 3rem, 0) scale(1.08);
  }
}

@keyframes twinkle {
  from {
    opacity: 0.35;
    transform: translateY(0);
  }
  to {
    opacity: 0.7;
    transform: translateY(8px);
  }
}

@keyframes bounceArrow {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.45;
  }
  50% {
    transform: translateY(6px);
    opacity: 1;
  }
}

@keyframes shimmerCard {
  from {
    background-position: 200% 0, 0 0;
  }
  to {
    background-position: -20% 0, 0 0;
  }
}

@media (max-width: 960px) {
  .gallery__grid {
    grid-template-columns: repeat(6, 1fr);
  }

  .memory-card--feature,
  .memory-card--wide {
    grid-column: span 6;
  }

  .memory-card--tall,
  .memory-card--square {
    grid-column: span 3;
  }
}

@media (max-width: 680px) {
  .hero,
  .gallery-intro,
  .gallery {
    width: min(calc(100% - 1.1rem), var(--max-width));
  }

  .hero {
    min-height: auto;
    padding-bottom: 0;
  }

  .topbar {
    top: 0.7rem;
  }

  .topbar__brand,
  .topbar__link {
    padding: 0.7rem 0.85rem;
    font-size: 0.9rem;
  }

  .gallery-intro {
    margin-top: 4.7rem;
    margin-bottom: -3.4rem;
    padding: 0;
  }

  .gallery {
    padding-top: 5.8rem;
  }

  .gallery__grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .memory-card,
  .memory-card--feature,
  .memory-card--wide,
  .memory-card--tall,
  .memory-card--square {
    grid-column: auto;
    min-height: 11.5rem;
    aspect-ratio: 5 / 4;
  }

}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
