.alvin-presentation {
  --alvin-red: #c91523;
  color: #202427;
  text-align: center;
  width: 100%;
  max-width: 23rem;
  margin-inline: auto;
}

.alvin-presentation-media {
  min-height: 10rem;
  display: grid;
  place-items: center;
}

.alvin-presentation-media > img {
  display: block;
  width: min(100%, 18rem);
  height: 16rem;
  object-fit: contain;
}

.alvin-presentation-media > video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 16rem;
  border-radius: 0.5rem;
  background: #202427;
}

.alvin-presentation [hidden] {
  display: none !important;
}

.alvin-presentation-dialog {
  width: min(60rem, calc(100vw - 2rem));
  max-width: calc(100vw - 2rem);
  max-height: calc(100dvh - 2rem);
  margin: auto;
  padding: 1rem;
  color: #202427;
  background: #fff;
  border: 1px solid #cfd4d9;
  border-radius: 0.75rem;
  text-align: left;
  box-sizing: border-box;
}

.alvin-presentation-dialog::backdrop {
  background: rgb(18 21 24 / 78%);
}

.alvin-presentation-dialog > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.alvin-presentation-dialog h2 {
  margin: 0;
  font: inherit;
  font-weight: 650;
}

.alvin-presentation-dialog button {
  min-width: 3rem;
  min-height: 2.75rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid #cfd4d9;
  border-radius: 0.4rem;
  color: inherit;
  background: #fff;
  cursor: pointer;
  font: inherit;
}

.alvin-presentation-dialog button:focus-visible {
  outline: 3px solid #202427;
  outline-offset: 2px;
}

.alvin-presentation-dialog > video {
  display: block;
  width: 100%;
  max-height: calc(100dvh - 8rem);
  aspect-ratio: 16 / 9;
  border-radius: 0.4rem;
  background: #202427;
}

.alvin-presentation-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.alvin-presentation-controls button {
  min-height: 2.75rem;
  padding: 0.6rem 0.9rem;
  border: 1px solid #cfd4d9;
  border-radius: 0.4rem;
  background: #fff;
  color: #202427;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.alvin-presentation-controls button:first-child {
  border-color: var(--alvin-red);
  color: var(--alvin-red);
}

.alvin-presentation-controls button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.alvin-presentation-controls button:focus-visible,
.alvin-presentation-transcript summary:focus-visible {
  outline: 3px solid #202427;
  outline-offset: 3px;
}

.alvin-presentation-status,
.alvin-presentation-transcript {
  font-size: 0.75rem;
  line-height: 1.5;
  color: #525b65;
  margin-top: 0.5rem;
}

.alvin-presentation-status:empty {
  display: none;
}

.alvin-presentation-transcript summary {
  width: fit-content;
  margin-inline: auto;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.alvin-presentation-transcript p {
  max-width: 38ch;
  margin: 0.5rem auto 0;
}

.alvin-presentation--compact {
  max-width: 100%;
  padding-block: 0.5rem 0.75rem;
  border-bottom: 1px solid #e1e5e9;
}

.alvin-presentation--compact .alvin-presentation-media > img {
  height: 7rem;
}

.alvin-presentation--compact .alvin-presentation-media {
  min-height: 7rem;
}

.alvin-presentation--compact .alvin-presentation-media > video {
  max-height: 12rem;
  width: min(100%, 21rem);
}

@media (prefers-reduced-motion: no-preference) {
  .alvin-presentation:focus-within[data-state="idle"] [data-alvin-poster],
  .alvin-presentation:hover[data-state="idle"] [data-alvin-poster] {
    animation: alvin-greeting 1.8s ease-in-out 2;
  }
}

@media (prefers-reduced-motion: reduce) {
  .alvin-presentation *,
  .alvin-presentation *::before,
  .alvin-presentation *::after {
    animation: none !important;
    transition: none !important;
  }
}

@keyframes alvin-greeting {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}
