/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Catamaran&family=Poppins&family=Sans+3&display=swap');

/* For tablets and up */
@media (min-width: 768px) {
  body {
    font-size: 18px;
  }
}
  
/* For desktops and up */
@media (min-width: 1024px) {
  body {
    font-size: 20px;
  }
}

/* Preloader styles */
#preloader {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 100vw;
  background: linear-gradient(
    to bottom,
    #ffd8d7 0%,
    #ffecec 50%,
    #ffffff 100%
  );
  z-index: 9999;
  transition: opacity 0.5s ease;
  opacity: 1;
  pointer-events: all;
}

#preloader .progress {
  height: 8px;
  background-color: #f8f9fa;
  overflow: hidden;
}

#preloader .progress-bar {
  width: 0;
  transition: width 1s ease;
}

#preloader.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Base styles (mobile-first) */
body {
  font-size: 16px;
}

/* Background */
.gradient-background {
  min-height: 100vh;
  background-color: #F3F1E7;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* Fonts and application */
@font-face {
  font-family: 'CPFont';
  src: url('../fonts/CP.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

h1, h2 {
  font-family: 'Poppins', sans-serif;
}

h3, h4, h5, h6 {
  font-family: 'Catamaran', sans-serif;
}

p {
  font-family: 'Sans 3', sans-serif;
}

.tagline {
  font-family: 'CPFont', sans-serif;
  color: #5B6765;
}

#header-name {
  color: #5B6765;
}

/* CSS for the menu links */
.menu-link {
  text-decoration: none;
  transition: all 0.3s ease;
  border-radius: 8px;
  position: relative;
}

.menu-link::after {
  content: "";
  position: absolute;
  width: 0;
  background-color: rgba(166, 166, 166, 0.4); /* #A6A6A6 with opacity */
  left: 50%;
  transform: translateX(-50%);
  bottom: -0.25em;
  height: 2px;
  border-radius: 8px;
  transition: all 0.3s ease;
}

@keyframes pulse11 {
  0% {
    box-shadow: 0 0 0 0 rgba(166, 166, 166, 0.4);
  }
  100% {
    box-shadow: 0 0 0 1em transparent;
  }
}

.menu-link:hover::after {
  width: 100%;
  animation: pulse11 1s;
  box-shadow: 0 0 0 1em transparent;
}

/* Page transition styling */
body.fade-fade {
  opacity: 0;
  transition: opacity 0.4s ease-out;
}

body.fade-fade.show {
  opacity: 1;
}

/* Header styling */

.title-style {
  color: #5c3636;
  padding-top: 3%;
}

.logo-sm {
  max-width: 350px;
}

/* Image Blur Effect */
.home-blur-image {
  filter: blur(20px);
  transition: filter 0.5s ease;
  max-width: 50%;
}

.books-blur-image {
  filter: blur(20px);
  transition: filter 0.5s ease;
}

.books-modal-blur-image {
  filter: blur(20px);
  transition: filter 0.5s ease;
  margin-top: 20px;
  margin-bottom: 20px;
}


/* Books Card Styling */

.book-card {
  cursor: pointer;
  overflow: visible;
}

.book-card img {
  transition: transform 0.3s ease;
  will-change: transform;
}

.book-card:hover img {
  transform: scale(1.02);
}

/* Bio page animation */
@keyframes typewriter1 {
  from {
    width: 0;
  }
  to {
    width: calc(var(--characters) * 1ch);
  }
}

@keyframes fade-cursor {
  from {
    border-right-color: #e7bfbf;
  }
  to {
    border-right-color: transparent;
  }
}

.bio-animation h1:nth-child(1) {
  color: #355c7d;
  font-family: 'Fira Code', monospace;
  font-weight: 800;
  font-size: 1.5rem;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  display: block;
  max-width: 100%;
  --characters: 14;
  animation:
    typewriter1 2s steps(var(--characters), end) forwards,
    fade-cursor 1s ease 2s forwards;
  border-right: 2px solid #e7bfbf;
  width: 0;
}

.bio-animation h1:nth-child(2) {
  opacity: 0;
  font-family: "Work Sans", sans-serif;
  background: linear-gradient(to right, #bb8383, #e7bfbf);
  font-weight: 800;
  font-size: 3rem;
  display: inline-block;
  white-space: nowrap;
  overflow: hidden;
  max-width: 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.bio-fadein {
  font-family: 'Fira Code', monospace; /* Typewriter-style font */
  font-weight: 500;
  font-size: 1.2rem;
  opacity: 0;
  animation: fadeIn 1s ease-in forwards;
  animation-delay: 4.2s; /* Adjust based on bio-animation duration */
}  

/* Home Book Flip Animation */
@keyframes bookFlip {
  0% {
    transform: rotateY(90deg);
    opacity: 0;
  }
  100% {
    transform: rotateY(0deg);
    opacity: 1;
  }
}

.book-cover-animate {
  transform-style: preserve-3d;
  animation: bookFlip 1s ease-out forwards;
}

/* Rich Text Content */
.rich-text-output * {
  background-color: transparent !important;
}
