@font-face {
  font-family: "Inter Local";
  src: url("assets/fonts/Inter-Variable.ttf") format("truetype-variations");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  font-family: "Inter Local", sans-serif;
  background: #fcd63e;
  color: #454656;
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100svh;
  overflow-x: hidden;
  background: #ffffff;
  -webkit-font-smoothing: antialiased;
}

.stage {
  display: grid;
  min-height: 100svh;
  place-items: center;
}

.composition {
  width: min(79.4vw, 31rem);
  padding-bottom: clamp(1.8rem, 11.5vw, 2.8rem);
}

.question {
  margin: 0;
  font-size: clamp(3.6rem, 14.75vw, 5.75rem);
  font-weight: 400;
  letter-spacing: -0.012em;
  line-height: 1.01;
}

.line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.035em;
}

.line > span {
  display: block;
  opacity: 0;
  transform: translateY(105%);
  white-space: nowrap;
  animation: reveal-line 560ms cubic-bezier(0.2, 0.75, 0.25, 1) forwards;
}

.line:nth-child(2) > span {
  animation-delay: 420ms;
}

.line:nth-child(3) > span {
  animation-delay: 840ms;
  letter-spacing: -0.036em;
}

.question strong {
  font-weight: 700;
}

.question em {
  font-style: italic;
  font-weight: inherit;
}

.bubble {
  position: relative;
  width: 97.8%;
  aspect-ratio: 305 / 209;
  margin-top: clamp(4rem, 16.5vw, 6.25rem);
  color: #fff;
  opacity: 0;
  transform: translateY(1.2rem);
  animation: reveal-bubble 520ms 1.75s cubic-bezier(0.2, 0.8, 0.25, 1) forwards;
}

.bubble-shape {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 0.9rem 1.05rem rgb(69 70 86 / 27%));
}

.term {
  position: absolute;
  z-index: 1;
  top: 0;
  right: 0;
  left: 2.5rem;
  display: flex;
  height: 80.66%;
  align-items: center;
  font-size: clamp(2.35rem, 11.7vw, 4.4rem);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.02;
}

.term.is-changing {
  animation: term-flash 90ms ease-out;
}

@keyframes reveal-line {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes reveal-bubble {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes term-flash {
  from {
    opacity: 0.25;
    transform: translateY(0.15em);
  }

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

@media (min-width: 52rem) {
  .composition {
    display: grid;
    width: min(90vw, 68rem);
    padding-bottom: 0;
    grid-template-columns: minmax(23rem, 31rem) minmax(19rem, 24rem);
    column-gap: clamp(3rem, 7vw, 7rem);
    align-items: center;
    justify-content: center;
  }

  .question {
    font-size: clamp(4rem, 8vw, 5.75rem);
  }

  .bubble {
    width: 100%;
    margin-top: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .line > span,
  .bubble,
  .term.is-changing {
    animation: none;
    opacity: 1;
    transform: none;
  }
}
