/* Basic resets and global styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  /* Use the imported Poppins font for a friendly, modern feel. The
     fallback fonts ensure good rendering on systems without Poppins. */
  font-family: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont,
    'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  background-color: #fafafa;
  color: #222;
  transition: background-color 0.4s ease, color 0.4s ease;
}

body.dark {
  background-color: #121212;
  color: #eaeaea;
}

/*
 * The header should stick to the top of the screen as you scroll
 * without covering the underlying content. We use `position: sticky`
 * rather than `fixed` so the document flow accounts for the header
 * height. A semi‑transparent backdrop and blur ensure the text and
 * links remain legible over the page content.
 */
header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
  /* Remove the bottom border to eliminate the visual gap between the
     header and hero sections. */
  border-bottom: none;
}

/* Dark mode variation for the sticky header */
body.dark header {
  background: rgba(18, 18, 18, 0.8);
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.logo {
  display: flex;
  align-items: center;
  /* Remove font styling since the logo is now an image */
}

/* Size the logo image so it sits neatly within the header */
.logo img {
  /* Increase the logo size for better visibility */
  height: 72px;
  width: auto;
  display: block;
}

nav {
  display: flex;
  gap: 1.2rem;
}

.nav-link {
  text-decoration: none;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: inherit;
  opacity: 0;
  transform: translateY(-10px);
}

.nav-link:hover {
  color: #8257e5;
}

.darkmode-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  padding: 0.5rem;
  opacity: 0;
  transform: rotate(0deg);
}

main {
  /* Remove extra top padding; the hero’s own padding and the sticky
     header ensure content isn’t obscured. */
  padding-top: 0;
}

/* Hero section */
.hero {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  padding: 6rem 2rem;
  overflow: hidden;
  color: inherit;
}

/* Position hero text centrally and constrain width */
.hero-content {
  max-width: 700px;
  text-align: left;
  z-index: 1;
}

.hero-title {
  line-height: 1.1;
  margin-bottom: 1rem;
}

.hero-tagline {
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
  opacity: 0;
  transform: translateY(20px);
}

/* Additional tagline under the main hero tagline */
.hero-subtagline {
  font-size: 1rem;
  margin-bottom: 2rem;
  max-width: 600px;
  opacity: 0;
  transform: translateY(20px);
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw + 1rem, 5rem);
  font-weight: 800;
  margin-bottom: 1rem;
  opacity: 0;
  transform: translateY(20px);
}

.hero .tagline {
  /* Deprecated: old tagline removed */
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: #8257e5;
  color: #fff;
  text-decoration: none;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  border-radius: 4px;
  font-weight: 600;
  opacity: 0;
  transform: translateY(20px);
  transition: background 0.3s ease;
}

.btn:hover {
  background: #6641c5;
}

/* Hero background image overlay */
.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url('images/abstract_bg.png');
  background-size: cover;
  background-position: center;
  opacity: 0.25;
  z-index: -2;
}

/* Retain grid animation for subtle movement */
.grid-background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  pointer-events: none;
  z-index: -1;
  filter: blur(2px);
}

.grid-background .square {
  width: 18px;
  height: 18px;
  margin: 6px;
  background: rgba(130, 87, 229, 0.15);
  opacity: 0;
}

/* Books section */
/* Reset the books section styling to accommodate horizontal carousel */
.books {
  /* Extra bottom padding to accommodate the indicator dots and
     ensure the next section doesn't overlap the carousel. */
  padding: 6rem 0 9rem;
  overflow: hidden;
  position: relative;
  /* Warm gradient background inspired by the reference design */
  background: linear-gradient(135deg, #fbe0c2 0%, #fc8ba1 100%);
  margin-top: 2rem;
}

.books h2 {
  text-align: center;
  font-size: 2.4rem;
  margin-bottom: 3rem;
}

/* Horizontal carousel container */

/*
 * The horizontal carousel holds one slide at a time spanning the full
 * viewport width. By setting the flex basis to 100% we ensure
 * slides align edge‑to‑edge. Padding is removed so that the slide
 * takes up the entire horizontal space; internal margins are handled
 * inside the slide card.
 */
.book-carousel {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 0;
}

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

/* Individual slide */
/*
 * Each slide fills the entire carousel viewport horizontally. We
 * center its contents so that the inner card can be sized relative
 * to the viewport while leaving space on either side. An initial
 * offset animates the slide in from the right.
 */
.book-slide {
  flex: 0 0 100%;
  max-width: 100%;
  /* Increase the slide height to give the larger card more breathing room */
  min-height: 480px;
  scroll-snap-align: start;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateX(60px);
}

body.dark .book-slide {
  background: #2a2a2a;
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.05);
}

.slide-image {
  width: 45%;
  height: auto;
  object-fit: cover;
}

.slide-content {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 55%;
}

.slide-content h3 {
  font-size: 1.8rem;
  margin: 0 0 0.5rem 0;
  font-weight: 600;
}

.slide-content p {
  font-size: 1.1rem;
}

.books h2 {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 2rem;
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

/* Style each book card with an image and concise info */
.book-card {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(20px);
}

body.dark .book-card {
  background: #2a2a2a;
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.05);
}

.book-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.book-info {
  padding: 1rem 1.2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  flex: 1;
}

.book-info h3 {
  font-size: 1.4rem;
  margin: 0;
}

.book-info p {
  font-size: 0.95rem;
  flex: 1;
}

.actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.2rem;
}

.action-btn {
  display: inline-block;
  padding: 0.8rem 2rem;
  background: linear-gradient(135deg, #fca311, #e74c3c);
  color: #fff;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 30px;
  flex: none;
  text-align: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

/* Upcoming section */
/* Upcoming section with decorative background */
.upcoming {
  position: relative;
  padding: 6rem 2rem;
  text-align: center;
  overflow: hidden;
}

.upcoming-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url('images/stars_bg.png');
  background-size: cover;
  background-position: center;
  opacity: 0.3;
  z-index: -1;
}

.upcoming-title {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  opacity: 0;
  transform: translateY(20px);
}

.upcoming-text {
  max-width: 600px;
  margin: 0 auto 1.5rem;
  font-size: 1.1rem;
  opacity: 0;
  transform: translateY(20px);
}

.upcoming-btn {
  opacity: 0;
  transform: translateY(20px);
}

/* Contact section */
.contact {
  padding: 4rem 2rem;
  background: rgba(130, 87, 229, 0.05);
}

.contact h2 {
  text-align: center;
  margin-bottom: 1rem;
  font-size: 2rem;
}

.contact p {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 1rem;
}

.contact-form {
  max-width: 500px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.contact-form input,
.contact-form textarea {
  padding: 0.8rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.9rem;
}

body.dark .contact-form input,
body.dark .contact-form textarea {
  background: #2a2a2a;
  border-color: #444;
  color: #f5f5f5;
}

.contact-form button {
  align-self: flex-start;
}

footer {
  text-align: center;
  padding: 2rem;
  font-size: 0.9rem;
}

/* About section */
.about {
  /* Give the about section a slightly deeper backdrop for emphasis. */
  margin-top: 2rem;
  padding: 5rem 2rem;
  background: rgba(130, 87, 229, 0.08);
}

.about-content {
  display: flex;
  flex-wrap: wrap;
  gap: 3rem;
  align-items: center;
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
  opacity: 0;
  transform: translateY(20px);
}

.about-image {
  flex: 1 1 300px;
  text-align: center;
}

.about-image img {
  width: 100%;
  max-width: 380px;
  border-radius: 12px;
}

.about-text {
  flex: 1 1 300px;
}

.about-text h2 {
  font-size: 2.2rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.about-text p {
  font-size: 1.05rem;
  line-height: 1.7;
}

/* Why section */
.why {
  margin-top: 2rem;
  padding: 5rem 2rem;
  text-align: center;
  background: rgba(130, 87, 229, 0.06);
}

.why h2 {
  font-size: 2rem;
  margin-bottom: 2rem;
}

.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

.why-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1.5rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.05);
  opacity: 0;
  transform: translateY(20px);
}

.why-icon {
  width: 90px;
  height: 90px;
  margin-bottom: 1.2rem;
}

.why-item h3 {
  font-size: 1.35rem;
  margin-bottom: 0.6rem;
  font-weight: 600;
}

.why-item p {
  font-size: 1rem;
  max-width: 300px;
}

/* Ensure anchored sections are not hidden behind the fixed header. The
   scroll-margin-top property offsets the scroll position so that
   headings appear just below the header when navigating via
   anchors. */
section {
  /* Increase scroll margin to account for taller header and add extra breathing room. */
  scroll-margin-top: 120px;
}

/* ======== Book carousel redesign ======== */

/*
 * The carousel indicators appear centred below the slides. The dots
 * reflect which slide is currently visible. In light mode the
 * inactive dots are semi‑transparent grey, while in dark mode they
 * lighten slightly.
 */
.book-indicators {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: row;
  gap: 0.8rem;
  z-index: 2;
}

.book-indicators .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.25);
  transition: background 0.3s ease;
}

.book-indicators .dot.active {
  background: #f15b2a;
}

body.dark .book-indicators .dot {
  background: rgba(255, 255, 255, 0.35);
}

body.dark .book-indicators .dot.active {
  background: #f15b2a;
}

/* The slide card is now a unified container for the cover and text. It
   spans most of the viewport width and has a fixed height so the
   entire book cover is visible inside it. */
.slide-card {
  position: relative;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  overflow: hidden;
  width: 85%;
  max-width: 1100px;
  height: 340px;
  padding: 0;
}

/* The cover now lives fully inside the card on the left. Rounded
   corners on the left side match the card’s radius. */
.image-wrapper {
  position: relative;
  flex: 0 0 340px;
  height: 100%;
  overflow: hidden;
  border-radius: 20px 0 0 20px;
}

.image-wrapper img {
  width: 100%;
  height: 100%;
  /* Centre the book cover art within its wrapper. */
  object-fit: cover;
  object-position: center;
}

.slide-text {
  /* Take up the remaining width of the card and centre the text
     vertically. Horizontal padding prevents the text from crowding the
     image or the edge of the card. */
  flex: 1 1 auto;
  padding: 0 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
}

.slide-tag {
  font-size: 0.85rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.slide-text h3 {
  font-size: 2rem;
  margin: 0;
  font-weight: 700;
}

.slide-text p {
  font-size: 1.1rem;
  line-height: 1.6;
  margin: 0;
}

/* About section */