*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  overscroll-behavior: none;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: linear-gradient(125deg, rgba(34, 139, 34, 0.45), rgba(255, 255, 255, 0.35));
  font-family: Helvetica, Arial, sans-serif;
}

.container {
  margin: 120px auto;
  max-width: 600px;
  padding: 0 20px;
}

.hero-header {
  position: relative;
  margin: 80px 0;
}

.hero-image {
  position: relative;
  background-image: url("../assets/img/mexicanPoetry_RetroCosmos.png");
  background-size: cover;
  background-position: center;
  aspect-ratio: 16 / 6;
  width: 100%;
  border-radius: 20px;
  box-shadow: 0px 20px 60px rgba(65, 50, 100, 0.12);
  transition:
    transform 0.4s ease,
    box-shadow 0.4s ease;
}

.hero-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 20px;
}

.hero-header h1 {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: clamp(22px, 2.2vw, 34px);
  font-weight: 700;
  letter-spacing: 0.1rem;
  text-align: center;
  text-shadow: 0px 6px 20px rgba(0, 0, 0, 0.7);
  z-index: 2;
  pointer-events: none;
}

.form-container {
  background-color: white;
  box-shadow: 0px 20px 60px rgba(65, 50, 100, 0.08);
  border-radius: 10px;
  margin-bottom: 30px;
  padding: 20px;
}

form {
  display: flex;
  align-items: center;
  gap: 20px;
}

.instructions {
  flex: 1 1 auto;
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(39, 33, 66, 0.5);
  border-radius: 50px;
  font-size: 16px;
  color: black;
}

.submit-button {
  flex: 0 0 auto;
  background: #885df1;
  color: white;
  border: none;
  border-radius: 50px;
  padding: 14px 28px;
  white-space: nowrap;
  cursor: pointer;
}

.hint {
  margin-top: 8px;
  font-size: 12px;
  opacity: 0.6;
}

.poem {
  font-size: 30px;
  color: black;
  background-color: white;
  padding: 20px;
  line-height: 2;
  border-left: 3px solid #885df1;
  box-shadow: 0px 20px 60px rgba(65, 50, 100, 0.08);
  border-radius: 10px;
}

.hidden {
  display: none;
}

footer {
  margin-top: 30px;
  text-align: center;
  font-size: 14px;
  background-color: #afd3ad;
  box-shadow: 0px 20px 60px rgba(65, 50, 100, 0.08);
  border-radius: 10px;
  color: rgba(44, 3, 55, 0.6);
  padding: 10px;
}

a {
  color: rgb(31, 5, 54);
}

@media (max-width: 768px) {
  .container {
    margin: 40px auto;
  }

  .hero-header {
    margin: 40px 0;
  }

  .hero-image {
    aspect-ratio: 3 / 4;
  }

  form {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .instructions {
    flex: 1 1 0%;
    min-width: 0;
    padding: 14px 16px;
  }

  .instructions::placeholder {
    font-size: 12px;
  }

  .submit-button {
    flex: 0 0 auto;
    padding: 14px 18px;
    white-space: nowrap;
  }
}

@media (min-width: 769px) {
  .hero-image:hover {
    transform: translateY(-4px) scale(1.015);
    box-shadow: 0px 30px 80px rgba(65, 50, 100, 0.2);
  }
}

.generating {
  animation: blink-animation 1s steps(2, start) infinite;
}

@keyframes blink-animation {
  to {
    visibility: hidden;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.submit-button:disabled {
  opacity: 0.95;
  cursor: not-allowed;
  animation: glowPulse 1.6s ease-in-out infinite;
}

@keyframes glowPulse {
  0% {
    box-shadow: 0 0 0px rgba(136, 93, 241, 0.4);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 18px rgba(136, 93, 241, 0.6);
    transform: scale(1.03);
  }
  100% {
    box-shadow: 0 0 0px rgba(136, 93, 241, 0.4);
    transform: scale(1);
  }
}
