/* =========================================
   LOVE QUEST
   FIRST SCREEN
   ========================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
}

body {
    overflow: hidden;

    font-family:
        "Segoe UI",
        Arial,
        sans-serif;

    color: white;

    background:
        radial-gradient(
            circle at 50% 45%,
            #3d1638 0%,
            #1d0c24 38%,
            #08050d 80%
        );
}


/* =========================================
   MAIN HERO
   ========================================= */

.hero {
    position: relative;

    width: 100%;
    height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;

    overflow: hidden;

    isolation: isolate;
}


/* =========================================
   BACKGROUND GLOW
   ========================================= */

.glow {
    position: absolute;

    width: 450px;
    height: 450px;

    border-radius: 50%;

    background:
        radial-gradient(
            circle,
            rgba(255, 90, 180, 0.22),
            rgba(255, 90, 180, 0.05) 45%,
            transparent 70%
        );

    filter: blur(20px);

    animation: glowPulse 6s ease-in-out infinite;

    z-index: -2;
}


/* =========================================
   EXTRA BACKGROUND LIGHT
   ========================================= */

.hero::before {
    content: "";

    position: absolute;

    width: 100%;
    height: 100%;

    background:
        radial-gradient(
            circle at 15% 80%,
            rgba(180, 70, 255, 0.10),
            transparent 25%
        ),

        radial-gradient(
            circle at 85% 20%,
            rgba(255, 80, 170, 0.10),
            transparent 25%
        );

    z-index: -3;
}


/* =========================================
   MAIN CONTENT
   ========================================= */

.hero-content {
    position: relative;

    width: min(900px, 90%);

    text-align: center;

    z-index: 5;

    animation: contentAppear 1.5s ease forwards;
}


/* =========================================
   SMALL TITLE
   ========================================= */

.small-title {
    margin-bottom: 28px;

    font-size: 0.72rem;

    letter-spacing: 6px;

    color: #dca6ca;

    animation: fadeUp 1s ease 0.2s both;
}


/* =========================================
   MAIN TITLE
   ========================================= */

h1 {
    font-family: Georgia, "Times New Roman", serif;

    font-size: clamp(
        3.2rem,
        7vw,
        6.5rem
    );

    line-height: 0.98;

    font-weight: 400;

    letter-spacing: -2px;

    background:
        linear-gradient(
            120deg,
            #ffffff 10%,
            #ffd1e8 45%,
            #ffffff 80%
        );

    background-size: 200% auto;

    -webkit-background-clip: text;
    background-clip: text;

    color: transparent;

    animation:
        fadeUp 1s ease 0.45s both,
        shimmer 7s linear infinite;
}


/* =========================================
   SUBTITLE
   ========================================= */

.subtitle {
    margin-top: 30px;

    font-size: 1rem;

    color: rgba(255, 255, 255, 0.55);

    letter-spacing: 1px;

    animation: fadeUp 1s ease 0.7s both;
}


/* =========================================
   BUTTON
   ========================================= */

#beginBtn {
    position: relative;

    margin-top: 45px;

    padding: 16px 30px;

    display: inline-flex;
    align-items: center;
    gap: 14px;

    border: 1px solid rgba(255, 255, 255, 0.18);

    border-radius: 50px;

    background:
        rgba(255, 255, 255, 0.07);

    backdrop-filter: blur(12px);

    color: white;

    font-size: 0.9rem;

    letter-spacing: 1.5px;

    cursor: pointer;

    transition:
        transform 0.35s ease,
        background 0.35s ease,
        box-shadow 0.35s ease,
        border-color 0.35s ease;

    animation: fadeUp 1s ease 0.95s both;
}


#beginBtn span {
    font-size: 1.2rem;

    transition:
        transform 0.35s ease;
}


#beginBtn:hover {
    transform: translateY(-5px);

    background:
        rgba(255, 100, 180, 0.15);

    border-color:
        rgba(255, 180, 220, 0.4);

    box-shadow:
        0 15px 45px rgba(255, 80, 170, 0.18);
}


#beginBtn:hover span {
    transform: translateX(5px);
}


#beginBtn:active {
    transform: translateY(-2px) scale(0.98);
}


/* =========================================
   FLOATING HEARTS
   ========================================= */

.hearts {
    position: absolute;

    inset: 0;

    overflow: hidden;

    pointer-events: none;

    z-index: 1;
}


.hearts span {
    position: absolute;

    bottom: -80px;

    left: 50%;

    color: rgba(255, 130, 190, 0.35);

    font-size: 20px;

    filter:
        drop-shadow(
            0 0 8px rgba(255, 80, 170, 0.25)
        );

    animation:
        heartFloat
        var(--duration)
        linear
        infinite;

    animation-delay:
        var(--delay);
}


/* Individual hearts */

.hearts span:nth-child(1) {
    left: 5%;
    font-size: 14px;
    --duration: 11s;
    --delay: -2s;
}

.hearts span:nth-child(2) {
    left: 15%;
    font-size: 23px;
    --duration: 15s;
    --delay: -8s;
}

.hearts span:nth-child(3) {
    left: 27%;
    font-size: 12px;
    --duration: 10s;
    --delay: -5s;
}

.hearts span:nth-child(4) {
    left: 39%;
    font-size: 27px;
    --duration: 14s;
    --delay: -11s;
}

.hearts span:nth-child(5) {
    left: 50%;
    font-size: 16px;
    --duration: 12s;
    --delay: -3s;
}

.hearts span:nth-child(6) {
    left: 61%;
    font-size: 24px;
    --duration: 16s;
    --delay: -9s;
}

.hearts span:nth-child(7) {
    left: 73%;
    font-size: 13px;
    --duration: 10s;
    --delay: -6s;
}

.hearts span:nth-child(8) {
    left: 82%;
    font-size: 28px;
    --duration: 13s;
    --delay: -12s;
}

.hearts span:nth-child(9) {
    left: 91%;
    font-size: 17px;
    --duration: 15s;
    --delay: -4s;
}

.hearts span:nth-child(10) {
    left: 47%;
    font-size: 10px;
    --duration: 9s;
    --delay: -7s;
}


/* =========================================
   BOTTOM SYMBOL
   ========================================= */

.scroll-hint {
    position: absolute;

    bottom: 30px;
    left: 50%;

    transform: translateX(-50%);

    color: rgba(255, 255, 255, 0.3);

    font-size: 15px;

    animation:
        hintPulse
        2.5s
        ease-in-out
        infinite;
}


/* =========================================
   ANIMATIONS
   ========================================= */

@keyframes contentAppear {

    from {
        opacity: 0;
        transform: scale(0.96);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}


@keyframes fadeUp {

    from {
        opacity: 0;
        transform: translateY(25px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


@keyframes shimmer {

    0% {
        background-position: 200% center;
    }

    100% {
        background-position: -200% center;
    }
}


@keyframes glowPulse {

    0%,
    100% {
        transform: scale(0.9);
        opacity: 0.6;
    }

    50% {
        transform: scale(1.2);
        opacity: 1;
    }
}


@keyframes heartFloat {

    0% {
        transform:
            translateY(0)
            translateX(0)
            rotate(0deg)
            scale(0.8);

        opacity: 0;
    }

    10% {
        opacity: 0.8;
    }

    50% {
        transform:
            translateY(-50vh)
            translateX(25px)
            rotate(25deg)
            scale(1);
    }

    90% {
        opacity: 0.5;
    }

    100% {
        transform:
            translateY(-115vh)
            translateX(-30px)
            rotate(-20deg)
            scale(0.7);

        opacity: 0;
    }
}


@keyframes hintPulse {

    0%,
    100% {
        opacity: 0.25;
        transform:
            translateX(-50%)
            translateY(0);
    }

    50% {
        opacity: 0.8;
        transform:
            translateX(-50%)
            translateY(-8px);
    }
}


/* =========================================
   MOBILE
   ========================================= */

@media (max-width: 600px) {

    .small-title {
        font-size: 0.6rem;
        letter-spacing: 4px;
    }

    h1 {
        font-size: 3.2rem;
        letter-spacing: -1px;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    #beginBtn {
        padding: 14px 25px;
    }

    .glow {
        width: 300px;
        height: 300px;
    }
}
/* =========================================
   SCENE 2 — LETTER
   ========================================= */

.letter-scene {
    position: fixed;

    inset: 0;

    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: center;

    text-align: center;

    background:
        radial-gradient(
            circle at 50% 50%,
            #35152f 0%,
            #180b1d 42%,
            #07050b 85%
        );

    opacity: 0;
    visibility: hidden;

    transition:
        opacity 1s ease,
        visibility 1s ease;

    z-index: 20;
}


/* Scene becomes visible */

.letter-scene.active {
    opacity: 1;
    visibility: visible;
}


/* Background glow */

.letter-background-glow {
    position: absolute;

    width: 500px;
    height: 500px;

    border-radius: 50%;

    background:
        radial-gradient(
            circle,
            rgba(255, 80, 170, 0.18),
            transparent 65%
        );

    filter: blur(30px);

    animation:
        letterGlow 5s ease-in-out infinite;

    pointer-events: none;
}


/* Title */

.letter-title {
    position: relative;

    margin-bottom: 55px;

    font-size: 0.7rem;

    letter-spacing: 5px;

    color: #d9a4ca;

    animation:
        letterTitleAppear
        1s ease
        both;
}


/* =========================================
   ENVELOPE
   ========================================= */

.envelope {
    position: relative;

    width: 340px;
    height: 220px;

    cursor: pointer;

    perspective: 1000px;

    filter:
        drop-shadow(
            0 30px 35px rgba(0, 0, 0, 0.5)
        );

    transition:
        transform 0.4s ease;
}


/* Hover */

.envelope:hover {
    transform:
        translateY(-8px)
        scale(1.02);
}


/* =========================================
   ENVELOPE BACK
   ========================================= */

.envelope-back {
    position: absolute;

    inset: 0;

    border-radius: 10px;

    background:
        linear-gradient(
            135deg,
            #70284c,
            #a43c68
        );

    box-shadow:
        inset 0 0 20px rgba(255,255,255,0.05);

    z-index: 1;
}


/* =========================================
   LETTER
   ========================================= */

.letter {
    position: absolute;

    left: 25px;
    top: 18px;

    width: 290px;
    height: 185px;

    z-index: 2;

    background:
        linear-gradient(
            135deg,
            #fffafd,
            #f6e6ef
        );

    border-radius: 5px;

    color: #54243e;

    z-index: 2;

    display: flex;

    align-items: center;
    justify-content: center;

    transition:
        transform 0.9s
        cubic-bezier(.2,.8,.2,1),

        box-shadow 0.5s ease;
}


/* Letter text */

.letter-content {
    opacity: 0;

    transform:
        translateY(10px);

    transition:
        opacity 0.5s ease 0.5s,
        transform 0.5s ease 0.5s;
}


.tiny-heart {
    font-size: 28px;

    color: #c54b7c;

    margin-bottom: 12px;
}


.letter-content p {
    font-family:
        Georgia,
        "Times New Roman",
        serif;

    font-size: 1rem;

    line-height: 1.6;

    font-style: italic;
}


/* =========================================
   ENVELOPE FRONT
   ========================================= */

.envelope-front {
    position: absolute;

    inset: 0;

    border-radius: 10px;

    background:
        linear-gradient(
            135deg,
            #853054,
            #b94370
        );

    clip-path:
        polygon(
            0 0,
            50% 55%,
            100% 0,
            100% 100%,
            0 100%
        );

    z-index: 4;
}


/* =========================================
   ENVELOPE FLAP
   ========================================= */

.envelope-flap {
    position: absolute;

    top: 0;
    left: 0;

    width: 100%;
    height: 115px;

    background:
        linear-gradient(
            135deg,
            #a43a65,
            #c44a78
        );

    clip-path:
        polygon(
            0 0,
            100% 0,
            50% 100%
        );

    transform-origin: top center;

    transition:
        transform 0.8s
        cubic-bezier(.2,.8,.2,1);

    z-index: 5;
}


/* =========================================
   OPEN ENVELOPE
   ========================================= */

.envelope.open .envelope-flap {
    transform:
        rotateX(180deg);
}


.envelope.open .letter {
    transform: translateY(-145px);

    z-index: 10;

    box-shadow:
        0 25px 50px
        rgba(0, 0, 0, 0.35);
}

.envelope.open .letter-content {
    opacity: 1;

    transform:
        translateY(0);
}


/* =========================================
   CLICK MESSAGE
   ========================================= */

.click-envelope {
    position: relative;

    margin-top: 70px;

    font-size: 0.75rem;

    letter-spacing: 3px;

    color:
        rgba(255,255,255,0.4);

    animation:
        clickPulse
        2s
        ease-in-out
        infinite;
}


/* =========================================
   ANIMATIONS
   ========================================= */

@keyframes letterGlow {

    0%,
    100% {
        transform: scale(0.9);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.15);
        opacity: 1;
    }
}


@keyframes letterTitleAppear {

    from {
        opacity: 0;
        transform:
            translateY(20px);
    }

    to {
        opacity: 1;
        transform:
            translateY(0);
    }
}


@keyframes clickPulse {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 0.8;
    }
}


/* =========================================
   MOBILE
   ========================================= */

@media (max-width: 600px) {

    .envelope {
        transform:
            scale(0.82);
    }

    .envelope:hover {
        transform:
            translateY(-5px)
            scale(0.84);
    }

    .letter-title {
        font-size: 0.6rem;
        letter-spacing: 3px;
    }
}
/* =========================================
   OPENED LETTER CONTENT
   ========================================= */

.letter-content {
    width: 100%;
    padding: 30px;

    text-align: center;

    opacity: 0;

    transform: translateY(15px);

    transition:
        opacity 0.7s ease 0.6s,
        transform 0.7s ease 0.6s;
}

.envelope.open .letter-content {
    opacity: 1;
    transform: translateY(0);
}


/* HEART */

.tiny-heart {
    font-size: 25px;

    color: #c54b7c;

    margin-bottom: 12px;
}


/* GREETING */

.letter-greeting {
    margin-bottom: 12px;

    font-family:
        Georgia,
        "Times New Roman",
        serif;

    font-size: 1.3rem;

    color: #54243e;
}


/* MESSAGE */

#letterMessage {
    min-height: 55px;

    font-family:
        Georgia,
        "Times New Roman",
        serif;

    font-size: 0.95rem;

    line-height: 1.6;

    color: #70445a;
}


/* CONTINUE BUTTON */

#continueBtn {
    margin-top: 20px;

    padding: 10px 20px;

    border: 1px solid rgba(130, 45, 85, 0.25);

    border-radius: 30px;

    background: rgba(130, 45, 85, 0.08);

    color: #54243e;

    font-size: 0.75rem;

    letter-spacing: 1px;

    cursor: pointer;

    opacity: 0;

    transform: translateY(10px);

    transition:
        opacity 0.6s ease,
        transform 0.3s ease,
        background 0.3s ease;
}

#continueBtn.visible {
    opacity: 1;

    transform: translateY(0);
}

#continueBtn:hover {
    background: rgba(130, 45, 85, 0.15);

    transform:
        translateY(-2px);
}

#continueBtn span {
    margin-left: 8px;

    transition:
        transform 0.3s ease;
}

#continueBtn:hover span {
    display: inline-block;

    transform:
        translateX(4px);
}
/* =========================================
   SCENE 3 — MEMORIES
   ========================================= */

.memory-scene {
    position: fixed;

    inset: 0;

    display: flex;

    align-items: center;
    justify-content: center;

    overflow: hidden;

    background:
        radial-gradient(
            circle at 50% 45%,
            #32132f 0%,
            #170a1c 45%,
            #06040a 90%
        );

    opacity: 0;
    visibility: hidden;

    transition:
        opacity 1s ease,
        visibility 1s ease;

    z-index: 30;
}


.memory-scene.active {
    opacity: 1;
    visibility: visible;
}


/* BACKGROUND GLOW */

.memory-glow {
    position: absolute;

    width: 650px;
    height: 650px;

    border-radius: 50%;

    background:
        radial-gradient(
            circle,
            rgba(255, 80, 170, 0.15),
            transparent 68%
        );

    filter: blur(35px);

    animation:
        memoryGlow 7s ease-in-out infinite;

    pointer-events: none;
}


/* CONTENT */

.memory-content {
    position: relative;

    width: min(1100px, 90%);

    text-align: center;

    z-index: 2;
}


/* LABEL */

.memory-label {
    margin-bottom: 20px;

    font-size: 0.7rem;

    letter-spacing: 6px;

    color: #dca6ca;
}


/* TITLE */

.memory-content h2 {
    font-family:
        Georgia,
        "Times New Roman",
        serif;

    font-size:
        clamp(2.8rem, 6vw, 5.5rem);

    font-weight: 400;

    line-height: 1;

    letter-spacing: -2px;

    color: white;

    margin-bottom: 25px;
}


/* SUBTITLE */

.memory-subtitle {
    max-width: 550px;

    margin:
        0 auto 35px;

    color:
        rgba(255,255,255,0.52);

    font-size: 0.95rem;

    line-height: 1.7;
}


/* START BUTTON */

#memoryStartBtn {
    padding: 15px 27px;

    border:
        1px solid
        rgba(255,255,255,0.18);

    border-radius: 50px;

    background:
        rgba(255,255,255,0.06);

    color: white;

    cursor: pointer;

    font-size: 0.8rem;

    letter-spacing: 1.5px;

    transition:
        transform 0.3s ease,
        background 0.3s ease,
        opacity 0.5s ease;
}


#memoryStartBtn:hover {
    transform: translateY(-4px);

    background:
        rgba(255,100,180,0.14);
}


#memoryStartBtn.hidden {
    opacity: 0;

    pointer-events: none;

    transform:
        translateY(10px);
}


/* BUTTON ARROW */

#memoryStartBtn span,
#memoryContinueBtn span {
    margin-left: 8px;
}


/* =========================================
   MEMORY CARDS
   ========================================= */

.memory-cards {
    display: flex;

    justify-content: center;

    gap: 22px;

    margin-top: 45px;

    opacity: 0;

    visibility: hidden;

    transform:
        translateY(25px);

    transition:
        opacity 0.8s ease,
        transform 0.8s ease,
        visibility 0.8s ease;
}


.memory-cards.visible {
    opacity: 1;

    visibility: visible;

    transform:
        translateY(0);
}


.memory-card {
    position: relative;

    width: 280px;

    min-height: 250px;

    padding: 28px 24px;

    border:
        1px solid
        rgba(255,255,255,0.12);

    border-radius: 18px;

    background:
        rgba(255,255,255,0.055);

    backdrop-filter: blur(15px);

    text-align: left;

    cursor: pointer;

    overflow: hidden;

    transition:
        transform 0.4s ease,
        border-color 0.4s ease,
        background 0.4s ease,
        box-shadow 0.4s ease;
}


.memory-card::before {
    content: "";

    position: absolute;

    inset: 0;

    background:
        radial-gradient(
            circle at 50% 0%,
            rgba(255,120,190,0.12),
            transparent 65%
        );

    opacity: 0;

    transition:
        opacity 0.4s ease;
}


.memory-card:hover {
    transform:
        translateY(-10px);

    border-color:
        rgba(255,180,220,0.3);

    background:
        rgba(255,255,255,0.08);

    box-shadow:
        0 20px 50px
        rgba(0,0,0,0.25);
}


.memory-card:hover::before {
    opacity: 1;
}


.memory-card.selected {
    transform:
        translateY(-10px);

    border-color:
        rgba(255,170,215,0.45);

    background:
        rgba(255,100,180,0.10);
}


/* CARD NUMBER */

.card-number {
    position: relative;

    color:
        rgba(255,255,255,0.25);

    font-size: 0.7rem;

    letter-spacing: 2px;

    margin-bottom: 25px;
}


/* CARD ICON */

.card-icon {
    position: relative;

    margin-bottom: 15px;

    font-size: 1.5rem;

    color: #e49abb;
}


/* CARD TITLE */

.memory-card h3 {
    position: relative;

    margin-bottom: 10px;

    font-family:
        Georgia,
        "Times New Roman",
        serif;

    font-size: 1.35rem;

    font-weight: 400;

    color: white;
}


/* CARD DESCRIPTION */

.memory-card p {
    position: relative;

    color:
        rgba(255,255,255,0.48);

    font-size: 0.8rem;

    line-height: 1.5;
}


/* CARD HINT */

.card-hint {
    position: absolute;

    bottom: 22px;
    right: 22px;

    font-size: 0.62rem;

    letter-spacing: 1px;

    color:
        rgba(255,255,255,0.25);
}



/* =========================================
   REVEALED MESSAGE
   ========================================= */

.memory-message {
    position: absolute;

    left: 50%;
    top: 50%;

    width: min(500px, 90%);

    padding: 35px;

    transform:
        translate(-50%, -45%)
        scale(0.95);

    opacity: 0;

    visibility: hidden;

    border:
        1px solid
        rgba(255,255,255,0.15);

    border-radius: 20px;

    background:
        rgba(30,10,30,0.9);

    backdrop-filter: blur(20px);

    box-shadow:
        0 30px 80px
        rgba(0,0,0,0.45);

    transition:
        opacity 0.6s ease,
        transform 0.6s ease,
        visibility 0.6s ease;

    z-index: 10;
}


.memory-message.visible {
    opacity: 1;

    visibility: visible;

    transform:
        translate(-50%, -50%)
        scale(1);
}


.message-symbol {
    margin-bottom: 20px;

    font-size: 1.8rem;

    color: #df76a7;
}


#memoryMessageText {
    font-family:
        Georgia,
        "Times New Roman",
        serif;

    font-size: 1.15rem;

    line-height: 1.7;

    color:
        rgba(255,255,255,0.85);
}


/* CONTINUE */

#memoryContinueBtn {
    margin-top: 25px;

    padding: 12px 23px;

    border:
        1px solid
        rgba(255,255,255,0.15);

    border-radius: 30px;

    background:
        rgba(255,255,255,0.06);

    color: white;

    cursor: pointer;

    font-size: 0.75rem;

    letter-spacing: 1px;

    transition:
        background 0.3s ease,
        transform 0.3s ease;
}


#memoryContinueBtn:hover {
    background:
        rgba(255,100,180,0.14);

    transform:
        translateY(-3px);
}



/* =========================================
   ANIMATION
   ========================================= */

@keyframes memoryGlow {

    0%,
    100% {
        transform: scale(0.9);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.15);
        opacity: 1;
    }

}


/* =========================================
   MOBILE
   ========================================= */

@media (max-width: 800px) {

    .memory-cards {
        flex-direction: column;

        align-items: center;

        gap: 14px;

        margin-top: 25px;
    }


    .memory-card {
        width: min(360px, 90vw);

        min-height: 150px;

        padding: 20px;
    }


    .card-number {
        margin-bottom: 10px;
    }


    .card-icon {
        display: none;
    }


    .memory-card p {
        margin-bottom: 15px;
    }

}
