body {
  margin: 0;
  font-family: "Press Start 2P", monospace, sans-serif;
  background: black;
  color: white;
  overflow-x: hidden;
}

.parallax {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: -1;
  transform: translateZ(0);
  backface-visibility: hidden;

}

.layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 300%;
  height: 100%;
  background-repeat: repeat-x;
  background-position: 0 bottom;
  background-size: auto 100%;
  image-rendering: pixelated;
}

#layer1 { 
  background-image: url("forest/layer1.png"); 
  animation: seamlessScroll 120s linear infinite;
}
#layer2 { 
  background-image: url("forest/layer2.png"); 
  animation: seamlessScroll 80s linear infinite;
}
#layer3 { 
  background-image: url("forest/layer3.png"); 
  animation: seamlessScroll 50s linear infinite;
}
#layer4 { 
  background-image: url("forest/layer4.png"); 
  animation: seamlessScroll 30s linear infinite;
}
#layer5 { 
  background-image: url("forest/layer5.png"); 
  animation: seamlessScroll 16s linear infinite;
}

@keyframes seamlessScroll {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-33.333%, 0, 0); }
}

.layer {
  --scroll-distance: -33.333%;
}

h1 {
  position: relative;
  z-index: 10;
  margin: 40px auto;
  padding: 50px 100px;
  background-color: rgba(255, 192, 203, 0.7);
  color: white;
  font-size: 24px;
  text-align: center;
  border: 4px solid white;
  border-radius: 8px;
  width: fit-content;
  animation: float 3s ease-in-out infinite;
  will-change: transform;
  transform: translateZ(0);
}

@keyframes float {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -15px, 0); }
}

.debug-layer {
  border-left: 2px solid red;
  border-right: 2px solid blue;
}

@media (prefers-reduced-motion: reduce) {
  .layer {
    animation-duration: 240s;
  }
  h1 {
    animation: none;
  }
}

@media (max-width: 768px) {
  .layer {
    animation-duration: calc(var(--duration, 60s) * 1.5);
  }
}

.envelope-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 400px;
  height: 400px;
  transform: translate(-50%, -50%);
  border: none;
  background-image: url("PLove1.png");
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  image-rendering: pixelated;
  cursor: pointer;
  z-index: 20;
  background-color: transparent;
  animation: buttonFloat 4s ease-in-out infinite;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Enhanced floating animation */
@keyframes buttonFloat {
  0%, 100% { 
    transform: translate(-50%, -50%) rotate(0deg) scale(1);
  }
  25% { 
    transform: translate(-50%, -50%) rotate(1deg) scale(1.02);
  }
  50% { 
    transform: translate(-50%, -50%) rotate(0deg) scale(1.05);
  }
  75% { 
    transform: translate(-50%, -50%) rotate(-1deg) scale(1.02);
  }
}

.envelope-btn:hover {
  transform: translate(-50%, -50%) scale(1.1) rotate(2deg);
  filter: brightness(1.2);
  animation: buttonHover 0.6s ease-in-out infinite alternate;
}

@keyframes buttonHover {
  0% { transform: translate(-50%, -50%) scale(1.1) rotate(2deg); }
  100% { transform: translate(-50%, -50%) scale(1.12) rotate(-2deg); }
}

.envelope-btn:active {
  transform: translate(-50%, -50%) scale(0.95);
  filter: brightness(1.4) contrast(1.2);
}

.envelope-btn:hover::before {
  opacity: 1;
}

.letter-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 50;
}

.letter-content {
  background-color: rgba(255, 255, 255, 0.95);
  color: black;
  padding: 40px 60px;
  border: 4px solid pink;
  border-radius: 12px;
  max-width: 600px;
  max-height: 80vh;       /* limit height to 80% of viewport */
  overflow-y: auto;       /* enable vertical scrolling */
  text-align: center;
  font-size: 18px;
  font-family: "Press Start 2P", monospace;
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
  animation: fadeIn 0.5s ease forwards;
  line-height: 1.8;
}

.letter-content::-webkit-scrollbar {
  width: 10px;
}

.letter-content::-webkit-scrollbar-thumb {
  background-color: pink;
  border-radius: 5px;
}

.letter-content::-webkit-scrollbar-track {
  background: rgba(255, 192, 203, 0.2);
  border-radius: 5px;
}


#closeLetter {
  margin-top: 20px;
  padding: 10px 20px;
  font-family: "Press Start 2P", monospace;
  font-size: 16px;
  border: 2px solid pink;
  background-color: pink;
  color: white;
  cursor: pointer;
  border-radius: 6px;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.calendar {
  position: relative;
  z-index: 10;
  margin: 20px auto;
  padding: 20px;
  width: 600px;
  background-color: rgba(255,192,203,0.7);
  border: 4px solid white;
  border-radius: 12px;
  text-align: center;
  font-family: "Press Start 2P", monospace;
  color: white;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-gap: 8px;
  margin-top: 10px;
}

.day {
  width: 60px;
  height: 60px;
  background-color: pink;
  border: 2px solid white;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  font-family: "Press Start 2P", monospace;
  font-size: 14px;
  image-rendering: pixelated;
  user-select: none;
  transition: transform 0.2s, filter 0.2s;
}

.day:hover {
  transform: scale(1.1);
  filter: brightness(1.2);
}

.day.locked {
  background-color: rgba(255,192,203,0.3);
  cursor: default;
  filter: grayscale(80%);
}

.parallax-section {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 600px;
}

.calendar-section {
  background-color: #d2b48c;
  padding: 40px 20px;
  text-align: center;
  font-family: "Press Start 2P", monospace;
}

/* Calendar container */
#calendarDays {
  display: grid;
  grid-template-columns: repeat(7, 60px); /* 7 columns for 7 days */
  grid-gap: 8px;
  justify-content: center;
  margin-top: 20px;
  background-color: rgba(255, 192, 203, 0.85); /* opaque pink */
  padding: 20px;
  border: 4px solid white;
  border-radius: 12px;
  width: fit-content; /* shrink to content */
  margin-left: auto;
  margin-right: auto;
}

/* Each day */
.day {
  width: 60px;
  height: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #ffb6c1; /* solid pink */
  border: 2px solid white;
  cursor: pointer;
  font-size: 14px;
  color: white;
  user-select: none;
  transition: transform 0.2s, filter 0.2s;
  box-sizing: border-box;
}

.day:hover {
  transform: scale(1.1);
  filter: brightness(1.2);
}

.day.locked {
  background-color: rgba(255,182,193,0.5); /* lighter pink for locked days */
  cursor: default;
}

.never {
  opacity: 0;
}

.timer {
  position: absolute;      /* position relative to nearest positioned ancestor */
  top: 500px;              /* adjust this number until it's below the envelope */
  left: 50%;               /* center horizontally */
  transform: translateX(-50%);
  font-family: "Press Start 2P", monospace;
  font-size: 18px;
  color: white;
  text-align: center;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
  z-index: 10;             /* make sure it’s above parallax layers */
}

.highlight {
  font-weight: bold;
  text-decoration: underline;
  line-height: 2.4;
  color:rgb(246, 174, 198);
  text-shadow: 
    0 0 5px rgba(255, 146, 146, 0.4),  /* subtle white glow */
    0 0 10px rgba(255, 255, 255, 0.2); /* slightly bigger, more transparent glow */
  font-size: larger;
  animation: float 3s ease-in-out infinite;
  display: inline-block;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }  /* moves up slightly */
}

.neal-pixel-sprite {
  position: absolute;
  top: 50%;              /* align vertically with envelope */
  left: 40%;             /* start from center */
  width: 225px;          /* adjust size */
  height: auto;
  image-rendering: pixelated;
  z-index: 20;
  animation: spriteFloat 4s ease-in-out infinite;
}
.joanne-pixel-sprite {
  position: absolute;
  top: 50%;              /* align vertically with envelope */
  left: 99%;             /* start from center */
  width: 200px;          /* adjust size */
  height: auto;
  image-rendering: pixelated;
  z-index: 20;
  animation: spriteFloat 4s ease-in-out infinite;
}

/* floating animation like the envelope */
@keyframes spriteFloat {
  0%, 100% { transform: translate(-180%, -50%) rotate(0deg); }
  50% { transform: translate(-180%, -55%) rotate(-1deg); }
}

@keyframes spriteFloatJoanne {
  0%, 100% { transform: translate(-180%, -50%) rotate(0deg); }
  50% { transform: translate(-180%, -45%) rotate(1deg); }
}