* {
  box-sizing: border-box;
}

body {
  margin: 0;
  display: flex;
  min-height: 100dvh;
  perspective: 1000px;
  font: 1em/1.4 "Poppins", sans-serif;
  overflow: hidden;
  color: hsl(180 68% 5%);
  background-image: radial-gradient(
    circle farthest-corner at 50% 50%,
    hsl(187 20% 88%) 30%,
    hsl(149 20% 94%) 100%
  );
}

.book {
  position: relative;
  display: flex;
  margin: auto;
  width: 40cqmin;
  /*1* let pointer event go trough pages of lower Z than .book */
  pointer-events: none;
  transform-style: preserve-3d;
  transition: translate 1s;
  translate: calc(min(var(--c), 1) * 50%) 0%;
  /* Incline on the X axis for pages preview */
  rotate: 1 0 0 30deg;
}

.page {
  /* PS: Don't go below thickness 0.5 or the pages might transpare */
  --thickness: 4;
  flex: none;
  display: flex;
  width: 100%;
  font-size: 2cqmin;
  /*1* allow pointer events on pages */
  pointer-events: all;
  user-select: none;
  transform-style: preserve-3d;
  transform-origin: left center;
  transition: transform 1s,
    rotate 1s ease-in
      calc((min(var(--i), var(--c)) - max(var(--i), var(--c))) * 50ms);
  translate: calc(var(--i) * -100%) 0px 0px;
  transform: translateZ(
    calc((var(--c) - var(--i) - 0.5) * calc(var(--thickness) * 0.23cqmin))
  );
  rotate: 0 1 0 calc(clamp(0, var(--c) - var(--i), 1) * -180deg);
}

.front,
.back {
  position: relative;
  flex: none;
  width: 100%;
  backface-visibility: hidden;
  overflow: hidden;
  background-color: #fff;
  /* Fix backface visibility Firefox: */
  translate: 0px;
}

.back {
  translate: -100% 0;
  rotate: 0 1 0 180deg;
}

/* That's it. Your FlipBook customization styles: */

.book {
  counter-reset: page -1;
  & a {
    color: inherit;
  }
}

.page {
  box-shadow: 0em 0.5em 1em -0.2em #00000020;
}

.front,
.back {
  display: flex;
  flex-flow: column wrap;
  justify-content: space-between;
  padding: 2em;
  border: 1px solid #0002;

  &:has(img) {
    padding: 0;
  }

  & img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  &::after {
    position: absolute;
    bottom: 1em;
    counter-increment: page;
    content: counter(page) ".";
    font-size: 0.8em;
  }
}
.cover {
  &::after {
    content: "";
  }
}
.front {
  &::after {
    right: 1em;
  }
  background: linear-gradient(to left, #f7f7f7 80%, #eee 100%);
  border-radius: 0.1em 0.5em 0.5em 0.1em;
}
.back {
  &::after {
    left: 1em;
  }
  background-image: linear-gradient(to right, #f7f7f7 80%, #eee 100%);
  border-radius: 0.5em 0.1em 0.1em 0.5em;
}

.cover {
  background: radial-gradient(
      circle farthest-corner at 80% 20%,
      hsl(150 80% 20% / 0.3) 0%,
      hsl(170 60% 10% / 0.1) 100%
    ),
    hsl(231, 32%, 29%) url("./33.jpg") 50% / cover;
  color: hsl(0, 0%, 100%);
}
.cover2 {
  background: radial-gradient(
      circle farthest-corner at 80% 20%,
      hsl(150 80% 20% / 0.3) 0%,
      hsl(170 60% 10% / 0.1) 100%
    ),
    hsl(231, 32%, 29%) url("./3.jpg") 50% / cover;
  color: hsl(0, 0%, 100%);
}

/* Elegant Waitlist Button */
.waitlist-link {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  
  /* Vintage paper aesthetic */
  background: linear-gradient(135deg, #f4e8d0 0%, #e8dcc8 100%);
  color: #2c1810;
  
  /* Elegant border */
  border: 2px solid #8b2e2e;
  box-shadow: 
    0 4px 12px rgba(44, 24, 16, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 0 0 1px rgba(139, 46, 46, 0.1);
  
  /* Typography */
  font-family: 'Crimson Text', serif;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-decoration: none;
  
  /* Spacing */
  padding: 0.85rem 2.5rem;
  border-radius: 6px;
  
  /* Smooth transitions */
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Subtle texture */
  background-image: 
    linear-gradient(135deg, #f4e8d0 0%, #e8dcc8 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' /%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
}

.waitlist-link:hover {
  transform: translateX(-50%) translateY(-3px);
  box-shadow: 
    0 8px 20px rgba(44, 24, 16, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 0 0 1px rgba(139, 46, 46, 0.2);
  background: linear-gradient(135deg, #fff8e7 0%, #f4e8d0 100%);
  border-color: #6b1e1e;
}

.waitlist-link:active {
  transform: translateX(-50%) translateY(-1px);
  box-shadow: 
    0 3px 8px rgba(44, 24, 16, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.waitlist-text {
  display: inline-block;
  position: relative;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .waitlist-link {
    bottom: 1.5rem;
    padding: 0.7rem 1.8rem;
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {
  .waitlist-link {
    bottom: 1rem;
    padding: 0.6rem 1.5rem;
    font-size: 0.85rem;
    letter-spacing: 0.3px;
  }
}
