/* ===========================
   Landing Page Styles
   =========================== */

.landing-body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: "Comic Sans MS", "Comic Sans", cursive;
  background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
  background-size: 400% 400%;
  animation: landing-gradient 8s ease infinite;
  overflow: hidden;
  color: white;
  text-align: center;
}

@keyframes landing-gradient {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ---- Floating background shapes ---- */
.landing-bg-shapes {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.landing-bg-shapes span {
  position: absolute;
  display: block;
  width: 20px;
  height: 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  animation: landing-float 20s linear infinite;
  bottom: -50px;
}

.landing-bg-shapes span:nth-child(1)  { left:  5%; width: 80px;  height: 80px;  animation-delay: 0s;    animation-duration: 18s; }
.landing-bg-shapes span:nth-child(2)  { left: 15%; width: 30px;  height: 30px;  animation-delay: 2s;    animation-duration: 22s; }
.landing-bg-shapes span:nth-child(3)  { left: 30%; width: 60px;  height: 60px;  animation-delay: 4s;    animation-duration: 20s; }
.landing-bg-shapes span:nth-child(4)  { left: 45%; width: 20px;  height: 20px;  animation-delay: 0s;    animation-duration: 16s; }
.landing-bg-shapes span:nth-child(5)  { left: 60%; width: 50px;  height: 50px;  animation-delay: 3s;    animation-duration: 24s; }
.landing-bg-shapes span:nth-child(6)  { left: 75%; width: 70px;  height: 70px;  animation-delay: 6s;    animation-duration: 19s; }
.landing-bg-shapes span:nth-child(7)  { left: 85%; width: 40px;  height: 40px;  animation-delay: 8s;    animation-duration: 21s; }
.landing-bg-shapes span:nth-child(8)  { left: 50%; width: 25px;  height: 25px;  animation-delay: 10s;   animation-duration: 17s; }
.landing-bg-shapes span:nth-child(9)  { left: 20%; width: 15px;  height: 15px;  animation-delay: 1s;    animation-duration: 25s; }
.landing-bg-shapes span:nth-child(10) { left: 90%; width: 90px;  height: 90px;  animation-delay: 5s;    animation-duration: 23s; }

@keyframes landing-float {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 0.4;
  }
  100% {
    transform: translateY(-120vh) rotate(720deg);
    opacity: 0;
  }
}

/* ---- Content container ---- */
.landing-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 20px;
}

/* ---- Hero image wrapper ---- */
.landing-hero-wrapper {
  position: relative;
  display: inline-block;
}

/* ---- Hero image ---- */
.landing-hero-img {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 40px rgba(138, 43, 226, 0.5), 0 0 80px rgba(138, 43, 226, 0.2);
  animation: landing-pulse 3s ease-in-out infinite;
  object-fit: cover;
  cursor: pointer;
  transition: border-color 0.3s ease;
}

.landing-hero-img:hover {
  border-color: rgba(255, 110, 199, 0.6);
}

@keyframes landing-pulse {
  0%, 100% { transform: scale(1);    box-shadow: 0 0 40px rgba(138, 43, 226, 0.5), 0 0 80px rgba(138, 43, 226, 0.2); }
  50%      { transform: scale(1.05); box-shadow: 0 0 60px rgba(138, 43, 226, 0.7), 0 0 120px rgba(138, 43, 226, 0.3); }
}

/* Speaking state: gentle VN-style idle bob */
.landing-hero-img.speaking {
  animation: hero-speaking-bob 1.8s ease-in-out infinite;
  border-color: rgba(123, 104, 238, 0.6);
  box-shadow: 0 0 50px rgba(138, 43, 226, 0.7), 0 0 100px rgba(138, 43, 226, 0.3);
}

@keyframes hero-speaking-bob {
  0%, 100% { transform: translateY(0) scale(1.02); }
  25%      { transform: translateY(-4px) scale(1.03); }
  50%      { transform: translateY(0) scale(1.02); }
  75%      { transform: translateY(2px) scale(1.01); }
}

/* New-line bounce pop */
.landing-hero-img.speaking-bounce {
  animation: hero-line-bounce 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes hero-line-bounce {
  0%   { transform: scale(1.02); }
  40%  { transform: scale(1.12); }
  70%  { transform: scale(0.98); }
  100% { transform: scale(1.02); }
}

/* ---- Speech bubble (easter egg) ---- */
.speech-bubble {
  position: absolute;
  bottom: calc(100% + 20px);
  left: 50%;
  transform: translateX(-50%) scale(0.8);
  background: rgba(20, 17, 50, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(123, 104, 238, 0.4);
  border-radius: 16px;
  padding: 16px 22px;
  min-width: 240px;
  max-width: 340px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 20px rgba(123, 104, 238, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 10;
  cursor: pointer;
}

/* Tail triangle */
.speech-bubble::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 10px solid transparent;
  border-top-color: rgba(20, 17, 50, 0.92);
}

.speech-bubble.visible {
  opacity: 1;
  transform: translateX(-50%) scale(1);
  pointer-events: auto;
}

.speech-text {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.95em;
  line-height: 1.5;
  white-space: pre-wrap;
}

.speech-cursor {
  color: #7b68ee;
  animation: speech-blink 0.6s step-end infinite;
  font-size: 0.95em;
}

@keyframes speech-blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0; }
}

/* ---- Title ---- */
.landing-title {
  font-size: 4em;
  margin: 0;
  background: linear-gradient(90deg, #ff6ec7, #ffcc00, #00ffcc, #7b68ee, #ff6ec7);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: landing-rainbow-text 4s linear infinite;
  text-shadow: none;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.2));
}

@keyframes landing-rainbow-text {
  0%   { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

/* ---- Subtitle ---- */
.landing-subtitle {
  font-size: 1.3em;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
  letter-spacing: 2px;
}

/* ---- Nav buttons container ---- */
.landing-nav-buttons {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  margin-top: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ---- Unified landing button ----
   Default: outline style
   Hover: gradient fill (purple → pink) */
.landing-btn {
  display: inline-block;
  padding: 16px 44px;
  font-family: "Comic Sans MS", "Comic Sans", cursive;
  font-size: 1.2em;
  font-weight: bold;
  color: rgba(255, 255, 255, 0.85);
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.35s ease;
  box-shadow: none;
}

.landing-btn:hover {
  color: white;
  background: linear-gradient(135deg, #7b68ee, #ff6ec7);
  border-color: transparent;
  transform: scale(1.06);
  box-shadow: 0 4px 24px rgba(123, 104, 238, 0.5);
}

.landing-btn:active {
  transform: scale(0.97);
}

/* ---- Footer ---- */
.landing-footer {
  position: fixed;
  bottom: 16px;
  font-size: 0.8em;
  color: rgba(255, 255, 255, 0.3);
  z-index: 1;
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
  .landing-title {
    font-size: 2.2em;
  }
  .landing-subtitle {
    font-size: 1em;
    letter-spacing: 1px;
  }
  .landing-hero-img {
    width: 120px;
    height: 120px;
  }
  .landing-nav-buttons {
    flex-direction: column;
    gap: 12px;
  }
  .landing-btn {
    padding: 14px 36px;
    font-size: 1em;
  }
  .speech-bubble {
    min-width: 200px;
    max-width: 280px;
    padding: 12px 16px;
    font-size: 0.85em;
  }
}
