@font-face {
  font-family: "ImpactLocal";
  src: url("assets/fonts/Impact.woff2") format("woff2");
  font-display: swap;
}

@font-face {
  font-family: "RockSalt";
  src: url("assets/fonts/RockSalt-Regular.woff2") format("woff2");
  font-display: swap;
}

@font-face {
  font-family: "MontserratLocal";
  src: url("assets/fonts/Montserrat-Regular.woff2") format("woff2");
  font-display: swap;
}

:root {
  --pink: #f42a79;
  --paper: #eeeae3;
  --ink: #080808;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: #0a0a0a;
  color: var(--ink);
  font-family: "MontserratLocal", Arial, sans-serif;
}

button {
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  background: none;
}

.app {
  min-height: 100svh;
  display: grid;
  place-items: start center;
  background:
    radial-gradient(circle at 20% 10%, rgba(244, 42, 121, 0.22), transparent 24rem),
    #090909;
}

.poster {
  position: relative;
  width: 100vw;
  height: 177.7778vw;
  max-width: 450px;
  max-height: 800px;
  overflow: hidden;
  isolation: isolate;
  background: var(--paper);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.58);
}

.poster__background,
.intro img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  pointer-events: none;
}

.slider {
  position: absolute;
  z-index: 2;
  inset: 23% 0 16.2%;
  opacity: 0;
  touch-action: pan-y;
}

.slides {
  position: absolute;
  inset: 0;
}

.slide {
  position: absolute;
  top: 0;
  left: 50%;
  width: 42%;
  height: 100%;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: translateX(-50%) scale(0.68);
  transition:
    opacity 420ms ease,
    transform 520ms cubic-bezier(0.2, 0.8, 0.2, 1),
    filter 420ms ease;
  will-change: transform, opacity;
}

.slide img {
  position: absolute;
  left: 50%;
  bottom: 0;
  max-height: 100%;
  object-fit: contain;
  opacity: 0;
  transform: translateX(-50%);
  filter: drop-shadow(0 18px 16px rgba(0, 0, 0, 0.2));
  mix-blend-mode: multiply;
  transition: opacity 260ms ease;
  pointer-events: none;
  user-select: none;
}

.slide__person {
  width: 158%;
}

.slide__pants {
  width: 92%;
  bottom: 12%;
  max-height: 72%;
}

.slide.is-active {
  z-index: 4;
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

.slide.is-active .slide__person {
  opacity: 1;
}

.slide.is-prev {
  z-index: 2;
  opacity: 0.84;
  transform: translateX(-142%) translateY(3%) scale(0.6);
  filter: saturate(0.94);
}

.slide.is-next {
  z-index: 2;
  opacity: 0.84;
  transform: translateX(42%) translateY(3%) scale(0.6);
  filter: saturate(0.94);
}

.slide.is-prev .slide__pants,
.slide.is-next .slide__pants {
  opacity: 1;
}

.slide.is-away-left {
  transform: translateX(-210%) translateY(18%) scale(0.44);
}

.slide.is-away-right {
  transform: translateX(110%) translateY(18%) scale(0.44);
}

.nav-button {
  position: absolute;
  z-index: 6;
  top: 43%;
  width: 15.5%;
  aspect-ratio: 121 / 76;
  cursor: pointer;
  transform: translateY(-50%);
  filter: drop-shadow(8px 4px 0 rgba(255, 255, 255, 0.72));
  opacity: 0;
  transition: transform 180ms ease;
}

.nav-button:hover {
  transform: translateY(-50%) scale(1.08);
}

.nav-button:active {
  transform: translateY(-50%) scale(0.94);
}

.nav-button:focus-visible {
  outline: 3px solid var(--pink);
  outline-offset: 4px;
}

.nav-button img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.nav-button--prev {
  left: 14.3%;
  filter: drop-shadow(-8px 4px 0 rgba(255, 255, 255, 0.72));
}

.nav-button--prev img {
  transform: scaleX(-1);
}

.nav-button--next {
  right: 14.3%;
}

.intro {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: start center;
  overflow-y: auto;
  overflow-x: hidden;
  background: #050505;
}

.intro.is-exiting {
  pointer-events: none;
  animation: introLift 720ms cubic-bezier(0.76, 0, 0.24, 1) forwards;
}

.intro-stage {
  position: relative;
  width: min(100vw, 56.25vh);
  height: min(100vh, 177.7778vw);
  max-width: 450px;
  max-height: 800px;
  overflow: hidden;
  background: #050505;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.58);
  animation: introStageIn 620ms ease-out both;
}

.intro-stage::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(180deg, transparent 28%, rgba(0, 0, 0, 0.3) 42%, transparent 64%);
  pointer-events: none;
}

.intro img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  pointer-events: none;
  animation: introImage 900ms ease-out 120ms both;
}

.question-card {
  position: absolute;
  z-index: 3;
  top: 45%;
  left: 50%;
  width: min(84vw, 370px);
  display: grid;
  gap: 12px;
  padding: 18px 17px 16px;
  border: 3px solid var(--pink);
  border-radius: 8px;
  opacity: 1;
  transform: translateX(-50%) rotate(-1.5deg);
  color: #fff;
  background: rgba(5, 5, 5, 0.82);
  box-shadow:
    8px 8px 0 rgba(244, 42, 121, 0.72),
    0 0 0 2px rgba(0, 0, 0, 0.45);
  transition:
    opacity 220ms ease,
    transform 220ms ease;
  animation: questionIn 560ms cubic-bezier(0.2, 0.8, 0.2, 1) 760ms both;
}

.question-card.has-entered {
  animation: none;
}

.question-card.is-wrong {
  opacity: 1;
  animation: answerWrong 440ms cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

.question-card.is-correct {
  opacity: 1;
  border-color: #42f58a;
  box-shadow:
    8px 8px 0 rgba(66, 245, 138, 0.66),
    0 0 0 2px rgba(0, 0, 0, 0.45);
  animation: answerCorrect 520ms ease both;
}

.question-card.is-hidden {
  opacity: 0;
  transform: translate(-50%, 10px) rotate(-1.5deg);
  pointer-events: none;
  animation: none;
}

.question-card label {
  font-family: "ImpactLocal", Impact, sans-serif;
  font-size: clamp(19px, 5.4vw, 25px);
  line-height: 1;
  text-transform: uppercase;
}

.answer-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  opacity: 1;
  transform: translateY(0);
  animation: fieldIn 420ms ease 1040ms both;
}

.answer-row input {
  min-width: 0;
  height: 40px;
  border: 2px solid var(--pink);
  border-radius: 999px;
  padding: 4px 14px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  font-family: "MontserratLocal", Arial, sans-serif;
  font-size: 18px;
  outline: 0;
}

.answer-row input:focus {
  box-shadow: 0 0 0 3px rgba(244, 42, 121, 0.28);
}

.question-card.is-wrong .answer-row input {
  border-color: #ff3b5f;
  background: rgba(255, 59, 95, 0.18);
}

.question-card.is-correct .answer-row input {
  border-color: #42f58a;
  background: rgba(66, 245, 138, 0.14);
}

.answer-row button {
  min-width: 78px;
  height: 40px;
  border-radius: 999px;
  padding: 5px 14px 4px;
  color: #050505;
  background: var(--pink);
  cursor: pointer;
  font-family: "ImpactLocal", Impact, sans-serif;
  font-size: 20px;
  line-height: 1;
  text-transform: uppercase;
}

.question-feedback {
  min-height: 18px;
  margin: 0;
  color: var(--pink);
  font-family: "RockSalt", cursive;
  font-size: 13px;
  line-height: 1.2;
  opacity: 1;
  animation: fieldIn 360ms ease 1180ms both;
}

.question-card.is-correct .question-feedback {
  color: #42f58a;
}

.loader {
  position: absolute;
  z-index: 4;
  top: 52%;
  left: 50%;
  width: min(74vw, 330px);
  height: 38px;
  padding: 2.5px;
  border: 2px solid var(--pink);
  border-radius: 999px;
  background: rgba(6, 6, 6, 0.34);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.32);
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition:
    opacity 220ms ease,
    transform 220ms ease;
}

.loader span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--pink);
  transition: width 620ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.intro.is-loading .loader {
  opacity: 1;
  transform: translate(-50%, 0);
}

.signature {
  position: absolute;
  right: 14px;
  bottom: 12px;
  z-index: 3;
  margin: 0;
  color: rgba(255, 255, 255, 0.56);
  font-family: "RockSalt", cursive;
  font-size: 9px;
  line-height: 1.35;
  text-align: right;
  text-transform: lowercase;
  pointer-events: none;
}

.poster-signature {
  position: absolute;
  z-index: 8;
  right: 12px;
  bottom: 4px;
  max-width: 157px;
  margin: 0;
  color: rgba(255, 255, 255, 0.48);
  font-family: "RockSalt", cursive;
  font-size: 8px;
  line-height: 1.35;
  text-align: right;
  text-transform: lowercase;
  pointer-events: none;
}

.poster {
  opacity: 0;
  transform: translateY(18px) scale(0.985);
}

.app.is-ready .poster {
  animation: posterIn 760ms ease both;
}

.app.is-ready .slider {
  animation: sliderIn 620ms ease 260ms both;
}

.app.is-ready .nav-button--prev {
  animation: navLeftIn 520ms cubic-bezier(0.2, 0.8, 0.2, 1) 560ms both;
}

.app.is-ready .nav-button--next {
  animation: navRightIn 520ms cubic-bezier(0.2, 0.8, 0.2, 1) 700ms both;
}

@keyframes introLift {
  0%,
  66% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    visibility: hidden;
  }
}

@keyframes introImage {
  0% {
    opacity: 0;
    transform: scale(1);
    filter: saturate(1.08) contrast(1.05);
  }

  58% {
    opacity: 1;
    transform: scale(1);
    filter: saturate(1.08) contrast(1.05);
  }

  100% {
    opacity: 1;
    transform: scale(1);
    filter: saturate(1.08) contrast(1.05);
  }
}

@keyframes introStageIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes questionIn {
  from {
    opacity: 0;
    transform: translate(-50%, 18px) rotate(-1.5deg) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) rotate(-1.5deg) scale(1);
  }
}

@keyframes fieldIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes posterIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes sliderIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes navLeftIn {
  from {
    opacity: 0;
    transform: translate(-12px, -50%);
  }

  to {
    opacity: 1;
    transform: translateY(-50%);
  }
}

@keyframes navRightIn {
  from {
    opacity: 0;
    transform: translate(12px, -50%);
  }

  to {
    opacity: 1;
    transform: translateY(-50%);
  }
}

@keyframes answerWrong {
  0%,
  100% {
    transform: translateX(-50%) rotate(-1.5deg);
  }

  18% {
    transform: translateX(calc(-50% - 10px)) rotate(-3.5deg);
  }

  36% {
    transform: translateX(calc(-50% + 9px)) rotate(1.5deg);
  }

  54% {
    transform: translateX(calc(-50% - 6px)) rotate(-2.5deg);
  }

  72% {
    transform: translateX(calc(-50% + 4px)) rotate(-0.5deg);
  }
}

@keyframes answerCorrect {
  0% {
    transform: translateX(-50%) rotate(-1.5deg) scale(1);
  }

  46% {
    transform: translateX(-50%) rotate(-1.5deg) scale(1.045);
  }

  100% {
    transform: translateX(-50%) rotate(-1.5deg) scale(1);
  }
}

@media (max-width: 420px) {
  .poster,
  .intro-stage {
    max-width: none;
    max-height: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
