/* ============================================================
   RESET & BASE
   ============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    margin: 0;
    background-color: #000;
    font-family: "Josefin Sans", sans-serif;
}

/* Canvas del Shader — siempre vivo, detrás de todo */
#shader-bg {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* ============================================================
   CONTENEDOR Y TARJETA
   ============================================================ */
.main-body-container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.split-view-card {
    width: 90vw;
    max-width: 1500px;
    height: 85vh;
    max-height: 1000px;
    min-height: 600px;
    border-radius: 20px;
    display: flex;
    overflow: hidden;
    box-shadow:
        0 30px 60px rgba(0, 0, 0, 0.6),
        0 0 80px rgba(80, 11, 86, 0.2);
    opacity: 0;
    transform: translateY(40px);
    animation: fadeSlideUp 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

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

/* ============================================================
   SIDEBAR
   Usa position:relative + overflow:hidden para que el
   clip del ancho sea limpio durante la transición.
   Los dos paneles son position:absolute y se solapan.
   ============================================================ */
.sidebar-info {
    /* Ancho animable — flex: 0 0 auto + width explícito */
    flex: 0 0 auto;
    width: 40%;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #ba9dc4 0%, #faa969 100%);
    transition: width 0.72s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Estado portfolio: sidebar más estrecha */
.sidebar-info.is-portfolio {
    width: 30%;
}

/* ---- Paneles del sidebar ---- */
.sidebar-panel {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    padding: 2vh 1.5vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;
    /* Sin overflow-y para no mostrar scrollbar; el avatar se limita por max-height */
    overflow: hidden;
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.42s ease, transform 0.42s ease;
}

/* Home panel: cuando está oculto sale por la izquierda */
#panel-home.panel-out-left {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-28px);
}

/* Portfolio panel: cuando está oculto espera a la derecha */
#panel-portfolio-nav.panel-out-right {
    opacity: 0;
    pointer-events: none;
    transform: translateX(28px);
}

/* ---- Elementos del sidebar ---- */
.top-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    flex-shrink: 1;
    min-height: 0;
}

.middle-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

/* Avatar: se encoge si hay poco espacio */
.avatar-container {
    width: 80%;
    /* Límite de altura para que no desborde el sidebar en pantallas pequeñas */
    max-height: min(260px, 34vh);
    flex-shrink: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.avatar-container img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.avatar-container:hover {
    transform: translateY(-8px) scale(1.1);
}

/* Título PORTFOLIO */
.artist-name {
    color: #fff;
    font-family: "Josefin Sans", sans-serif;
    font-size: clamp(1.4rem, 2.2vw, 2.6rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-align: center;
    margin-bottom: 4px;
}

.artist-role {
    color: #fff;
    font-size: clamp(0.72rem, 0.9vw, 0.95rem);
    font-weight: normal;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 10px;
}

/* Redes sociales */
.social-icons {
    display: flex;
    gap: clamp(14px, 2vw, 24px);
    margin-bottom: 8px;
}

.social-icons a {
    display: inline-block;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.social-icons a i {
    font-size: clamp(22px, 2vw, 30px);
    color: #fff;
    transition: color 0.3s;
}

.social-icons a:hover { transform: translateY(-8px) scale(1.1); }
.social-icons a:hover i { color: #e37721; }

/* ---- Menú / Filtros ---- */
.main-menu {
    width: 100%;
    display: flex;
    justify-content: center;
}

.main-menu ul {
    list-style: none;
    width: 100%;
    max-width: clamp(220px, 22vw, 360px);
    display: flex;
    flex-direction: column;
    gap: clamp(8px, 1.5vh, 16px);
}

/* Botones de menú (navegación) */
.menu-btn {
    text-decoration: none;
    background-color: #fff;
    color: #e37721;
    font-family: "Josefin Sans", sans-serif;
    font-weight: 600;
    font-size: clamp(0.75rem, 1.1vw, 1.05rem);
    text-align: center;
    text-transform: lowercase;
    letter-spacing: 0.5px;
    border-radius: 30px;
    padding: clamp(9px, 1.3vh, 14px) 18px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.28s, color 0.28s, transform 0.28s, box-shadow 0.28s;
}

.menu-btn:hover {
    background-color: #cba4cf;
    color: #fff;
    transform: scale(1.05) rotate(3deg);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.35);
}

.btn-icon {
    font-size: clamp(16px, 1.4vw, 24px);
    margin-right: 13px;
}

/* Botones de filtro (portfolio) */
.filter-btn {
    background: #fff;
    border: none;
    padding: clamp(9px, 1.3vh, 14px) 18px;
    border-radius: 50px;
    font-family: "DM Sans", sans-serif;
    font-weight: bold;
    color: #e37721;
    cursor: pointer;
    width: 100%;
    font-size: clamp(0.72rem, 0.95vw, 0.98rem);
    transition: background 0.28s, color 0.28s, transform 0.2s;
}

.filter-btn.active,
.filter-btn:hover {
    background: #cba4cf;
    color: #fff;
}

.filter-btn:hover { transform: scale(1.04); }

/* Back link */
.back-link {
    color: #fff;
    text-decoration: none;
    font-size: 0.85rem;
    opacity: 0.7;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: opacity 0.25s;
    margin-top: 4px;
}

.back-link:hover { opacity: 1; }

/* ============================================================
   PANEL DERECHO
   Los dos views son position:absolute y se solapan.
   ============================================================ */
.right-panel {
    flex: 1;
    position: relative;
    overflow: hidden;
}

/* Ambos views comparten esta base */
.view-panel {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    opacity: 1;
    transition: opacity 0.55s ease;
}

/* Estado oculto — fade a cero */
.view-panel.panel-hidden {
    opacity: 0;
    pointer-events: none;
}

/* Vista HOME: imagen destacada */
#view-home {
    background-color: #1a0f0a;
}

#view-home img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Vista GALLERY: galería scrollable */
#view-gallery {
    overflow-y: auto;
    overflow-x: hidden;
    background-color: rgba(26, 15, 10, 0.28);
}

/* ============================================================
   MASONRY GRID
   grid-auto-rows: 1px  →  JS calcula el span de cada imagen
   según su altura real. Sin huecos, sin librerías.
   ============================================================ */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 1px;
    gap: 12px;
    padding: 20px;
    align-items: start;
}

@media (max-width: 1200px) {
    .portfolio-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .portfolio-grid { grid-template-columns: 1fr; }
}

/* ---- Gallery items ---- */
.gallery-item {
    border-radius: 10px;
    cursor: pointer;
    border: 2px solid transparent;
    overflow: hidden;
    display: block;
    width: 100%;
    /* Estado inicial invisible; JS añade .visible */
    opacity: 0;
    transform: translateY(16px) scale(0.96);
    transition:
        opacity 0.42s ease,
        transform 0.42s ease,
        border-color 0.25s ease;
    will-change: opacity, transform;
}

.gallery-item.visible {
    opacity: 1;
    transform: none;
}

/* Salida al filtrar */
.gallery-item.filter-out {
    opacity: 0 !important;
    transform: scale(0.82) !important;
    pointer-events: none;
    transition: opacity 0.28s ease, transform 0.28s ease !important;
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
}

.gallery-item.visible:hover {
    transform: scale(1.03);
    border-color: rgba(255, 255, 255, 0.85);
}

/* ============================================================
   MODAL
   ============================================================ */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: #ba9dc4;
    padding: 20px;
    border-radius: 20px;
    max-width: 80%;
    display: flex;
    gap: 20px;
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from { transform: scale(0.8); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

.modal-content img {
    max-height: 70vh;
    border-radius: 10px;
}

.modal-info {
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 300px;
}

.modal-info h3 {
    font-family: "Josefin Sans", sans-serif;
    margin-bottom: 10px;
    font-size: 1.8rem;
}

.close-btn {
    margin-top: 20px;
    padding: 10px 16px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-family: "Josefin Sans", sans-serif;
    font-size: 0.9rem;
    background: #fff;
    color: #7a4a8a;
    transition: background 0.25s;
}

.close-btn:hover { background: #e0c0e8; }
