:root {
    --bg-dark: #050505;
    --accent: #00ff9d;
    --headline: #c8c5be;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --glass: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --font-main: 'Outfit', sans-serif;
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    touch-action: manipulation;
    /* Disable double-tap zoom */
}

html {
    overscroll-behavior-x: none;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-main);
    overflow-x: hidden;
    line-height: 1.6;
    min-height: 100vh;
}

.hero-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-image: linear-gradient(rgba(0, 0, 0, 0.4), var(--bg-dark));
    background-size: cover;
    background-position: center;
    z-index: -1;
    filter: brightness(0.6);
}

/* Global Navigation */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    height: 80px;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    background: rgba(5, 5, 5, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
}

.logo {
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: -1px;
    text-transform: lowercase;
    text-decoration: none;
    color: white;
    transition: var(--transition-smooth);
}

.logo span {
    color: var(--accent);
}

.logo.lyrics-active {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.1;
    max-width: 60%;
}

.logo.lyrics-active .lyrics-song-title {
    font-size: clamp(0.85rem, 4vw, 1.1rem);
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
}

.logo.lyrics-active .lyrics-artist {
    font-size: clamp(0.6rem, 2.5vw, 0.75rem);
    font-weight: 500;
    color: var(--accent);
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: var(--transition-smooth);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--accent);
}

/* Common Section Layout */
section {
    max-width: 1100px;
    margin: 0 auto;
    padding: 120px 2rem 4rem;
}

h2 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 2rem;
    text-transform: uppercase;
    letter-spacing: -1px;
    color: var(--headline);
    line-height: 1;
}

/* Common Card/Glass elements */
.card {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    padding: 2rem;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    transition: var(--transition-smooth);
}

.card:hover {
    border-color: var(--accent);
    transform: translateY(-5px);
}

/* Featured Image on Landing */
.featured-image {
    width: 100%;
    max-width: 800px;
    margin: 0 auto 3.5rem;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
    background: var(--glass);
    backdrop-filter: blur(10px);
    line-height: 0;
}

.featured-image img {
    width: 100%;
    height: auto;
    display: block;
    filter: brightness(0.9);
    transition: var(--transition-smooth);
}

.featured-image:hover img {
    filter: brightness(1.1);
    transform: scale(1.02);
}

/* Brand Logo Integration */
.brand-logo-img {
    width: 100%;
    max-width: 500px;
    height: auto;
    margin-bottom: 2.5rem;
    mix-blend-mode: screen;
    /* Makes black background transparent */
    filter: contrast(1.1) brightness(1.2);
    /* Sharpens the white logo */
}

/* Mobile Navigation */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    z-index: 1000;
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 2px;
    background: var(--accent);
    transition: var(--transition-smooth);
}

@media (max-width: 768px) {
    nav {
        padding: 1rem;
    }

    .menu-toggle {
        display: flex;
    }

    .nav-links {
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        /* Start from top for scrolling */
        align-items: center;
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background: rgba(5, 5, 5, 0.98);
        backdrop-filter: blur(20px);
        transition: var(--transition-smooth);
        z-index: 500;
        gap: 2.5rem;
        padding: 8rem 2rem 4rem;
        /* Breathe room for logo and bottom */
        overflow-y: auto;
        /* Enable scrolling */
    }

    .nav-links.mobile-active {
        right: 0;
    }

    .nav-links a {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 2.2rem;
    }

    .fade-in {
        animation: fadeIn 0.4s ease forwards;
    }

    /* NEW: Return Highlight Pulse */
    @keyframes highlightPulse {
        0% {
            border-color: var(--accent);
            box-shadow: 0 0 0 rgba(0, 255, 157, 0);
        }

        30% {
            border-color: var(--accent);
            box-shadow: 0 0 30px rgba(0, 255, 157, 0.4);
        }

        100% {
            border-color: var(--glass-border);
            box-shadow: 0 0 0 rgba(0, 255, 157, 0);
        }
    }

    .highlight-pulse {
        animation: highlightPulse 2s ease-out;
        border-color: var(--accent) !important;
    }

    section {
        padding: 8rem 1.5rem 1rem;
    }

    .brand-logo-img {
        max-width: 80%;
    }
}

/* Hamburger animations */
body.nav-open .menu-toggle span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

body.nav-open .menu-toggle span:nth-child(2) {
    opacity: 0;
}

body.nav-open .menu-toggle span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

body.nav-open {
    overflow: hidden;
}

/* Global Footer */
footer {
    padding: 4rem 2rem 3rem;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 500;
    opacity: 0.6;
}

/* Utilities */
.hidden {
    display: none;
}

/* Artist Mode Specifics */
.artist-meta {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--glass-border);
}

.artist-meta span {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--accent);
    background: rgba(0, 255, 157, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 1px;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    pointer-events: none;
}

.toast {
    background: rgba(5, 5, 5, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid var(--accent);
    color: white;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 1px;
    box-shadow: 0 10px 30px rgba(0, 255, 157, 0.2);
    animation: toast-in 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast::before {
    content: '✓';
    color: var(--accent);
    font-weight: 800;
}

@keyframes toast-in {
    from {
        transform: translateY(100px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.toast.fade-out {
    animation: toast-out 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toast-out {
    from {
        transform: translateY(0);
        opacity: 1;
    }

    to {
        transform: translateY(-20px);
        opacity: 0;
    }
}

/* The Score Aesthetic Stats Box (Global) */
.section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 3.5rem;
    flex-wrap: wrap;
    gap: 1.5rem;
    min-height: 60px;
    /* Ensure baseline consistency */
}

.section-header h2 {
    margin-bottom: 0;
    white-space: nowrap;
}

.stats-box {
    display: flex;
    background: #000;
    border: 1px solid var(--glass-border);
    padding: 2px;
    border-radius: 4px;
    font-family: 'Outfit', sans-serif;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.stat-item {
    width: 90px;
    padding: 0.5rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-item:last-child {
    border-right: none;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
}

.stat-label {
    font-size: 0.55rem;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 1px;
    margin-top: 2px;
    text-transform: uppercase;
}

@media (max-width: 768px) {
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }

    .stats-box {
        width: 100%;
        justify-content: space-between;
    }

    .stat-item {
        flex: 1;
    }
}

/* --- THE PLACER: Global Mini-Player --- */
.loophole-placer {
    position: fixed;
    bottom: -200px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 2rem);
    max-width: 600px;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    padding: 0.8rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1000;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loophole-placer.active {
    bottom: 2rem;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.placer-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    overflow: hidden;
}

.placer-title {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--accent);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
}

.placer-artist {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.placer-controls {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.placer-prev-btn,
.placer-next-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
    color: var(--text-secondary);
}

.placer-play-btn {
    background: var(--accent);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.placer-play-btn:hover {
    transform: scale(1.1);
}

.placer-prev-btn:hover,
.placer-next-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: scale(1.08);
}

.placer-prev-btn[disabled],
.placer-next-btn[disabled] {
    opacity: 0.35;
    cursor: default;
    transform: none;
}

.placer-close-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
    color: var(--text-secondary);
}

.placer-close-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: scale(1.08);
}

.placer-play-btn svg {
    width: 18px;
    height: 18px;
    fill: black;
}

.placer-prev-btn svg,
.placer-next-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.placer-close-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2.2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.placer-progress {
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 4rem);
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    overflow: hidden;
    cursor: pointer;
}

.placer-progress-bar {
    height: 100%;
    background: var(--accent);
    width: 0%;
    transition: width 0.1s linear;
}
