/* =========================================
   1. INDEX (index.html)
   ========================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Georgia", serif;
}

html, body {
  min-height: 100%;
  width: 100%;
  background-color: #400000;
}

body {
  background-image: radial-gradient(circle at center, #630617, #400000);
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-size: cover;
  color: white;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto; 
  scroll-behavior: auto; 
}

.falling-hearts {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.falling-hearts span {
  position: absolute;
  top: -10%;
  font-size: 20px;
  animation: fall linear infinite;
  opacity: 0.9;
}

/* --- WAVE 1: (Range 0.5s to 6s) --- */
.falling-hearts span:nth-child(1)  { left: 95%;  animation-duration: 35s; animation-delay: 0.5s; }
.falling-hearts span:nth-child(2)  { left: 15%;  animation-duration: 33.5s; animation-delay: 2.1s; }
.falling-hearts span:nth-child(3)  { left: 25%;  animation-duration: 34s; animation-delay: 4.8s; }
.falling-hearts span:nth-child(4)  { left: 35%;  animation-duration: 33s; animation-delay: 1.2s; }
.falling-hearts span:nth-child(5)  { left: 85%;  animation-duration: 35s; animation-delay: 5.8s; }
.falling-hearts span:nth-child(6)  { left: 55%;  animation-duration: 34.5s; animation-delay: 0.8s; }
.falling-hearts span:nth-child(7)  { left: 65%;  animation-duration: 33s; animation-delay: 3.4s; }
.falling-hearts span:nth-child(8)  { left: 75%;  animation-duration: 34.5s; animation-delay: 1.9s; }
.falling-hearts span:nth-child(9)  { left: 45%;  animation-duration: 33s; animation-delay: 5.2s; }
.falling-hearts span:nth-child(10) { left: 5%;   animation-duration: 35s; animation-delay: 2.7s; }

/* Wave 1 Shadows (Range 3.5s to 6s) | Shifted to avoid clumping */
.falling-hearts span:nth-child(11) { left: 90%;  animation-duration: 35s; animation-delay: 3.5s; } 
.falling-hearts span:nth-child(12) { left: 10%;  animation-duration: 33.5s; animation-delay: 4.2s; } 
.falling-hearts span:nth-child(13) { left: 30%;  animation-duration: 34s; animation-delay: 3.9s; } 
.falling-hearts span:nth-child(14) { left: 60%;  animation-duration: 34.5s; animation-delay: 5.1s; } 
.falling-hearts span:nth-child(15) { left: 80%;  animation-duration: 33s; animation-delay: 4.6s; } 

/* --- WAVE 2: (Range 6.5s to 12s) --- */
.falling-hearts span:nth-child(16) { left: 10%;  animation-duration: 33s; animation-delay: 6.5s; }
.falling-hearts span:nth-child(17) { left: 80%;  animation-duration: 34.5s; animation-delay: 8.2s; }
.falling-hearts span:nth-child(18) { left: 30%;  animation-duration: 35s; animation-delay: 8.5s; }
.falling-hearts span:nth-child(19) { left: 70%;  animation-duration: 33s; animation-delay: 7.4s; }
.falling-hearts span:nth-child(20) { left: 50%;  animation-duration: 33.5s; animation-delay: 9.9s; }
.falling-hearts span:nth-child(21) { left: 60%;  animation-duration: 35s; animation-delay: 6.8s; }
.falling-hearts span:nth-child(22) { left: 40%;  animation-duration: 34.5s; animation-delay: 10.3s; }
.falling-hearts span:nth-child(23) { left: 25%;  animation-duration: 33.5s; animation-delay: 10.7s; }
.falling-hearts span:nth-child(24) { left: 90%;  animation-duration: 32.5s; animation-delay: 11.1s; }
.falling-hearts span:nth-child(25) { left: 2%;   animation-duration: 34.5s; animation-delay: 11.8s; }

/* Wave 2 Shadows (Range 9.5s to 12.5s) | Shifted based on proximity */
.falling-hearts span:nth-child(26) { left: 15%;  animation-duration: 34s; animation-delay: 9.6s; } 
.falling-hearts span:nth-child(27) { left: 75%;  animation-duration: 33.5s; animation-delay: 10.4s; } 
.falling-hearts span:nth-child(28) { left: 35%;  animation-duration: 35s; animation-delay: 12.5s; } 
.falling-hearts span:nth-child(29) { left: 65%;  animation-duration: 34s; animation-delay: 11.2s; } 
.falling-hearts span:nth-child(30) { left: 55%;  animation-duration: 33.5s; animation-delay: 10.8s; } 

/* --- WAVE 3: (Range 12.5s to 18s) --- */
.falling-hearts span:nth-child(31) { left: 10%;  animation-duration: 35s; animation-delay: 12.5s; }
.falling-hearts span:nth-child(32) { left: 90%;  animation-duration: 34.5s; animation-delay: 14.2s; }
.falling-hearts span:nth-child(33) { left: 30%;  animation-duration: 33.5s; animation-delay: 17.5s; }
.falling-hearts span:nth-child(34) { left: 70%;  animation-duration: 34.5s; animation-delay: 13.4s; }
.falling-hearts span:nth-child(35) { left: 50%;  animation-duration: 33.5s; animation-delay: 15.9s; }
.falling-hearts span:nth-child(36) { left: 60%;  animation-duration: 35s; animation-delay: 12.8s; }
.falling-hearts span:nth-child(37) { left: 40%;  animation-duration: 34.5s; animation-delay: 16.3s; }
.falling-hearts span:nth-child(38) { left: 20%;  animation-duration: 35s; animation-delay: 14.7s; }
.falling-hearts span:nth-child(39) { left: 80%;  animation-duration: 33s; animation-delay: 17.1s; }
.falling-hearts span:nth-child(40) { left: 2%;   animation-duration: 34.5s; animation-delay: 17.8s; }

/* Wave 3 Shadows (Range 15.5s to 18s) | Shifted away from active pioneers */
.falling-hearts span:nth-child(41) { left: 15%;  animation-duration: 35s; animation-delay: 15.5s; } 
.falling-hearts span:nth-child(42) { left: 85%;  animation-duration: 33.5s; animation-delay: 16.4s; } 
.falling-hearts span:nth-child(43) { left: 25%;  animation-duration: 34.5s; animation-delay: 18.0s; } 
.falling-hearts span:nth-child(44) { left: 75%;  animation-duration: 33.5s; animation-delay: 17.2s; } 
.falling-hearts span:nth-child(45) { left: 45%;  animation-duration: 34.5s; animation-delay: 16.8s; } 

/* --- WAVE 4: (Range 18.5s to 26s) --- SPREAD BY TIME & POSITION */
.falling-hearts span:nth-child(46) { left: 95%;  animation-duration: 35s; animation-delay: 18.5s; }
.falling-hearts span:nth-child(47) { left: 15%;  animation-duration: 33.5s; animation-delay: 21.5s; } /* Pushed from 20.2 */
.falling-hearts span:nth-child(48) { left: 55%;  animation-duration: 34.5s; animation-delay: 25.8s; } /* Pushed to end of range */
.falling-hearts span:nth-child(49) { left: 35%;  animation-duration: 35s; animation-delay: 19.8s; }
.falling-hearts span:nth-child(50) { left: 85%;  animation-duration: 33s; animation-delay: 23.2s; }
.falling-hearts span:nth-child(51) { left: 45%;  animation-duration: 34.5s; animation-delay: 18.8s; }
.falling-hearts span:nth-child(52) { left: 65%;  animation-duration: 35s; animation-delay: 24.5s; }
.falling-hearts span:nth-child(53) { left: 5%;   animation-duration: 33s; animation-delay: 20.2s; }
.falling-hearts span:nth-child(54) { left: 75%;  animation-duration: 34.5s; animation-delay: 20.4s; }
.falling-hearts span:nth-child(55) { left: 25%;  animation-duration: 33.5s; animation-delay: 25.1s; }

/* Wave 4 Shadows (Range 22.5s to 27s) | Timing spread to avoid neighbors */
.falling-hearts span:nth-child(56) { left: 90%;  animation-duration: 35s; animation-delay: 23.5s; } 
.falling-hearts span:nth-child(57) { left: 20%;  animation-duration: 34.5s; animation-delay: 26.8s; } 
.falling-hearts span:nth-child(58) { left: 50%;  animation-duration: 33.5s; animation-delay: 22.8s; } 
.falling-hearts span:nth-child(59) { left: 30%;  animation-duration: 35s; animation-delay: 24.2s; } 
.falling-hearts span:nth-child(60) { left: 80%;  animation-duration: 35s; animation-delay: 25.5s; }

/* --- WAVE 5: (Range 24.5s to 30s) --- */
.falling-hearts span:nth-child(61) { left: 10%;  animation-duration: 35s; animation-delay: 27.5s; }
.falling-hearts span:nth-child(62) { left: 20%;  animation-duration: 34.5s; animation-delay: 32.2s; }
.falling-hearts span:nth-child(63) { left: 30%;  animation-duration: 33.5s; animation-delay: 30.5s; }
.falling-hearts span:nth-child(64) { left: 40%;  animation-duration: 34.5s; animation-delay: 28.4s; }
.falling-hearts span:nth-child(65) { left: 50%;  animation-duration: 33.5s; animation-delay: 30.9s; }
.falling-hearts span:nth-child(66) { left: 60%;  animation-duration: 35s; animation-delay: 27.8s; }
.falling-hearts span:nth-child(67) { left: 70%;  animation-duration: 34.5s; animation-delay: 31.3s; }
.falling-hearts span:nth-child(68) { left: 80%;  animation-duration: 35s; animation-delay: 29.7s; }
.falling-hearts span:nth-child(69) { left: 90%;  animation-duration: 33s; animation-delay: 32.1s; }
.falling-hearts span:nth-child(70) { left: 2%;   animation-duration: 34.5s; animation-delay: 32.8s; }

/* Wave 5 Shadows (Range 27.5s to 30s) | Adjusted to mirror pioneers safely */
.falling-hearts span:nth-child(71) { left: 15%;  animation-duration: 35s; animation-delay: 30.6s; } 
.falling-hearts span:nth-child(72) { left: 65%;  animation-duration: 33.5s; animation-delay: 30.4s; } 
.falling-hearts span:nth-child(73) { left: 25%;  animation-duration: 34.5s; animation-delay: 33.0s; } 
.falling-hearts span:nth-child(74) { left: 85%;  animation-duration: 33.5s; animation-delay: 27.2s; } 
.falling-hearts span:nth-child(75) { left: 45%;  animation-duration: 34.5s; animation-delay: 33.8s; }
@keyframes fall {
  0%   { transform: translateY(0) rotate(0deg); opacity: 0; }
  10%  { opacity: 1; }
  100% { transform: translateY(120vh) rotate(360deg); opacity: 0; }
}

.heart-beat {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2;
}

.big-heart {
  width: 60vw;
  max-width: 300px;
  height: 60vw;
  max-height: 300px;
  background: #820e23;
  position: relative;
  transform: rotate(-45deg) translate(-15%, 15%) scale(0.9);
  box-shadow: 0 0 60px rgba(0,0,0,0.6);
  border-radius: 20px;
  animation: beat 3s ease-in-out infinite;
}

.big-heart::before, .big-heart::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  background: #820e23;
  border-radius: 50%;
}
.big-heart::before { top: -50%; left: 0; }
.big-heart::after { top: 0; left: 50%; }

@keyframes beat {
  0%, 100% { transform: rotate(-45deg) translate(-15%, 15%) scale(0.9); }
  50% { transform: rotate(-45deg) translate(-15%, 15%) scale(0.915); }
}

.heart-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48vw; 
  max-width: 240px; 
  text-align: center;
  z-index: 3;
}

.heart-text h1 {
  font-size: 7.5vw; 
  margin-bottom: 2.5vw;
  white-space: nowrap;
}

@media (min-width: 500px) {
  .heart-text h1 { font-size: 34px; margin-bottom: 1vw; }
}

.valentine-msg {
  width: 100%;
  text-align: left;
  margin-left: -12.5vw; 
  font-size: 6vw; 
  margin-bottom: 5vw;
  display: block;
  white-space: nowrap;
}

@media (min-width: 500px) {
  .valentine-msg { font-size: 32px; margin-left: -90px; margin-bottom: 2vw; }
}

.label {
  width: 100%;
  text-align: left; 
  font-size: 2.8vw; 
  margin-bottom: 0.2vw;
  padding-left: 2px;
  opacity: 0.9;
  font-style: italic;
  display: block;
}

@media (min-width: 500px) {
  .label { font-size: 14px; }
}

.heart-text input {
  width: 100%;
  padding: 1.8vw;
  border-radius: 8px;
  border: none;
  background: rgba(255,255,255,0.25);
  color: white;
  margin-bottom: 1.8vw;
  font-size: 3.5vw;
  text-align: center;
}

@media (min-width: 500px) {
  .heart-text input { font-size: 16px; padding: 10px; margin-bottom: 15px; }
}

.heart-text button {
  width: 70%;
  padding: 1.8vw;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #7b0018, #4a000d);
  color: white;
  cursor: pointer;
  font-size: 3.5vw;
}

@media (min-width: 500px) {
  .heart-text button { font-size: 16px; padding: 10px; }
}

/* =========================================
   2. BOTH (Shared by Story and Eyes)
   ========================================= */
.story-body {
    display: flex;
    flex-direction: column;
    align-items: center; 
    padding-top: 15vh;
    min-height: 100vh;
}

.glass-box {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 25px;
    padding: 30px 20px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    width: 100%;
    position: relative;
    z-index: 11;
}

.title-pressable {
    font-size: clamp(24px, 10cqi, 42px); 
    margin-bottom: 2vh;
    color: #fff;
    cursor: pointer;
    user-select: none;
}

.message-text {
    font-size: clamp(16px, 5.2cqi, 22px); 
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    text-align: right;
    white-space: pre-wrap;
    max-width: 40ch;
    margin: 0 auto;
}

.skip-heart {
    position: absolute;
    top: 15px;
    font-size: 18px;
    cursor: pointer;
    user-select: none;
    opacity: 0.6;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 15;
}

.skip-heart:hover {
    opacity: 1;
    transform: scale(1.2);
}

.skip-heart.left { left: 15px; }
.skip-heart.right { right: 15px; }

/* =========================================
   3. STORY (story.html Only)
   ========================================= */
.glass-container {
    width: 85vw;
    max-width: 500px;
    position: relative; 
    z-index: 10;
    transition: margin-top 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.floating-img-wrap {
    position: absolute;
    top: 0;
    left: 50%;
    width: 0;
    height: 0;
    z-index: 5;
    overflow: hidden;
    pointer-events: auto; 
}

.floating-img {
    width: 100%;
    height: 100%;
    opacity: 0; 
    object-fit: cover;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    display: block;
    transition: opacity 0.5s;
}

.start-button {
    background: linear-gradient(135deg, #8b0000, #5a0000);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px 45px;
    border-radius: 30px;
    font-size: 1.1rem;
    margin-top: 20px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    animation: fadeIn 0.8s ease-out forwards;
}

.start-button::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.3), transparent);
    transform: skewX(-25deg);
    transition: left 0.5s ease;
}

.start-button:hover::before { 
    left: 150%; 
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes popUL {
    0% { width: 0; height: 0; opacity: 0; transform: translate(-50%, 0) scale(0); }
    100% { width: 44%; height: 130px; opacity: 1; transform: translate(-105%, -280px) scale(1); }
}
@keyframes popUR {
    0% { width: 0; height: 0; opacity: 0; transform: translate(-50%, 0) scale(0); }
    100% { width: 44%; height: 130px; opacity: 1; transform: translate(5%, -280px) scale(1); }
}
@keyframes popLL {
    0% { width: 0; height: 0; opacity: 0; transform: translate(-50%, 0) scale(0); }
    100% { width: 44%; height: 130px; opacity: 1; transform: translate(-105%, -140px) scale(1); }
}
@keyframes popLR {
    0% { width: 0; height: 0; opacity: 0; transform: translate(-50%, 0) scale(0); }
    100% { width: 44%; height: 130px; opacity: 1; transform: translate(5%, -140px) scale(1); }
}

@media (max-height: 600px) {
    @keyframes popUL {
        0% { width: 0; height: 0; opacity: 0; transform: translate(-50%, 0) scale(0); }
        100% { width: 44%; height: 90px; opacity: 1; transform: translate(-105%, -200px) scale(1); }
    }
    @keyframes popUR {
        0% { width: 0; height: 0; opacity: 0; transform: translate(-50%, 0) scale(0); }
        100% { width: 44%; height: 90px; opacity: 1; transform: translate(5%, -200px) scale(1); }
    }
    @keyframes popLL {
        0% { width: 0; height: 0; opacity: 0; transform: translate(-50%, 0) scale(0); }
        100% { width: 44%; height: 90px; opacity: 1; transform: translate(-105%, -100px) scale(1); }
    }
    @keyframes popLR {
        0% { width: 0; height: 0; opacity: 0; transform: translate(5%, -100px) scale(1); }
    }
}

/* =========================================
   4. EYES (eyes.html Only)
   ========================================= */
.button-group {
    margin-top: 25px;
    display: none; 
    gap: 15px;
    justify-content: center;
}

.nav-btn {
    background: linear-gradient(135deg, #8b0000, #5a0000);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px 45px;
    border-radius: 30px;
    font-size: 1.1rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    display: inline-block;
    transition: transform 0.3s ease;
}

.nav-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.3), transparent);
    transform: skewX(-25deg);
    transition: left 0.5s ease;
}

.nav-btn:hover::before { 
    left: 150%; 
}

.nav-btn:hover {
    transform: translateY(-2px);
}


