@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+Tamil:wght@400;500;600;700&family=Noto+Sans+Tamil:wght@400;500;600&display=swap');

:root {
    --rose: #bd647e;
    --rose-dark: #874154;
    --rose-light: #f9dce5;
    --glass: rgba(255, 250, 252, 0.84);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px 16px;
    position: relative;
    isolation: isolate;
    overflow-x: hidden;

    background:
        radial-gradient(ellipse at 15% 20%, #fff3f7 0%, transparent 42%),
        radial-gradient(ellipse at 85% 80%, #f5d7e4 0%, transparent 45%),
        linear-gradient(135deg, #f9e8ee, #fff8f3, #f5dfe9);

    font-family: 'Noto Sans Tamil', sans-serif;
    color: #633e46;
}

/* Soft glowing lights behind every page */
body::before,
body::after {
    content: "";
    position: fixed;
    inset: -20%;
    z-index: -1;
    pointer-events: none;
}

body::before {
    background:
        radial-gradient(circle at 20% 30%,
            rgba(255, 255, 255, 0.9) 0 2px, transparent 4px),
        radial-gradient(circle at 75% 20%,
            rgba(255, 215, 230, 0.9) 0 3px, transparent 6px),
        radial-gradient(circle at 65% 75%,
            rgba(255, 255, 255, 0.8) 0 2px, transparent 5px),
        radial-gradient(circle at 30% 85%,
            rgba(255, 221, 232, 0.8) 0 3px, transparent 6px);
    background-size: 180px 190px, 240px 220px, 210px 250px, 260px 200px;
    animation: sparkleDrift 16s linear infinite;
}

body::after {
    background:
        radial-gradient(ellipse at center,
            transparent 40%, rgba(160, 85, 115, 0.09) 100%);
}

.welcome-card {
    position: relative;
    width: 100%;
    max-width: 850px;
    padding: clamp(28px, 5vw, 58px) clamp(18px, 5vw, 42px);
    text-align: center;

    background: var(--glass);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 28px;

    box-shadow:
        0 25px 80px rgba(125, 60, 80, 0.16),
        0 0 35px rgba(255, 255, 255, 0.65),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);

    -webkit-backdrop-filter: blur(15px);
    backdrop-filter: blur(15px);

    animation: cardAppear 900ms ease both;
}

/* Decorative glowing border */
.welcome-card::before {
    content: "";
    position: absolute;
    inset: 7px;
    border: 1px solid rgba(207, 143, 163, 0.3);
    border-radius: 22px;
    pointer-events: none;
}

.top-text {
    color: #986c78;
    font-size: 14px;
    line-height: 1.9;
}

.flower {
    font-size: clamp(42px, 8vw, 58px);
    margin: 18px 0;
    animation: flowerFloat 3s ease-in-out infinite;
    filter: drop-shadow(0 5px 12px rgba(189, 100, 126, 0.2));
}

.greeting {
    font-size: 18px;
    line-height: 1.9;
}

h1 {
    margin: 18px 0;
    font-family: 'Noto Serif Tamil', serif;
    font-size: clamp(25px, 5vw, 43px);
    line-height: 1.8;
    text-wrap: balance;
}

h1 span {
    display: block;
    color: var(--rose);
    text-shadow: 0 3px 18px rgba(189, 100, 126, 0.16);
}

.divider {
    margin: 20px 0;
    color: #c98b9b;
    letter-spacing: 3px;
}

.message {
    font-size: 16px;
    line-height: 2.05;
    overflow-wrap: anywhere;
}

.hint {
    margin-top: 22px;
    color: #986c78;
    font-size: 14px;
    line-height: 1.8;
}

button {
    margin-top: 24px;
    padding: 14px 24px;
    max-width: 100%;

    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 30px;

    background: linear-gradient(120deg, #a94e6b, #d88fa8);
    color: white;

    font-family: inherit;
    font-size: 14px;
    line-height: 1.8;
    cursor: pointer;

    box-shadow: 0 8px 25px rgba(184, 95, 121, 0.25);
    transition: transform 250ms ease, box-shadow 250ms ease;
}

button:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(184, 95, 121, 0.34);
}

button:focus-visible {
    outline: 3px solid #874154;
    outline-offset: 4px;
}

button:disabled {
    cursor: default;
    opacity: 0.7;
}

.signature {
    margin-top: 28px;
    color: var(--rose-dark);
    font-family: 'Noto Serif Tamil', serif;
    line-height: 1.9;
}

.memory-gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.photo-frame {
    min-width: 0;
    padding: 10px;

    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(232, 189, 199, 0.85);
    border-radius: 17px;

    box-shadow: 0 12px 30px rgba(125, 60, 80, 0.13);
    transition: transform 300ms ease, box-shadow 300ms ease;
}

.photo-frame:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 35px rgba(125, 60, 80, 0.18);
}

.photo-frame img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 520px;

    /* Preserve the complete vertical photo */
    aspect-ratio: auto;
    object-fit: contain;

    border-radius: 10px;
    background: rgba(249, 220, 229, 0.35);
}

.photo-frame p {
    margin-top: 12px;
    font-size: 13px;
    line-height: 1.9;
}

.single-photo {
    grid-template-columns: minmax(0, 1fr);
    max-width: 540px;
    margin-left: auto;
    margin-right: auto;
}

.single-photo .photo-frame img {
    max-height: 620px;
    width: auto;
    max-width: 100%;
    margin-inline: auto;
}

.letter {
    text-align: left;
    max-width: 560px;
    margin: 25px auto 0;
    line-height: 2.05;
}

.letter p {
    margin-bottom: 18px;
}

.letter p:first-child {
    color: var(--rose);
    font-weight: 600;
}

.music-panel {
    margin: 30px auto;
    padding: 26px 18px;
    max-width: 430px;

    background: rgba(255, 246, 248, 0.85);
    border: 1px solid #edcbd8;
    border-radius: 24px;

    box-shadow: 0 12px 35px rgba(180, 95, 118, 0.1);
}

.music-disc {
    display: grid;
    place-items: center;
    width: 85px;
    height: 85px;
    margin: 0 auto 18px;

    border-radius: 50%;
    background: linear-gradient(135deg, #b85f79, #e8a9c0);
    color: white;
    font-size: 38px;

    box-shadow: 0 8px 25px #b45f7635;
    animation: discGlow 2.8s ease-in-out infinite;
}

.song-title {
    font-family: 'Noto Serif Tamil', serif;
    font-size: 20px;
    color: var(--rose-dark);
    line-height: 1.8;
}

.song-note {
    margin-top: 8px;
    font-size: 13px;
    color: #986c78;
    line-height: 1.8;
}

.music-panel button {
    margin-top: 20px;
}

.final-surprise {
    border: 2px solid rgba(232, 189, 199, 0.9);
    box-shadow:
        0 20px 60px rgba(180, 95, 118, 0.18),
        inset 0 0 0 6px rgba(255, 255, 255, 0.65);
}

.final-heart {
    margin-top: 28px;
    font-size: 34px;
    animation: heartbeat 1.8s ease-in-out infinite;
}

.final-title {
    margin-top: 20px;
    color: #b45f76;
    font-family: 'Noto Serif Tamil', serif;
    font-size: clamp(20px, 4vw, 30px);
    line-height: 1.9;
}

/* Consistent navigation on mobile and desktop */
.navigation-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

.navigation-buttons button {
    margin-top: 8px;
}

/* Animations */
@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(22px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes flowerFloat {
    0%, 100% { transform: translateY(0) rotate(-3deg); }
    50% { transform: translateY(-7px) rotate(3deg); }
}

@keyframes sparkleDrift {
    from { transform: translateY(0); }
    to { transform: translateY(-45px); }
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.09); }
}

@keyframes discGlow {
    0%, 100% { box-shadow: 0 8px 25px #b45f7635; }
    50% { box-shadow: 0 8px 34px #b45f7670; }
}

/* Phone-friendly layout */
@media (max-width: 600px) {
    body {
        align-items: flex-start;
        padding: 14px 10px;
    }

    .welcome-card {
        padding: 32px 17px;
        border-radius: 22px;
    }

    .welcome-card::before {
        inset: 5px;
        border-radius: 17px;
    }

    .memory-gallery {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }

    .photo-frame img {
        max-height: 68vh;
    }

    .single-photo .photo-frame img {
        max-height: 72vh;
    }

    .message {
        font-size: 14px;
        line-height: 2;
    }

    .greeting {
        font-size: 16px;
    }

    .navigation-buttons {
        gap: 8px;
    }

    .navigation-buttons button {
        flex: 1 1 135px;
        padding: 12px 13px;
        font-size: 13px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== MAGICAL AMMA BIRTHDAY EFFECTS ===== */

body {
    overflow-x: hidden;
}

/* Floating rose petals and hearts */
body::after {
    content: "♡  ✦  🌸  ♡  ✧  🌷  ♡  ✦  🌸";
    position: fixed;
    z-index: 5;
    top: -80px;
    left: 0;
    width: 100%;
    height: 120vh;
    display: block;
    overflow: hidden;
    pointer-events: none;
    color: #d77f9c;
    font-size: 23px;
    letter-spacing: 18px;
    line-height: 1.8;
    overflow-wrap: anywhere;
    opacity: 0.28;
    background: none;
    border: none;
    animation: petalsFall 18s linear infinite;
}

/* Make each page feel like a new scene */
.welcome-card {
    animation: magicalEntrance 1s cubic-bezier(.2,.75,.3,1) both;
}

/* Glowing Tamil headings */
h1 span,
.final-title {
    animation: roseGlow 3s ease-in-out infinite;
}

/* Soft breathing glow on the card */
.welcome-card {
    box-shadow:
        0 20px 70px rgba(189, 100, 126, 0.18),
        0 0 35px rgba(255, 213, 229, 0.35),
        inset 0 0 25px rgba(255, 255, 255, 0.55);
    animation:
        magicalEntrance 1s cubic-bezier(.2,.75,.3,1) both,
        cardGlow 5s ease-in-out 1s infinite;
}

/* Photos gently appear */
.photo-frame {
    animation: photoReveal 1s ease both;
}

.photo-frame:nth-child(2) {
    animation-delay: 180ms;
}

/* Floating flower icon */
.flower {
    animation: flowerFloat 3s ease-in-out infinite;
}

/* Music disc can keep its own glow */
.music-disc {
    animation: discGlow 2.5s ease-in-out infinite;
}

@keyframes petalsFall {
    0% {
        transform: translate3d(0, -10vh, 0) rotate(0deg);
    }
    50% {
        transform: translate3d(12px, 45vh, 0) rotate(120deg);
    }
    100% {
        transform: translate3d(-12px, 105vh, 0) rotate(260deg);
    }
}

@keyframes magicalEntrance {
    from {
        opacity: 0;
        transform: translateY(28px) scale(.97);
        filter: blur(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

@keyframes roseGlow {
    0%, 100% {
        text-shadow: 0 0 5px rgba(217, 130, 158, .12);
    }
    50% {
        text-shadow:
            0 0 14px rgba(217, 130, 158, .4),
            0 0 28px rgba(255, 190, 211, .3);
    }
}

@keyframes cardGlow {
    0%, 100% {
        box-shadow: 0 20px 65px rgba(189, 100, 126, .15);
    }
    50% {
        box-shadow: 0 24px 75px rgba(189, 100, 126, .26);
    }
}

@keyframes photoReveal {
    from {
        opacity: 0;
        transform: scale(.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    body::after,
    .welcome-card,
    h1 span,
    .final-title,
    .photo-frame,
    .flower,
    .music-disc {
        animation: none !important;
    }
}

/* ===== AMMA BIRTHDAY: 3D + MOTION EXPERIENCE ===== */

body {
    position: relative;
    isolation: isolate;
    overflow-x: hidden;
    background:
        radial-gradient(ellipse at 15% 15%, #fff7fb 0%, transparent 38%),
        radial-gradient(ellipse at 85% 75%, #f1cddd 0%, transparent 42%),
        linear-gradient(135deg, #fbeaf1, #fff8f5 50%, #f3dce9);
}

/* Moving ambient light */
body::before {
    content: "";
    position: fixed;
    inset: -30%;
    z-index: -2;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 25% 30%,
            rgba(255,255,255,.95), transparent 28%),
        radial-gradient(ellipse at 75% 65%,
            rgba(245,174,204,.38), transparent 32%),
        radial-gradient(ellipse at 60% 15%,
            rgba(255,225,236,.8), transparent 25%);
    filter: blur(24px);
    animation: ambientFloat 16s ease-in-out infinite alternate;
}

/* Sparkling particles drifting through the scene */
body::after {
    content: "✦　 ·　 ✧　 ♡　 ·　 ✦　 🌸　 ✧　 ·　 ♡";
    position: fixed;
    inset: -100px -20px;
    z-index: 4;
    pointer-events: none;
    overflow: hidden;
    color: rgba(190, 100, 137, .48);
    font-size: 19px;
    line-height: 5.5;
    letter-spacing: 9px;
    overflow-wrap: anywhere;
    text-shadow: 0 0 12px rgba(255,255,255,.95);
    animation: sparkleJourney 20s linear infinite;
}

/* Floating 3D glass card */
.welcome-card {
    position: relative;
    z-index: 1;
    transform-style: preserve-3d;
    background: rgba(255, 250, 253, .70);
    border: 1px solid rgba(255,255,255,.88);
    -webkit-backdrop-filter: blur(15px);
    backdrop-filter: blur(15px);
    box-shadow:
        0 28px 70px rgba(119, 48, 82, .16),
        0 8px 24px rgba(215, 143, 174, .12),
        inset 0 1px 0 rgba(255,255,255,.95);
    animation: sceneEnter 1.1s cubic-bezier(.2,.75,.25,1) both,
               gentleHover 7s ease-in-out 1.1s infinite;
}

/* Extra depth around the glass */
.welcome-card::before {
    content: "";
    position: absolute;
    inset: 8px;
    z-index: -1;
    pointer-events: none;
    border: 1px solid rgba(224, 160, 186, .25);
    border-radius: inherit;
    box-shadow: 0 0 35px rgba(255,255,255,.35);
    transform: translateZ(-12px);
}

/* Headings shimmer softly */
h1 span,
.final-title {
    text-shadow:
        0 0 12px rgba(221, 137, 166, .25),
        0 4px 24px rgba(255, 255, 255, .75);
    animation: textShimmer 3.5s ease-in-out infinite;
}

/* Photos have a raised, cinematic frame */
.photo-frame {
    transform: perspective(900px) translateZ(0);
    transition: transform .6s ease, box-shadow .6s ease;
}

.photo-frame:hover {
    transform: perspective(900px) translateY(-6px) rotateX(2deg);
    box-shadow: 0 25px 45px rgba(125, 60, 80, .2);
}

.photo-frame img {
    transition: transform .8s ease, filter .8s ease;
}

.photo-frame:hover img {
    transform: scale(1.015);
}

/* Floating flower and heartbeat */
.flower {
    filter: drop-shadow(0 8px 15px rgba(189, 100, 126, .25));
    animation: flowerFlight 4s ease-in-out infinite;
}

.final-heart {
    filter: drop-shadow(0 0 15px rgba(236, 105, 154, .38));
    animation: heartPulse3D 1.8s ease-in-out infinite;
}

/* Cinematic entrance */
@keyframes sceneEnter {
    from {
        opacity: 0;
        transform: perspective(1200px) translateY(35px) rotateX(4deg) scale(.96);
        filter: blur(7px);
    }
    to {
        opacity: 1;
        transform: perspective(1200px) translateY(0) rotateX(0) scale(1);
        filter: blur(0);
    }
}

@keyframes gentleHover {
    0%, 100% { translate: 0 0; }
    50% { translate: 0 -5px; }
}

@keyframes ambientFloat {
    0% { transform: translate3d(-2%, -1%, 0) rotate(0deg) scale(1); }
    50% { transform: translate3d(2%, 2%, 0) rotate(4deg) scale(1.04); }
    100% { transform: translate3d(-1%, 3%, 0) rotate(-3deg) scale(1.02); }
}

@keyframes sparkleJourney {
    0% { transform: translate3d(0, -2%, 0) rotate(0deg); }
    50% { transform: translate3d(12px, 2%, 0) rotate(3deg); }
    100% { transform: translate3d(-8px, 7%, 0) rotate(-2deg); }
}

@keyframes textShimmer {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.12); }
}

@keyframes flowerFlight {
    0%, 100% { transform: translateY(0) rotate(-4deg); }
    50% { transform: translateY(-10px) rotate(5deg); }
}

@keyframes heartPulse3D {
    0%, 100% { transform: perspective(300px) scale(1) rotateY(0deg); }
    50% { transform: perspective(300px) scale(1.12) rotateY(12deg); }
}

/* Keep animations comfortable on phones */
@media (max-width: 600px) {
    .welcome-card {
        animation: sceneEnter .8s ease both;
        padding-left: 17px;
        padding-right: 17px;
    }

    body::after {
        font-size: 15px;
        letter-spacing: 5px;
        opacity: .65;
    }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
    body::before,
    body::after,
    .welcome-card,
    h1 span,
    .final-title,
    .flower,
    .final-heart {
        animation: none !important;
    }

    .photo-frame,
    .photo-frame img {
        transition: none !important;
    }
}

/* ===== FULL-SCREEN 3D BIRTHDAY SCENE ===== */

body.birthday-scene {
    position: relative;
    isolation: isolate;
    overflow-x: hidden;
    background:
        radial-gradient(ellipse at 20% 20%, #fff8fc 0%, transparent 35%),
        radial-gradient(ellipse at 80% 70%, #f2c5d9 0%, transparent 38%),
        linear-gradient(135deg, #f7dce8, #fff4f7 48%, #eac4d8);
}

.scene-lights {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    perspective: 900px;
}

.light-orb {
    position: absolute;
    display: block;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    filter: blur(35px);
    opacity: .55;
    animation: orbMove 12s ease-in-out infinite alternate;
}

.orb-one {
    top: 5%;
    left: -8%;
    background: #ffd6e8;
}

.orb-two {
    right: -10%;
    top: 35%;
    background: #e9b9ed;
    animation-delay: -4s;
}

.orb-three {
    bottom: -10%;
    left: 28%;
    background: #fff1d9;
    animation-delay: -7s;
}

.floating-heart,
.floating-petal {
    position: absolute;
    display: block;
    font-size: 30px;
    opacity: 0;
    filter: drop-shadow(0 5px 10px rgba(180, 80, 125, .25));
    animation: floatUp 9s linear infinite;
}

.heart-one { left: 12%; bottom: -50px; animation-delay: 0s; }
.heart-two { left: 75%; bottom: -50px; animation-delay: 3s; }
.heart-three { left: 48%; bottom: -50px; animation-delay: 6s; }

.petal-one { left: 30%; bottom: -50px; animation-delay: 1s; }
.petal-two { left: 88%; bottom: -50px; animation-delay: 4s; }
.petal-three { left: 60%; bottom: -50px; animation-delay: 7s; }

body.birthday-scene .welcome-card {
    z-index: 1;
    background: rgba(255, 250, 253, .67);
    border: 1px solid rgba(255, 255, 255, .9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow:
        0 30px 80px rgba(121, 54, 91, .18),
        inset 0 1px 0 rgba(255, 255, 255, .95);
    animation: cardArrive 1.2s cubic-bezier(.2,.8,.2,1) both;
}

@keyframes orbMove {
    from { transform: translate3d(-10px, -10px, -80px) scale(.9); }
    to { transform: translate3d(40px, 30px, 80px) scale(1.2); }
}

@keyframes floatUp {
    0% {
        opacity: 0;
        transform: translate3d(0, 0, -100px) rotate(-20deg) scale(.65);
    }
    15% { opacity: .75; }
    70% { opacity: .6; }
    100% {
        opacity: 0;
        transform: translate3d(35px, -115vh, 150px) rotate(35deg) scale(1.25);
    }
}

@keyframes cardArrive {
    from {
        opacity: 0;
        transform: perspective(1000px) translateY(35px) rotateX(7deg) scale(.96);
        filter: blur(5px);
    }
    to {
        opacity: 1;
        transform: perspective(1000px) translateY(0) rotateX(0) scale(1);
        filter: blur(0);
    }
}

@media (max-width: 600px) {
    .light-orb {
        width: 170px;
        height: 170px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .light-orb,
    .floating-heart,
    .floating-petal,
    body.birthday-scene .welcome-card {
        animation: none !important;
    }
}
/* ===== CONTINUOUS FLOATING HEARTS & PETALS ===== */

.scene-lights {
    z-index: 0;
}

/* Keep the birthday card above the animations */
body.birthday-scene .welcome-card {
    position: relative;
    z-index: 2;
}

/* Floating animation base */
.floating-heart,
.floating-petal {
    position: absolute;
    display: block;
    bottom: -70px;
    opacity: 0;
    pointer-events: none;
    will-change: transform, opacity;
    animation: floatUp 12s linear infinite;
}

/* Hearts */
.floating-heart {
    font-size: 25px;
}

.heart-one   { left: 4%;  animation-delay: 0s; }
.heart-two   { left: 14%; animation-delay: 2s; }
.heart-three { left: 24%; animation-delay: 4s; }
.heart-four  { left: 34%; animation-delay: 1s; }
.heart-five  { left: 44%; animation-delay: 6s; }
.heart-six   { left: 54%; animation-delay: 3s; }
.heart-seven { left: 64%; animation-delay: 8s; }
.heart-eight { left: 74%; animation-delay: 5s; }
.heart-nine  { left: 84%; animation-delay: 1.5s; }
.heart-ten   { left: 94%; animation-delay: 7s; }
.heart-eleven { left: 38%; animation-delay: 9s; }
.heart-twelve { left: 78%; animation-delay: 10s; }

/* Flower petals */
.floating-petal {
    font-size: 27px;
    animation-duration: 15s;
}

.petal-one   { left: 9%;  animation-delay: 3s; }
.petal-two   { left: 20%; animation-delay: 7s; }
.petal-three { left: 31%; animation-delay: 0s; }
.petal-four  { left: 47%; animation-delay: 5s; }
.petal-five  { left: 59%; animation-delay: 9s; }
.petal-six   { left: 69%; animation-delay: 2s; }
.petal-seven { left: 81%; animation-delay: 6s; }
.petal-eight { left: 91%; animation-delay: 11s; }

/* Rise, drift sideways, fade in and fade out */
@keyframes floatUp {
    0% {
        opacity: 0;
        transform: translate3d(0, 0, 0) rotate(-20deg) scale(.7);
    }

    12% {
        opacity: .8;
    }

    50% {
        transform: translate3d(30px, -55vh, 0)
                   rotate(15deg) scale(1);
        opacity: .7;
    }

    85% {
        opacity: .55;
    }

    100% {
        opacity: 0;
        transform: translate3d(-25px, -115vh, 0)
                   rotate(40deg) scale(1.15);
    }
}

/* Smaller elements on mobile */
@media (max-width: 600px) {
    .floating-heart {
        font-size: 19px;
    }

    .floating-petal {
        font-size: 21px;
    }
}
/* ===== PREMIUM FULL-SCREEN PHOTO BACKGROUND ===== */

body.birthday-scene {
    min-height: 100vh;
    position: relative;
    isolation: isolate;
    overflow-x: hidden;

    background:
        linear-gradient(
            135deg,
            rgba(64, 20, 45, 0.45),
            rgba(145, 50, 95, 0.22),
            rgba(35, 15, 35, 0.55)
        ),
        url("../images/page2-memories/family1.jpeg")
        center / cover no-repeat fixed;
}

/* Soft photo overlay */
body.birthday-scene::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;

    background: inherit;
    filter: blur(2px);
    transform: scale(1.03);
}

/* Keep animations visible behind the card */
.scene-lights {
    z-index: 0;
}

body.birthday-scene .welcome-card {
    position: relative;
    z-index: 2;

    background: rgba(255, 245, 251, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 26px;

    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    box-shadow:
        0 25px 70px rgba(35, 10, 30, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

@media (max-width: 600px) {
    body.birthday-scene {
        background-attachment: scroll;
    }

    body.birthday-scene .welcome-card {
        margin: 16px;
    }
}

/* ==========================================
   FAST FLOWING SPARKLES — STORY PAGES
   Pages 2, 3, 4, 5 and 7
   ========================================== */
/* ===== FLOATING HEARTS ONLY ON STORY PAGES ===== */

body:not(.birthday-scene)::after {
    content: "♡     ♥     💗     ♡     💕";
    position: fixed;
    inset: 0;
    z-index: 50;
    pointer-events: none;

    font-size: 27px;
    line-height: 1;
    word-spacing: 65px;
    overflow: hidden;

    /* No dots or grid */
    background: none;

    animation: heartsFlow 5s linear infinite;
    opacity: 0.8;
}

/* Hearts gently float upward */
@keyframes heartsFlow {
    0% {
        background-position: 0 100vh;
        transform: translateY(30px);
    }

    100% {
        background-position: 0 -100vh;
        transform: translateY(-30px);
    }
}

@media (max-width: 600px) {
    body:not(.birthday-scene)::after {
        font-size: 21px;
        word-spacing: 35px;
        animation-duration: 4s;
    }
}

/* ===== FINAL OVERRIDES: REAL FLOATING HEARTS, NO DOT GRID ===== */

/* Disable older text/dot overlays that were attached to pseudo-elements. */
body::after,
body:not(.birthday-scene)::after {
    content: none !important;
    display: none !important;
    background: none !important;
    animation: none !important;
}

/* Put this block in pages 2, 3, 4, 5 and 7 just after <body>. */
.story-hearts {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 20;
}

.story-hearts span {
    position: absolute;
    bottom: -60px;
    display: block;
    opacity: 0;
    font-size: 26px;
    filter: drop-shadow(0 5px 10px rgba(180, 80, 125, .22));
    will-change: transform, opacity;
    animation: heartRise 5s linear infinite;
}

.story-hearts span:nth-child(1)  { left: 4%;  animation-delay: 0s; }
.story-hearts span:nth-child(2)  { left: 13%; animation-delay: 1s; }
.story-hearts span:nth-child(3)  { left: 22%; animation-delay: 2s; }
.story-hearts span:nth-child(4)  { left: 31%; animation-delay: .5s; }
.story-hearts span:nth-child(5)  { left: 40%; animation-delay: 1.5s; }
.story-hearts span:nth-child(6)  { left: 49%; animation-delay: 2.5s; }
.story-hearts span:nth-child(7)  { left: 58%; animation-delay: .8s; }
.story-hearts span:nth-child(8)  { left: 67%; animation-delay: 1.8s; }
.story-hearts span:nth-child(9)  { left: 76%; animation-delay: 3s; }
.story-hearts span:nth-child(10) { left: 85%; animation-delay: 1.2s; }
.story-hearts span:nth-child(11) { left: 94%; animation-delay: 2.2s; }

@keyframes heartRise {
    0% {
        opacity: 0;
        transform: translate3d(0, 0, 0) rotate(-15deg) scale(.7);
    }
    15% { opacity: .8; }
    50% {
        opacity: .75;
        transform: translate3d(25px, -50vh, 0) rotate(15deg) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate3d(-20px, -115vh, 0) rotate(30deg) scale(1.2);
    }
}

@media (max-width: 600px) {
    .story-hearts span {
        font-size: 20px;
        animation-duration: 4s;
    }
}
