html {
  background: #fff;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
}

.home {
  --duck-clearance: 8rem;
  position: relative;
  display: grid;
  place-items: center;
  color: #000;
  font: 1rem Arial, sans-serif;
}

.home header,
.home footer {
  position: absolute;
  inset-inline: 1rem;
  font-size: 24px;
  text-align: center;
}

.home header {
  top: 1rem;
}

.home header p {
  margin: 0;
  padding-inline: 5rem;
}

.portfolio {
  position: absolute;
  top: 0;
  right: 0;
  padding: 0.375rem 0.625rem;
  border: 1px solid currentColor;
  border-radius: 0.25rem;
  color: inherit;
  font-size: 0.875rem;
  text-decoration: none;
}

.portfolio:hover {
  text-decoration: underline;
}

.home footer {
  bottom: 1rem;
}

.duck {
  display: block;
  width: min(498px, 90vw, calc(90vh * 498 / 449));
  width: min(498px, 90vw, calc(90dvh * 498 / 449));
  height: auto;
}

.home .duck {
  /* Reserve the same space above and below so the duck stays centered. */
  width: min(498px, 90vw, max(1px, calc((100vh - var(--duck-clearance)) * 498 / 449)));
  width: min(498px, 90vw, max(1px, calc((100dvh - var(--duck-clearance)) * 498 / 449)));
}

.home .music-player {
  position: absolute;
  bottom: max(0.75rem, env(safe-area-inset-bottom));
  left: max(0.75rem, env(safe-area-inset-left));
  width: min(12rem, calc(100% - 1.5rem));
  display: grid;
  gap: 0.125rem;
  font-size: 0.875rem;
}

.music-player select {
  width: 100%;
  min-height: 1.75rem;
  border: 1px solid currentColor;
  border-radius: 0.25rem;
  background: #fff;
  color: inherit;
  font: inherit;
  text-overflow: ellipsis;
}

.music-volume {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  min-height: 1.5rem;
}

.music-volume input {
  flex: 1;
  min-width: 0;
  margin: 0;
  accent-color: #000;
}

.home .music-video {
  position: absolute;
  top: 100%;
  left: max(0.75rem, env(safe-area-inset-left));
  width: min(22.5rem, calc(100% - 1.5rem));
  min-width: 200px;
  padding-block: 0.75rem;
  font-size: 0.875rem;
}

.music-video iframe {
  display: block;
  width: 100%;
  min-height: 200px;
  aspect-ratio: 16 / 9;
  border: 0;
}

#music-status {
  margin: 0;
}

@media (min-width: 78rem) and (min-height: 26rem) {
  .home .music-video {
    top: auto;
    bottom: 4.5rem;
  }
}

@media (max-width: 36rem) {
  .home {
    --duck-clearance: 14rem;
  }

  .home header p {
    padding: 2.5rem 0 0;
  }

  .home .music-player {
    bottom: max(3rem, env(safe-area-inset-bottom));
  }
}

.lost {
  position: fixed;
  inset: 0;
  min-height: 0;
  overflow: hidden;
  background: #fff;
}

.lost .duck {
  position: absolute;
  top: 0;
  left: 0;
}

.lost h1 {
  position: absolute;
  inset: auto 0 max(1rem, env(safe-area-inset-bottom));
  width: fit-content;
  max-width: 90%;
  margin: 0 auto;
  padding: 0.25em 0.5em;
  border-radius: 0.25em;
  background: rgb(255 255 255 / 90%);
  color: #555;
  font: normal 0.875rem system-ui, sans-serif;
  text-align: center;
}
