body {
  background: #fbf6ee;
  font-family: Cambria, "Hoefler Text", "Liberation Serif", Times, "Times New Roman", serif;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start; /* header stays on top */
  padding-top: 10px; /* optional spacing */
}

.nav-toggle-button {
    position: fixed;
    top: 20px;
    right:-15px;
    z-index: 1000;
    background-color: transparent; 
    color: transparent; 
    font-size: 0;
    width: 100px;
    height: 50px;
    border: none;
    border-radius: 5px;
    padding: 0;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.nav-toggle-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.nav-toggle-button:hover {
    transform: scale(1.05);
}

.nav-wrapper {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: 300px;
    background-color: rgba(30, 30, 30, 0.5); 
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1); 
    z-index: 999;
    transform: translateX(300px); 
    transition: transform 0.4s ease-in-out;
    padding-top: 80px; /* Space for the top toggle button */
}

/* State to show the menu */
.nav-wrapper.open {
    transform: translateX(0); 
}

.bookmark {
    width: 100%;
    padding: 10px 15px; 
    border-radius: 4px;
    text-align: left;
    display: block; 
    text-decoration: none; 
    color: #ffcc70; 
    transition: background-color 0.2s ease, transform 0.2s ease;
}

/* Create the Bullet Point (using pseudo-element) */
.bookmark span::before {
    content: '•'; /* The bullet character */
    color: #ffcc70; /* Bullet color */
    font-size: 1.2em;
    margin-right: 15px; /* Space between bullet and text */
    display: inline-block;
    width: 15px; /* Give it a fixed width for alignment */
}

.bookmark:hover {
    background-color: rgba(255, 204, 112, 0.25);
    transform: scale(1.05);
}

.bookmark span {
    opacity: 1; 
    color: #f7e2b3;
    font-weight: normal;
    font-size: 13px;
    display: inline; 
}


.header-image {
  text-align: center;
  width: 850px;
  z-index: 3;
  padding-bottom: 10px;
  margin-top: 30px;
}

.header-image img {
  max-width: 100%;
  height: auto;
  max-height: 90px; /* adjust as needed */
}

.extra-image {
  text-align: center;
  margin-top: -50px;
}

.extra-image img {
  max-width: 500px;     /* adjust size */
  width: 30%;
  height: auto;
}

.page-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #fbf6ee url('../assets/chap3bg.webp') center/cover no-repeat;
  z-index: -1; /* behind everything */
}

.hero-card-container {
  perspective: 1000px;
  animation: float 4s ease-in-out infinite alternate;

  display: flex;          
  flex-direction: row;    
  justify-content: center; 
  gap: 30px;   
  flex-wrap: wrap;       
  margin-bottom: 50px; 
}

.hero-card {
  width: 400px;
  height: 520px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.8s;
  cursor: pointer;
  margin-top: 25px;
}

.card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 15px;
  overflow: hidden;
}

.card-face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.back {
  transform: rotateY(180deg);
}

.hero-card.flipped {
  transform: rotateY(180deg);
}

@keyframes float {
  from { transform: translateY(0px); }
  to { transform: translateY(-15px); }
}

@media (max-width: 1024px) {
  .hero-card-container {
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }
}

.hero-card .manualBtn {
  position: absolute;
  bottom: 60px;      /* adjust distance from bottom of card */
  left: 71%;         /* center horizontally */
  transform: translateX(-50%);
  background: none;
  border: none;
  cursor: pointer;
  width: 80px;       /* adjust as needed */
  height: auto;
  z-index: 10;
}

.hero-card .manualBtn img {
  width: 100%;
  height: auto;
}


#title {
  position: absolute;
  top: 380px;
  left: 60px;
  width: 200px;
  text-align: center;
  font-size: 14px;
  color: black;
  font-family: Constantia, "Lucida Bright", "DejaVu Serif", Georgia, serif;
  transition: opacity 0.5s ease;
  opacity: 1;
  text-align: left;
}

.page-link {
  position: absolute;
  top: 53%; /* position inside the page */
  left: 18%;
  font-size: 10px;
  color: black;
  text-decoration: none;
  font-weight: 600;
  transition: 0.3s;
  font-family: Constantia, "Lucida Bright", "DejaVu Serif", Georgia, serif;
  z-index: 100; /* ensure it's above everything */
  pointer-events: auto; /* clickable */
}

.page-link:hover {
  color: #d94c63;
  text-decoration: underline;
}

/* Book opening animation */
.book.open {
  animation: openBook 1s ease forwards;
}

@keyframes openBook {
  0% {
    transform: scale(0.8) rotateY(60deg);
    opacity: 0;
  }
  100% {
    transform: scale(1) rotateY(0deg);
    opacity: 1;
  }
}

/* Book Section */
.book-section {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  animation: fadeIn 0.5s ease forwards;
  z-index: 5;
}

/* Book container */
.book {
  position: relative;
  width: 1010px;     /* adjust book width */
  height: 650px;     /* adjust book height */
  perspective: 1200px;
  transform-style: preserve-3d;
  transform-origin: center;
  transition: transform 1s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: auto;
  z-index: 6;
}

/* Spreads (both pages aligned together perfectly) */
.spread {
  position: absolute;
  width: 100%;
  height: 100%;
  display: none;
}

.spread.visible {
  display: flex;
}

/* Each page — no gap between left and right */
.page {
  flex: 1;
  height: 100%;
  background-size: cover;
  background-position: center;
  position: relative;
  margin: 0px;          /* no spacing between pages */
  padding: 0px;
}

.page.left {
  flex: none;
  width: 55%;              /* you can adjust this */
  height: 105%;
  background-size: cover;
  background-position: center; /* adjust focus if needed */
  position: relative;
  margin-left: 10px;
}

.page-title {
  position: absolute;
  top: 30px;        /* distance from top */
  left: 50%;
  transform: translateX(-50%);
  width: 220px;     /* adjust based on your image */
  height: auto;
  pointer-events: none; /* so it doesn't block clicks on content */
  z-index: 3;
}

.radar-caption {
  position: absolute;
  top: 80px;        /* distance from top */
  left: 50%;
  transform: translateX(-50%);
  width: 450px;     /* adjust based on your image */
  height: auto;
  pointer-events: none; /* so it doesn't block clicks on content */
  z-index: 3;
}

.risk-caption {
  position: absolute;
  top: -5px;        /* distance from top */
  left: 50%;
  transform: translateX(-50%);
  width: 400px;     /* adjust based on your image */
  height: auto;
  pointer-events: none; /* so it doesn't block clicks on content */
  z-index: 3;
}

.page-caption {
  position: absolute;
  top: 20px;        /* distance from top */
  left: 50%;
  transform: translateX(-50%);
  width: 400px;     /* adjust based on your image */
  height: auto;
  pointer-events: none; /* so it doesn't block clicks on content */
  z-index: 3;
}

.page-tips {
  position: absolute;
  top: 510px;        /* distance from top */
  left: 32%;
  transform: translateX(-50%);
  width: 300px;     /* adjust based on your image */
  height: auto;
  pointer-events: none; /* so it doesn't block clicks on content */
  z-index: 3;
}

.page5-tip {
  position: absolute;
  top: 545px;        /* distance from top */
  left: 32%;
  transform: translateX(-50%);
  width: 250px;     /* adjust based on your image */
  height: auto;
  pointer-events: none; /* so it doesn't block clicks on content */
  z-index: 3;
}


#info-box {
  position: absolute;
  top: 590px;    /* distance from top of page.left */
  left: 290px;   /* distance from left of page.left */
  width: 200px; /* optional: control width */
  text-align: center;
  font-size: 10px;
  color: #4a372c;
  transition: opacity 0.5s ease;
  opacity: 1;    /* JS will fade in/out */
}

/* Right page */
.page.right {
  flex: none;
  width: 55%;              /* you can adjust this */
  height: 105%;
  position: relative;
  margin: 0;
}

/* Content box (for your info, chart, etc.) */
.content-box {
  position: relative;
  top: 10%;
  left: 10%;
  width: 80%;
  height: 80%;
  text-align: center;
  font-size: 18px;
  padding: 10px;
  overflow: auto;
}

/* --- Button Controls --- */
/* Back button (left side of book) */
.prevPage {
  position: absolute;
  top: 97%;            /* adjust vertical position */
  left: 4%;            /* adjust horizontal position */
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  width: 40px;         /* change size here */
  height: 60px;        /* change size here */
  z-index: 10;
  opacity: 0.9;
}

/* Next button (right side of book) */
.nextPage {
  position: absolute;
  top: 97%;            /* adjust vertical position */
  right: -8%;           /* adjust horizontal position */
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  width: 40px;         /* change size here */
  height: 60px;        /* change size here */
  z-index: 10;
  opacity: 0.9;
}

.prevPage img,
.nextPage img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Exit button (top-right corner of book) */
.exitBook {
  position: absolute;
  top: 50px;             /* adjust y position */
  right: -7%;           /* adjust x position */
  width: 60px;         /* change size here */
  height: 50px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 12;
  opacity: 0.9;
}

.exitBook img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Hover effects (optional) */
#prevPage:hover,
#nextPage:hover,
#exitBook:hover {
  opacity: 1;
}

/* Fade In */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInButtons {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* hidden state by default */
#prevPage,
#nextPage,
#exitBook {
  opacity: 0;
  pointer-events: none; /* prevent clicking before visible */
}

/* when visible */
.show-buttons #prevPage,
.show-buttons #nextPage,
.show-buttons #exitBook {
  animation: fadeInButtons 0.8s ease forwards;
  animation-delay: 0.5s; /* appear slightly after book opens */
  pointer-events: all;
}

.page.right .content-box {
  display: block;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow- visible !important;
}

.music-toggle {
  position: fixed;
  top: 20px;
  right: 100px; /* to the left of nav-toggle (which is at right: -15px) */
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  z-index: 1000;
  padding: 0;
  width: auto;
  height: auto;
  outline: none;
  -webkit-tap-highlight-color: transparent; /* removes tap highlight on mobile */
}

.next-button {
  position: fixed;
  bottom: 40px;
  right: -30px;
  width: 140px;
  height: 125px;
  background: transparent;
  border: none;
  cursor: pointer;
  opacity: 1;
  visibility: visible;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease, visibility 0.6s ease;
  z-index: 100;
  padding: 0;
  outline: none;
}

.next-button:hover {
  opacity: 0.9; /* or apply a filter if you prefer */
}

.next-btn-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.next-button:hover {
  /* Scale the button up by 10% (1.1) */
  transform: scale(1.2);
  /* Slightly increase the opacity for emphasis (optional, you already have one) */
  opacity: 1; 
}