:root {
  --bg: #030307;
  --panel: rgba(16, 6, 18, 0.7);
  --hot-pink: #b56cff;
  --rose: #9b5cff;
  --red: #7f35ff;
  --wine: #2a103f;
  --soft: #efe3ff;
  --cyan: #a8f8ff;
  --text: #f7f0ff;
}

* {
  box-sizing: border-box;
}

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

body {
  overflow: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 50% 18%, rgba(155, 92, 255, 0.2), transparent 26rem),
    radial-gradient(circle at 16% 72%, rgba(168, 248, 255, 0.07), transparent 22rem),
    linear-gradient(145deg, #020204 0%, #07040c 42%, #12051d 100%);
  font-family: Rajdhani, Arial, sans-serif;
}

button {
  font: inherit;
}

.experience {
  position: relative;
  width: 100vw;
  min-height: 100vh;
  isolation: isolate;
}

.experience::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  content: "";
  background-image:
    linear-gradient(rgba(181, 108, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(181, 108, 255, 0.06) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at center, black, transparent 72%);
}

.experience::after {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background:
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.025) 0,
      rgba(255, 255, 255, 0.025) 1px,
      transparent 1px,
      transparent 5px
    );
  opacity: 0.35;
  pointer-events: none;
}

.start-screen,
.heart-screen {
  position: absolute;
  inset: 0;
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: clamp(20px, 5vw, 64px);
  transition: opacity 900ms ease, transform 900ms ease, filter 900ms ease;
}

.start-screen.is-hidden {
  opacity: 0;
  transform: scale(1.08);
  filter: blur(18px);
  pointer-events: none;
}

.terminal-shell {
  position: relative;
  width: min(560px, 92vw);
  padding: clamp(28px, 6vw, 52px) 20px;
  text-align: center;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
}

.terminal-shell::before,
.terminal-shell::after {
  display: none;
}

.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(transparent 50%, rgba(155, 92, 255, 0.035) 50%);
  background-size: 100% 6px;
  opacity: 0.5;
}

.eyebrow {
  margin: 0 0 8px;
  color: #d4b0ff;
  font-family: Consolas, "Courier New", monospace;
  font-size: clamp(0.68rem, 2.2vw, 0.9rem);
  font-weight: 400;
  letter-spacing: 0;
  text-shadow:
    0 0 7px rgba(181, 108, 255, 0.68),
    0 0 20px rgba(127, 53, 255, 0.4);
}

h1,
h2 {
  margin: 0;
  font-family: Orbitron, Rajdhani, sans-serif;
  letter-spacing: 0;
}

h1 {
  color: #d4b0ff;
  font-family: Consolas, "Courier New", monospace;
  font-size: clamp(0.86rem, 3vw, 1.45rem);
  font-weight: 400;
  line-height: 1.25;
  text-shadow:
    0 0 7px rgba(181, 108, 255, 0.68),
    0 0 20px rgba(127, 53, 255, 0.4);
}

.subtitle {
  width: min(520px, 100%);
  margin: 24px auto 0;
  color: #efe1ff;
  font-size: clamp(1.1rem, 3vw, 1.55rem);
  font-weight: 500;
  line-height: 1.25;
  text-shadow: 0 0 16px rgba(181, 108, 255, 0.6);
}

.decrypt-button {
  position: relative;
  min-height: 34px;
  margin-top: 12px;
  padding: 0 18px;
  color: #fff9fc;
  background:
    linear-gradient(90deg, rgba(127, 53, 255, 0.92), rgba(197, 138, 255, 0.9)),
    #9b5cff;
  border: 1px solid rgba(239, 225, 255, 0.58);
  border-radius: 6px;
  box-shadow:
    0 0 14px rgba(181, 108, 255, 0.48),
    0 0 34px rgba(127, 53, 255, 0.3),
    inset 0 0 10px rgba(255, 255, 255, 0.16);
  cursor: pointer;
  font-family: Rajdhani, Arial, sans-serif;
  font-size: clamp(0.72rem, 2.2vw, 0.86rem);
  font-weight: 700;
  letter-spacing: 0;
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.decrypt-button:hover,
.decrypt-button:focus-visible {
  transform: translateY(-2px) scale(1.02);
  box-shadow:
    0 0 18px rgba(181, 108, 255, 0.76),
    0 0 54px rgba(127, 53, 255, 0.42),
    inset 0 0 18px rgba(255, 255, 255, 0.22);
  outline: none;
}

.decrypt-button:active {
  transform: translateY(1px) scale(0.99);
}

.button-glitch {
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, rgba(168, 248, 255, 0.24), transparent);
  opacity: 0;
  transform: translateX(-45%);
}

.decrypt-button:hover .button-glitch {
  animation: buttonGlitch 900ms ease;
}

.heart-screen {
  opacity: 0;
  pointer-events: none;
}

.heart-screen.is-visible {
  opacity: 1;
  pointer-events: auto;
}

#particleCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.status-bar {
  position: fixed;
  top: clamp(14px, 4vw, 28px);
  left: 50%;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  width: min(560px, calc(100vw - 32px));
  padding: 10px 14px;
  color: rgba(245, 235, 255, 0.84);
  background: rgba(8, 3, 10, 0.72);
  border: 1px solid rgba(181, 108, 255, 0.34);
  border-radius: 8px;
  box-shadow: 0 0 28px rgba(127, 53, 255, 0.22);
  font-family: Orbitron, Rajdhani, sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  transform: translateX(-50%);
  overflow: hidden;
  --progress: 0;
}

.status-bar::before {
  position: absolute;
  inset: 0 auto 0 0;
  z-index: 0;
  width: calc(var(--progress) * 100%);
  content: "";
  background:
    linear-gradient(90deg, rgba(127, 53, 255, 0.42), rgba(206, 166, 255, 0.55)),
    rgba(127, 53, 255, 0.24);
  box-shadow:
    0 0 18px rgba(181, 108, 255, 0.52),
    0 0 42px rgba(127, 53, 255, 0.32);
  transition: width 90ms linear;
}

.status-bar span {
  position: relative;
  z-index: 1;
}

.heart-field {
  position: relative;
  z-index: 2;
  width: min(90vw, 900px);
  height: min(76vh, 700px);
  min-height: min(540px, calc(100vh - 130px));
  filter: drop-shadow(0 0 34px rgba(127, 53, 255, 0.52));
  transform: translateY(28px);
}

.heart-word {
  position: absolute;
  left: 50%;
  top: 50%;
  color: var(--word-color, var(--soft));
  font-family: Orbitron, Rajdhani, sans-serif;
  font-size: clamp(0.42rem, 1.08vw, 0.78rem);
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  text-shadow:
    0 0 7px rgba(239, 225, 255, calc(var(--glow, 0.9) * 0.95)),
    0 0 15px rgba(181, 108, 255, calc(var(--glow, 0.9) * 0.9)),
    0 0 28px rgba(127, 53, 255, calc(var(--glow, 0.9) * 0.76));
  transform: translate(-50%, -50%) scale(0.25);
  animation: wordReveal 780ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: var(--delay);
}

.heart-word:nth-child(3n) {
  color: var(--word-color, #caa0ff);
}

.heart-word:nth-child(4n) {
  color: var(--word-color, #9b5cff);
}

.heart-word:nth-child(7n) {
  color: var(--word-color, #ffffff);
}

.final-message {
  position: fixed;
  left: 50%;
  top: 55%;
  z-index: 4;
  width: min(560px, calc(100vw - 28px));
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, calc(-50% + 24px));
  transition: opacity 900ms ease, transform 900ms ease;
}

.final-message.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%);
}

.final-message p {
  margin: 0 0 4px;
  color: #faf7ff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.5rem, 4vw, 2.7rem);
  font-weight: 400;
  letter-spacing: 0;
  text-shadow:
    0 0 12px rgba(255, 255, 255, 0.7),
    0 0 28px rgba(181, 108, 255, 0.5);
}

.final-message h2 {
  margin-top: 8px;
  color: rgba(250, 247, 255, 0.96);
  font-size: clamp(1.35rem, 4.5vw, 3rem);
  line-height: 1;
  text-shadow:
    0 0 14px rgba(181, 108, 255, 0.95),
    0 0 40px rgba(127, 53, 255, 0.8),
    0 0 100px rgba(127, 53, 255, 0.52);
}

@keyframes wordReveal {
  0% {
    opacity: 0;
    filter: blur(7px);
    transform: translate(-50%, -50%) scale(0.25);
  }

  58% {
    opacity: 1;
    filter: blur(0);
    transform: translate(-50%, -50%) scale(1.18);
  }

  100% {
    opacity: var(--final-opacity, 0.96);
    filter: blur(0);
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes sweep {
  0%,
  34% {
    transform: translateX(-55%);
  }

  72%,
  100% {
    transform: translateX(55%);
  }
}

@keyframes buttonGlitch {
  0% {
    opacity: 0;
    transform: translateX(-45%);
  }

  30% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translateX(45%);
  }
}

@media (max-width: 720px) {
  body {
    overflow: hidden;
  }

  .terminal-shell {
    width: min(360px, 94vw);
    padding: 30px 18px;
  }

  .decrypt-button {
    width: auto;
    max-width: min(100%, 320px);
  }

  .heart-field {
    width: 98vw;
    height: 74vh;
    min-height: 430px;
  }

  .heart-word {
    font-size: clamp(0.44rem, 2.15vw, 0.72rem);
  }
}

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