/* ============================================= */
/* CSS CUSTOM PROPERTIES                         */
/* ============================================= */
:root {
    --pink: #FFDCE5;
    --pink-deep: #FFB8C6;
    --pink-hot: #FF8FAB;
    --rose: #FF6B81;
    --cream: #FFF5E4;
    --lavender: #EAD7FF;
    --mint: #DFFFE0;
    --gold: #FFD700;
    --dark: #2D2D2D;
    --white: #FFFDF7;
    --shadow: rgba(0, 0, 0, 0.06);
    --shadow-md: rgba(0, 0, 0, 0.1);
    --shadow-pink: rgba(255, 107, 129, 0.2);

    --font: 'Quicksand', 'Nunito', sans-serif;
    --font-cursive: 'Dancing Script', cursive;

    --radius: 24px;
    --radius-lg: 32px;
    --radius-xl: 40px;
}

/* ============================================= */
/* RESET & BASE                                  */
/* ============================================= */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: var(--font);
    color: var(--dark);
    background: linear-gradient(180deg,
            #FFE4EC 0%,
            var(--pink) 15%,
            var(--cream) 35%,
            var(--lavender) 55%,
            var(--pink) 75%,
            var(--cream) 90%,
            var(--mint) 100%);
    background-attachment: fixed;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ============================================= */
/* FLOATING HEARTS & SPARKLES                    */
/* ============================================= */
#floating-hearts,
#sparkle-field {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

#sparkle-field {
    z-index: 1;
}

.floating-heart {
    position: absolute;
    bottom: -40px;
    opacity: 0;
    animation: floatUp var(--duration) var(--delay) ease-in infinite;
    pointer-events: none;
    user-select: none;
}

@keyframes floatUp {
    0% {
        transform: translateY(0) rotate(0deg) scale(0.5);
        opacity: 0;
    }

    10% {
        opacity: 0.5;
    }

    50% {
        opacity: 0.35;
        transform: translateY(-50vh) rotate(180deg) scale(1);
    }

    100% {
        transform: translateY(-110vh) rotate(360deg) scale(0.3);
        opacity: 0;
    }
}

.sparkle-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--gold);
    border-radius: 50%;
    opacity: 0;
    animation: sparkleAnim var(--sp-duration, 3s) var(--sp-delay, 0s) ease-in-out infinite;
}

@keyframes sparkleAnim {

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

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

/* ============================================= */
/* SECTIONS BASE                                 */
/* ============================================= */
.section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    z-index: 2;
}

.section-content {
    max-width: 700px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 28px;
}

.section-title {
    font-size: clamp(1.6rem, 5vw, 2.4rem);
    font-weight: 700;
    color: var(--dark);
    letter-spacing: -0.5px;
    line-height: 1.3;
}

.cursive-title {
    font-family: var(--font-cursive);
    font-size: clamp(1.8rem, 5.5vw, 2.8rem) !important;
    color: var(--rose);
}

.section-subtitle {
    font-size: 1rem;
    color: #888;
    font-weight: 500;
    margin-top: -12px;
}

/* ============================================= */
/* FADE-IN ANIMATION (scroll triggered)          */
/* ============================================= */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================= */
/* CHARACTER STYLES                              */
/* ============================================= */
.character-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-char .kawaii-char {
    width: 180px;
}

.kawaii-char {
    width: 160px;
    height: auto;
    filter: drop-shadow(0 8px 24px rgba(255, 107, 129, 0.15));
}

.char-large .kawaii-char {
    width: 200px;
}

/* Blush pulse */
.blush {
    animation: blushPulse 2.5s ease-in-out infinite;
}

@keyframes blushPulse {

    0%,
    100% {
        opacity: 0.55;
    }

    50% {
        opacity: 0.85;
    }
}

/* Love character bounce */
.char-love {
    animation: loveBounce 2s ease-in-out infinite;
}

@keyframes loveBounce {

    0%,
    100% {
        transform: translateY(0) rotate(-2deg);
    }

    50% {
        transform: translateY(-12px) rotate(2deg);
    }
}

/* Excited bounce */
.char-excited {
    animation: excitedBounce 1.5s ease-in-out infinite;
}

@keyframes excitedBounce {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    25% {
        transform: translateY(-10px) scale(1.02);
    }

    50% {
        transform: translateY(-5px) scale(1);
    }

    75% {
        transform: translateY(-12px) scale(1.03);
    }
}

/* Super happy jump */
.char-super-happy {
    animation: superHappy 0.6s ease-in-out infinite;
}

@keyframes superHappy {

    0%,
    100% {
        transform: translateY(0) scale(1) rotate(0deg);
    }

    25% {
        transform: translateY(-25px) scale(1.05) rotate(-3deg);
    }

    75% {
        transform: translateY(-20px) scale(1.03) rotate(3deg);
    }
}

/* Sparkle dots */
.sparkle-dot {
    animation: twinkle 1.2s ease-in-out infinite alternate;
}

@keyframes twinkle {
    0% {
        opacity: 0.3;
        transform: scale(0.7);
    }

    100% {
        opacity: 1;
        transform: scale(1.3);
    }
}

/* Float hearts on character */
.float-heart {
    animation: heartFloat 2.5s ease-in-out infinite;
}

@keyframes heartFloat {

    0%,
    100% {
        transform: translateY(0);
        opacity: 0.7;
    }

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

/* Shooting hearts */
.shoot-heart {
    animation: shootOut 1.5s ease-out infinite;
}

.shoot-heart:nth-of-type(odd) {
    animation-delay: 0.3s;
}

.shoot-heart:nth-of-type(even) {
    animation-delay: 0.7s;
}

@keyframes shootOut {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }

    100% {
        transform: translate(var(--sx, 0), -30px) scale(0.3);
        opacity: 0;
    }
}

/* ============================================= */
/* HERO SECTION                                  */
/* ============================================= */
.hero-section {
    min-height: 100vh;
    padding-top: 60px;
}

.hero-heading {
    font-size: clamp(2rem, 7vw, 3.2rem);
    font-weight: 700;
    line-height: 1.3;
    color: var(--dark);
}

.name-highlight {
    font-family: var(--font-cursive);
    font-size: clamp(2.8rem, 9vw, 4.5rem);
    background: linear-gradient(135deg, var(--rose) 0%, #c084fc 40%, var(--pink-hot) 80%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
    animation: nameGlow 3s ease-in-out infinite;
}

@keyframes nameGlow {

    0%,
    100% {
        filter: brightness(1) drop-shadow(0 0 0px transparent);
    }

    50% {
        filter: brightness(1.1) drop-shadow(0 0 20px rgba(255, 107, 129, 0.4));
    }
}

.hero-subtext {
    font-size: clamp(1rem, 3vw, 1.2rem);
    font-weight: 500;
    color: #666;
    line-height: 1.8;
    max-width: 500px;
}

.hero-subtext strong {
    color: var(--rose);
    font-weight: 700;
}

.scroll-hint {
    margin-top: 24px;
    animation: scrollBounce 2.5s ease-in-out infinite;
}

.scroll-hint span {
    font-size: 0.95rem;
    color: var(--pink-hot);
    font-weight: 600;
    letter-spacing: 1px;
}

@keyframes scrollBounce {

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

    50% {
        transform: translateY(10px);
        opacity: 1;
    }
}

/* ============================================= */
/* LOVE LETTER SECTION                           */
/* ============================================= */
.letter-section {
    min-height: auto;
    padding: 80px 20px;
}

.letter-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius-lg);
    padding: 40px 36px;
    box-shadow:
        0 8px 32px var(--shadow),
        0 0 0 1px rgba(255, 184, 198, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    width: 100%;
    position: relative;
    overflow: hidden;
}

.letter-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--rose), var(--pink-hot), #c084fc, var(--rose));
    background-size: 200% 100%;
    animation: shimmerBar 3s ease-in-out infinite;
}

@keyframes shimmerBar {

    0%,
    100% {
        background-position: 0% 0%;
    }

    50% {
        background-position: 100% 0%;
    }
}

.letter-inner {
    min-height: 120px;
    display: flex;
    align-items: flex-start;
}

.typewriter-text {
    font-size: clamp(1rem, 2.8vw, 1.15rem);
    font-weight: 500;
    color: #555;
    line-height: 2;
    text-align: left;
    white-space: pre-wrap;
}

.cursor-blink {
    font-size: 1.2rem;
    font-weight: 300;
    color: var(--rose);
    animation: cursorBlink 0.8s step-end infinite;
    margin-left: 2px;
}

@keyframes cursorBlink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.letter-signature {
    margin-top: 24px;
    font-family: var(--font-cursive);
    font-size: 1.3rem;
    color: var(--rose);
    text-align: right;
    font-weight: 600;
}

/* ============================================= */
/* FLIP CARDS                                    */
/* ============================================= */
.reasons-section {
    min-height: auto;
    padding: 80px 20px;
}

.flip-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    width: 100%;
    max-width: 700px;
}

.flip-card {
    height: 220px;
    perspective: 800px;
    cursor: pointer;
}

.flip-card-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.flip-card.flipped .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-front,
.flip-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.flip-front {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(255, 220, 229, 0.6));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 8px 30px var(--shadow), 0 0 0 1px rgba(255, 184, 198, 0.15);
    gap: 12px;
    transition: box-shadow 0.3s ease;
}

.flip-front:hover {
    box-shadow: 0 12px 40px var(--shadow-pink), 0 0 0 2px rgba(255, 107, 129, 0.2);
}

.flip-emoji {
    font-size: 2.8rem;
    animation: emojiWiggle 2s ease-in-out infinite;
}

@keyframes emojiWiggle {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-8deg);
    }

    75% {
        transform: rotate(8deg);
    }
}

.flip-label {
    font-size: 1rem;
    font-weight: 700;
    color: var(--rose);
    letter-spacing: 0.5px;
}

.flip-back {
    background: linear-gradient(135deg, var(--rose), var(--pink-hot));
    transform: rotateY(180deg);
    box-shadow: 0 8px 30px var(--shadow-pink);
}

.flip-back p {
    font-size: clamp(0.9rem, 2.5vw, 1rem);
    font-weight: 600;
    color: white;
    line-height: 1.7;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

/* ============================================= */
/* PROMISE WALL                                  */
/* ============================================= */
.promises-section {
    min-height: auto;
    padding: 80px 20px;
}

.promises-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
    width: 100%;
    max-width: 700px;
}

.promise-card {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius);
    padding: 28px 24px;
    box-shadow: 0 6px 24px var(--shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(255, 184, 198, 0.15);
}

.promise-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 36px var(--shadow-pink);
}

.promise-icon {
    font-size: 2.2rem;
}

.promise-card p {
    font-size: clamp(0.9rem, 2.5vw, 1rem);
    font-weight: 500;
    color: #555;
    line-height: 1.7;
}

/* Staggered fade-in for promises */
.promise-card.fade-in:nth-child(1) {
    transition-delay: 0s;
}

.promise-card.fade-in:nth-child(2) {
    transition-delay: 0.1s;
}

.promise-card.fade-in:nth-child(3) {
    transition-delay: 0.15s;
}

.promise-card.fade-in:nth-child(4) {
    transition-delay: 0.2s;
}

.promise-card.fade-in:nth-child(5) {
    transition-delay: 0.25s;
}

.promise-card.fade-in:nth-child(6) {
    transition-delay: 0.3s;
}

/* ============================================= */
/* VALENTINE QUESTION                            */
/* ============================================= */
.valentine-section {
    min-height: 90vh;
}

.valentine-title {
    font-size: clamp(1.8rem, 5.5vw, 2.8rem) !important;
}

.buttons-wrapper {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 16px;
    position: relative;
}

.valentine-btn {
    font-family: var(--font);
    font-size: clamp(1.2rem, 3.5vw, 1.5rem);
    font-weight: 700;
    padding: 20px 52px;
    border: none;
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 6px 28px var(--shadow-md);
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.btn-yes {
    background: linear-gradient(135deg, #a8e6a3, #7dd87d);
    color: #2D5A27;
    animation: btnPulse 2s ease-in-out infinite;
}

@keyframes btnPulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 6px 28px rgba(125, 216, 125, 0.3);
    }

    50% {
        transform: scale(1.04);
        box-shadow: 0 8px 36px rgba(125, 216, 125, 0.5);
    }
}

.btn-yes:hover {
    transform: scale(1.1) !important;
    box-shadow: 0 10px 40px rgba(125, 216, 125, 0.5) !important;
}

.btn-no {
    background: linear-gradient(135deg, var(--pink-deep), var(--pink-hot));
    color: #8B2252;
    transition: all 0.15s ease;
}

.btn-no:hover {
    /* JS handles the runaway effect */
}

.btn-no.shrinking {
    animation: shrinkAway 0.3s ease forwards;
}

@keyframes shrinkAway {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(0.6);
        opacity: 0.5;
    }
}

/* ============================================= */
/* CELEBRATION OVERLAY                           */
/* ============================================= */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s ease;
}

.overlay.active {
    opacity: 1;
    pointer-events: all;
}

.celebration-overlay {
    background: radial-gradient(ellipse at center, rgba(255, 220, 229, 0.97) 0%, rgba(255, 244, 228, 0.97) 100%);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.overlay-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    padding: 40px 24px;
    text-align: center;
    max-width: 550px;
    z-index: 1002;
}

.overlay-text {
    font-size: clamp(1.2rem, 4vw, 1.6rem);
    font-weight: 700;
    color: var(--dark);
    line-height: 1.6;
    animation: textPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes textPop {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.celebration-text {
    background: linear-gradient(135deg, var(--rose), #c084fc, var(--rose));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: clamp(1.4rem, 5vw, 2rem);
    animation: textPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), gradientShift 3s ease-in-out infinite;
}

@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.overlay-subtext {
    font-family: var(--font-cursive);
    font-size: clamp(1rem, 3vw, 1.3rem);
    color: var(--rose);
    opacity: 0;
    animation: fadeUp 0.8s 0.4s ease-out forwards;
}

@keyframes fadeUp {
    0% {
        opacity: 0;
        transform: translateY(15px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.overlay-content::after {
    content: 'tap anywhere to close 💗';
    font-size: 0.8rem;
    color: rgba(45, 45, 45, 0.35);
    font-weight: 500;
    margin-top: 8px;
}

/* ============================================= */
/* CONFETTI & FIREWORKS                          */
/* ============================================= */
#confetti-container,
#fireworks-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1001;
    overflow: hidden;
}

.confetti-heart {
    position: absolute;
    animation: confettiFall var(--fall-duration, 3s) var(--fall-delay, 0s) ease-in forwards;
    pointer-events: none;
    user-select: none;
}

@keyframes confettiFall {
    0% {
        transform: translateY(-20px) rotate(0deg) scale(1);
        opacity: 1;
    }

    100% {
        transform: translateY(110vh) rotate(720deg) scale(0.3);
        opacity: 0;
    }
}

.firework {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    animation: fireworkBurst var(--fw-duration, 1.5s) var(--fw-delay, 0s) ease-out forwards;
}

@keyframes fireworkBurst {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }

    100% {
        transform: translate(var(--fw-x, 0), var(--fw-y, -80px)) scale(0);
        opacity: 0;
    }
}

/* ============================================= */
/* RESPONSIVE                                    */
/* ============================================= */
@media (max-width: 768px) {
    .section {
        padding: 60px 16px;
    }

    .hero-char .kawaii-char {
        width: 150px;
    }

    .kawaii-char {
        width: 130px;
    }

    .char-large .kawaii-char {
        width: 160px;
    }

    .buttons-wrapper {
        flex-direction: column;
        width: 100%;
        gap: 16px;
    }

    .valentine-btn {
        width: 100%;
        padding: 18px 40px;
    }

    .flip-grid,
    .promises-grid {
        grid-template-columns: 1fr;
    }

    .letter-card {
        padding: 28px 22px;
    }
}

@media (max-width: 480px) {
    .hero-char .kawaii-char {
        width: 120px;
    }

    .kawaii-char {
        width: 100px;
    }

    .char-large .kawaii-char {
        width: 130px;
    }

    .section-content {
        gap: 20px;
    }

    .flip-card {
        height: 200px;
    }

    .letter-card {
        padding: 22px 18px;
    }

    .overlay-content {
        padding: 28px 16px;
    }
}

/* ============================================= */
/* REDUCED MOTION                                */
/* ============================================= */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}