:root {
  --nav-blue: #0b1f3a;
  --gold: #d4af37;
  --bot-green: #2e5d4e;
  --paper: #faf9f6;
  --ink: #1a1a1a;
}

html, body {
  overflow-x: hidden;
}

.hero-book {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: var(--nav-blue);
  position: relative;
  overflow: visible;  /* Must be visible so page curl is never clipped */
  padding: 4rem 1rem;
}

/* Cover Left Content (Appears only on Page 1 beside the book) */
.cover-left-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 5%;
  z-index: 10;
  transition: opacity 0.4s ease-in-out;
}

.cover-left-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2.5rem, 4vw, 4.5rem);
  color: var(--paper);
  line-height: 1.1;
  margin-bottom: 1.5rem;
  font-weight: 400;
}

.cover-left-text {
  font-family: 'Inter', sans-serif;
  font-size: clamp(0.9rem, 1.2vw, 1.1rem);
  color: rgba(255,255,255,0.85);
  line-height: 1.8;
  font-weight: 300;
  margin-bottom: 2.5rem;
}

.cover-left-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Cover Right Content (Appears only on Page 10 beside the closed book) */
.cover-right-content {
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  padding: 0 5%;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease-in-out;
}

.cover-right-quote {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  color: var(--gold);
  line-height: 1.3;
  font-style: italic;
  font-weight: 300;
  text-align: right;
}
/* Button override for the left cover area */
.cover-left-buttons .btn-outline-tob {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  padding: 12px 24px;
  transition: all 0.3s ease;
  text-decoration: none;
}
.cover-left-buttons .btn-outline-tob:hover {
  background: #fff;
  color: var(--nav-blue);
}


/* Elegant radial gradient in background */
.hero-book::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(212, 175, 55, 0.08), transparent 60%);
  pointer-events: none;
}

.flip-book-container {
  width: 90%;
  max-width: 1200px;
  aspect-ratio: 2 / 1.3;
  margin: 0 auto;
  position: relative;
  filter: drop-shadow(0 30px 40px rgba(0,0,0,0.4));
  
  /* Hardcover board simulation */
  background-color: #06111e;
  padding: 12px;
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05); /* subtle highlight on edge */
}

.flip-book {
  width: 100%;
  height: 100%;
}

.page {
  background-color: var(--paper);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.03'/%3E%3C/svg%3E");
  border-left: 1px solid rgba(0,0,0,0.03);
  border-right: 1px solid rgba(0,0,0,0.03);
  overflow: hidden;
  position: relative;
}

/* Inner spine shadows to enhance book realism */
.page.--left .page-content::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 40px; height: 100%;
  background: linear-gradient(to left, rgba(0,0,0,0.15), transparent);
  pointer-events: none;
  z-index: 10;
}
.page.--right .page-content::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 40px; height: 100%;
  background: linear-gradient(to right, rgba(0,0,0,0.15), transparent);
  pointer-events: none;
  z-index: 10;
}

/* Magazine Layout Styles */
.magazine-layout {
  width: 100%;
  height: 100%;
  padding: 10% 12%; /* Large margins (breathing space) */
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.center-content {
  align-items: center;
  text-align: center;
}

.mag-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(3rem, 5vw, 4.5rem);
  color: var(--ink);
  line-height: 1.1;
  margin-bottom: 1.5rem;
  font-weight: 400;
}

.mag-subtitle {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2rem, 3vw, 3rem);
  color: var(--ink);
  line-height: 1.2;
  margin-bottom: 1.5rem;
  font-weight: 400;
}

.mag-rule {
  width: 50px;
  height: 1px;
  background-color: var(--gold);
  margin-bottom: 2rem;
}

.mag-text {
  font-family: 'Inter', sans-serif;
  font-size: clamp(0.9rem, 1.2vw, 1.1rem);
  color: #4a4a4a;
  line-height: 1.8;
  font-weight: 300;
}

.mag-caption {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-top: 1.5rem;
}

.mag-list {
  list-style: none;
  padding: 0;
  margin-top: 2rem;
}

.mag-list li {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  color: var(--bot-green);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.mag-video-frame {
  width: 100%;
  aspect-ratio: 4/5;
  background: #eee;
  border-radius: 2px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.mag-video-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mag-img-small {
  width: 100%;
  height: 250px;
  margin-top: 3rem;
  opacity: 0.9;
}

.mag-img-wide {
  width: 100%;
  height: 200px;
  margin-top: 3rem;
  border-radius: 2px;
}

.mag-img-tall {
  width: 100%;
  height: 100%;
  opacity: 0.95;
}

.mag-big-type {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(4rem, 8vw, 8rem);
  font-weight: 700;
  margin: 0;
  line-height: 1;
  text-align: center;
  background: url('/images/botanical-jar-4.png') center/cover;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

@media(max-width: 768px) {
  .flip-book-container {
    width: 95%;
    aspect-ratio: 1 / 1.3;
  }
  .magazine-layout {
    padding: 8%;
  }
}

/* ═════════ NEW ADDITIONS: FLIP TAG & CONTROLS ═════════ */
.flip-tag {
  position: absolute;
  bottom: 30px;
  right: 30px;
  background-color: #d32f2f;
  color: #fff;
  padding: 8px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 100;
  box-shadow: 0 4px 15px rgba(211,47,47,0.4);
  animation: pulse-flip 2s infinite;
  pointer-events: auto;
  cursor: pointer;
}

@keyframes pulse-flip {
  0% { transform: scale(1); box-shadow: 0 4px 15px rgba(211,47,47,0.4); }
  50% { transform: scale(1.05); box-shadow: 0 4px 25px rgba(211,47,47,0.6); }
  100% { transform: scale(1); box-shadow: 0 4px 15px rgba(211,47,47,0.4); }
}

.book-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-top: 3rem;
  z-index: 10;
}

.book-arrow {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.book-arrow:hover {
  background: #fff;
  color: var(--nav-blue);
  border-color: #fff;
}

.book-dots {
  display: flex;
  gap: 12px;
}

.book-dot {
  width: 10px;
  height: 10px;
  background: rgba(255,255,255,0.3);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
}

.book-dot.active {
  background: #fff;
  transform: scale(1.3);
}

.book-dot:hover {
  background: rgba(255,255,255,0.8);
}

/* ═════════ NEW ADDITIONS: REAL BOOK COVER ═════════ */
.page.back-cover {
  background-image:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.2'/%3E%3C/svg%3E"),
    linear-gradient(
      to right,
      #06111e 0%,
      #06111e 23%,
      #b89b5e 23%,
      #b89b5e 31%,
      #0c223f 31%,
      #0c223f 33%,
      #f5f5f5 33%,
      #f5f5f5 39%,
      #0c223f 39%,
      #0c223f 41%,
      #c21f2f 41%,
      #c21f2f 49%,
      #0c223f 49%,
      #0c223f 51%,
      #c21f2f 51%,
      #c21f2f 59%,
      #0c223f 59%,
      #0c223f 61%,
      #f5f5f5 61%,
      #f5f5f5 67%,
      #0c223f 67%,
      #0c223f 69%,
      #b89b5e 69%,
      #b89b5e 77%,
      #06111e 77%,
      #06111e 100%
    );
  box-shadow: inset 0 0 0 8px rgba(212,175,55,0.25);
}

.page.cover-page {
  background-image: 
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.2'/%3E%3C/svg%3E"),
    linear-gradient(
      to right,
      #06111e 0%,
      #06111e 23%,     /* Blue balance left */

      #b89b5e 23%,
      #b89b5e 31%,     /* Gold stripe (8%) */

      #0c223f 31%,
      #0c223f 33%,     /* Navy line */

      #f5f5f5 33%,
      #f5f5f5 39%,     /* White stripe */

      #0c223f 39%,
      #0c223f 41%,     /* Navy line */

      #c21f2f 41%,
      #c21f2f 49%,     /* Red stripe (8%) */

      #0c223f 49%,
      #0c223f 51%,     /* Center Navy line */

      #c21f2f 51%,
      #c21f2f 59%,     /* Red stripe (8%) */

      #0c223f 59%,
      #0c223f 61%,     /* Navy line */

      #f5f5f5 61%,
      #f5f5f5 67%,     /* White stripe */

      #0c223f 67%,
      #0c223f 69%,     /* Navy line */

      #b89b5e 69%,
      #b89b5e 77%,     /* Gold stripe (8%) */

      #06111e 77%,
      #06111e 100%     /* Blue balance right */
    );
  box-shadow: inset 0 0 0 8px rgba(212,175,55,0.25);
}

.page.cover-page .mag-title,
.page.back-cover .mag-title {
  color: var(--gold);
  text-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.page.cover-page .mag-caption,
.page.back-cover .mag-caption {
  color: #fff;
  opacity: 0.9;
}

/* ═════════════════════════════════════════
   BOTANICAL LIBRARY SECTION
═════════════════════════════════════════ */
.botlib-section {
  padding: 7rem 2rem 5rem;
  background: #faf9f6;
}

.botlib-header {
  text-align: center;
  margin-bottom: 3.5rem;
}

.botlib-eyebrow {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: #a37c4e;
  margin-bottom: 1rem;
}

.botlib-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2.2rem, 4vw, 3.5rem);
  font-weight: 400;
  color: #1a1208;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.botlib-title em {
  font-style: italic;
  color: #2e5d4e;
}

.botlib-sub {
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  color: #4A3E2E;
  line-height: 1.7;
  max-width: 500px;
  margin: 0 auto;
}

/* Grid: hero card left + stacked right */
.botlib-jc-grid {
  display: flex;
  gap: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
  overflow-x: auto;
  padding: 1rem;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: #a37c4e #f5f0e8;
  -webkit-overflow-scrolling: touch;
}

.botlib-jc-grid::-webkit-scrollbar {
  height: 6px;
}
.botlib-jc-grid::-webkit-scrollbar-track {
  background: #f5f0e8;
  border-radius: 4px;
}
.botlib-jc-grid::-webkit-scrollbar-thumb {
  background-color: #a37c4e;
  border-radius: 4px;
}

.botlib-jc-card {
  flex: 0 0 calc(25% - 1.125rem);
  min-width: 280px;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 2.2rem 1.2rem;
  scroll-snap-align: start;
}

.botlib-jc-inner {
  background: #fdfaf5;
  border-radius: 8px;
  padding: 3rem 1.5rem 2rem;
  flex: 1;
  text-align: center;
  position: relative;
  z-index: 2;
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
  overflow: hidden;
}

.botlib-jc-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.6rem;
  color: #2a2a2a;
  line-height: 1.2;
  margin-bottom: 1rem;
  font-weight: 500;
  position: relative;
  z-index: 2;
}

.botlib-jc-line {
  width: 40px;
  height: 2px;
  background-color: #D35C3A;
  margin: 0 auto 1.5rem;
  position: relative;
  z-index: 2;
}

.botlib-jc-text {
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  color: #4a4a4a;
  line-height: 1.6;
  position: relative;
  z-index: 2;
}

/* Abstract floral overlays matching the reference aesthetic */
.botlib-jc-card::before,
.botlib-jc-card::after {
  content: '';
  position: absolute;
  z-index: 1;
  background-size: contain;
  background-repeat: no-repeat;
  pointer-events: none;
}

/* Card 1 */
.botlib-jc-card:nth-child(1)::before {
  top: -10px; left: -10px; width: 140px; height: 140px;
  background-image: url("/images/bot-cluster-1.png");
  mix-blend-mode: multiply;
  opacity: 0.9;
}
.botlib-jc-card:nth-child(1)::after {
  bottom: -20px; right: -20px; width: 160px; height: 160px;
  background-image: url("/images/bot-cluster-1.png");
  mix-blend-mode: multiply;
  opacity: 0.9;
  transform: rotate(180deg);
}

/* Card 2 */
.botlib-jc-card:nth-child(2)::before {
  top: 10px; left: -10px; width: 150px; height: 150px;
  background-image: url("/images/bot-cluster-2.png");
  mix-blend-mode: multiply;
  opacity: 0.95;
}
.botlib-jc-card:nth-child(2)::after {
  bottom: -10px; right: -10px; width: 170px; height: 170px;
  background-image: url("/images/bot-cluster-2.png");
  mix-blend-mode: multiply;
  opacity: 0.95;
  transform: rotate(180deg);
}

/* Card 3 */
.botlib-jc-card:nth-child(3)::before {
  top: -10px; right: -10px; width: 160px; height: 160px;
  background-image: url("/images/bot-cluster-3.png");
  mix-blend-mode: multiply;
  opacity: 0.9;
  transform: scaleX(-1);
}
.botlib-jc-card:nth-child(3)::after {
  bottom: 10px; left: -10px; width: 140px; height: 140px;
  background-image: url("/images/bot-cluster-3.png");
  mix-blend-mode: multiply;
  opacity: 0.9;
}

/* Card 4 */
.botlib-jc-card:nth-child(4)::before {
  top: -10px; left: -10px; width: 150px; height: 150px;
  background-image: url("/images/bot-cluster-4.png");
  mix-blend-mode: multiply;
  opacity: 0.95;
}
.botlib-jc-card:nth-child(4)::after {
  bottom: -20px; right: -20px; width: 170px; height: 170px;
  background-image: url("/images/bot-cluster-4.png");
  mix-blend-mode: multiply;
  opacity: 0.95;
  transform: rotate(180deg);
}
/* ═════════════════════════════════════════
   MOBILE HERO BANNER
   (visible ONLY on mobile, hidden on desktop)
═════════════════════════════════════════ */
.mobile-hero-banner {
  display: none; /* hidden on desktop */
  background: var(--nav-blue);
  padding: 3.5rem 1.8rem 2.5rem;
  position: relative;
  overflow: hidden;
}

.mobile-hero-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 20% 60%, rgba(212,175,55,0.07), transparent 60%);
  pointer-events: none;
}

.mobile-hero-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2.6rem, 10vw, 3.8rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.12;
  margin-bottom: 1.4rem;
  position: relative;
}

.mobile-hero-text {
  font-family: 'Inter', sans-serif;
  font-size: 0.93rem;
  color: rgba(255,255,255,0.82);
  line-height: 1.75;
  margin-bottom: 2rem;
  max-width: 520px;
  position: relative;
}

.mobile-hero-btns {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  position: relative;
}

.mobile-hero-btn {
  display: block;
  text-align: center;
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.45);
  padding: 14px 24px;
  text-decoration: none;
  transition: background 0.3s, color 0.3s;
  border-radius: 2px;
}

.mobile-hero-btn:hover {
  background: #fff;
  color: var(--nav-blue);
}

/* ═════════════════════════════════════════
   HERO BOOK — MOBILE RESPONSIVE
═════════════════════════════════════════ */
@media (max-width: 768px) {

  /* Show mobile hero banner */
  .mobile-hero-banner {
    display: block;
  }

  .hero-book {
    position: relative;
    min-height: 100vh;
    padding: 0;
    background: var(--nav-blue);
    overflow: hidden; /* Prevent horizontal overflow */
  }

  /* CRITICAL: perfectly centered mobile book */
  .flip-book-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90vw;
    max-width: 400px;
    aspect-ratio: 1 / 1.35;
    margin: 0;
    padding: 0;
  }

  /* Hide desktop overlay text — not needed on mobile */
  .cover-left-content,
  .cover-right-content {
    display: none !important;
  }

  .book-controls {
    position: absolute;
    bottom: 3%;
    left: 50%;
    transform: translateX(-50%);
    padding: 1rem 0.5rem;
    gap: 10px;
    z-index: 20;
    width: 100%;
  }

  .book-arrow {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .book-dot {
    width: 8px;
    height: 8px;
  }

  /* Page typography scale-down */
  .mag-title  { font-size: clamp(1.8rem, 8vw, 3rem) !important; }
  .mag-subtitle { font-size: 1.1rem; }
  .mag-text   { font-size: 0.82rem; }
  .mag-caption { font-size: 0.7rem; }
  .mag-list li { font-size: 0.8rem; }

  /* Cover page gradient stays centred on narrow screens */
  .page.cover-page {
    background-size: cover;
  }

  /* Botanical Library mobile grid adjustment */
  .botlib-jc-card {
    flex: 0 0 85%;
    min-width: unset;
    padding: 16px 9px; /* Requested padding ratio */
  }
  
  .botlib-jc-inner {
    padding: 1.5rem 1rem;
  }
}
