@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #08090d;
  --bg-soft: #10131b;
  --panel: #131723;
  --panel-2: #1a1f2d;
  --line: #2a3143;
  --line-soft: rgba(255, 255, 255, 0.11);
  --text: #f3f5fa;
  --muted: #afb6c8;
  --muted-2: #9098ab;
  --amber: #d6a34b;
  --amber-strong: #b98735;
  --amber-soft: #f2d394;
  --focus: #ffe2aa;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-lg: 0 28px 60px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 14px 32px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 8px 18px rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Manrope', 'Segoe UI', Tahoma, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 520px at -12% -20%, rgba(214, 163, 75, 0.14), transparent 62%),
    radial-gradient(1000px 560px at 115% -16%, rgba(53, 74, 121, 0.24), transparent 58%),
    linear-gradient(180deg, #05060a 0%, #090b11 48%, #07080c 100%);
  min-height: 100vh;
  line-height: 1.45;
  letter-spacing: 0.002em;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.container {
  width: min(1240px, 94%);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  backdrop-filter: blur(12px);
  background: rgba(8, 10, 16, 0.78);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  transition: background 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
}

.site-header::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(214, 163, 75, 0.6), transparent);
  opacity: 0.4;
}

.site-header.is-scrolled {
  background: rgba(8, 10, 16, 0.94);
  border-color: rgba(214, 163, 75, 0.2);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.45);
}

.nav-wrap {
  min-height: 78px;
  display: flex;
  align-items: center;
  gap: 18px;
  position: relative;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
}

.logo-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: 0.6px;
  color: #1a150a;
  background: linear-gradient(135deg, var(--amber-soft), var(--amber-strong));
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.24), 0 10px 22px rgba(0, 0, 0, 0.36);
}

.logo-text {
  font-family: 'Cinzel', Georgia, serif;
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 1rem;
  color: #f1d6a0;
  text-transform: uppercase;
}

.menu {
  display: flex;
  align-items: center;
  gap: 14px;
}

.menu a {
  position: relative;
  padding: 8px 10px;
  border-radius: 8px;
  color: #c7ccda;
  font-weight: 600;
  transition: 0.25s ease;
}

.menu a::after {
  content: '';
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 6px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(214, 163, 75, 0.86), transparent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.24s ease;
}

.menu a:hover {
  background: rgba(214, 163, 75, 0.13);
  color: #f7e2ba;
}

.menu a:hover::after {
  transform: scaleX(1);
}

.search-form {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(15, 18, 26, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.search-form input {
  width: min(350px, 42vw);
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(12, 14, 20, 0.94);
  color: var(--text);
  font-size: 0.95rem;
  padding: 10px 13px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-form input::placeholder {
  color: #8f96a8;
}

.search-form input:focus {
  border-color: rgba(214, 163, 75, 0.65);
  box-shadow: 0 0 0 3px rgba(214, 163, 75, 0.2);
}

.search-form button,
.btn {
  border: 0;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.93rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, filter 0.2s ease;
}

.search-form button {
  padding: 10px 15px;
  color: #1f170b;
  background: linear-gradient(120deg, var(--amber-soft), var(--amber));
  box-shadow: var(--shadow-sm);
}

.search-form button:hover,
.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

main {
  padding-bottom: 34px;
}

.hero {
  padding: 34px 0 18px;
}

.hero-content {
  position: relative;
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 28px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(760px 300px at 4% -34%, rgba(214, 163, 75, 0.22), transparent 72%),
    linear-gradient(130deg, rgba(15, 18, 27, 0.97), rgba(12, 14, 21, 0.97));
  padding: 22px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.hero-content::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 40%);
}

.hero-content::after {
  content: '';
  position: absolute;
  inset: auto -20% -45% auto;
  width: 460px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(214, 163, 75, 0.12), transparent 70%);
  pointer-events: none;
}

.hero-media {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.11);
  background: #0f1117;
  align-self: start;
}

.hero-cover {
  width: 100%;
  height: 100%;
  min-height: 350px;
  object-fit: contain !important;
  background: #0f1117;
}

.hero-info {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 14px;
  justify-content: center;
}

.tag {
  width: fit-content;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(214, 163, 75, 0.14);
  color: #ffd99a;
  border: 1px solid rgba(214, 163, 75, 0.28);
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: 0.77rem;
  text-transform: uppercase;
}

.hero-info h1 {
  margin: 0;
  font-family: 'Cinzel', Georgia, serif;
  font-size: clamp(1.65rem, 2.9vw, 3rem);
  line-height: 1.14;
  letter-spacing: 0.01em;
  text-wrap: balance;
}

.hero-info p {
  margin: 0;
  color: var(--muted);
  max-width: 64ch;
  font-size: 1rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 2px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 17px;
}

.btn-primary {
  color: #22190a;
  background: linear-gradient(120deg, var(--amber-soft), var(--amber));
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
}

.btn-outline {
  color: #f7ebd0;
  border: 1px solid rgba(214, 163, 75, 0.54);
  background: rgba(214, 163, 75, 0.09);
}

.hero-empty {
  width: 100%;
  text-align: left;
}

.hero-empty h1 {
  margin: 0 0 8px;
  font-family: 'Cinzel', Georgia, serif;
  font-size: clamp(1.5rem, 3.4vw, 2.6rem);
}

.hero-empty p {
  color: var(--muted);
  margin: 0 0 14px;
}

.catalog {
  padding-top: 8px;
}

.section-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 20px;
}

.pill {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(16, 19, 28, 0.84);
  color: #d2d7e3;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.83rem;
  transition: 0.22s ease;
}

.pill:hover,
.pill.active {
  border-color: rgba(214, 163, 75, 0.5);
  color: #ffe1a5;
  background: rgba(214, 163, 75, 0.14);
}

.catalog-row {
  margin-bottom: 28px;
  padding: 12px 0 4px;
}

.row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.row-head h2 {
  margin: 0;
  font-size: clamp(1.2rem, 1.8vw, 1.7rem);
  font-family: 'Cinzel', Georgia, serif;
}

.row-head a {
  color: #f3cf8d;
  font-weight: 700;
  font-size: 0.92rem;
}

.cards-row {
  display: flex !important;
  gap: 14px;
  overflow-x: auto;
  padding: 4px 2px 10px;
  scroll-snap-type: x proximity;
  scroll-behavior: smooth;
  justify-content: flex-start;
  align-items: stretch;
}

.cards-row::-webkit-scrollbar {
  height: 10px;
}

.cards-row::-webkit-scrollbar-thumb {
  background: #2a3140;
  border-radius: 999px;
}

.ebook-card {
  flex: 0 0 228px;
  scroll-snap-align: start;
}

.cards-row > .ebook-card {
  width: 228px !important;
  min-width: 228px !important;
  max-width: 228px !important;
}

.card-link {
  position: relative;
  display: block;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(21, 24, 34, 0.98), rgba(14, 17, 26, 0.98));
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
}

.card-link::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(130deg, rgba(255, 255, 255, 0.09), transparent 38%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.card-link:hover {
  transform: translateY(-6px);
  border-color: rgba(214, 163, 75, 0.45);
  box-shadow: 0 22px 42px rgba(0, 0, 0, 0.52);
}

.card-link:hover::before {
  opacity: 1;
}

.card-cover-wrap {
  position: relative;
  height: 300px;
  background: radial-gradient(circle at 50% -20%, rgba(214, 163, 75, 0.08), transparent 55%), #0d1017;
}

.card-cover-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain !important;
  object-position: center;
  transition: transform 0.35s ease;
}

.card-link:hover .card-cover-wrap img {
  transform: scale(1.03);
}

.card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 42%, rgba(7, 9, 14, 0.78) 100%);
  pointer-events: none;
}

.card-meta {
  padding: 12px 12px 13px;
}

.card-meta h3 {
  margin: 0 0 7px;
  font-size: 0.94rem;
  font-weight: 800;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.card-cta {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.79rem;
  color: #f7d89f;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.card-cta::after {
  content: '→';
  transform: translateX(0);
  transition: transform 0.2s ease;
}

.card-link:hover .card-cta::after {
  transform: translateX(2px);
}

.catalog-page,
.detail-page {
  padding: 30px 0 40px;
}

.page-head {
  margin-bottom: 16px;
}

.page-head h1 {
  margin: 8px 0 4px;
  font-family: 'Cinzel', Georgia, serif;
  font-size: clamp(1.5rem, 2.5vw, 2.4rem);
}

.page-subtitle {
  margin: 0;
  color: var(--muted);
}

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}

.detail-wrap {
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-lg);
  background: linear-gradient(140deg, rgba(16, 18, 27, 0.98), rgba(12, 15, 24, 0.98));
  padding: 22px;
  display: grid;
  grid-template-columns: minmax(270px, 330px) 1fr;
  gap: 24px;
  box-shadow: var(--shadow-lg);
}

.detail-media {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: #0f1118;
}

.detail-cover {
  width: 100%;
  height: 100%;
  min-height: 430px;
  object-fit: contain !important;
  background: #0f1118;
}

.detail-info h1 {
  margin: 8px 0 12px;
  font-family: 'Cinzel', Georgia, serif;
  font-size: clamp(1.5rem, 2.8vw, 2.7rem);
  line-height: 1.16;
  text-wrap: balance;
}

.short {
  margin: 0 0 10px;
  color: #e8cea0;
  font-weight: 600;
}

.long-text {
  color: var(--muted);
  line-height: 1.68;
}

.site-footer {
  margin-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(12, 13, 19, 0.88), rgba(9, 10, 15, 0.95));
}

.footer-wrap {
  padding: 22px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer-wrap strong {
  font-family: 'Cinzel', Georgia, serif;
  color: #f0d4a0;
}

.footer-wrap p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.footer-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.footer-links a {
  color: #ced3de;
  font-weight: 600;
}

.footer-links a:hover {
  color: #f6d89f;
}

[data-animate] {
  opacity: 1;
  transform: none;
}

html.js [data-animate] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

html.js [data-animate].is-inview {
  opacity: 1;
  transform: translateY(0);
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

@media (max-width: 1024px) {
  .nav-wrap {
    flex-wrap: wrap;
    padding: 12px 0;
    min-height: auto;
  }

  .menu {
    order: 3;
  }

  .search-form {
    width: 100%;
    order: 4;
    margin-left: 0;
  }

  .search-form input {
    width: 100%;
  }

  .hero-content,
  .detail-wrap {
    grid-template-columns: 1fr;
  }

  .hero-cover,
  .detail-cover {
    min-height: 320px;
  }
}

@media (max-width: 680px) {
  .container {
    width: min(1240px, 92%);
  }

  .logo {
    min-width: auto;
  }

  .logo-text {
    font-size: 0.9rem;
  }

  .menu {
    gap: 8px;
  }

  .menu a {
    font-size: 0.9rem;
    padding: 6px 8px;
  }

  .hero-content {
    padding: 16px;
    gap: 18px;
  }

  .hero-actions {
    width: 100%;
  }

  .btn {
    width: 100%;
  }

  .cards-row {
    gap: 10px;
  }

  .ebook-card {
    flex: 0 0 170px;
  }

  .cards-row > .ebook-card {
    width: 170px !important;
    min-width: 170px !important;
    max-width: 170px !important;
  }

  .card-cover-wrap {
    height: 235px;
  }

  .grid-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .footer-wrap {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
