@font-face {
  font-family: "DM Sans";
  src: url("assets/dm-sans.ttf") format("truetype");
  font-display: swap;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: #fff8f1;
  color: #482b3b;
  font: 1rem/1.5 "DM Sans", sans-serif;
}
main {
  min-height: 100vh;
  min-height: 100svh;
  padding: 1.5rem 1rem;
  display: grid;
  place-items: center;
  text-align: center;
}
section { width: 100%; }
h1 {
  margin: 0;
  font: italic 400 clamp(2.2rem, 6.5vw, 4.5rem)/1.15 Georgia, serif;
  letter-spacing: -.055em;
  text-wrap: balance;
}
button {
  border: 0;
  padding: 0;
  background: transparent;
  color: #704655;
  font: inherit;
  cursor: pointer;
}
button:focus-visible, video:focus-visible {
  outline: 2px solid #933562;
  outline-offset: 5px;
}
#gift {
  display: inline-grid;
  justify-items: center;
  margin-top: .5rem;
  border-radius: 1rem;
}
#gift-box {
  display: block;
  width: min(72vw, 16rem, 53svh);
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  mix-blend-mode: multiply;
}
#action, #restart {
  padding: .6rem .4rem;
  text-decoration: underline;
  text-decoration-color: #bf9da7;
  text-underline-offset: .32em;
}
#gift:hover span, #restart:hover { color: #9b285c; }
#movie {
  display: block;
  width: min(100%, 72svh, 38rem);
  aspect-ratio: 1;
  margin: auto;
  border-radius: .5rem;
  background: #24191f;
}
#restart { margin-top: 1rem; min-height: 44px; }
#video-note { margin: .75rem auto 0; }
@media (prefers-reduced-motion: no-preference) {
  #gift:hover .present { transform: translateY(-3px); }
  .present { transition: transform .18s ease-out; }
}

h1 { overflow-wrap: anywhere; }
.present { position: relative; display: block; }
#greeting:not([hidden]) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .8rem 1.2rem;
  margin: 0 auto 1.25rem;
  max-width: 48rem;
}
#birthday-photo, #thumbnail { object-fit: cover; }
#birthday-photo {
  width: clamp(4rem, 10vw, 5.5rem);
  aspect-ratio: 1;
  border-radius: 50%;
}
#birthday-wish { font-size: clamp(2rem, 5vw, 3.5rem); max-width: 100%; }
#greeting:not([hidden]) + video { width: min(100%, 58svh, 36rem); }
#personalize { display: block; margin: .4rem auto 0; padding: .65rem; color: #795b64; font-size: .875rem; }
#personalize:hover, #remove-photo:hover { text-decoration: underline; }
dialog {
  width: min(24rem, calc(100% - 2rem));
  max-height: 90svh;
  padding: clamp(1.25rem, 5vw, 2rem);
  border: 1px solid #d9c6ca;
  border-radius: 1rem;
  background: #fff8f1;
  color: inherit;
}
dialog::backdrop { background: #38252f70; }
dialog h2 { margin: 0 0 1.35rem; font: italic 400 2rem/1.15 Georgia, serif; }
dialog label { display: block; margin: 1rem 0 .3rem; }
dialog input { width: 100%; font: inherit; color: inherit; }
input[type=text], input[type=url] { border: 1px solid #bca8af; border-radius: .4rem; padding: .6rem; background: #fffdf9; }
input::file-selector-button { padding: .45rem; margin-right: .45rem; font: inherit; color: inherit; }
#photo-preview:not([hidden]) { display: flex; align-items: center; gap: .75rem; margin-top: .75rem; }
#thumbnail { width: 48px; height: 48px; border-radius: .25rem; }
.hint, #photo-error { font-size: .875rem; color: #705763; }
.actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1.25rem; }
.actions button { min-height: 44px; padding: .6rem 1rem; }
#save, #copy-link { background: #68344d; color: white; border-radius: .45rem; }
#save:disabled { opacity: .55; }
#share .actions { align-items: center; justify-content: space-between; }
#open-gift, #done { color: #704655; text-underline-offset: .2em; }
#done { min-height: 44px; }
#copy-status { margin: .5rem 0 0; }
#copy-status:empty { display: none; }
[hidden] { display: none !important; }
