@font-face {
  font-family: "PP Eiko";
  src: url("assets/fonts/pp-eiko-medium.otf") format("opentype");
  font-display: swap;
  font-style: normal;
  font-weight: 500;
}

@font-face {
  font-family: "PP Eiko";
  src: url("assets/fonts/pp-eiko-light-italic.otf") format("opentype");
  font-display: swap;
  font-style: italic;
  font-weight: 300;
}

:root {
  --live-preview-ready: 1;
  color-scheme: light;
  background: #f7f0e7;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100svh;
  overflow: hidden;
  background: #f7f0e7;
}

.keepsake {
  display: grid;
  min-height: 100svh;
  place-items: center;
  padding: clamp(2rem, 5vw, 5rem);
}

.portrait {
  position: relative;
  isolation: isolate;
  display: grid;
  width: min(100%, 24rem);
  justify-items: center;
}

.portrait::before {
  position: absolute;
  z-index: -1;
  inset: 12% 4% 8% 16%;
  border-radius: 50%;
  background: rgba(219, 126, 216, 0.1);
  content: "";
  filter: blur(2.5rem);
  pointer-events: none;
}

.lovebirds {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(100svh - clamp(8rem, 16vw, 12rem));
  object-fit: contain;
  animation: keepsake-breathe 9s ease-in-out infinite;
  transform-origin: 50% 52%;
  will-change: transform;
}

@keyframes keepsake-breathe {
  0%,
  100% {
    transform: translate3d(0, 2px, 0) rotate(-0.35deg);
  }

  50% {
    transform: translate3d(0, -7px, 0) rotate(0.35deg);
  }
}

.keepsake-caption {
  margin: clamp(-2.25rem, -4vw, -1.5rem) 0 0;
  color: #435500;
  font-family: "PP Eiko", serif;
  font-size: 1.1rem;
  font-style: italic;
  font-weight: 300;
  letter-spacing: 0.16em;
  line-height: 1.25;
  text-align: center;
  transform: translate(-12px, -22px);
  white-space: nowrap;
}

.caption-line {
  display: block;
}

.heart {
  display: inline-block;
  color: #db7ed8;
  font-family: Georgia, serif;
  font-size: 0.78em;
  font-style: normal;
}

.playlist {
  position: fixed;
  z-index: 10;
  right: clamp(1rem, 3vw, 2rem);
  bottom: 1.2rem;
  color: #435500;
  font-family: "PP Eiko", serif;
  font-style: italic;
  font-weight: 300;
}

.playlist summary {
  width: max-content;
  margin-left: auto;
  padding: 0.5rem 0.7rem;
  border: 1px solid rgba(67, 85, 0, 0.22);
  border-radius: 999px;
  background: rgba(247, 240, 231, 0.9);
  box-shadow: 0 0.4rem 1.1rem rgba(67, 85, 0, 0.07);
  cursor: pointer;
  font-size: 0.78rem;
  line-height: 1.1;
  list-style: none;
  backdrop-filter: blur(0.6rem);
  transition:
    color 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease;
}

.playlist summary::-webkit-details-marker {
  display: none;
}

.playlist summary span {
  margin-left: 0.2em;
  color: #db7ed8;
  font-size: 0.9em;
  font-style: normal;
}

.playlist[open] summary,
.playlist summary:hover {
  border-color: #435500;
  background: #435500;
  color: #f7f0e7;
}

.playlist-player {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.75rem);
  width: min(24rem, calc(100vw - 2rem));
  overflow: hidden;
  border-radius: 0.75rem;
  box-shadow: 0 1.25rem 4rem rgba(40, 50, 0, 0.2);
}

.playlist iframe {
  display: block;
  width: 100%;
  height: 22rem;
  border: 0;
}

@media (hover: hover) and (pointer: fine) {
  .lovebirds {
    animation: none;
  }
}

@media (max-width: 40rem) {
  .keepsake {
    padding: 1.5rem;
  }

  .portrait {
    width: min(100%, 15rem);
  }

  .lovebirds {
    max-height: calc(100svh - 6rem);
  }

  .keepsake-caption {
    transform: translate(-12px, -12px);
  }

  .playlist {
    right: 1rem;
    bottom: 0.7rem;
  }

}

@media (prefers-reduced-motion: reduce) {
  .lovebirds {
    animation: none;
  }

  .playlist summary {
    transition: none;
  }

}

@media (prefers-reduced-motion: reduce) and (max-width: 40rem) {
  .lovebirds {
    animation: keepsake-breathe 9s ease-in-out infinite;
  }
}
