:root {
  --primary-color: #6d4c3d;
  --secondary-color: #a67c52;
  --accent-color: #8c6d46;
  --background-color: #f9f5f0;
  --parchment-color: #f8f3e6;
  --text-color: #3e2723;
  --light-text: #8d6e63;
  --shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

body {
  font-family: "Crimson Text", serif;
  background-color: var(--background-color);
  color: var(--text-color);
  background-image: radial-gradient(#e8e0d1 1.5px, transparent 1.5px);
  background-size: 24px 24px;
  min-height: 100vh;
  margin: 0;
  padding: 15px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.container {
  max-width: 600px;
  width: 100%;
  margin: 15px auto;
  padding: 20px;
  position: relative;
}

header {
  text-align: center;
  margin-bottom: 25px;
  position: relative;
}

header::after {
  content: "";
  display: block;
  width: 120px;
  height: 2px;
  background: linear-gradient(
    to right,
    transparent,
    var(--accent-color),
    transparent
  );
  margin: 15px auto;
}

h1 {
  font-family: "Great Vibes", cursive;
  font-size: 3.5rem;
  color: var(--primary-color);
  margin: 0;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

h2 {
  font-family: "Great Vibes", cursive;
  font-size: 2.2rem;
  color: var(--primary-color);
  text-align: center;
  margin: 10px 0 15px;
}

.poem-form {
  background: var(--parchment-color);
  padding: 20px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin-bottom: 25px;
  border: 1px solid rgba(166, 124, 82, 0.3);
  position: relative;
  overflow: hidden;
}

.poem-form::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(
    to right,
    var(--primary-color),
    var(--secondary-color),
    var(--primary-color)
  );
}

form {
  display: flex;
  gap: 10px;
}

.inputField {
  padding: 14px 16px;
  border: 1px solid rgba(166, 124, 82, 0.4);
  border-radius: 6px;
  flex: 1;
  font-size: 16px;
  background: rgba(255, 255, 255, 0.7);
  font-family: "Merriweather", serif;
  color: var(--text-color);
  transition: all 0.2s ease;
}

.inputField:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(140, 109, 70, 0.15);
}

.inputField::placeholder {
  color: var(--light-text);
  font-style: italic;
}

.hint {
  line-height: 1.4;
  margin-top: 4px;
  opacity: 0.6;
  font-size: 11px;
  text-align: center;
}

.submitbutton {
  background: linear-gradient(to bottom, var(--primary-color), #5a3c30);
  color: white;
  border: none;
  border-radius: 6px;
  width: 120px;
  padding: 14px;
  font-size: 16px;
  font-family: "Merriweather", serif;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 3px 5px rgba(0, 0, 0, 0.08);
}

.submitbutton:hover {
  background: linear-gradient(to bottom, #7d5a48, #6d4c3d);
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.poem-container {
  background: var(--parchment-color);
  padding: 25px 30px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  position: relative;
  border: 1px solid rgba(166, 124, 82, 0.3);
  min-height: 180px;
}

.poem-container::before {
  content: "";
  position: absolute;
  top: 15px;
  left: 15px;
  right: 15px;
  bottom: 15px;
  border: 1px solid rgba(166, 124, 82, 0.15);
  border-radius: 4px;
  pointer-events: none;
}

#poemText {
  font-family: "Crimson Text", serif;
  font-size: 18px;
  line-height: 1.7;
  text-align: center;
  color: var(--text-color);
  margin: 0;
  padding: 10px 0;
  position: relative;
}

.poem-line {
  display: block;
  margin-bottom: 6px;
  position: relative;
}

.generating {
  animation: blink-animation 1s steps(5, start) infinite;
  text-align: center;
  font-style: italic;
  color: var(--light-text);
}

footer {
  text-align: center;
  margin-top: 25px;
  color: var(--light-text);
  font-size: 14px;
  padding: 15px;
  font-family: "Merriweather", serif;
}

footer a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 700;
  transition: all 0.2s ease;
}

footer a:hover {
  color: var(--accent-color);
  text-decoration: underline;
}

@media (max-width: 768px) {
  .container {
    padding: 15px;
  }

  h1 {
    font-size: 2.8rem;
  }

  h2 {
    font-size: 1.9rem;
  }

  .poem-form {
    padding: 15px;
  }

  .poem-container {
    padding: 20px;
  }

  #poemText {
    font-size: 16px;
  }
}

.decoration {
  position: absolute;
  opacity: 0.08;
  z-index: -1;
}

.feather {
  top: 30px;
  right: 30px;
  font-size: 80px;
}

.ink-blot {
  bottom: 70px;
  left: 30px;
  font-size: 70px;
}

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

.signature {
  display: block;
  margin-top: 10px;
  font-style: italic;
  color: var(--accent-color);
  font-weight: 600;
}
