body {
  background-color: #6e0d4d;
  color: #6915c2;
  font-family: Comic Sans MS;
  margin: 0;
  overflow-x: hidden;
}
.fly-out-text span {
  display: inline-block;
  animation: splitOut linear forwards;
  animation-timeline: --section;
  animation-range: exit;
  
  /* This applies the outline to all words */
  color: White; 
  text-shadow: 
    -2px -2px 0 #000,  
     2px -2px 0 #000,
    -2px  2px 0 #000,
     2px  2px 0 #000;
}

.heart-content p {
  color: white; /* Interior color */
  font-size: 15px;
  font-weight: bold;
  /* Adjust the color (#000) or thickness (2px) below */
  text-shadow: 
    -2px -2px 0 #000,  
     2px -2px 0 #000,
    -2px  2px 0 #000,
     2px  2px 0 #000;
}

/* Section for the text that flies away */
.hero-section {
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  view-timeline-name: --section;
}

.fly-out-text span {
  display: inline-block;
  animation: splitOut linear forwards;
  animation-timeline: --section;
  animation-range: exit;
}

/* Give each word a slightly different direction */
.fly-out-text span:nth-child(1) { --x: -600px; --r: 720deg; }
.fly-out-text span:nth-child(2) { --x: 400px; --r: -1080deg; }
.fly-out-text span:nth-child(3) { --x: -300px; --r: 1440deg; }
.fly-out-text span:nth-child(4) { --x: 700px; --r: -1800deg; }

@keyframes splitOut {
  0% {
    transform: translate(0, 0) rotate(0deg) scale(1);
    opacity: 1;
  }
  30% {
    transform: translate(calc(var(--x) / 4), -200px) rotate(calc(var(--r) / 4)) scale(5);
    opacity: 1; /* Stay visible at the start of the zoom */
  }
  70% {
    opacity: 0.5; /* Start fading fast here */
  }
  100% {
    transform: translate(var(--x), -2000px) rotate(var(--r)) scale(40);
    opacity: 0; /* Fully invisible at the end */
  }
}


.card img { 
  width: 250px; 
  height: auto;
  display: block;
}

.card p {
  margin-top: 10px;
  font-weight: bold;
}

/* Floating Animation */
@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-20px); }
  100% { transform: translateY(0px); }
}

.card {
  cursor: pointer;
  animation: float 4s ease-in-out infinite;
}

/* Different float speeds for variety */
.middle { animation-delay: 1s; }
.top-right { animation-delay: 2s; }

/* Text Bubble Styling */
.text-bubble {
  display: none;
  background: white;
  border: 2px solid black;
  border-radius: 15px;
  padding: 10px;
  position: absolute;
  top: -50px;
  left: 50%;
  transform: translateX(-50%);
  width: 150px;
  z-index: 10;
  box-shadow: 5px 5px 0px black;
}

.image-gallery::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  /* Layers the 3 flowers with different spacing and sizes to look messy */
  background-image: 
    url('peonie1.png'), 
    url('peonie2.png'), 
    url('peonie3.png'),
    url('peonie1.png');
  background-size: 60px, 130px, 90px, 110px;
  /* Random horizontal offsets to break the "strip" look */
  background-position: 15% 0, 45% 0, 75% 0, 95% 0;
  background-repeat: repeat;
  animation: messyRain 12s linear infinite;
  filter: drop-shadow(0 0 5px rgba(0,0,0,0.1));
}

@keyframes messyRain {
  0% { 
    background-position: 15% 0, 45% 0, 75% 0, 95% 0; 
  }
  100% { 
    /* Different Y values create different falling speeds */
    background-position: 15% 1200px, 45% 800px, 75% 1500px, 95% 1000px; 
  }
}

/* Container to define the scroll track */
.scrolling-bubble-container {
  height: 150vh; /* Adjust height to control how long the scroll takes */
  view-timeline-name: --zoom-scroll;
  view-timeline-axis: block;
  position: relative;
  overflow: hidden;
}

.zoom-bubble {
  position: fixed;
  top: 70%;
  left: -200px; /* Start off-screen left */
  background: white;
  border: 3px solid black;
  border-radius: 50px;
  padding: 15px 30px;
  font-family: "Comic Sans MS", cursive;
  font-weight: bold;
  box-shadow: 8px 8px 0px black;
  z-index: 50;
  
  /* Link animation to the scroll timeline */
  animation: zoomAcross linear forwards;
  animation-timeline: --zoom-scroll;
  animation-range: entry 0% exit 100%;
}

@keyframes zoomAcross {
  0% {
    transform: translateX(0vw) scale(0.5);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  100% {
    transform: translateX(120vw) scale(3); /* Zooms large as it hits the right */
    opacity: 0;
  }
}

/* --- Heart Styles --- */
.heart-container {
  height: 300px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  margin: 50px 0;
}

.heart-wrapper {
  position: relative;
  width: 200px;
  height: 200px;
}

.heart-half {
  position: absolute;
  width: 100px;
  height: 160px;
  background: #db3742;
  border-radius: 50px 50px 0 0;
  transition: transform 0.8s ease-in-out;
  z-index: 2;
}

.left {
  left: 0;
  transform: rotate(-45deg);
  transform-origin: 100% 100%;
}

.right {
  left: 100px;
  transform: rotate(45deg);
  transform-origin: 0% 100%;
}

.heart-content {
  position: absolute;
  top: 20%;
  left: 0;
  width: 100%;
  text-align: center;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.5s;
}

/* Open Heart State */
.heart-container.open .left { transform: rotate(-120deg); }
.heart-container.open .right { transform: rotate(120deg); }
.heart-container.open .heart-content { opacity: 1; transition-delay: 0.4s; }

/* --- Collage Styles --- */
.collage-block {
  display: flex;
  margin: 50px auto;
  width: 90%;
  max-width: 1000px;
  background: rgba(255, 255, 255, 0.6); /* Semi-transparent */
  border: 4px solid black;
  padding: 20px;
  box-shadow: 15px 15px 0px rgba(0,0,0,0.1);
}

.collage-left {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-gap: 10px;
  padding-right: 20px;
}

.collage-left img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  border: 2px solid black;
}

/* Make some images bigger for the "collage" look */
.c-1 { grid-column: span 2; grid-row: span 2; height: 210px !important; }

.collage-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.letter-box {
  max-width: 800px;
  margin: 60px auto;
  background: #fffdf5; /* Off-white paper color */
  border-left: 10px solid #ba41a6; /* Red "margin" line style */
  border-top: 2px solid #ddd;
  border-right: 2px solid #ddd;
  border-bottom: 2px solid #ddd;
  padding: 40px;
  box-shadow: 10px 10px 0px rgba(0, 0, 0, 0.05); /* Soft shadow */
  position: relative;
  transform: rotate(-1deg); /* Slight tilt for a natural look */
}

.letter-inner {
  font-family: "Comic Sans MS", cursive;
  line-height: 1.8;
  color: #333;
}

.letter-inner h2 {
  margin-top: 0;
  color: #ba41a6;
  /* Applying the outline style you like */
  text-shadow: 1px 1px 0px #000;
}

.letter-inner p {
  font-size: 18px;
  margin-bottom: 20px;
}

.signature {
  text-align: right;
  font-size: 22px;
  font-weight: bold;
  margin-top: 40px;
}

/* Update the gallery container */
.image-gallery {
  display: flex;
  flex-direction: column; /* Stacks bubble container and peonies */
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  position: relative;
}

/* The transparent box behind the peonies */
.peonie-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 50px; /* Space between flowers */
  padding: 40px;
  background: rgba(255, 255, 255, 0.15); /* Transparent white */
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 30px;
  backdrop-filter: blur(8px); /* Blurs the rain behind the box */
  z-index: 5;
}

/* Reset the cards so they don't use old corner positions */
.card {
  position: relative !important; 
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  transform: none !important;
  cursor: pointer;
  animation: float 4s ease-in-out infinite;
}

.wrap-container {
  width: 300px;
  height: 400px;
  margin: 50px auto;
  perspective: 1000px;
  cursor: pointer;
}

.wrap-card {
  width: 100%;
  height: 100%;
  position: relative;
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

/* When clicked, it rotates and shrinks slightly to "wrap" */
.wrap-container.flipped .wrap-card {
  transform: rotateY(180deg) scale(0.9);
}

.wrap-front, .wrap-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border-radius: 15px;
  overflow: hidden;
}

.wrap-front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 3px solid black;
}

.wrap-back {
  transform: rotateY(180deg);
}

.translucent-box {
  width: 90%;
  padding: 20px;
  background: rgba(255, 255, 255, 0.2); /* Translucent background */
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 10px;
  color: white;
  text-align: center;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
  font-size: 18px;
}

.click-hint {
  position: absolute;
  bottom: 10px;
  background: rgba(0,0,0,0.6);
  color: white;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 12px;
}

.bookmark-tab {
  position: fixed;
  bottom: -250px; /* Hide most of it below the screen */
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 300px;
  background: #ff4d4d;
  color: white;
  transition: bottom 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 1000;
  border-radius: 5px 5px 0 0;
  box-shadow: 0 -5px 15px rgba(0,0,0,0.3);
  cursor: pointer;
  padding: 15px;
  text-align: center;
}

/* The visible part before pulling */
.bookmark-pull {
  height: 40px;
  font-weight: bold;
  font-size: 14px;
  line-height: 20px;
}

/* When clicked, the bottom position changes */
.bookmark-tab.pulled {
  bottom: 0px;
}

.bookmark-content h3 {
  margin-top: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.3);
  padding-bottom: 5px;
}

.bookmark-content p {
  font-size: 14px;
  line-height: 1.5;
  margin-top: 15px;
}

/* The little tassel at the bottom (top when pulled) */
.bookmark-tassel {
  width: 4px;
  height: 40px;
  background: gold;
  margin: 20px auto 0;
  position: relative;
}

.bookmark-tassel::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: -8px;
  width: 20px;
  height: 20px;
  background: gold;
  border-radius: 50%;
}

/* The Dimmer Layer */
.scroll-dimmer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #000; /* Black (or use #2e0521 for dark purple) */
  z-index: -1; /* Sits above the rain, but below the text/cards */
  pointer-events: none; /* Allows you to still click everything */
  
  /* Link to the global scroll */
  opacity: 0;
  animation: darkenBackground linear forwards;
  animation-timeline: scroll();
}

@keyframes darkenBackground {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 0.4; /* Your requested 40% opacity */
  }
}