/* ---------------------------------------------------------------
   App shell: background, mesh blobs, stage, corner chips
   --------------------------------------------------------------- */

.app {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: clip;
  background: linear-gradient(
    135deg,
    #160720 0%,
    #260830 40%,
    #3a0828 70%,
    #1a0620 100%
  );
}

/* --- Glowing mesh blobs ------------------------------------------------ */

.mesh {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.mesh__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
}

.mesh__blob--1 {
  top: -20%;
  left: -10%;
  width: 60vw;
  height: 60vw;
  background: radial-gradient(
    circle,
    rgba(236, 72, 153, 0.22) 0%,
    transparent 70%
  );
}

.mesh__blob--2 {
  bottom: -15%;
  right: -10%;
  width: 55vw;
  height: 55vw;
  background: radial-gradient(
    circle,
    rgba(168, 85, 247, 0.18) 0%,
    transparent 70%
  );
}

.mesh__blob--3 {
  top: 40%;
  left: 30%;
  width: 40vw;
  height: 40vw;
  filter: blur(50px);
  background: radial-gradient(
    circle,
    rgba(244, 114, 182, 0.14) 0%,
    transparent 70%
  );
}

/* --- Floating hearts --------------------------------------------------- */

.floating-hearts {
  pointer-events: none;
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 1;
}

.floating-heart {
  position: absolute;
  top: 0;
  left: var(--left);
  color: var(--pink-300);
  will-change: transform, opacity;
  /* `backwards` is load-bearing: without a fill mode the element shows its base
     style during animation-delay — top:0, no transform, opacity 1 — so all ten
     hearts stack opaque at the top edge until their delay elapses. */
  animation: float-up var(--duration) linear var(--delay) infinite backwards;
}

.floating-heart svg {
  width: var(--size);
  height: var(--size);
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* --- Stage (page container) -------------------------------------------- */

.stage {
  position: relative;
  z-index: 10;
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
}

.page {
  width: 100%;
  display: flex;
  justify-content: center;
}

.page--narrow {
  max-width: 42rem;
  display: block;
}

/* --- Corner chips (Lock / Back) ---------------------------------------- */

.chip {
  position: absolute;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 9999px;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 4px 16px rgba(0, 0, 0, 0.25);
  transition: background 0.2s ease, transform 0.2s ease;
}

.chip:hover {
  background: rgba(255, 255, 255, 0.15);
}

.chip__icon .icon {
  width: 1rem;
  height: 1rem;
}

.chip--top-right {
  top: 1.5rem;
  right: 1.5rem;
}

.chip--top-left {
  top: 1.5rem;
  left: 1.5rem;
}

/* --- Cursor + sparkle trail -------------------------------------------- */

.sparkle-layer {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 99;
  overflow: hidden;
}

.sparkle-layer svg {
  position: absolute;
  top: 0;
  left: 0;
  transform: translate(-50%, -50%);
  will-change: transform, opacity;
}

.cursor-dot {
  pointer-events: none;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 101;
  will-change: transform;
  transform: translate(-100px, -100px);
}

.cursor-dot__inner {
  transition: transform 0.28s var(--ease-out-expo);
}

.cursor-dot[data-mode="pointer"] .cursor-dot__inner {
  transform: scale(1.18);
}

.cursor-dot[data-mode="key"] .cursor-dot__inner {
  transform: scale(1.2) rotate(-35deg);
}

/* Glass heart: a grounding shadow plus a faint bloom, so it sits on the page
   instead of floating flatly above it. */
.glass-heart {
  will-change: transform;
  filter: drop-shadow(0 1px 3px rgba(131, 24, 67, 0.55))
    drop-shadow(0 0 12px rgba(249, 168, 212, 0.5));
  animation: cursor-beat 3.2s ease-in-out infinite;
}

/* Over something clickable the glass catches more light and stops beating. */
.cursor-dot[data-mode="pointer"] .glass-heart {
  filter: drop-shadow(0 1px 4px rgba(131, 24, 67, 0.5))
    drop-shadow(0 0 14px rgba(255, 255, 255, 0.5))
    drop-shadow(0 0 26px rgba(236, 72, 153, 0.45));
  animation: none;
}

/* The key only appears over the padlock, so it is always in its "lit" state. */
.glass-key {
  filter: drop-shadow(0 1px 3px rgba(131, 24, 67, 0.55))
    drop-shadow(0 0 12px rgba(255, 255, 255, 0.45))
    drop-shadow(0 0 22px rgba(236, 72, 153, 0.5));
}

/* Touch devices keep their native cursor — no trail, no dot. */
@media not all and (hover: hover) and (pointer: fine) {
  .sparkle-layer,
  .cursor-dot {
    display: none;
  }
}

@media (max-width: 640px) {
  .stage {
    padding: 4.5rem 1rem 3rem;
  }
}
