:root {
  --ink: #2a2118;
  --paper: #fbf6ec;
  --crimson: #c5282e;
  --gold: #e7c36a;
  --night: #0c1833;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  overflow: hidden;
  background: var(--night);
  color: var(--ink);
  font-family: Outfit, "Segoe UI", sans-serif;
}

.ambient {
  position: fixed;
  inset: -8%;
  z-index: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  filter: blur(46px) saturate(1.25) brightness(0.72);
  transform: scale(1.06);
}

.stage {
  position: relative;
  z-index: 1;
  height: 100%;
  display: grid;
  place-items: center;
}

.stage::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background: rgba(6, 12, 28, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 1100ms cubic-bezier(0.42, 0, 0.58, 1);
}

.frame {
  position: relative;
  z-index: 1;
  transition:
    transform 1100ms cubic-bezier(0.42, 0, 0.58, 1),
    filter 1100ms cubic-bezier(0.42, 0, 0.58, 1);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.14);
}

.art,
.doors {
  position: absolute;
  inset: 0;
}

.art {
  background-image: var(--art);
  background-repeat: no-repeat;
  background-size: var(--fw) var(--fh);
  background-position: 0 0;
}

.door {
  position: absolute;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  perspective: 420px;
  transform-style: preserve-3d;
}

.door:focus {
  outline: none;
}

.door:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.pocket {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #fff;
}

.door-still {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}

.learn-play[hidden] {
  display: none;
}

.learn-play {
  position: absolute;
  z-index: 6;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 0.35em 0.5em;
  border: 0;
  background: transparent;
  opacity: 0;
  pointer-events: none;
}

.door.is-open + .learn-play {
  opacity: 0;
}

.door.is-open.is-settled + .learn-play {
  opacity: 1;
  transition: opacity 200ms ease;
}

.learn-play-label {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 0.4em;
  padding: 0.4em 0.72em 0.4em 0.52em;
  border-radius: 999px;
  background: var(--crimson);
  color: #fff;
  font-family: Outfit, "Segoe UI", sans-serif;
  font-weight: 600;
  font-size: 1em;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.28);
  pointer-events: none;
}

.door.is-open.is-settled + .learn-play .learn-play-label {
  pointer-events: auto;
  cursor: pointer;
}

.door.is-playing + .learn-play,
.door.is-playing + .learn-play .learn-play-label,
.door.is-open.is-settled.is-playing + .learn-play,
.door.is-open.is-settled.is-playing + .learn-play .learn-play-label {
  opacity: 0;
  pointer-events: none;
}

.learn-play-icon {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0.42em 0 0.42em 0.68em;
  border-color: transparent transparent transparent #fff;
}

.leaf {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform-origin: left center;
  transition: transform 600ms cubic-bezier(0.42, 0, 0.58, 1);
}

.door:hover .leaf,
.door:focus-visible .leaf {
  transform: rotateY(-32deg);
  transition-duration: 300ms;
}

.door:hover,
.door:focus-visible {
  z-index: 2;
}

.door.is-open {
  z-index: 5;
}

.door.is-open .leaf,
.door.is-open:hover .leaf,
.door.is-open:focus-visible .leaf {
  transform: rotateY(-158deg);
  transition-duration: 600ms;
}

body.is-door-open .door:not(.is-open):hover .leaf,
body.is-door-open .door:not(.is-open):focus-visible .leaf {
  transform: none;
}

body.is-door-open .door:not(.is-open):hover .face,
body.is-door-open .door:not(.is-open):focus-visible .face {
  box-shadow: none;
}

body.is-door-open .door:not(.is-open):hover,
body.is-door-open .door:not(.is-open):focus-visible {
  z-index: auto;
}

.door.is-locked {
  cursor: default;
}

.door.is-locked:hover .leaf,
.door.is-locked:focus-visible .leaf {
  transform: none;
}

.door.is-locked:hover .face,
.door.is-locked:focus-visible .face {
  box-shadow: none;
}

.face,
.back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
}

.face {
  background-image: var(--art);
  background-repeat: no-repeat;
  background-size: var(--fw) var(--fh);
  background-position: var(--pos);
  box-shadow: inset 0 0 0 1px rgba(255, 220, 140, 0.0);
}

.door:hover .face,
.door:focus-visible .face {
  box-shadow:
    inset 0 0 0 1.5px rgba(255, 214, 120, 0.95),
    8px 10px 18px rgba(0, 0, 0, 0.28);
}

.door.is-open .face,
.door.is-open:hover .face,
.door.is-open:focus-visible .face {
  box-shadow: none;
}

.door.is-open:focus-visible {
  outline: none;
}

.back {
  background: #fff;
  transform: rotateY(180deg);
}

body.is-zooming,
body.is-zooming * {
  pointer-events: none !important;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 24px;
}

.overlay[hidden] {
  display: none;
}

body.is-blown .frame {
  filter: blur(16px);
}

body.is-door-open .frame {
  z-index: 3;
}

body.is-door-open .overlay {
  z-index: 8;
  pointer-events: none;
  background: transparent;
}

body.is-door-open .scrim {
  display: block;
  background: transparent;
  /* The overlay itself is pointer-events: none while a door is open, so the
     full-screen background catcher must opt back in or clicks fall through. */
  pointer-events: auto;
}

body.is-door-open .panel {
  position: fixed;
  top: 16px;
  right: 16px;
  left: auto;
  width: auto;
  max-height: none;
  padding: 0;
  overflow: visible;
  background: transparent;
  box-shadow: none;
  pointer-events: none;
  animation: none;
}

body.is-door-open .panel-video {
  display: none;
}

body.is-door-open .panel-close {
  position: static;
  pointer-events: auto;
  background: #fff;
}

.door-player {
  position: fixed;
  z-index: 9;
  overflow: hidden;
  background: #1a120c;
  transition:
    left 1100ms cubic-bezier(0.42, 0, 0.58, 1),
    top 1100ms cubic-bezier(0.42, 0, 0.58, 1),
    width 1100ms cubic-bezier(0.42, 0, 0.58, 1),
    height 1100ms cubic-bezier(0.42, 0, 0.58, 1);
}

.door-player[hidden] {
  display: none;
}

/* While snapping to a new size on resize, don't animate the move. */
.door-player.is-resizing {
  transition: none;
}

.door-player video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #1a120c;
}

.scrim {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  background: rgba(6, 12, 28, 0.28);
  cursor: pointer;
}

.panel {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  max-height: min(860px, calc(100vh - 48px));
  overflow: auto;
  padding: 16px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.42);
  animation: rise 320ms ease;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.panel-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: rgba(42, 33, 24, 0.06);
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.panel-close:hover {
  background: rgba(42, 33, 24, 0.12);
}

.panel-kicker {
  margin: 0 36px 12px 0;
  color: var(--crimson);
  font-family: Fraunces, Georgia, serif;
  font-size: 14px;
  font-weight: 680;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.panel-video {
  overflow: hidden;
  border-radius: 12px;
  background: #1a120c;
  aspect-ratio: 16 / 9;
}

.panel-video video,
.panel-video iframe,
.yt-facade {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.yt-facade {
  position: relative;
  padding: 0;
  cursor: pointer;
}

.yt-facade img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.yt-play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 8px 16px 8px 14px;
  border-radius: 999px;
  background: var(--crimson);
  color: white;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.yt-play::before {
  content: "";
  display: inline-block;
  margin-right: 8px;
  border-style: solid;
  border-width: 6px 0 6px 10px;
  border-color: transparent transparent transparent white;
  vertical-align: -1px;
}

.video-empty {
  display: grid;
  place-items: center;
  height: 100%;
  color: rgba(251, 246, 236, 0.72);
  font-size: 14px;
  letter-spacing: 0.04em;
}

.panel-question {
  margin: 16px 0 12px;
  font-family: Fraunces, Georgia, serif;
  font-size: 26px;
  font-weight: 560;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.panel-answers {
  display: grid;
  gap: 8px;
}

.answer {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(42, 33, 24, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
}

.answer:hover {
  border-color: rgba(197, 40, 46, 0.45);
}

.answer-key {
  flex: 0 0 auto;
  width: 1.4em;
  color: var(--crimson);
  font-weight: 600;
}

.answer.is-picked {
  background: var(--crimson);
  border-color: var(--crimson);
  color: white;
}

.answer.is-picked .answer-key {
  color: var(--gold);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .frame,
  .leaf,
  .panel,
  .stage::before,
  .door-player {
    transition: none;
    animation: none;
  }
}
