:root {
  --night: #070b18;
  --foam: #f4f1ff;
  --muted: #9aa3c7;
  --match: #f0c36a;
  --candy: #ff5c8a;
  --iris: #8ea2ff;
  --spot: rgba(240, 195, 106, 0.18);
  --display: "Italiana", "Bodoni Moda", "Didot", serif;
  --sans: "Syne", "Avenir Next", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--night);
  color: var(--foam);
}

html {
  height: 100%;
}

body {
  min-height: 100dvh;
  font-family: var(--sans);
  overflow: hidden;
  cursor: crosshair;
}

a,
button {
  cursor: pointer;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(1200px 700px at 12% -10%, rgba(255, 92, 138, 0.18), transparent 55%),
    radial-gradient(900px 600px at 110% 30%, rgba(142, 162, 255, 0.2), transparent 50%),
    radial-gradient(800px 500px at 50% 120%, rgba(240, 195, 106, 0.1), transparent 55%),
    var(--night);
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.55;
  mix-blend-mode: screen;
  animation: drift 18s ease-in-out infinite;
}

.orb-a {
  width: min(48vw, 420px);
  height: min(48vw, 420px);
  left: -8%;
  top: 8%;
  background: #ff5c8a;
  animation-delay: -4s;
}

.orb-b {
  width: min(52vw, 480px);
  height: min(52vw, 480px);
  right: -12%;
  bottom: -8%;
  background: #6d7cff;
  animation-duration: 22s;
}

.orb-c {
  width: min(30vw, 260px);
  height: min(30vw, 260px);
  right: 22%;
  top: 18%;
  background: #f0c36a;
  opacity: 0.28;
  animation-duration: 16s;
  animation-delay: -8s;
}

@keyframes drift {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(4%, -6%, 0) scale(1.08);
  }
}

.vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(7, 11, 24, 0.55) 100%);
}

.grain {
  position: absolute;
  inset: 0;
  opacity: 0.18;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.9'/%3E%3C/svg%3E");
}

.spot {
  position: absolute;
  width: 42vw;
  height: 42vw;
  max-width: 560px;
  max-height: 560px;
  border-radius: 50%;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, var(--spot), transparent 68%);
  transition: opacity 0.6s ease;
}

.top,
.floor {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.top {
  top: 0;
}

.floor {
  bottom: 0;
}

.mark {
  color: var(--foam);
  text-decoration: none;
  border: 1px solid color-mix(in srgb, var(--foam) 35%, transparent);
  width: 2.1rem;
  height: 2.1rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  letter-spacing: 0.04em;
  font-size: 0.62rem;
}

.mark:hover,
.mark:focus-visible {
  color: var(--night);
  background: var(--foam);
  outline: none;
}

.ciao {
  margin: 0;
  color: var(--match);
}

.stage {
  position: relative;
  z-index: 2;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 5.5rem 7vw 5rem;
}

.hi,
.im,
.meet {
  margin: 0;
}

.hi {
  font-weight: 800;
  font-size: clamp(1.6rem, 3.4vw, 2.4rem);
  color: var(--candy);
  letter-spacing: -0.04em;
  animation: rise 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hi span {
  display: inline-block;
  transform-origin: 70% 80%;
  animation: wave 2.8s ease-in-out 1.1s infinite;
}

.im {
  margin-top: 0.2rem;
  margin-bottom: 0.55rem;
  font-size: 1.05rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--match);
  animation: rise 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.12s both;
}

.name {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.8rem, 11.2vw, 9rem);
  line-height: 0.86;
  letter-spacing: -0.035em;
  font-synthesis: none;
}

.line {
  display: block;
  position: relative;
  white-space: nowrap;
  min-height: 0.86em;
}

.line[data-text="Sofia"] {
  padding-left: 0.06em;
}

.line[data-text="Mortelli"] {
  padding-left: 0.28em;
}

.letter-wrap {
  display: inline-block;
  animation: letter-in 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.letter {
  display: inline-block;
  position: relative;
  will-change: transform;
  padding: 0 0.015em;
  color: var(--foam);
  text-shadow: 0 0 40px rgba(142, 162, 255, 0.18);
  user-select: none;
  touch-action: none;
  cursor: grab;
}

.letter::after {
  content: "";
  position: absolute;
  inset: -0.12em -0.06em;
}

.letter.is-held {
  color: var(--match);
  z-index: 5;
  cursor: grabbing;
}

.meet {
  margin-top: 1.6rem;
  max-width: 22ch;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-weight: 400;
  letter-spacing: 0.01em;
  animation: rise 1s cubic-bezier(0.16, 1, 0.3, 1) 0.55s both;
}

.hint {
  margin: 0;
}

.reset {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--foam);
  font: inherit;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.4rem 0;
  text-decoration: underline;
  text-underline-offset: 0.3em;
}

.reset:hover,
.reset:focus-visible {
  color: var(--candy);
  outline: none;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translate3d(0, 18px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes wave {
  0%,
  100% {
    transform: rotate(0deg);
  }
  18% {
    transform: rotate(-14deg);
  }
  32% {
    transform: rotate(8deg);
  }
  46% {
    transform: rotate(-6deg);
  }
  60% {
    transform: rotate(0deg);
  }
}

@keyframes letter-in {
  from {
    opacity: 0;
    transform: translate3d(0, 0.45em, 0) rotate(8deg);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
}

@media (max-width: 640px) {
  .stage {
    padding: 6rem 1.25rem 5.5rem;
  }

  .line[data-text="Mortelli"] {
    padding-left: 0;
  }

  .top,
  .floor {
    padding: 1rem 1.1rem;
  }

  body {
    overflow: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .orb,
  .hi span,
  .hi,
  .im,
  .meet,
  .letter-wrap {
    animation: none;
  }

  .spot {
    display: none;
  }
}

@media (max-width: 640px) and (prefers-reduced-motion: reduce) {
  body {
    overflow: auto;
  }
}
