:root {
    --bg-color: #0d0b0a;
    /* Deep charcoal/brown */
    --text-primary: #e6dace;
    /* Earthy off-white */
    --text-secondary: #8c7c6b;
    --accent-glow: rgba(189, 102, 15, 0.4);
    /* Subtle ambient amber */
    --accent-solid: #d47e24;
    --font-heading: 'Cinzel', serif;
    --font-body: 'Inter', sans-serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    overflow: hidden;
    /* Prevent scrolling, fully immersive */
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* OVERLAY */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #1a1512 0%, var(--bg-color) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    transition: opacity 2s ease-in-out, visibility 2s ease-in-out;
}

.overlay.fade-out {
    opacity: 0;
    visibility: hidden;
}

.overlay-content {
    text-align: center;
    animation: slowFloat 6s ease-in-out infinite alternate;
}

.title {
    font-family: var(--font-heading);
    font-size: 4rem;
    letter-spacing: 0.2em;
    font-weight: 400;
    margin-bottom: 1rem;
    text-shadow: 0 0 20px var(--accent-glow);
    text-transform: uppercase;
}

.subtitle {
    font-size: 1.2rem;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    font-weight: 300;
}

.glow-on-hover {
    font-family: var(--font-heading);
    background: transparent;
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1rem 3rem;
    font-size: 1.2rem;
    letter-spacing: 0.1em;
    cursor: pointer;
    border-radius: 40px;
    transition: all 0.4s ease;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
}

.glow-on-hover::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    background: var(--accent-glow);
    border-radius: 50%;
    transition: width 0.6s ease, height 0.6s ease;
    z-index: -1;
    filter: blur(10px);
}

.glow-on-hover:hover::before {
    width: 300px;
    height: 300px;
}

.glow-on-hover:hover {
    border-color: var(--accent-solid);
    color: #fff;
    box-shadow: 0 0 20px var(--accent-glow);
}

/* MAIN CONTENT */
#main-content {
    width: 100%;
    height: 100%;
    position: relative;
    opacity: 0;
    transition: opacity 2s ease-in-out 0.5s;
}

#main-content.visible {
    opacity: 1;
}

canvas#visualizer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    /* Let clicks pass through */
}

/* LYRICS */
.experience-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding-right: 15%;
    z-index: 2;
    pointer-events: none;
}

.lyrics-container {
    max-width: 500px;
    height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: visible;
    /* Changed from hidden to avoid clipping the glowing text shadow */
    -webkit-mask-image: linear-gradient(to bottom, transparent, black 20%, black 80%, transparent);
    mask-image: linear-gradient(to bottom, transparent, black 20%, black 80%, transparent);
}

#lyrics-display {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 20px 40px;
    /* Add horizontal padding to prevent active scaled items from clipping */
    transition: transform 1s ease-out;
}

.lyric-line {
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--text-secondary);
    opacity: 0.3;
    padding: 0 20px;
    margin: 0 -20px;
    transition: all 0.8s ease;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
    transform: translateY(20px);
    transform-origin: left center;
    /* Scale from the left so it doesn't push past the left edge */
}

.lyric-line.active {
    opacity: 1;
    color: var(--text-primary);
    transform: translateY(0) scale(1.05);
    text-shadow: 0 0 15px var(--accent-glow);
}

.lyric-line.past {
    opacity: 0;
    transform: translateY(-20px);
}

/* AUDIO CONTROLS */
.audio-controls {
    position: absolute;
    bottom: 50px;
    left: 50px;
    right: 50px;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    z-index: 10;
    background: rgba(0, 0, 0, 0.4);
    padding: 1rem 2rem;
    border-radius: 40px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.control-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent-solid);
    transform: scale(1.1);
}

.icon {
    width: 24px;
    height: 24px;
}

.hidden {
    display: none !important;
}

.progress-bar-container {
    flex-grow: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

#progress-bar {
    height: 100%;
    width: 0%;
    background: var(--accent-solid);
    box-shadow: 0 0 10px var(--accent-solid);
    transition: width 0.1s linear;
}

#time-display {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
    min-width: 80px;
    text-align: right;
}

@keyframes slowFloat {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-15px);
    }
}

@media (max-width: 768px) {
    .title {
        font-size: 2.5rem;
    }

    .experience-container {
        justify-content: center;
        padding-right: 0;
        text-align: center;
    }

    .lyrics-container {
        -webkit-mask-image: none;
        mask-image: none;
        text-align: center;
    }

    .lyric-line {
        transform-origin: center center;
        /* On mobile, since they are center-aligned, scale from the center */
    }

    .audio-controls {
        bottom: 20px;
        left: 20px;
        right: 20px;
        padding: 0.8rem 1.5rem;
    }
}