:root {
    --bg-main: #0a0508;
    --text-main: #ffffff;
    --text-dim: #b3a5b0;
    --accent: #ff4d85;
    --accent-glow: rgba(255, 77, 133, 0.4);
    --font-sans: 'Montserrat', sans-serif;
    --font-serif: 'Playfair Display', serif;
    --font-cursive: 'Caveat', cursive;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-sans);
    overflow-x: hidden;
    position: relative;
    scroll-behavior: smooth;
    cursor: none;
    /* Custom cursor */
}



/* Custom Cursor */
.custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, rgba(255, 255, 255, 1) 0%, rgba(255, 77, 133, 0.5) 50%, transparent 100%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    mix-blend-mode: screen;
    box-shadow: 0 0 15px rgba(255, 77, 133, 0.8);
    transition: width 0.2s, height 0.2s;
}

.custom-cursor.hover {
    width: 40px;
    height: 40px;
}

::-webkit-scrollbar {
    display: none;
}

/* Dynamic Soft Background */
.dynamic-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.5;
    animation: float 20s infinite alternate ease-in-out;
}

.b1 {
    width: 50vw;
    height: 50vw;
    background: #3a0d1e;
    top: -10%;
    left: -10%;
}

.b2 {
    width: 40vw;
    height: 40vw;
    background: #1f0b2e;
    bottom: -10%;
    right: -10%;
    animation-delay: -5s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(100px, 50px) scale(1.2);
    }
}

.vignette {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, transparent 10%, #050204 100%);
}

#fx-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10;
    pointer-events: none;
}

/* --- SPOTIFY BACKGROUND LYRICS --- */
.bg-lyrics-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 5;
    /* Behind text, above background */
    pointer-events: none;
    /* User clicks pass through */
    display: flex;
    flex-direction: column;
    padding-left: 5%;
    overflow: hidden;
    mask-image: linear-gradient(to bottom, transparent 5%, black 40%, black 60%, transparent 95%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 5%, black 40%, black 60%, transparent 95%);
}

.bg-lyrics-content {
    display: flex;
    flex-direction: column;
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
    transform: translateY(0px);
    /* Managed by JS */
}

.bg-lyric-line {
    font-family: var(--font-sans);
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 900;
    color: rgba(255, 255, 255, 0.15);
    /* Dimmed by default */
    margin: 15px 0;
    line-height: 1.2;
    filter: blur(4px);
    transition: all 0.5s ease;
    transform-origin: left center;
    transform: scale(0.95);
}

.bg-lyric-line.active {
    color: rgba(255, 255, 255, 0.7);
    /* BRIGHTER active state */
    filter: blur(0px);
    transform: scale(1.05);
    /* Beat pulse scale */
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

/* WOW Accents in background text */
.bg-lyric-line.accent-lyric {
    transition: all 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.bg-lyric-line.accent-lyric.active {
    color: var(--accent);
    /* Pink color */
    transform: scale(1.1);
    text-shadow: 0 0 30px var(--accent-glow), 0 0 60px var(--accent);
    position: relative;
    z-index: 10;
}

.bg-lyric-line.accent-lyric.active::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 10%;
    width: 80%;
    height: 150%;
    transform: translateY(-50%);
    background: radial-gradient(ellipse at center, rgba(255, 77, 133, 0.2) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
    animation: pulse-aura 2s infinite alternate ease-in-out;
}

@keyframes pulse-aura {
    0% {
        transform: translateY(-50%) scale(1);
        opacity: 0.5;
    }

    100% {
        transform: translateY(-50%) scale(1.5);
        opacity: 1;
        filter: hue-rotate(15deg);
    }
}

/* --- AUDIO CONTROLS (Volume) --- */
.audio-controls {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 10px 15px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: opacity 0.5s;
}

.audio-controls.hidden {
    opacity: 0;
    pointer-events: none;
}

.audio-controls span {
    font-size: 1.2rem;
}

.audio-controls input[type="range"] {
    appearance: none;
    width: 100px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    outline: none;
}

.audio-controls input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--text-main);
    cursor: pointer;
}

/* Start Screen */
.start-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--bg-main);
    z-index: 200;
    transition: opacity 1s;
}

.player-card {
    text-align: center;
    padding: 50px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
}

.player-card h1 {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.player-card p {
    color: var(--text-dim);
    margin-bottom: 30px;
}

.pulse-loader {
    width: 40px;
    height: 40px;
    margin: 20px auto 0;
    border-radius: 50%;
    background: var(--accent);
    animation: scale-pulse 1.5s infinite ease-in-out;
}

@keyframes scale-pulse {
    0% {
        transform: scale(0.8);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.2);
        opacity: 1;
        box-shadow: 0 0 20px var(--accent);
    }

    100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
}

.play-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--text-main);
    color: var(--bg-main);
    border: none;
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.2);
}

.play-btn:hover {
    transform: scale(1.1);
    background: var(--accent);
    color: white;
    box-shadow: 0 0 40px var(--accent-glow);
}

/* Content */
.main-content {
    position: relative;
    z-index: 50;
    padding: 0 20px;
}

.main-content.hidden {
    display: none;
}

.story-container {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    /* Center text for notebook feel */
}

.spacer-small {
    height: 15vh;
}

.visual-break {
    height: 15vh;
}

.mega-space {
    height: 30vh;
}

.spacer {
    height: 30vh;
}

/* Handwriting Text Styling on Notebook Paper */
.greeting-title {
    font-family: var(--font-cursive);
    font-size: clamp(3rem, 8vw, 5rem);
    color: var(--text-main);
    margin-bottom: 2rem;
    padding: 30px 40px;
    display: inline-block;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);

    /* Dark Notebook Card */
    background-color: #0d060a;
    /* Very dark background to block lyrics */
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 25px 25px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
}

.greeting-text {
    font-family: var(--font-cursive);
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    line-height: 1.5;
    color: var(--text-dim);
    margin: 2rem 0;
    padding: 30px 40px;
    display: inline-block;
    max-width: 90%;

    /* Dark Notebook Card */
    background-color: #0d060a;
    /* Very dark background to block lyrics */
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 25px 25px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
}

.highlight-phrase {
    color: var(--text-main);
    font-weight: 600;
}

.magic-reveal {
    display: block;
    margin-top: 10px;
    font-family: var(--font-serif);
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    color: var(--accent);
    font-style: italic;
    font-weight: 800;
}

.fade-up {
    /* Base class for elements that will be revealed via scroll */
    opacity: 0;
    transform: translateY(30px);
}

/* Photo Overhaul */
.photo-card {
    position: relative;
    width: 100%;
    max-width: 450px;
    margin: 0 0 0 auto;
    border-radius: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    /* GSAP will control movement, removed static rotate */
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10;
}

.photo-card::before {
    content: "";
    position: absolute;
    inset: -20px;
    background: radial-gradient(circle, rgba(255, 77, 133, 0.35), transparent 70%);
    filter: blur(30px);
    z-index: -1;
    pointer-events: none;
}

.photo-inner img {
    width: 100%;
    border-radius: 4px;
    display: block;
}

/* Central Hero Object */
.hero-center-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 80px 0;
    perspective: 1000px;
}

.interactive-rose-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-center-img {
    width: clamp(200px, 40vw, 400px);
    filter: drop-shadow(0 0 50px rgba(255, 77, 133, 0.4));
    transform-style: preserve-3d;
    transition: filter 0.5s ease, transform 0.5s ease;
    z-index: 10;
}

.rose-signature {
    font-family: var(--font-cursive);
    font-size: clamp(1.2rem, 3vw, 2.2rem);
    color: var(--text-dim);
    margin-top: 15px;
    opacity: 0;
    transform: translateY(15px);
    text-shadow: 0 0 10px rgba(255, 77, 133, 0.3);
}

.interactive-petal {
    position: absolute;
    width: 15px;
    height: 15px;
    background: linear-gradient(135deg, #ff4d85, #ff8da1);
    border-radius: 50% 0 50% 50%;
    pointer-events: none;
    opacity: 0;
    z-index: 5;
    box-shadow: 0 0 10px rgba(255, 77, 133, 0.6);
}

.hero-center-img {
    width: clamp(200px, 40vw, 400px);
    filter: drop-shadow(0 0 50px rgba(255, 77, 133, 0.4));
    transform-style: preserve-3d;
    transition: filter 0.3s ease;
}

.hero-center-img:hover {
    filter: drop-shadow(0 0 80px rgba(255, 77, 133, 0.8));
}

.rose-prompt {
    position: absolute;
    top: 10%;
    right: -20%;
    font-family: var(--font-cursive);
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    color: var(--accent);
    text-shadow: 0 0 15px rgba(255, 77, 133, 0.8), 0 0 30px rgba(255, 77, 133, 0.5);
    pointer-events: none;
    animation: bouncePrompt 2s infinite ease-in-out;
    transform: rotate(15deg);
}

@keyframes bouncePrompt {

    0%,
    100% {
        transform: translateY(0) rotate(15deg);
    }

    50% {
        transform: translateY(-15px) rotate(15deg);
    }
}

.rose-reveal-text {
    font-family: var(--font-serif);
    font-size: clamp(1.2rem, 3.5vw, 2rem);
    /* Slightly smaller to fit inside card */
    color: #fff;
    text-shadow: 0 0 20px rgba(255, 77, 133, 0.6);
    margin-top: 20px;
    /* Reduced margin */
    text-align: center;
    line-height: 1.4;
    font-style: italic;
    font-weight: 600;
    /* display is now handled inline by style attribute */
}

.rose-reveal-text span {
    display: inline-block;
}

/* Screen Flash Overlay */
.screen-flash {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.35), rgba(255, 77, 133, 0.12), transparent 70%);
    pointer-events: none;
    z-index: 999;
}

/* Finale */
.finale-section {
    padding: 10vh 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 30vh;
    position: relative;
    z-index: 500;
}

.finale-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    padding-top: 5vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    z-index: 9999;
    pointer-events: none;
    /* Let clicks pass through until active */
}

.finale-pre-title {
    font-family: var(--font-serif);
    font-size: clamp(1.5rem, 3vh, 3rem);
    font-weight: 600;
    font-style: italic;
    color: var(--text-dim);
    margin-bottom: 2vh;
    opacity: 0;
    text-align: center;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.finale-title {
    font-family: var(--font-sans);
    font-size: clamp(2.5rem, 6vh, 5rem);
    font-weight: 800;
    margin-bottom: 0;
    margin-top: 0;
    letter-spacing: -1px;
    color: #fff;
    text-shadow:
        0 0 20px rgba(255, 77, 133, 0.6),
        0 0 50px rgba(255, 77, 133, 0.3);
    opacity: 0;
    /* Hidden until triggered */
    text-align: center;
    line-height: 1.1;
}

.finale-icon {
    height: clamp(60px, 12vh, 150px);
    width: auto;
    opacity: 0;
    margin-bottom: 1vh;
    filter: drop-shadow(0 0 30px rgba(255, 77, 133, 0.5));
    mix-blend-mode: screen;
}

.finale-portrait {
    height: clamp(250px, 50vh, 600px);
    width: auto;
    max-width: 90vw;
    object-fit: cover;
    border-radius: 20px;
    margin-top: 1vh;
    opacity: 0;
    /* Hidden until triggered */
    filter: drop-shadow(0 0 50px rgba(255, 77, 133, 0.4));
    z-index: 501;
}

.explode-btn {
    background: linear-gradient(45deg, #ff4d85, #ff8da1);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.5rem;
    font-family: var(--font-sans);
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 10px 20px var(--accent-glow);
    transition: transform 0.2s;
}

.explode-btn:hover {
    transform: scale(1.05);
}

/* Progress */
.audio-progress {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100vw;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    z-index: 1000;
}

.audio-bar {
    height: 100%;
    width: 0%;
    background: var(--accent);
}

/* --- MOBILE OPTIMIZATIONS --- */
@media (max-width: 768px) {

    /* Prevent lyrics from being too overwhelming */
    .bg-lyric-line {
        font-size: clamp(2.5rem, 8vw, 4rem);
        margin: 10px 0;
    }

    .bg-lyrics-container {
        padding-left: 2%;
        /* less offset */
        mask-image: linear-gradient(to bottom, transparent 2%, black 30%, black 70%, transparent 95%);
        -webkit-mask-image: linear-gradient(to bottom, transparent 2%, black 30%, black 70%, transparent 95%);
    }

    /* Fix Rose Prompt position to stay inside card */
    .rose-prompt {
        bottom: 5px;
        right: 15px;
        font-size: 1.5rem;
    }

    /* Make greeting text slightly tighter padding */
    .greeting-title,
    .greeting-text {
        padding: 20px 25px;
        line-height: 1.4;
    }

    /* Finale Overlay adjustments to prevent overflow */
    .finale-title {
        white-space: normal;
        /* allow text wrap just in case */
        line-height: 1.1;
    }

    .finale-portrait {
        width: 200px;
        height: 280px;
        transform: translateY(30px) rotate(-3deg);
    }

    .finale-icon {
        width: 50px;
    }
}