@font-face {
  font-family: "Sergio Hand";
  src: url("./fonts/SergioHand-Regular.woff2") format("woff2");
  font-display: swap;
  font-weight: 400;
}
:root {
  font-family: "Sergio Hand", cursive;
  font-synthesis: none;
  color: #302631;
  background-color: var(--base);
  background-image: radial-gradient(ellipse at top left, var(--one), transparent 65%),
    radial-gradient(ellipse at bottom left, var(--three), transparent 65%),
    linear-gradient(135deg, var(--base), var(--four));
  --base: #f3dfc5;
  --one: #bd93ce;
  --two: #f39b71;
  --three: #98b3ce;
  --four: #f1c1c5;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  isolation: isolate;
}
button, a { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.sky {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: -2;
  background-color: var(--base);
  transition: background-color 1.8s ease;
  pointer-events: none;
}
.sky::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, #fffcf23d, transparent 72%), url("grain.svg");
  opacity: .065;
}
.cloud {
  position: absolute;
  width: 91vmax;
  height: 78vmax;
  border-radius: 48% 52% 66% 34% / 55% 54% 46% 45%;
  filter: blur(clamp(40px, 6vw, 110px));
  transition: background-color 1.9s ease;
  animation: float 22s ease-in-out infinite alternate;
  will-change: transform;
}
.cloud-one { left: -52vmax; top: -42vmax; background-color: var(--one); }
.cloud-two { right: -49vmax; top: -38vmax; background-color: var(--two); animation-delay: -14s; animation-duration: 26s; }
.cloud-three { bottom: -57vmax; left: -18vmax; background-color: var(--three); animation-delay: -7s; animation-duration: 28s; }
.cloud-four { right: -54vmax; bottom: -56vmax; background-color: var(--four); animation-delay: -3s; animation-duration: 20s; }
.art-haze { position: absolute; inset: -15vmax; background-size: cover; background-position: center; filter: blur(90px); opacity: 0; transition: opacity 1.6s ease; animation: float 24s ease-in-out infinite alternate; }
.art-haze.visible { opacity: .28; }
@keyframes float {
  from { transform: translate3d(-4vmax, -2vmax, 0) rotate(-7deg) scale(.96); opacity: .75; }
  to { transform: translate3d(7vmax, 5vmax, 0) rotate(9deg) scale(1.08); opacity: 1; }
}
.art-haze { animation-name: haze-drift; }
@keyframes haze-drift { to { transform: translate(5%, -3%) scale(1.16); } }
header, footer { display: grid; justify-items: center; align-items: center; min-height: 78px; padding: 10px 20px; }
.playlist, footer button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 5px 10px;
  font-size: 23px;
  text-decoration: none;
  background: none;
  border: 0;
}
.playlist:hover, footer button:hover, .track-link:hover { text-decoration: underline; text-underline-offset: 5px; }
.arrow { width: 8px; height: 8px; margin-left: 7px; border-top: 1px solid; border-right: 1px solid; position: relative; }
.arrow::after { content: ""; width: 10px; height: 1px; background: currentColor; position: absolute; right: 0; top: -1px; transform-origin: right; transform: rotate(-45deg); }
main { display: grid; align-content: center; justify-items: center; text-align: center; padding: 16px 24px 24px; min-width: 0; }
#stage { width: min(100%, 43rem); }
h1, p { margin: 0; font-weight: 400; }
h1 { font-size: clamp(42px, 6vw, 73px); line-height: 1.1; text-wrap: balance; overflow-wrap: anywhere; }
.signin {
  display: inline-block; background: #fff9ec19; border: 1.4px solid currentColor;
  border-radius: 50px 46px 48px 43px / 44px 48px 43px 47px;
  padding: 8px 26px 12px; margin-top: 22px;
  font-size: clamp(25px, 2.6vw, 33px); line-height: 1.15;
  transition: background .25s ease, transform .25s ease;
}
.signin:hover { background: #fff9ec4d; transform: translateY(-2px); }
.signin:active { transform: scale(.98); }
.signin:disabled { opacity: .65; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 6px; }
.credits, .track-info { display: contents; }
.song { display: grid; justify-items: center; gap: 8px; }
.sleeve { width: clamp(155px, min(61vw, 39svh), 355px); aspect-ratio: 1; margin-bottom: 13px; }
.cover { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: 7%; box-shadow: 0 12px 35px #25182c23; }
.song h1 { font-size: clamp(31px, 4vw, 46px); }
.track-link { text-decoration: none; }
.artist, .feedback { font-size: clamp(22px, 2.2vw, 30px); line-height: 1.2; }
.note { white-space: pre-line; overflow-wrap: anywhere; font-size: clamp(29px, 3.5vw, 41px); line-height: 1.28; max-width: 30ch; padding-top: 18px; }
.note-title { margin: 0; font-size: 28px; font-weight: 400; }
.feedback, #message { margin: 18px auto 0; max-width: 36ch; }
#message { font-size: 24px; }
footer button { font-size: 19px; opacity: .76; }
@media (max-width: 600px) {
  header, footer { min-height: 64px; }
  .cloud { width: 92vmax; height: 80vmax; }
  .cloud-one { left: -68vmax; top: -39vmax; }
  .cloud-two { right: -73vmax; top: -18vmax; }
  .cloud-three { left: -54vmax; bottom: -51vmax; }
  .cloud-four { right: -76vmax; bottom: -40vmax; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.letter {
  max-width: 27ch;
  text-wrap: balance;
  margin-inline: auto;
  font-size: clamp(29px, 4.2vw, 50px);
  line-height: 1.24;
}
.welcome .signin { margin-top: clamp(22px, 3.5vh, 38px); }

.letter h1, .letter p { display: inline; font: inherit; }

@media (max-width: 600px), (max-height: 480px) and (pointer: coarse) {
  body {
    position: relative;
    min-height: 100dvh;
    padding-inline: env(safe-area-inset-left) env(safe-area-inset-right);
  }
  /* Paint the document through the safe areas, including when Safari moves its bars. */
  .sky {
    position: absolute;
    inset: 0;
    min-height: 100lvh;
  }
  header {
    min-height: 48px;
    padding: calc(env(safe-area-inset-top) + 6px) 16px 2px;
  }
  .playlist { font-size: 18px; }
  footer {
    min-height: 48px;
    padding: 2px 16px calc(6px + env(safe-area-inset-bottom));
  }
  main { padding: 24px clamp(18px, 6vw, 32px); }
  .welcome { width: min(100%, 340px); margin-inline: auto; }
  .letter {
    position: relative;
    isolation: isolate;
    max-width: none;
    padding: 30px clamp(20px, 6vw, 28px) 26px;
    text-align: left;
    text-wrap: pretty;
    font-size: clamp(20px, 5.4vw, 24px);
    line-height: 1.38;
  }
  .letter::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    transform: rotate(-1.6deg);
    background: linear-gradient(118deg, #fffaf0, #fcf2de);
    border-radius: 2px 3px 5px 2px;
    box-shadow: 0 2px 3px #46362514, 0 11px 25px -10px #482c424a;
  }
  .letter::after {
    content: "";
    position: absolute;
    left: 39%; top: -7px; width: 25%; height: 16px;
    transform: rotate(3deg);
    background: #ecd8b1b5;
    clip-path: polygon(1% 0,100% 5%,98% 35%,100% 55%,97% 73%,99% 100%,0 96%,2% 67%,0 35%);
  }
  .letter h1, .letter p { display: block; }
  .letter h1 { font-size: 1.18em; line-height: 1.2; margin-bottom: 12px; }
  .letter p + p { margin-top: .62em; }
  .welcome .signin {
    min-height: 46px;
    margin-top: 27px;
    padding: 8px 22px 10px;
    background: #352a36; color: #fff9ed; border-color: transparent;
    font-size: 21px;
  }
  .welcome .signin:hover { background: #483949; }
  .song { gap: 0; width: min(100%, 340px); margin-inline: auto; justify-items: stretch; text-align: left; }
  .credits { display: flex; align-items: center; gap: 14px; }
  .track-info { display: block; min-width: 0; }
  .track-info .artist { font-size: 16px; line-height: 1.3; opacity: .82; margin-top: 4px; }
  .sleeve { width: 64px; flex: 0 0 64px; margin: 0; }
  .song h1 { font-size: 19px; line-height: 1.18; text-wrap: pretty; }
  .artist, .feedback { font-size: 20px; }
  .note { width: 100%; text-align: left; font-size: clamp(20px, 5.4vw, 23px); line-height: 1.45; margin-top: 20px; border-top: 1px solid #30263126; padding-top: 19px; max-width: none; }
  .waiting h1 { font-size: clamp(28px, 8vw, 38px); }
  footer button { font-size: 17px; }
}
