* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --chocolate-dark: #3e2723;
    --chocolate-medium: #5d4037;
    --chocolate-light: #8d6e63;
    --gold: #d4af37;
    --pink: #ff69b4;
    --cream: #f5deb3;
}

body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    overflow-x: hidden;
    height: 100vh;
    overflow-y: auto;
}

/* Cursor Trail Effect */
canvas#cursor-trail {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 999;
}

/* Fixed Navigation */
nav {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    gap: 15px;
    align-items: center;
}

/* sound toggle styles removed */

/* Section Spacing */
section {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Main Container */
.main-container {
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0;
    left: 0;
    background: linear-gradient(135deg, #2a2a3e 0%, #1a1a2e 100%);
    overflow: hidden;
    z-index: 5;
}

.transformation-stage {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hero Section - Chocolate Bar */
.stage-1 {
    background: linear-gradient(180deg, #2a2a3e 0%, #1a1a2e 100%);
    overflow: hidden;
}

.chocolate-wrapper {
    position: fixed;
    width: 280px;
    height: 480px;
    perspective: 1000px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    transition: opacity 1s ease-in-out, visibility 1s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Greeting heading above the chocolate */
.greeting {
    position: fixed;
    top: 18%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 920;
    text-align: center;
    pointer-events: none;
}

.greeting h2 {
    font-family: "Poppins", serif;
    color: var(--gold);
    font-size: 1.6rem;
    letter-spacing: 1px;
    text-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
    margin: 0;
}

.chocolate-bar {
    position: relative;
    width: 200px;
    height: 400px;
    background: linear-gradient(135deg, #3e2723 0%, #6d4c41 50%, #4e342e 100%);
    border-radius: 10px;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.8),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform-origin: center;
    perspective: 1000px;
    transition: all 1s ease-in-out;
    z-index: 10;
    margin: 0 auto;
}

.chocolate-bar.melting {
    width: 220px;
    height: 380px;
    border-radius: 50% 50% 40% 40%;
    opacity: 0.7;
}

.chocolate-bar.melting-complete {
    opacity: 0;
    pointer-events: none;
}

.chocolate-bar.cracked {
    animation: intense-crack 0.8s ease-out;
}

@keyframes intense-crack {
    0% {
        transform: scaleY(1) rotateZ(0deg) rotateX(0deg);
    }

    25% {
        transform: scaleY(0.92) rotateZ(-2deg) rotateX(5deg);
    }

    50% {
        transform: scaleY(0.88) rotateZ(3deg) rotateX(-5deg);
    }

    75% {
        transform: scaleY(0.95) rotateZ(-1deg) rotateX(2deg);
    }

    100% {
        transform: scaleY(1) rotateZ(0.5deg) rotateX(0deg);
    }
}

.chocolate-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 2;
    width: 90%;
}

.chocolate-content h1 {
    font-size: 1.8rem;
    color: var(--gold);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    font-weight: normal;
    letter-spacing: 2px;
    opacity: 0;
    animation: engrave 1s ease-in-out 0.5s forwards;
}

/* Headings: sleek, soft display font */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Poppins', 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-weight: 400;
}

@keyframes engrave {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.crack-lines {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 10px;
}

.crack-line {
    position: absolute;
    background: linear-gradient(90deg, transparent, rgba(255, 200, 100, 0.6), transparent);
    opacity: 0;
    transform-origin: center;
    box-shadow: 0 0 8px rgba(255, 200, 100, 0.8);
}

.crack-line.appear {
    animation: crack-appear 0.6s ease-out forwards;
}

@keyframes crack-appear {
    0% {
        opacity: 0;
        transform: scaleX(0);
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.6;
        transform: scaleX(1);
    }
}

/* Melting Section */
.stage-2 {
    background: linear-gradient(180deg, #1a1a2e 0%, #2a2a3e 100%);
    position: relative;
}

.stage-2 .melting-container {
    position: relative;
    width: 250px;
    height: 450px;
    perspective: 1000px;
}

.melting-chocolate {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 10px;
    background: linear-gradient(135deg, #3e2723 0%, #6d4c41 50%, #4e342e 100%);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    overflow: hidden;
    transition: all 0.5s ease;
}

/* Heart Section */
.stage-3 {
    background: linear-gradient(180deg, #2a2a3e 0%, #1a1a2e 100%);
    position: relative;
}

.stage-3 .heart-container {
    position: relative;
    width: 400px;
    height: 400px;
}

/* End Section */
.stage-4 {
    background: linear-gradient(135deg, #3e2723 0%, #8d6e63 100%);
}

.chocolate-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 20;
    width: 200px;
    pointer-events: none;
    transition: opacity 1s ease-in-out, visibility 1s ease-in-out;
}

.chocolate-text p {
    font-size: 1.3rem;
    line-height: 1.8;
    color: var(--gold);
    text-shadow: 0 0 20px rgba(0, 0, 0, 0.9), 2px 2px 4px rgba(0, 0, 0, 0.8);
    font-style: italic;
    font-weight: bold;
    opacity: 0;
}

/* Drips */
.drips {
    position: absolute;
    width: 200px;
    height: 400px;
    top: 0;
    left: 0;
    overflow: visible;
    border-radius: 10px;
    pointer-events: none;
}

.drip {
    position: absolute;
    background: linear-gradient(180deg, #3e2723 0%, rgba(62, 39, 35, 0));
    border-radius: 50% 50% 50% 0;
    opacity: 0;
    z-index: 3;
}

.drip.active {
    animation: drip-fall 2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes drip-fall {
    0% {
        opacity: 1;
        transform: translateY(0) scaleY(1);
    }

    100% {
        opacity: 0;
        transform: translateY(400px) scaleY(0.6);
    }
}

svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 20px 40px rgba(212, 175, 55, 0.3));
}

.heart-container {
    position: absolute;
    width: 400px;
    height: 400px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    z-index: 30;
    transition: opacity 0.8s ease-in-out, visibility 0.8s ease-in-out;
    pointer-events: none;
}

.heart-path {
    fill: url(#heartGradient);
    opacity: 0;
    animation: heart-appear 1s ease-in-out 0.5s forwards;
}

@keyframes heart-appear {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Final Message */
.final-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    opacity: 0;
    z-index: 40;
    transition: opacity 1s ease-in-out, visibility 1s ease-in-out;
    pointer-events: none;
}

.final-message h2 {
    font-size: 1.5rem;
    color: var(--gold);
    font-weight: normal;
    letter-spacing: 2px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

@keyframes fade-in {
    to {
        opacity: 1;
    }
}

.end-content {
    text-align: center;
    animation: fade-in 1s ease-in-out forwards;
}

.end-content h2 {
    font-size: 2.5rem;
    color: var(--gold);
    margin-bottom: 20px;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
}

.end-content p {
    font-size: 1.2rem;
    color: var(--cream);
    font-style: italic;
    margin-bottom: 30px;
}

.heart-emoji {
    font-size: 4rem;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .chocolate-bar {
        width: 150px;
        height: 300px;
    }

    .chocolate-bar.melting {
        width: 150px;
        height: 300px;
    }

    .chocolate-content h1 {
        font-size: 1.3rem;
    }

    .melting-container {
        width: 180px;
        height: 340px;
    }

    .chocolate-text p {
        font-size: 0.9rem;
    }

    .heart-container {
        width: 300px;
        height: 300px;
    }

    .end-content h2 {
        font-size: 1.8rem;
    }

    .end-content p {
        font-size: 1rem;
    }

    nav {
        top: 10px;
        right: 10px;
        gap: 10px;
    }

    .sound-toggle {
        padding: 8px 12px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .chocolate-bar {
        width: 120px;
        height: 250px;
    }

    .chocolate-content h1 {
        font-size: 1rem;
        letter-spacing: 1px;
    }

    .melting-container {
        width: 140px;
        height: 280px;
    }

    .chocolate-text p {
        font-size: 0.8rem;
        line-height: 1.5;
    }

    .heart-container {
        width: 300px;
        height: 300px;
    }

    .end-content h2 {
        font-size: 1.4rem;
    }

    .heart-emoji {
        font-size: 3rem;
    }
}

/* Scroll Progress Indicator */
.scroll-indicator {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(212, 175, 55, 0.3);
    color: var(--gold);
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
    border: 1px solid var(--gold);
    z-index: 900;
}

@media (max-width: 768px) {
    .scroll-indicator {
        bottom: 10px;
        padding: 8px 15px;
        font-size: 0.8rem;
    }
}