:root {
  --ink: #3b2f2f;
  --sepia: #f8f1e5;
  --border: #d9c7ad;
  --accent: #a47449;
  --error: #8c2f39;
}

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

body {
  margin: 0;
  font-family: "Georgia", "Times New Roman", serif;
  background: linear-gradient(180deg, #fdf8f1 0%, #f3e6d8 100%);
  color: var(--ink);
  min-height: 100vh;
}

.page {
  max-width: 900px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 3rem;
}

.masthead {
  text-align: center;
  margin-bottom: 1.5rem;
}

.masthead h1 {
  font-size: 2.6rem;
  letter-spacing: 0.12em;
  margin: 0 0 0.3rem;
}

.masthead p {
  margin: 0;
  font-style: italic;
  color: #6e4d3c;
}

.card {
  background: var(--sepia);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.75rem;
  box-shadow: 0 8px 22px rgba(59, 47, 47, 0.15);
  margin-bottom: 1.5rem;
}

.poem-form label {
  display: block;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.08em;
  color: #5c4736;
}

textarea,
input[type="text"],
input[type="number"] {
  width: 100%;
  margin-top: 0.35rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: #fffdf7;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

textarea:focus,
input:focus {
  outline: 2px solid rgba(164, 116, 73, 0.4);
}

.file-field {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  position: relative;
  margin: 1rem 0 0.5rem;
  padding: 0.85rem 1.8rem;
  border: 1px dashed var(--border);
  border-radius: 999px;
  color: #5c4736;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.1em;
  background: #fff9f0;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.1s ease;
}

.file-field:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.file-field::after {
  content: "↗";
  font-size: 1rem;
  color: var(--accent);
}

.file-field input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.hint {
  margin-top: -0.6rem;
  font-size: 0.9rem;
  color: #8c6b4d;
  font-style: italic;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 999px;
  padding: 0.85rem 2.6rem;
  background: linear-gradient(130deg, #b58b64, #9b6b46);
  color: #fffdf7;
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(99, 66, 44, 0.25);
  transition: transform 0.1s ease, box-shadow 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(99, 66, 44, 0.3);
}

.note {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.9rem 1.2rem;
  background: #fff7ef;
  color: #5c4736;
}

.note.error {
  border-color: var(--error);
  background: #fdeeee;
  color: var(--error);
}

.poem-card h2 {
  margin-top: 0;
  letter-spacing: 0.1em;
}

.poem-lines {
  list-style: decimal-leading-zero;
  padding-left: 1.5rem;
  margin: 1rem 0 0;
}

.poem-lines li {
  margin-bottom: 0.6rem;
  padding-left: 0.4rem;
}

footer {
  text-align: center;
  font-size: 0.9rem;
  color: #7a5a43;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

@media (max-width: 640px) {
  .page {
    padding: 1.8rem 1rem 2.2rem;
  }

  .masthead h1 {
    font-size: 2.1rem;
  }
}
