/* Ensure all elements include border-box sizing */
* {
  box-sizing: border-box;
}

/* SVG styling */
.centered-svg {
  display: block;
  margin: 0 auto 20px auto; /* centers the SVG with 20px space below */
  width: 80%;
  max-width: 300px; /* desktop max-size */
}

/* Global body styling */
body {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column; /* Stack the SVG and container vertically */
  align-items: center;
  min-height: 100vh;
  background-color: #e0f7fa;
}

/* Container styling */
.container {
  width: 90vw;
  height: 60vh; /* fixed for desktop screens */
  position: relative;
  background: #b3e5fc;
  border-radius: 20px;
  overflow: hidden;
}

/* Paragraph styling (fluid typography with clamp) */
.paragraph {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #023047;
  /* Font size scales fluidly between a minimum and maximum */
  font-size: clamp(0.75rem, 2vw, 1rem);
  text-align: left;
  z-index: 1;
  font-family: "Poppins", serif;
  padding: 1rem;
  line-height: 1.3;
}

/* Common styles for shapes */
.shape,
.triangle,
.square {
  position: absolute;
  opacity: 0;
  transition:
    transform 1s ease-out,
    opacity 1s ease-out;
}

/* Hover effect to reveal shapes */
.container:hover .shape,
.container:hover .triangle,
.container:hover .square {
  opacity: 1;
  transform: translate(0, 0);
}

/* Specific styles for each shape */
.shape1 {
  width: 15vw;
  height: 15vw;
  background: #81d4fa;
  border-radius: 50%;
  top: -20%;
  left: 5%;
  transform: translateY(-50px);
}

.shape2 {
  width: 20vw;
  height: 20vw;
  background: #4fc2f744;
  border-radius: 50%;
  bottom: -20%;
  right: 5%;
  transform: translateY(50px);
}

.shape3 {
  width: 12vw;
  height: 12vw;
  background: #ebb82a20;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
}

.triangle {
  width: 0;
  height: 0;
  border-left: 5vw solid transparent;
  border-right: 5vw solid transparent;
  /* Using rgba for transparency */
  border-bottom: 10vw solid rgba(2, 48, 71, 0.11);
  top: -10%;
  right: 20%;
  transform: translateY(-50px);
}

.square {
  width: 8vw;
  height: 8vw;
  border: 0.5vw solid rgba(255, 132, 0, 0.09);
  bottom: -10%;
  left: 20%;
  transform: rotate(45deg) translateX(-50px);
}

/* Adjust hover state for the square */
.container:hover .square {
  transform: translate(0, 0) rotate(45deg);
}

/* ---------------- Responsive Adjustments ---------------- */

/* For tablets and small desktops */
@media (max-width: 1024px) {
  .container {
    width: 95vw;
    height: auto;
    min-height: 70vh; /* ensures a minimum height for design consistency */
    padding: 2rem;
  }
  .paragraph {
    font-size: clamp(0.7rem, 1.8vw, 0.95rem);
    padding: 0.5rem;
    text-align: left;
    line-height: 1.5;
  }
}

/* For mobile devices (max-width: 768px) */
@media (max-width: 768px) {
  /* Let container height adjust automatically to wrap content */
  .container {
    width: 95vw;
    height: auto; /* switch to auto so text can fully display */
    min-height: 50vh; /* ensures a minimum height for design consistency */
    padding: 2rem; /* add some padding for extra breathing room */
  }
  .paragraph {
    /* Reduce the font size further so that all text stays visible */
    font-size: clamp(0.55rem, 1.8vw, 0.75rem);
    text-align: left;
    padding: 0.5rem;
    line-height: 1.2;
  }
  .centered-svg {
    max-width: 200px; /* reduce logo size for mobile */
  }
}

/* For very small screens (max-width: 480px) */
@media (max-width: 480px) {
  .container {
    width: 100vw;
    height: auto;
    min-height: 70vh;
    border-radius: 10px;
    padding: 1rem;
  }
  .paragraph {
    font-size: clamp(0.5rem, 2vw, 0.7rem);
    padding: 0.5rem;
    text-align: center;
    height: auto; /* Allow text to wrap naturally */
    /* Adjust line-height for better readability on small screens */
    line-height: 1.4;
  }
  .centered-svg {
    max-width: 150px;
  }
}
