:root {
  --fade: 1s;
  --ink: #fff;
  --ground: #0c0c0c;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--ground);
  color: var(--ink);
}

body {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.4;
}

#stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: var(--ground);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.slide {
  position: absolute;
  inset: 0;
  margin: 0;
  background: var(--ground);
  opacity: 0;
  transition: opacity var(--fade) ease;
}

.slide.is-visible {
  opacity: 1;
}

.slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  background: var(--ground);
}

/* A portrait frame on a wide screen is a tall crop if it is forced to cover.
   Letterbox it instead, like a print on a dark wall. Phones stay full-bleed. */
@media (min-aspect-ratio: 1/1) {
  .slide.portrait img {
    object-fit: contain;
  }
}

@media (prefers-reduced-motion: reduce) {
  .slide {
    transition: none;
  }
}

.scrim {
  position: fixed;
  z-index: 1;
  left: 0;
  right: 0;
  bottom: 0;
  height: min(52vh, 24rem);
  pointer-events: none;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.84) 0%,
    rgba(0, 0, 0, 0.58) 36%,
    rgba(0, 0, 0, 0.2) 70%,
    rgba(0, 0, 0, 0) 100%
  );
}

.overlay {
  position: fixed;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 40rem;
  padding: 1.25rem 1.25rem calc(1.15rem + env(safe-area-inset-bottom, 0px));
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85), 0 0 18px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.overlay h1,
.overlay .bio,
.overlay a,
.load-error {
  pointer-events: auto;
}

.overlay h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.bio {
  margin: 0.2rem 0 0.75rem;
  max-width: 26rem;
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.95rem;
  text-wrap: balance;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.95rem;
}

.overlay a {
  color: #fff;
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.3;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.55);
}

.overlay a:visited {
  color: #fff;
}

.overlay a:hover {
  border-bottom-color: #fff;
}

.overlay a:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
  border-bottom-color: transparent;
}

#toggle-play {
  position: fixed;
  z-index: 3;
  right: max(1rem, env(safe-area-inset-right, 0px));
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  margin: 0;
  padding: 0;
  color: #fff;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

#toggle-play svg {
  width: 0.85rem;
  height: 0.85rem;
  fill: currentColor;
}

#toggle-play .icon-play {
  transform: translateX(1px);
}

#toggle-play[aria-pressed="true"] .icon-play,
#toggle-play[aria-pressed="false"] .icon-pause {
  display: none;
}

#toggle-play:hover {
  background: rgba(0, 0, 0, 0.58);
}

#toggle-play:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

#toggle-play[hidden] {
  display: none;
}

.load-error {
  margin: 0.7rem 0 0;
  font-size: 0.95rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 480px) {
  .overlay h1 {
    font-size: 1.2rem;
  }
}
