/* ═══════════════════════════════════════════════════════
   Atlas of Intimacy — Landing Page
   Mobile-first · Variation A (Warm & Educational)
   ═══════════════════════════════════════════════════════ */

:root {
  --bg: #f5f0eb;
  --bg-card: #ffffff;
  --bg-quote: #faf7f3;
  --bg-footer: #3a2a1a;
  --text: #3a2a1a;
  --text-secondary: #5a4a3a;
  --text-muted: #8b7355;
  --text-light: #b09a7a;
  --accent: #c4956a;
  --accent-shadow: rgba(196, 149, 106, 0.3);
  --cta-gradient-start: #ebe3d9;
  --cta-gradient-end: #e0d5c6;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2 {
  font-family: var(--font-serif);
  font-weight: 400;
}

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

/* ── Fade-up animation base ──────────────────────── */
.fade-up {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Chapter cards: no fade-in delay */
.chapter-card.fade-up {
  opacity: 1;
  transform: none;
  transition: none;
}

/* Author portrait: scale 0.9 → 1.0 */
.author-photo.fade-up {
  transform: scale(0.9);
}
.author-photo.fade-up.visible {
  transform: scale(1);
}

/* CTA buttons: scale 0.95 → 1.0 */
.cta-full .fade-up {
  transform: scale(0.95);
}
.cta-full .fade-up.visible {
  transform: scale(1);
}

/* ── Reduced motion ──────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .fade-up {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .scroll-hint { animation: none !important; opacity: 0.7; }
  .cta-full .btn { animation: none; }
}

/* ═══════════════════════════════════════════════════════
   1. HERO
   ═══════════════════════════════════════════════════════ */
.hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px 60px;
  text-align: center;
  background: linear-gradient(to bottom, var(--bg) 0%, #ebe3d9 100%);
}

.hero-cover {
  width: 180px;
  border-radius: 4px;
  box-shadow: 0 20px 60px rgba(58, 10, 26, 0.3), 0 4px 12px rgba(0, 0, 0, 0.1);
  margin-bottom: 32px;
  will-change: transform;
  transition: transform 0.1s ease-out;
}

.hero-title {
  font-size: 28px;
  color: var(--text);
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.hero-subtitle {
  font-family: var(--font-serif);
  font-size: 14px;
  font-style: italic;
  color: var(--text-muted);
  margin-bottom: 40px;
}

.scroll-hint {
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-light);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* ── Badge ──────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  border: 1px solid var(--accent);
  border-radius: 100px;
  padding: 8px 18px;
  background: rgba(196, 149, 106, 0.08);
}

.badge-icon {
  font-size: 14px;
  color: var(--accent);
}

/* Hero badge: delayed entrance with glow */
.badge-hero {
  margin-bottom: 24px;
  opacity: 0;
  transform: scale(0.8);
  animation: badgeAppear 0.8s ease-out 1.5s forwards;
}

@keyframes badgeAppear {
  0% {
    opacity: 0;
    transform: scale(0.8);
    box-shadow: 0 0 0 0 rgba(196, 149, 106, 0);
  }
  60% {
    opacity: 1;
    transform: scale(1.04);
    box-shadow: 0 0 20px 4px rgba(196, 149, 106, 0.3);
  }
  100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(196, 149, 106, 0);
  }
}

/* CTA badge */
.badge-cta {
  margin-top: 20px;
}

/* ═══════════════════════════════════════════════════════
   1b. HERO IMAGE
   ═══════════════════════════════════════════════════════ */
.hero-image {
  display: flex;
  justify-content: center;
  padding: 0;
  background: #000;
}
.hero-image img {
  width: 100%;
  max-width: 600px;
  height: auto;
  display: block;
}

/* ═══════════════════════════════════════════════════════
   2. OPENING HOOK
   ═══════════════════════════════════════════════════════ */
.hook {
  background: var(--bg-card);
  text-align: center;
  padding: 48px 28px;
}

.hook-line {
  font-family: var(--font-serif);
  font-size: 16px;
  font-style: italic;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.hook-emphasis {
  font-size: 20px;
  color: var(--text);
  font-weight: 400;
}

/* ═══════════════════════════════════════════════════════
   3. CTA COMPACT
   ═══════════════════════════════════════════════════════ */
.cta-compact {
  background: var(--bg);
  text-align: center;
  padding: 32px 24px;
}

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  padding: 16px 40px;
  border-radius: 6px;
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.4;
  box-shadow: 0 4px 16px var(--accent-shadow);
  transition: filter 0.2s, box-shadow 0.2s, transform 0.2s;
}

.btn:hover {
  filter: brightness(1.08);
  box-shadow: 0 6px 24px var(--accent-shadow);
}

.btn:active {
  transform: scale(0.98);
}

.btn small {
  display: block;
  font-family: var(--font-sans);
  font-size: 12px;
  font-style: italic;
  opacity: 0.9;
  margin-top: 2px;
}

.btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.btn-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 12px;
}

/* ═══════════════════════════════════════════════════════
   4. CHAPTER CARDS
   ═══════════════════════════════════════════════════════ */
.chapters {
  background: var(--bg);
  padding: 48px 24px;
}

.chapter-card {
  background: var(--bg-card);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.3s, transform 0.3s;
}

.chapter-photo-wrap {
  position: relative;
  height: 240px;
  overflow: hidden;
  border-radius: 12px 12px 0 0;
}

.chapter-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chapter-body {
  padding: 24px;
}

.chapter-body h2 {
  font-size: 22px;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.25;
}

.chapter-tagline {
  font-family: var(--font-serif);
  font-size: 13px;
  font-style: italic;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.chapter-questions {
  list-style: none;
  margin-bottom: 20px;
}

.chapter-questions li {
  font-size: 14px;
  color: var(--text-secondary);
  padding: 6px 0 6px 20px;
  position: relative;
  line-height: 1.5;
}

.chapter-questions li::before {
  content: '?';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: bold;
}

.book-quote {
  border-left: 3px solid var(--accent);
  padding: 12px 16px;
  margin-top: 16px;
  background: var(--bg-quote);
  border-radius: 0 6px 6px 0;
}

.quote-label {
  display: block;
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 8px;
}

.book-quote p {
  font-family: var(--font-serif);
  font-size: 13px;
  font-style: italic;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 8px;
}

.book-quote p:last-child {
  margin-bottom: 0;
}

/* ═══════════════════════════════════════════════════════
   5. CAROUSEL — Inside the Book
   ═══════════════════════════════════════════════════════ */
.carousel-section {
  background: var(--bg-card);
  padding: 48px 0;
}

.carousel-section h2 {
  text-align: center;
  font-size: 22px;
  padding: 0 24px;
  margin-bottom: 8px;
}

.carousel-subtitle {
  text-align: center;
  font-family: var(--font-serif);
  font-size: 13px;
  font-style: italic;
  color: var(--text-muted);
  margin-bottom: 24px;
  padding: 0 24px;
}

.carousel-wrap {
  position: relative;
}

.carousel-arrow {
  display: none;
}

.carousel {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0 24px 20px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  outline: none;
}

.carousel::-webkit-scrollbar {
  display: none;
}

.carousel-page {
  flex: 0 0 260px;
  height: 368px;
  border-radius: 8px;
  overflow: hidden;
  scroll-snap-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s, opacity 0.3s;
}

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

/* Adjacent cards are slightly scaled down; center card is full size */
.carousel-page {
  transform: scale(0.95);
  opacity: 0.7;
}

/* Snap-aligned (center) card gets full scale via JS .carousel-page-active */
.carousel-page-active {
  transform: scale(1);
  opacity: 1;
}

/* Desktop hover */
@media (min-width: 768px) {
  .carousel-page:hover {
    transform: scale(1);
    opacity: 1;
  }
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 16px 0;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #d4c4b0;
  transition: background 0.2s;
}

.dot.active {
  background: var(--accent);
}

/* ═══════════════════════════════════════════════════════
   7. ABOUT THE AUTHOR
   ═══════════════════════════════════════════════════════ */
.author {
  background: var(--bg);
  padding: 48px 24px;
  text-align: center;
}

.author-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  transition: transform 0.6s ease-out;
}

.author-photo.visible {
  transform: scale(1);
}

.author h2 {
  font-size: 20px;
  margin-bottom: 4px;
}

.author-role {
  font-size: 12px;
  font-style: italic;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.author-bio {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
}

/* ═══════════════════════════════════════════════════════
   8. CTA FULL
   ═══════════════════════════════════════════════════════ */
.cta-full {
  background: linear-gradient(to bottom, var(--cta-gradient-start), var(--cta-gradient-end));
  text-align: center;
  padding: 56px 24px;
}

.cta-full h2 {
  font-size: 24px;
  margin-bottom: 8px;
}

.cta-price {
  font-family: var(--font-serif);
  font-size: 32px;
  color: var(--accent);
  margin: 16px 0 24px;
}

.price-old {
  text-decoration: line-through;
  opacity: 0.5;
  font-size: 0.85em;
  margin-right: 4px;
}

.cta-sale-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 20px;
  padding: 4px 14px;
  margin-bottom: 4px;
}

.cta-details {
  font-size: 13px;
  font-style: italic;
  color: var(--text-muted);
  line-height: 1.6;
  margin-top: 20px;
  max-width: 380px;
  margin-left: auto;
  margin-right: auto;
}

.cta-full .btn {
  animation: btnGlow 3s ease-in-out infinite;
}

@keyframes btnGlow {
  0%, 100% { box-shadow: 0 4px 16px var(--accent-shadow); }
  50% { box-shadow: 0 4px 32px rgba(196, 149, 106, 0.45); }
}

/* ═══════════════════════════════════════════════════════
   9. FOOTER
   ═══════════════════════════════════════════════════════ */
.footer {
  background: var(--bg-footer);
  color: var(--text-light);
  text-align: center;
  padding: 32px 24px;
  font-size: 12px;
}

.footer a {
  color: var(--accent);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

.footer-bestseller {
  margin-top: 16px;
  font-style: italic;
  opacity: 0.7;
}
.footer-copy {
  margin-top: 12px;
  opacity: 0.6;
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE — Tablet (≥768px)
   ═══════════════════════════════════════════════════════ */
@media (min-width: 768px) {
  body { font-size: 16px; }

  .hero-cover { width: 240px; }
  .hero-title { font-size: 48px; }
  .hero-subtitle { font-size: 16px; }

  .hook { padding: 64px 28px; max-width: 640px; margin-left: auto; margin-right: auto; }
  .hook-line { font-size: 18px; }
  .hook-emphasis { font-size: 24px; }

  .chapters {
    max-width: 900px;
    margin: 0 auto;
    padding: 56px 32px;
  }

  .chapter-card {
    display: grid;
    grid-template-columns: 40% 60%;
    margin-bottom: 32px;
  }

  .chapter-card:nth-child(even) {
    direction: rtl;
  }
  .chapter-card:nth-child(even) > * {
    direction: ltr;
  }

  .chapter-photo-wrap {
    height: auto;
    min-height: 360px;
    border-radius: 12px 0 0 12px;
  }

  .chapter-card:nth-child(even) .chapter-photo-wrap {
    border-radius: 0 12px 12px 0;
  }

  .chapter-body {
    padding: 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .chapter-body h2 {
    font-size: 26px;
  }

  .chapter-card:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  }

  .carousel-section h2 { font-size: 26px; }

  .carousel-arrow {
    display: block;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s;
  }
  .carousel-arrow:hover {
    background: rgba(0, 0, 0, 0.8);
  }
  .carousel-arrow-left { left: 8px; }
  .carousel-arrow-right { right: 8px; }

  .author-photo { width: 160px; height: 160px; }
  .author-bio { max-width: 560px; margin-left: auto; margin-right: auto; }

  .cta-full h2 { font-size: 28px; }
  .cta-price { font-size: 40px; }
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE — Desktop (≥1024px)
   ═══════════════════════════════════════════════════════ */
@media (min-width: 1024px) {
  .chapters {
    max-width: 960px;
  }

  .chapter-body h2 {
    font-size: 32px;
  }

  .chapter-tagline {
    font-size: 15px;
  }

  .chapter-questions li {
    font-size: 16px;
  }

  .book-quote p {
    font-size: 15px;
  }

  .carousel-page {
    flex: 0 0 280px;
    height: 396px;
  }

  .carousel-section h2 { font-size: 32px; }

  .carousel {
    padding: 0 calc((100% - 3 * 280px - 2 * 16px) / 2) 20px;
  }

  .cta-full {
    padding: 72px 24px;
  }
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE — Wide Desktop (≥1280px)
   ═══════════════════════════════════════════════════════ */
@media (min-width: 1280px) {
  .hero-cover { width: 280px; }

  .chapters {
    max-width: 1100px;
  }
}
