/* style.css */

/* --- Global Styles & Resets --- */
:root {
  /* Define a fun, vibrant color palette */
  --primary-color: #FF6F61; /* Energetic red/orange */
  --secondary-color: #6A0572; /* Deep playful purple */
  --accent-color: #FFE066; /* Bright cheerful yellow */
  --text-color-dark: #333333;
  --text-color-light: #FFFFFF;
  --background-color-light: #F0F0F0; /* Light base background */
  --shadow-color: rgba(0, 0, 0, 0.2);
}

*, *::before, *::after {
  box-sizing: border-box; /* Include padding and border in the element's total width and height */
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Comic Sans MS', 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  background-color: var(--background-color-light);
  color: var(--text-color-dark);
  display: flex;
  flex-direction: column; /* Stack items vertically */
  align-items: center; /* Center horizontally */
  justify-content: center; /* Center vertically */
  min-height: 100vh; /* Ensure body takes full viewport height */
  padding: 20px;
  text-align: center; /* Default text alignment for the body */
  overflow-x: hidden; /* Prevent horizontal scroll from animations */
}

/* --- Header Styling --- */
.xiaojian-text {
  font-size: 4em; /* Large and impactful */
  color: var(--primary-color);
  text-shadow: 4px 4px var(--secondary-color), 8px 8px var(--accent-color); /* Layered shadow for a fun 3D effect */
  margin-bottom: 40px;
  font-weight: 900; /* Extra bold */
  letter-spacing: 2px;
  text-transform: uppercase;
  line-height: 1.1;
  animation: bounceIn 1s ease-out forwards; /* Animation for entrance */
}

/* --- Image Styling --- */
.xiaojian {
  max-width: 320px; /* Max size for the image */
  width: 90%; /* Responsive width */
  height: auto;
  border: 12px solid var(--secondary-color); /* Strong, colorful border */
  border-radius: 50%; /* Makes the image circular */
  box-shadow: 0 10px 25px var(--shadow-color), 0 0 0 18px var(--primary-color); /* Multiple layers of shadow */
  margin-bottom: 40px;
  transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out; /* Smooth transitions for hover effects */
  animation: rotateIn 1.2s ease-out forwards; /* Animation for entrance */
  animation-delay: 0.5s; /* Delay after header animation */
}

.xiaojian:hover {
  transform: scale(1.08) rotate(5deg); /* Slightly enlarge and rotate on hover */
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3), 0 0 0 22px var(--primary-color); /* Enhanced shadow on hover */
}

/* --- Paragraph Styling --- */
.howtoxiaojianyourfriends {
  font-size: 1.8em;
  color: var(--text-color-dark);
  font-weight: bold;
  background-color: var(--accent-color); /* Highlight with the accent color */
  padding: 15px 30px;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
  margin-top: 20px;
  max-width: 600px;
  line-height: 1.4;
  animation: fadeIn 1.5s ease-out forwards; /* Animation for entrance */
  animation-delay: 1s; /* Delay after image animation */
}

/* --- Keyframe Animations --- */
@keyframes bounceIn {
  0% {
    transform: scale(0.1);
    opacity: 0;
  }
  60% {
    transform: scale(1.1);
    opacity: 1;
  }
  100% {
    transform: scale(1);
  }
}

@keyframes rotateIn {
  0% {
    transform: rotate(-180deg) scale(0);
    opacity: 0;
  }
  100% {
    transform: rotate(0deg) scale(1);
    opacity: 1;
  }
}

@keyframes fadeIn {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
  .xiaojian-text {
    font-size: 2.8em;
    text-shadow: 3px 3px var(--secondary-color), 6px 6px var(--accent-color);
    margin-bottom: 30px;
  }

  .xiaojian {
    max-width: 250px;
    border-width: 8px;
    box-shadow: 0 8px 20px var(--shadow-color), 0 0 0 12px var(--primary-color);
    margin-bottom: 30px;
  }

  .howtoxiaojianyourfriends {
    font-size: 1.5em;
    padding: 12px 25px;
  }
}

@media (max-width: 480px) {
  body {
    padding: 15px;
  }

  .xiaojian-text {
    font-size: 2em;
    text-shadow: 2px 2px var(--secondary-color), 4px 4px var(--accent-color);
    margin-bottom: 20px;
  }

  .xiaojian {
    max-width: 200px;
    border-width: 6px;
    box-shadow: 0 5px 15px var(--shadow-color), 0 0 0 9px var(--primary-color);
    margin-bottom: 20px;
  }

  .howtoxiaojianyourfriends {
    font-size: 1.2em;
    padding: 10px 20px;
  }
}