* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', sans-serif;
  background-color: #f7f7f7;
  color: #222;
  line-height: 1.6;
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
}

hr { border: none; border-top: 1px solid #ddd; margin: 30px 0; }

/* Header */
.header { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.avatar { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; }
.bio { flex: 1; font-size: 1rem; }

/* Books */
.books { display: flex; flex-direction: column; gap: 30px; }

.book-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  padding: 20px;
  border-radius: 6px;
}

.book-content { display: flex; align-items: flex-start; gap: 20px; }

.book-cover {
  width: 140px;
  height: 200px;            /* одинаковая высота для всех обложек */
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.book-info { flex: 1; }

.book-buttons { display: flex; gap: 10px; margin-bottom: 10px; }

.btn {
  display: inline-block;
  padding: 8px 16px;
  background-color: #444;
  color: #fff;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}
.btn:hover { background-color: #666; }
.btn:active { transform: scale(0.96); }

.book-desc { font-size: 0.95rem; color: #333; line-height: 1.5; }

/* Footer */
.footer { text-align: center; padding: 20px 0; }
.socials { display: flex; justify-content: center; gap: 20px; margin-bottom: 10px; }
.social-icon img { width: 24px; height: 24px; opacity: 0.8; transition: opacity 0.2s ease; }
.social-icon img:hover { opacity: 1; }
.copyright { font-size: 0.85rem; color: #555; }

/* Preloader */
#preloader {
  position: fixed;
  inset: 0;
  background: #f7f7f7;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

#preloader img {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  object-fit: cover;
  animation: spin 3s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.fade-out {
  animation: fadeOut 1,2s ease forwards;
}

@keyframes fadeOut {
  to { opacity: 0; visibility: hidden; }
}

/* Responsive */
@media (max-width: 768px) {
  body { padding: 10px; }
  .bio { font-size: 1.05rem; }

  .book-content {
    flex-direction: column;
    align-items: center;
  }

  .book-cover {
    width: 50%;          /* обложка занимает ~60% ширины экрана */
    max-width: 200px;    /* и не становится слишком большой */
    height: auto;        /* сохраняет пропорции */
  }

  .book-info {
    text-align: center;
  }
}
