/* ═══════════════════════════════════════════════
   TOKENS
═══════════════════════════════════════════════ */
:root {
  --cream:    #FDFAF5;
  --cream-2:  #F3EDE3;
  --cream-3:  #EBE2D5;
  --ink:      #1A1613;
  --ink-2:    #3D3530;
  --ink-3:    #6B5E55;
  --gold:     #B8860B;
  --gold-lt:  #D4A017;
  --gold-bg:  #FFF8E7;
  --white:    #FFFFFF;
  --border:   #E2D9CE;

  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans:  'Inter', system-ui, sans-serif;

  --radius:   12px;
  --radius-lg: 20px;
  --shadow:   0 2px 12px rgba(26,22,19,.08);
  --shadow-lg:0 8px 32px rgba(26,22,19,.12);

  --nav-h: 72px;
  --section-gap: 96px;
}

/* ═══════════════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--gold); }

ul { list-style: none; }

/* ═══════════════════════════════════════════════
   LAYOUT
═══════════════════════════════════════════════ */
.container {
  width: min(1200px, 100% - 48px);
  margin-inline: auto;
}

.section { padding-block: var(--section-gap); }

.centered { text-align: center; }

.mt-sm { margin-top: 28px; }

/* ═══════════════════════════════════════════════
   TYPOGRAPHY
═══════════════════════════════════════════════ */
h1, h2, h3, h4 { font-family: var(--font-serif); line-height: 1.2; }

h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); margin-bottom: 28px; }
h3 { font-size: 1.35rem; margin-bottom: 8px; }
h4 { font-size: 1.1rem; margin-bottom: 4px; }

p { color: var(--ink-2); }

.label {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 12px;
}
.label.centered { display: block; text-align: center; }

/* ═══════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: 50px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all .22s ease;
  white-space: nowrap;
}

.btn-gold {
  background: var(--gold);
  color: var(--white);
  border-color: var(--gold);
}
.btn-gold:hover {
  background: var(--gold-lt);
  border-color: var(--gold-lt);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(184,134,11,.35);
}

.btn-ghost {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,.5);
}
.btn-ghost:hover {
  background: rgba(255,255,255,.12);
  border-color: var(--white);
  color: var(--white);
}

.btn-outline {
  background: transparent;
  color: var(--gold);
  border-color: var(--gold);
}
.btn-outline:hover {
  background: var(--gold);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(184,134,11,.25);
}

.w-full { width: 100%; }

/* ═══════════════════════════════════════════════
   NAVBAR
═══════════════════════════════════════════════ */
.navbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1000;
  height: var(--nav-h);
  background: rgba(253,250,245,.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow .2s;
}

.navbar.scrolled { box-shadow: var(--shadow-lg); }

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0;
}

/* Actual logo image (SVG/PNG) */
.logo-img {
  height: 40px;
  width: auto;
  display: block;
}

/* Shown only when logo image fails to load */
.logo-fallback {
  display: none;   /* shown via onerror on <img> */
  align-items: center;
  gap: 10px;
}

.logo-icon {
  font-size: 1.5rem;
  color: var(--gold);
  line-height: 1;
}
.logo-text {
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.25;
  color: var(--ink);
}
.logo-text em {
  font-style: italic;
  color: var(--gold);
}
.logo-light .logo-img { filter: brightness(0) invert(1); }
.logo-light .logo-text { color: var(--cream); }
.logo-light .logo-text em { color: var(--gold-lt); }

/* Nav links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-links a {
  padding: 8px 14px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-2);
  transition: color .2s, background .2s;
}
.nav-links a:hover { color: var(--gold); background: var(--gold-bg); }

.nav-links .nav-cta {
  background: var(--gold);
  color: var(--white);
  padding: 9px 22px;
  font-weight: 600;
}
.nav-links .nav-cta:hover {
  background: var(--gold-lt);
  color: var(--white);
}

/* Burger */
.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 1100;
  position: relative;
}
.burger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: all .25s;
}
.burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ═══════════════════════════════════════════════
   HERO
   Recommended banner size: 1440 × 640 px (desktop)
   Mobile crop:  768 × 640 px
═══════════════════════════════════════════════ */
.hero {
  position: relative;
  min-height: 640px;
  display: flex;
  align-items: center;
  padding-top: var(--nav-h);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    /* Replace this gradient with your banner image:
       background-image: url('images/hero.jpg');
       background-size: cover;
       background-position: center; */
    radial-gradient(ellipse at 30% 60%, #2C1A0E 0%, #0F0A06 70%),
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 40px,
      rgba(255,255,255,.012) 40px,
      rgba(255,255,255,.012) 80px
    );
}

.hero-texture {
  position: absolute;
  inset: 0;
  background-image:
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.018'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(10,6,3,.55) 0%,
    rgba(10,6,3,.35) 60%,
    rgba(10,6,3,.65) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 1;
  padding-block: 64px;
  max-width: 680px;
}

.tag {
  display: inline-block;
  background: rgba(184,134,11,.25);
  border: 1px solid rgba(184,134,11,.5);
  color: #E8C060;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: .06em;
  padding: 6px 18px;
  border-radius: 50px;
  margin-bottom: 28px;
}

.hero-title {
  color: var(--white);
  margin-bottom: 8px;
}
.hero-title em {
  font-style: italic;
  color: #E8C060;
}

.hero-author {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: rgba(255,255,255,.65);
  font-style: italic;
  margin-bottom: 20px;
}

.hero-sub {
  font-size: 1.05rem;
  color: rgba(255,255,255,.78);
  line-height: 1.65;
  margin-bottom: 36px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 32px;
}

.hero-free-note {
  font-size: 0.88rem;
  color: rgba(255,255,255,.6);
}
.hero-free-note strong { color: #E8C060; }

/* ═══════════════════════════════════════════════
   ABOUT
═══════════════════════════════════════════════ */
.about { background: var(--white); }

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}

.about-text p { margin-bottom: 18px; }
.about-text p:last-of-type { margin-bottom: 0; }

.feature-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 8px;
}

.feature-list li {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.fi {
  font-size: 1.4rem;
  flex-shrink: 0;
  margin-top: 2px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gold-bg);
  border-radius: 10px;
}

.feature-list strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--ink);
  margin-bottom: 4px;
}

.feature-list p { font-size: 0.9rem; margin: 0; }

/* ═══════════════════════════════════════════════
   PRICING
═══════════════════════════════════════════════ */
.pricing { background: var(--cream-2); }

.pricing h2 { margin-bottom: 48px; }

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  align-items: stretch;
}

.plan-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  border: 2px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0;
  transition: box-shadow .25s, transform .25s;
  position: relative;
}

.plan-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.plan-card.featured {
  border-color: var(--gold);
  background: linear-gradient(160deg, #FFFDF5 0%, var(--white) 100%);
  box-shadow: 0 4px 24px rgba(184,134,11,.18);
}

.featured-badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gold);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 5px 20px;
  border-radius: 50px;
  white-space: nowrap;
}

.plan-icon {
  font-size: 2rem;
  margin-bottom: 16px;
}

.plan-card h3 {
  font-size: 1.3rem;
  color: var(--ink);
  margin-bottom: 10px;
}

.plan-desc {
  font-size: 0.88rem;
  color: var(--ink-3);
  margin-bottom: 28px;
  line-height: 1.5;
}

.plan-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

.amount {
  font-family: var(--font-serif);
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--ink);
}

.cycle {
  font-size: 0.82rem;
  color: var(--ink-3);
}

.plan-features {
  flex: 1;
  margin-bottom: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.plan-features li {
  font-size: 0.9rem;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 10px;
}

.plan-features li::before {
  content: '';
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex-shrink: 0;
  background-size: 10px;
  background-position: center;
  background-repeat: no-repeat;
}

.plan-features li.yes::before {
  background-color: #E8F5E9;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2 5l2.5 2.5L8 3' stroke='%232E7D32' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.plan-features li.no {
  color: var(--ink-3);
  text-decoration: line-through;
  opacity: .6;
}

.plan-features li.no::before {
  background-color: #FBE9E7;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M3 3l4 4M7 3l-4 4' stroke='%23C62828' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* ═══════════════════════════════════════════════
   RECOMMENDATIONS
═══════════════════════════════════════════════ */
.recommendations { background: var(--white); }

.recommendations h2 { margin-bottom: 48px; }

.books-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.book-card {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--cream);
  border: 1px solid var(--border);
  transition: box-shadow .25s, transform .25s;
}

.book-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.book-cover {
  aspect-ratio: 3/4;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  color: rgba(255,255,255,.6);
  letter-spacing: .05em;
}

.bc-brown  { background: linear-gradient(145deg, #6B3A2A, #A0552E); }
.bc-teal   { background: linear-gradient(145deg, #1F4E5F, #2E7D7A); }
.bc-purple { background: linear-gradient(145deg, #3D1F6B, #6A3FBF); }
.bc-red    { background: linear-gradient(145deg, #7A1A1A, #B83232); }

.book-meta {
  padding: 20px;
}

.book-author-name {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.book-card h4 {
  font-size: 1.05rem;
  color: var(--ink);
  margin-bottom: 10px;
}

.book-desc {
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--ink-3);
  margin: 0;
}

/* ═══════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════ */
.footer {
  background: #140E09;
  color: rgba(255,255,255,.75);
  padding-top: 64px;
}

.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.footer-brand .logo { margin-bottom: 16px; }

.footer-brand p {
  font-size: 0.9rem;
  color: rgba(255,255,255,.5);
  line-height: 1.6;
}

.footer h4 {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--white);
  margin-bottom: 16px;
}

.footer-nav ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-nav a {
  font-size: 0.9rem;
  color: rgba(255,255,255,.55);
  transition: color .2s;
}
.footer-nav a:hover { color: var(--gold-lt); }

.footer-contact p {
  font-size: 0.9rem;
  color: rgba(255,255,255,.55);
  margin-bottom: 6px;
}

.footer-contact a {
  color: var(--gold-lt);
  font-size: 0.9rem;
  font-weight: 500;
  transition: opacity .2s;
}
.footer-contact a:hover { opacity: .75; }

.socials {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.socials a {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: rgba(255,255,255,.55);
  transition: border-color .2s, color .2s;
}
.socials a:hover {
  border-color: var(--gold);
  color: var(--gold-lt);
}

.footer-bottom {
  padding-block: 20px;
}

.footer-bottom .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-bottom p {
  font-size: 0.8rem;
  color: rgba(255,255,255,.35);
}

.footer-bottom a {
  color: rgba(255,255,255,.35);
  transition: color .2s;
}
.footer-bottom a:hover { color: var(--gold-lt); }

/* ═══════════════════════════════════════════════
   SCROLL REVEAL
═══════════════════════════════════════════════ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .55s ease, transform .55s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ═══════════════════════════════════════════════
   RESPONSIVE — TABLET  ≤ 960px
═══════════════════════════════════════════════ */
@media (max-width: 960px) {
  :root { --section-gap: 72px; }

  .about-grid { grid-template-columns: 1fr; gap: 48px; }

  .pricing-grid { grid-template-columns: 1fr; max-width: 480px; margin-inline: auto; }

  .books-grid { grid-template-columns: repeat(2, 1fr); }

  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

/* ═══════════════════════════════════════════════
   МОБИЛЬНОЕ МЕНЮ — отдельный оверлей вне header
   (backdrop-filter на navbar создаёт stacking
   context, поэтому position:fixed внутри него
   не работает относительно viewport)
═══════════════════════════════════════════════ */
.mobile-menu {
  display: none; /* не нужен на десктопе */
}

@media (max-width: 860px) {
  /* Скрыть десктопный nav */
  .desktop-nav { display: none; }

  /* Показать бургер */
  .burger { display: flex; }

  /* Мобильный оверлей */
  .mobile-menu {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;

    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1030; /* navbar = 1000, burger = 1100 → меню между ними */

    background: var(--cream);
    padding-top: var(--nav-h);

    /* Закрытое состояние */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .28s ease, visibility .28s;
  }

  .mobile-menu.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .mobile-menu ul {
    width: 100%;
    display: flex;
    flex-direction: column;
  }

  .mobile-menu ul a {
    display: block;
    font-family: var(--font-serif);
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--ink);
    padding: 20px 0;
    text-align: center;
    border-bottom: 1px solid var(--border);
    transition: color .2s;
  }

  .mobile-menu ul a:hover { color: var(--gold); }

  .mobile-menu-cta {
    margin-top: 36px;
    min-width: 240px;
    text-align: center;
  }

  /* Крестик закрытия */
  .mobile-menu-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
  }

  .mobile-menu-close span {
    position: absolute;
    width: 22px;
    height: 2px;
    background: var(--ink);
    border-radius: 2px;
  }

  .mobile-menu-close span:nth-child(1) { transform: rotate(45deg); }
  .mobile-menu-close span:nth-child(2) { transform: rotate(-45deg); }
}

/* ═══════════════════════════════════════════════
   RESPONSIVE — MOBILE  ≤ 640px
═══════════════════════════════════════════════ */
@media (max-width: 640px) {
  :root { --section-gap: 56px; }

  /* Hero */
  .hero { min-height: 560px; }
  .hero-content { padding-block: 48px 56px; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { text-align: center; }

  /* Books */
  .books-grid { grid-template-columns: 1fr 1fr; }

  /* Footer */
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .footer-bottom .container {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 400px) {
  .books-grid { grid-template-columns: 1fr; max-width: 300px; margin-inline: auto; }
}
