body {
  margin: 0;
  background: #1e1b1b;
  font-family: "Courier New", monospace;

  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.08) 1px, transparent 1px);

  background-size: 40px 40px;
}

a {
  color: black;
}

.viewer {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 10px;
  counter-reset: page;
}

.page {
  width: 100%;
  max-width: 700px;
  aspect-ratio: 7/9;
  background: #fffef8;
  margin: 5px 0;
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(40px);
  animation: fadeIn 0.6s ease forwards;
}

.page.cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.page.cover .page-content {
  z-index: 1;
  position: absolute;
  inset: 0;
  padding: clamp(20px, 5vw, 60px);
}

.page::after {
  content: counter(page);
  counter-increment: page;
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
}

.page-content {
  position: absolute;
  inset: 0;
  padding: 40px;
  padding-bottom: 60px;
  z-index: 1;
}

.hand {
  font-family: "Comic Sans MS", cursive;
  line-height: 1.6;
  color: #222;
}

.title {
  font-size: clamp(18px, 4vw, 24px);
  margin-bottom: 15px;
}

p {
  font-size: clamp(14px, 3.5vw, 16px);
}

.date {
  margin-top: 20px;
  font-size: 12px;
  opacity: 0.7;
}

.doodle {
  position: absolute;
  font-size: clamp(16px, 4vw, 24px);
  opacity: 0.6;
}

.image-page img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.overlay {
  position: absolute;
  width: 180px;
  pointer-events: none;
  z-index: 2;
}

.form-group {
  margin-bottom: 12px;
}

input,
textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid #ccc;
  background: transparent;
  font-family: "Comic Sans MS", cursive;
}

button {
  margin-top: 10px;
  padding: 8px 14px;
  border: 1px solid #333;
  background: transparent;
  cursor: pointer;
}

.success {
  margin-top: 10px;
  font-size: 12px;
  opacity: 0;
  transition: 0.3s;
}

.success.show {
  opacity: 1;
}

@keyframes fadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 600px) {
  .page-content {
    padding: 25px;
    padding-bottom: 60px;
  }
}
