
/* =====================================
   PARAM'S BIRTHDAY WEBSITE 🤎
   Complete CSS — Scroll Fix
===================================== */

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

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 15% 15%, #fffaf4, transparent 35%),
        radial-gradient(circle at 90% 85%, #e8cdbb, transparent 35%),
        #f7eee5;
    color: #4b3025;
    font-family: 'Poppins', sans-serif;
    overflow-x: hidden;
}

button {
    font-family: inherit;
}

/* ========== SCREENS ========== */

.screen {
    display: none;
    position: absolute;
    inset: 0;
    width: 100%;
    min-height: 100vh;
    background:
        radial-gradient(circle at 15% 15%, #fffaf4, transparent 35%),
        radial-gradient(circle at 90% 85%, #e8cdbb, transparent 35%),
        #f7eee5;
    opacity: 0;
    visibility: hidden;
}

.screen.active {
    display: block;
    opacity: 1;
    visibility: visible;
    z-index: 10;
}

/* Welcome, birthday and final screens */

#welcome-screen,
#birthday-screen,
#final-screen {
    display: none;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 30px 15px;
}

#welcome-screen.active,
#birthday-screen.active,
#final-screen.active {
    display: flex;
}

/* IMPORTANT: scrolling screens */

#story-screen.active,
#memories-screen.active {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow-y: scroll;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    scrollbar-width: thin;
    scrollbar-color: #b99a85 transparent;
    touch-action: pan-y;
}

#story-screen .you-page,
#memories-screen .memories-page {
    position: relative;
    width: 100%;
    max-width: 850px;
    min-height: 100%;
    margin: 0 auto;
    padding: 50px 25px 130px;
}

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

.floating-hearts {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 50;
}

.floating-hearts span {
    position: absolute;
    font-size: 21px;
    opacity: 0.35;
    animation: floatHeart 6s ease-in-out infinite;
}

.floating-hearts span:nth-child(1) {
    left: 7%;
    top: 20%;
}

.floating-hearts span:nth-child(2) {
    left: 20%;
    top: 75%;
    animation-delay: 1s;
}

.floating-hearts span:nth-child(3) {
    left: 42%;
    top: 10%;
    animation-delay: 2s;
}

.floating-hearts span:nth-child(4) {
    right: 20%;
    top: 30%;
    animation-delay: 3s;
}

.floating-hearts span:nth-child(5) {
    right: 8%;
    top: 70%;
    animation-delay: 1.5s;
}

.floating-hearts span:nth-child(6) {
    left: 65%;
    bottom: 10%;
    animation-delay: 2.5s;
}

.floating-hearts span:nth-child(7) {
    left: 5%;
    bottom: 10%;
    animation-delay: 3.5s;
}

@keyframes floatHeart {
    0%, 100% {
        transform: translateY(0) rotate(-5deg);
    }
    50% {
        transform: translateY(-25px) rotate(5deg);
    }
}

/* ========== TEXT ========== */

.eyebrow {
    font-size: 10px;
    letter-spacing: 4px;
    font-weight: 600;
    text-transform: uppercase;
    opacity: 0.65;
}

.welcome-content,
.birthday-content {
    width: 100%;
    max-width: 900px;
    padding: 30px;
    text-align: center;
}

.welcome-content h1 {
    margin-top: 22px;
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(48px, 8vw, 85px);
    line-height: 0.98;
    font-weight: 600;
}

.welcome-subtitle {
    margin-top: 25px;
    font-size: 14px;
    opacity: 0.75;
}

/* ========== BUTTONS ========== */

.main-button {
    display: inline-block;
    margin-top: 30px;
    padding: 15px 28px;
    border: 1px solid #6b4636;
    border-radius: 50px;
    background: #6b4636;
    color: #fffaf5;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.main-button span {
    margin-left: 8px;
}

.main-button:hover {
    background: #4b3025;
    transform: translateY(-4px);
    box-shadow: 0 12px 25px #4b302526;
}

/* ========== BIRTHDAY SCREEN ========== */

.birthday-content h2 {
    margin-top: 22px;
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(65px, 11vw, 130px);
    line-height: 0.85;
    font-weight: 600;
}

.birthday-content h2 span,
.memories-intro h2 span,
.final-content h2 span {
    font-style: italic;
}

.birthday-cake {
    font-size: 75px;
    margin: 28px 0 12px;
    animation: cakeBounce 2s ease-in-out infinite;
}

.birthday-content h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 42px;
    letter-spacing: 5px;
    margin-top: 8px;
}

.jaadu {
    margin-top: 5px;
    font-family: 'Cormorant Garamond', serif;
    font-size: 25px;
    font-style: italic;
}

.birthday-wish {
    max-width: 480px;
    margin: 18px auto;
    font-size: 14px;
    line-height: 1.9;
    opacity: 0.75;
}

@keyframes cakeBounce {
    0%, 100% {
        transform: translateY(0) rotate(-3deg);
    }
    50% {
        transform: translateY(-12px) rotate(3deg);
    }
}

/* ========== YOU INTRO ========== */

.you-intro,
.memories-intro {
    min-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.you-intro h2 {
    margin: 20px 0 30px;
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(100px, 18vw, 180px);
    line-height: 0.85;
    font-weight: 500;
    letter-spacing: -5px;
}

.you-intro p:not(.eyebrow),
.memories-intro p:not(.eyebrow) {
    font-size: 15px;
    line-height: 1.9;
    opacity: 0.75;
}

.scroll-hint {
    margin-top: 60px;
    font-size: 10px;
    letter-spacing: 3px;
    opacity: 0.55;
    animation: hintFloat 2s infinite ease-in-out;
}

@keyframes hintFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(8px);
    }
}

/* ========== YOU CARDS ========== */

.you-card {
    width: 100%;
    max-width: 650px;
    margin: 90px auto;
    padding: 45px;
    background: rgba(255, 251, 246, 0.94);
    border: 1px solid #6b46361c;
    border-radius: 28px;
    box-shadow: 0 20px 60px #4b302514;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.you-card:hover {
    transform: translateY(-7px);
    box-shadow: 0 28px 65px #4b302520;
}

.card-number {
    display: block;
    font-size: 11px;
    letter-spacing: 3px;
    opacity: 0.5;
}

.card-icon {
    font-size: 42px;
    margin: 18px 0;
}

.card-label {
    font-size: 10px;
    letter-spacing: 3px;
    font-weight: 600;
    opacity: 0.65;
}

.you-card h3,
.gift-message h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 42px;
    font-weight: 600;
    margin: 15px 0 20px;
}

.you-card > p:not(.card-label) {
    white-space: pre-line;
    font-size: 14px;
    line-height: 2;
    opacity: 0.82;
}

.special-line {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #6b463622;
    font-family: 'Cormorant Garamond', serif;
    font-size: 25px;
    font-style: italic;
}

.featured-card {
    background: #ead7c9;
}

.funny-card {
    transform: rotate(1deg);
}

.funny-card:hover {
    transform: rotate(0deg) translateY(-7px);
}

.final-card {
    background: #4b3025;
    color: #fff9f3;
}

.final-card .card-label,
.final-card .card-number,
.final-card > p {
    opacity: 0.85;
}

.big-line {
    margin: 25px 0;
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(30px, 5vw, 48px);
    line-height: 1.15;
    font-weight: 600;
}

/* ========== GIFT MESSAGE ========== */

.gift-message {
    width: 100%;
    max-width: 650px;
    margin: 140px auto 100px;
    padding: 55px 35px;
    text-align: center;
    background: #fffaf58c;
    border: 1px dashed #6b463655;
    border-radius: 28px;
}

.gift-icon {
    font-size: 60px;
    margin-bottom: 20px;
    animation: giftFloat 2.5s infinite ease-in-out;
}

.gift-message > p:not(.card-label) {
    white-space: pre-line;
    font-size: 14px;
    line-height: 2;
    opacity: 0.8;
}

@keyframes giftFloat {
    0%, 100% {
        transform: translateY(0) rotate(-3deg);
    }
    50% {
        transform: translateY(-10px) rotate(3deg);
    }
}

/* ========== MEMORIES INTRO ========== */

.memories-intro h2 {
    margin: 22px 0 30px;
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(80px, 15vw, 150px);
    line-height: 0.85;
    font-weight: 500;
    letter-spacing: -4px;
}

/* ========== MEMORY PHOTOS ========== */

.memory-photo {
    display: block;
    width: min(470px, 90%);
    margin: 110px auto;
    padding: 14px 14px 18px;
    background: #fffaf5;
    border-radius: 5px;
    box-shadow: 0 20px 55px #4b30251f;
    text-align: center;
}

.memory-photo img {
    display: block;
    width: 100%;
    max-height: 600px;
    object-fit: cover;
    border-radius: 3px;
}

.memory-photo p {
    margin: 15px 5px 2px;
    font-family: 'Cormorant Garamond', serif;
    font-size: 20px;
    font-style: italic;
}

.memory-photo.photo-left {
    transform: rotate(-3deg);
}

.memory-photo.photo-right {
    transform: rotate(3deg);
}

.memory-photo.photo-center {
    transform: rotate(-1deg);
}

/* ========== MEMORIES ENDING ========== */

.memories-ending {
    max-width: 650px;
    margin: 160px auto 0;
    padding: 65px 35px;
    text-align: center;
    background: #fffaf5bf;
    border: 1px solid #6b463622;
    border-radius: 30px;
    box-shadow: 0 20px 60px #4b302514;
}

.ending-heart {
    font-size: 55px;
    margin-bottom: 25px;
}

.memories-ending h3 {
    margin: 22px 0 30px;
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(40px, 7vw, 65px);
    line-height: 0.98;
}

.memories-ending > p:not(.eyebrow) {
    max-width: 500px;
    margin: auto;
    font-size: 14px;
    line-height: 2;
    opacity: 0.8;
}

.ending-big {
    margin: 35px 0;
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(35px, 6vw, 55px);
    line-height: 1.05;
    font-weight: 600;
    font-style: italic;
}

/* ========== FINAL SCREEN ========== */

.final-content {
    width: 100%;
    max-width: 650px;
    padding: 30px;
    text-align: center;
}

.final-heart {
    font-size: 65px;
    margin: 30px 0;
    animation: heartBeat 2s infinite;
}

.final-content h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(60px, 10vw, 100px);
    line-height: 0.9;
    font-weight: 500;
}

.final-message {
    max-width: 500px;
    margin: 35px auto;
    white-space: pre-line;
    font-size: 14px;
    line-height: 2;
    opacity: 0.8;
}

.final-signature {
    font-family: 'Cormorant Garamond', serif;
    font-size: 28px;
    font-style: italic;
}

@keyframes heartBeat {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.12);
    }
}

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

@media (max-width: 600px) {
    .welcome-content,
    .birthday-content {
        padding: 20px 12px;
    }

    .you-page,
    .memories-page {
        padding: 50px 15px 100px;
    }

    .you-card {
        padding: 30px 22px;
        margin: 70px auto;
    }

    .you-card h3,
    .gift-message h3 {
        font-size: 34px;
    }

    .you-card > p:not(.card-label),
    .gift-message > p:not(.card-label) {
        font-size: 13px;
    }

    .gift-message {
        padding: 40px 22px;
    }

    .memory-photo {
        width: 92%;
        margin: 85px auto;
    }

    .memories-ending {
        padding: 45px 22px;
        margin-top: 110px;
    }

    .final-content {
        padding: 25px 15px;
    }
}

/* ========== ACCESSIBILITY ========== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
#story-screen.active,
#memories-screen.active {
    position: fixed;
    inset: 0;
    height: 100vh;
    overflow-y: auto !important;
    overflow-x: hidden;
}

#story-screen.active .you-page,
#memories-screen.active .memories-page {
    height: auto;
    min-height: 100%;
    padding-bottom: 150px;
}

/* FINAL SCROLL RULES */

#story-screen.active,
#memories-screen.active {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    touch-action: pan-y;
}

#story-screen.active .you-page,
#memories-screen.active .memories-page {
    position: relative;
    height: auto;
    min-height: 100%;
    overflow: visible;
    padding-bottom: 150px;
}

/* PERMANENT SCROLL FIX 🤎 */

#story-screen.active,
#memories-screen.active {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
}

#story-screen.active .you-page,
#memories-screen.active .memories-page {
    height: auto !important;
    min-height: 100%;
    overflow: visible !important;
}

/* FINAL OVERRIDE — YOU PAGE SCROLL */

html body #story-screen.active {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    height: 100vh !important;
    height: 100dvh !important;
    position: fixed !important;
    inset: 0 !important;
}
#story-screen.active,
#memories-screen.active {
    display: block !important;
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100vh !important;
    height: 100dvh !important;
    overflow-y: scroll !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
}
#story-screen.active,
#memories-screen.active {
    position: relative !important;
    height: 80vh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}