@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300;1,400&family=IM+Fell+English:ital@0;1&family=Cinzel+Decorative:wght@400;700&display=swap');

:root {
    --black: #050505;
    --deep: #0a0a0a;
    --charcoal: #141414;
    --ash: #1e1e1e;
    --fog: #2a2a2a;
    --silver: #8a8a8a;
    --pearl: #c8c8c8;
    --white: #f0ede8;
    --wendia: #7b2d8b;
    --wendia-light: #a855c8;
    --wendia-pale: #d4a0e8;
    --wendia-glow: rgba(123, 45, 139, 0.4);
    --wendia-faint: rgba(168, 85, 200, 0.12);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--black);
    color: var(--white);
    font-family: 'Cormorant Garamond', serif;
    min-height: 100vh;
    overflow-x: hidden;
    cursor: none;
}

/* Noise overlay */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.035'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 9997;
    opacity: 0.4;
}

/* Custom cursor */
.cursor {
    position: fixed;
    width: 8px;
    height: 8px;
    background: var(--wendia-light);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transition: transform 0.1s ease;
    box-shadow: 0 0 12px var(--wendia-glow);
}

.cursor-ring {
    position: fixed;
    width: 28px;
    height: 28px;
    border: 1px solid var(--wendia);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transition: transform 0.15s ease, opacity 0.3s;
    opacity: 0.6;
}

/* ============================================
           FONDO ANIMADO — NEBLINA WENDIA
           ============================================ */
.fondo-neblina {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.fondo-neblina::before {
    content: '';
    position: absolute;
    inset: -50%;
    background: radial-gradient(ellipse 80% 60% at 50% 40%, rgba(123, 45, 139, 0.08) 0%, transparent 70%),
        radial-gradient(ellipse 40% 40% at 20% 80%, rgba(100, 30, 120, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse 50% 30% at 80% 20%, rgba(80, 20, 100, 0.05) 0%, transparent 60%);
    animation: fogDrift 18s ease-in-out infinite alternate;
}

@keyframes fogDrift {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(-3%, 2%) scale(1.04);
    }
}

/* Pétalos cayendo */
.petal {
    position: absolute;
    border-radius: 80% 20% 80% 20%;
    opacity: 0;
    z-index: 4;
    animation: petalFall linear infinite;
    box-shadow: 0 0 6px var(--wendia-glow);
}

@keyframes petalFall {
    0% {
        transform: translateY(-20px) rotate(0deg) translateX(0);
        opacity: 0;
    }

    10% {
        opacity: 0.7;
    }

    90% {
        opacity: 0.3;
    }

    100% {
        transform: translateY(100vh) rotate(540deg) translateX(60px);
        opacity: 0;
    }
}

/* ============================================
           NAV
           ============================================ */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to bottom, rgba(5, 5, 5, 0.95) 0%, transparent 100%);
    backdrop-filter: blur(4px);
}

.nav-logo {
    font-family: 'Cinzel Decorative', serif;
    font-size: 0.85rem;
    letter-spacing: 0.2em;
    color: var(--wendia-light);
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 32px;
    list-style: none;
}

.nav-links a {
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.85rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--silver);
    text-decoration: none;
    transition: color 0.3s;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--wendia-light);
    transition: width 0.3s ease;
}

.nav-links a:hover {
    color: var(--wendia-pale);
}

.nav-links a:hover::after {
    width: 100%;
}

/* ============================================
           APP CONTENEDOR
           ============================================ */
.app {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: 80px;
}

/* ============================================
           HEADER — PORTADA DEL ÁLBUM 3D
           ============================================ */
.header-album {
    padding: 60px 20px 40px;
    text-align: center;
    perspective: 1000px;
    position: relative;
}

/* Portada 3D con efecto de profundidad */
.portada-3d {
    width: 280px;
    height: 280px;
    margin: 0 auto 30px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
}

.portada-3d:hover {
    transform: rotateY(15deg) rotateX(5deg) scale(1.05);
}

.portada-3d.girando {
    animation: girarPortada 8s linear infinite;
}

@keyframes girarPortada {
    0% {
        transform: rotateY(0deg);
    }

    100% {
        transform: rotateY(360deg);
    }
}

.portada-cara {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 40px var(--wendia-faint);
}

.portada-cara.frontal {
    background: linear-gradient(135deg, var(--deep) 0%, var(--charcoal) 50%, var(--ash) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 1px solid rgba(123, 45, 139, 0.3);
}

.portada-cara.frontal img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.portada-cara.trasera {
    background: linear-gradient(135deg, var(--charcoal) 0%, var(--deep) 100%);
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 30px;
    border: 1px solid rgba(123, 45, 139, 0.3);
}

.portada-cara.trasera p {
    font-size: 0.85em;
    color: var(--silver);
    line-height: 1.6;
    text-align: center;
    font-family: 'IM Fell English', serif;
    font-style: italic;
}

/* Info del álbum */
.info-album h1 {
    font-family: 'Cinzel Decorative', serif;
    font-size: 2.2em;
    color: var(--white);
    letter-spacing: 3px;
    margin-bottom: 8px;
    text-shadow: 0 0 30px var(--wendia-faint);
}

.info-album .artista {
    font-family: 'IM Fell English', serif;
    font-style: italic;
    font-size: 1.1em;
    color: var(--wendia-pale);
    margin-bottom: 15px;
}

.info-album .meta {
    font-size: 0.85em;
    color: var(--silver);
    letter-spacing: 2px;
}

.divider-ornament {
    display: flex;
    align-items: center;
    gap: 16px;
    justify-content: center;
    margin: 24px 0;
}

.divider-ornament::before,
.divider-ornament::after {
    content: '';
    height: 1px;
    width: 80px;
    background: linear-gradient(90deg, transparent, var(--wendia), transparent);
}

.divider-icon {
    color: var(--wendia-light);
    font-size: 1.2rem;
}

/* ============================================
           VISUALIZADOR DE AUDIO (Canvas)
           ============================================ */
.visualizador-contenedor {
    width: 100%;
    max-width: 600px;
    margin: 0 auto 30px;
    height: 120px;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(20, 20, 20, 0.8) 0%, rgba(10, 10, 10, 0.95) 100%);
    border: 1px solid rgba(123, 45, 139, 0.2);
}

#visualizador {
    width: 100%;
    height: 100%;
}

.visualizador-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Cinzel Decorative', serif;
    font-size: 0.8em;
    color: var(--silver);
    letter-spacing: 3px;
    pointer-events: none;
    transition: opacity 0.3s;
}

.visualizador-overlay.oculto {
    opacity: 0;
}

/* ============================================
           INFO DE CANCIÓN ACTUAL
           ============================================ */
.info-cancion-actual {
    max-width: 600px;
    margin: 0 auto 30px;
    padding: 25px;
    background: linear-gradient(180deg, rgba(20, 20, 20, 0.6) 0%, rgba(10, 10, 10, 0.8) 100%);
    border: 1px solid rgba(123, 45, 139, 0.2);
    border-radius: 12px;
    text-align: center;
    min-height: 100px;
    max-height: 340px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.info-cancion-actual .titulo-actual {
    position: sticky;
    top: 0;
    background: inherit;
}

.info-cancion-actual .titulo-actual {
    font-family: 'Cinzel Decorative', serif;
    font-size: 1.2em;
    color: var(--wendia-pale);
    margin-bottom: 8px;
    letter-spacing: 0.1em;
}

.info-cancion-actual .letra-actual {
    font-family: 'IM Fell English', serif;
    font-style: italic;
    font-size: 0.95em;
    color: var(--silver);
    line-height: 1.7;
    min-height: 1.6em;
    white-space: pre-line;
    text-align: left;
}

.cursor-escritura::after {
    content: '|';
    animation: parpadear 1s infinite;
    color: var(--wendia-light);
}

@keyframes parpadear {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* ============================================
           CONTROLES DE REPRODUCCIÓN
           ============================================ */
.controles-principales {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 25px;
    padding: 20px;
    margin-bottom: 20px;
}

.btn-control {
    background: none;
    border: none;
    color: var(--white);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Cinzel Decorative', serif;
}

.btn-control:hover {
    color: var(--wendia-light);
    transform: scale(1.2);
    text-shadow: 0 0 15px var(--wendia-glow);
}

.btn-control:active {
    transform: scale(0.95);
}

.btn-play {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(123, 45, 139, 0.3) 0%, rgba(20, 20, 20, 0.8) 100%);
    border: 1px solid var(--wendia);
    color: var(--white);
    font-size: 1.8em;
    box-shadow: 0 0 25px var(--wendia-faint);
    transition: all 0.3s;
}

.btn-play:hover {
    box-shadow: 0 0 40px var(--wendia-glow);
    transform: scale(1.1);
    border-color: var(--wendia-light);
}

.btn-play.reproduciendo {
    background: linear-gradient(135deg, var(--wendia) 0%, rgba(123, 45, 139, 0.3) 100%);
    animation: pulsar-play 2s ease-in-out infinite;
}

@keyframes pulsar-play {

    0%,
    100% {
        box-shadow: 0 0 25px var(--wendia-faint);
    }

    50% {
        box-shadow: 0 0 50px var(--wendia-glow);
    }
}

.btn-secundario {
    font-size: 1.5em;
    opacity: 0.7;
}

.btn-secundario:hover {
    opacity: 1;
}

/* ============================================
           BARRA DE PROGRESO
           ============================================ */
.barra-progreso-contenedor {
    max-width: 600px;
    margin: 0 auto 10px;
    padding: 0 20px;
}

.tiempos {
    display: flex;
    justify-content: space-between;
    font-size: 0.75em;
    color: var(--silver);
    margin-bottom: 8px;
    font-family: 'Courier New', monospace;
}

.barra-progreso {
    width: 100%;
    height: 4px;
    background: var(--ash);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.barra-progreso-relleno {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--wendia) 0%, var(--wendia-light) 100%);
    border-radius: 2px;
    transition: width 0.1s linear;
    box-shadow: 0 0 10px var(--wendia-glow);
}

.barra-progreso:hover .barra-progreso-relleno {
    box-shadow: 0 0 20px var(--wendia-light);
}

/* ============================================
           VOLUMEN
           ============================================ */
.volumen-contenedor {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 15px 20px;
    margin-bottom: 20px;
}

.volumen-contenedor span {
    font-size: 1.2em;
    color: var(--silver);
}

.barra-volumen {
    width: 120px;
    height: 4px;
    background: var(--ash);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}

.barra-volumen-relleno {
    height: 100%;
    width: 70%;
    background: var(--wendia-light);
    border-radius: 2px;
    transition: width 0.1s;
}

/* ============================================
           MODOS: ALEATORIO Y REPETIR
           ============================================ */
.modos-reproduccion {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 10px 20px 20px;
}

.btn-modo {
    background: none;
    border: none;
    color: var(--silver);
    cursor: pointer;
    font-size: 1.1em;
    transition: all 0.3s;
    padding: 8px;
    border-radius: 50%;
    font-family: 'Cinzel Decorative', serif;
}

.btn-modo:hover {
    color: var(--wendia-pale);
}

.btn-modo.activo {
    color: var(--wendia-light);
    text-shadow: 0 0 10px var(--wendia-glow);
}

/* ============================================
           LISTA DE CANCIONES
           ============================================ */
.lista-canciones {
    max-width: 700px;
    margin: 0 auto;
    padding: 0 20px 100px;
}

.lista-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(123, 45, 139, 0.2);
    margin-bottom: 10px;
    font-family: 'Cinzel Decorative', serif;
    font-size: 0.8em;
    color: var(--silver);
    letter-spacing: 2px;
}

.cancion-item {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    margin-bottom: 6px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    border: 1px solid transparent;
}

.cancion-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, rgba(123, 45, 139, 0.15) 0%, transparent 100%);
    transition: width 0.4s;
    z-index: 0;
}

.cancion-item:hover::before {
    width: 100%;
}

.cancion-item:hover {
    border-color: rgba(123, 45, 139, 0.3);
    transform: translateX(5px);
}

.cancion-item.activa {
    background: linear-gradient(90deg, rgba(123, 45, 139, 0.1) 0%, transparent 100%);
    border-color: rgba(168, 85, 200, 0.3);
    box-shadow: 0 0 20px rgba(123, 45, 139, 0.1);
}

.cancion-item.activa .numero-cancion {
    color: var(--wendia-light);
    text-shadow: 0 0 10px var(--wendia-glow);
}

.cancion-item.activa .titulo-cancion {
    color: var(--white);
}

.cancion-item>* {
    position: relative;
    z-index: 1;
}

.numero-cancion {
    width: 35px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: var(--silver);
    transition: color 0.3s;
}

.info-cancion {
    flex: 1;
    min-width: 0;
}

.titulo-cancion {
    font-family: 'IM Fell English', serif;
    font-size: 1em;
    color: var(--white);
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.artista-cancion {
    font-size: 0.8em;
    color: var(--silver);
}

.duracion-cancion {
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
    color: var(--silver);
}

.icono-reproduciendo {
    display: none;
    margin-right: 10px;
    color: var(--wendia-light);
}

.cancion-item.activa .icono-reproduciendo {
    display: block;
    animation: pulsar-icono 1s ease-in-out infinite;
}

.cancion-item.activa .numero-cancion {
    display: none;
}

@keyframes pulsar-icono {

    0%,
    100% {
        opacity: 0.5;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.3);
    }
}

/* ============================================
           VINILO DECORATIVO
           ============================================ */
.vinilo-contenedor {
    position: fixed;
    bottom: -100px;
    right: -100px;
    width: 300px;
    height: 300px;
    opacity: 0.06;
    pointer-events: none;
    z-index: 0;
    animation: girarVinilo 20s linear infinite;
}

@keyframes girarVinilo {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.vinilo-contenedor svg {
    width: 100%;
    height: 100%;
}

/* ============================================
           FOOTER
           ============================================ */
footer {
    border-top: 1px solid rgba(123, 45, 139, 0.15);
    padding: 60px 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 60% 80% at 50% 100%, rgba(123, 45, 139, 0.06) 0%, transparent 70%);
}

.footer-logo {
    font-family: 'Cinzel Decorative', serif;
    font-size: 1.4rem;
    color: var(--white);
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

.footer-author {
    font-family: 'IM Fell English', serif;
    font-style: italic;
    color: var(--wendia-light);
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.footer-icons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
    position: relative;
    z-index: 1;
}

.footer-icons span {
    font-size: 1.5rem;
}

.footer-phrase {
    font-family: 'Cormorant Garamond', serif;
    color: #4a4a4a;
    font-style: italic;
    font-size: 0.9rem;
    max-width: 500px;
    margin: 0 auto 20px;
    position: relative;
    z-index: 1;
}

.footer-copy {
    font-size: 0.75rem;
    color: var(--fog);
    letter-spacing: 0.2em;
    margin-top: 30px;
    position: relative;
    z-index: 1;
}

/* ============================================
           RESPONSIVE
           ============================================ */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .header-album {
        padding: 40px 15px 30px;
    }

    .portada-3d {
        width: 200px;
        height: 200px;
    }

    .info-album h1 {
        font-size: 1.6em;
    }

    .controles-principales {
        gap: 18px;
    }

    .btn-play {
        width: 60px;
        height: 60px;
        font-size: 1.5em;
    }

    .btn-secundario {
        font-size: 1.2em;
    }

    .visualizador-contenedor {
        height: 80px;
        margin: 0 15px 20px;
    }

    .lista-canciones {
        padding: 0 15px 60px;
    }

    .cancion-item {
        padding: 12px 15px;
    }

    .duracion-cancion {
        display: none;
    }

    .info-cancion-actual {
        margin: 0 15px 25px;
        padding: 20px;
    }

    .barra-progreso-contenedor {
        padding: 0 15px;
    }

    .vinilo-contenedor {
        width: 200px;
        height: 200px;
        bottom: -60px;
        right: -60px;
    }
}

@media (max-width: 480px) {
    .portada-3d {
        width: 160px;
        height: 160px;
    }

    .info-album h1 {
        font-size: 1.3em;
        letter-spacing: 2px;
    }

    .info-album .artista {
        font-size: 0.95em;
    }

    .btn-play {
        width: 55px;
        height: 55px;
    }

    .lista-header {
        font-size: 0.75em;
    }

    .titulo-cancion {
        font-size: 0.9em;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--black);
}

::-webkit-scrollbar-thumb {
    background: var(--wendia);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--wendia-light);
}

::selection {
    background: var(--wendia);
    color: var(--white);
}

.volver-index {
    position: fixed;
    top: 20px;
    left: 40px;
    z-index: 200;
    display: inline-block;
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.75rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--wendia-pale);
    text-decoration: none;
    border: 1px solid rgba(168, 85, 200, 0.3);
    padding: 9px 20px;
    background: rgba(20, 20, 20, 0.7);
    backdrop-filter: blur(4px);
    transition: all 0.4s;
}

.volver-index:hover {
    border-color: var(--wendia-light);
    color: var(--white);
    box-shadow: 0 0 20px rgba(168, 85, 200, 0.15);
    background: rgba(123, 45, 139, 0.1);
}